diff options
author | Cao jin <caoj.fnst@cn.fujitsu.com> | 2016-06-10 17:54:23 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-06-17 03:28:03 +0300 |
commit | 52ea63dea465575ccd71d52c3461b1b7d9f50ce0 (patch) | |
tree | 383646d945658fc740b9dc251bb15d38fc25ccdd /hw/pci/msi.c | |
parent | 97fe42f19b989ecfd0c6a23b9c09dbc7159c7602 (diff) |
fix some coding style problems
It has:
1. More newlines make the code block well separated.
2. Add more comments for msi_init.
3. Fix a indentation in vmxnet3.c.
4. ioh3420 & xio3130_downstream: put PCI Express capability init function
together, make it more readable.
cc: Michael S. Tsirkin <mst@redhat.com>
cc: Markus Armbruster <armbru@redhat.com>
cc: Marcel Apfelbaum <marcel@redhat.com>
cc: Dmitry Fleytman <dmitry@daynix.com>
cc: Jason Wang <jasowang@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci/msi.c')
-rw-r--r-- | hw/pci/msi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/pci/msi.c b/hw/pci/msi.c index a87ef4d752..359058e12c 100644 --- a/hw/pci/msi.c +++ b/hw/pci/msi.c @@ -165,6 +165,22 @@ bool msi_enabled(const PCIDevice *dev) PCI_MSI_FLAGS_ENABLE); } +/* + * Make PCI device @dev MSI-capable. + * Non-zero @offset puts capability MSI at that offset in PCI config + * space. + * @nr_vectors is the number of MSI vectors (1, 2, 4, 8, 16 or 32). + * If @msi64bit, make the device capable of sending a 64-bit message + * address. + * If @msi_per_vector_mask, make the device support per-vector masking. + * Return the offset of capability MSI in config space on success, + * return -errno on error. + * + * -ENOTSUP means lacking msi support for a msi-capable platform. + * -EINVAL means capability overlap, happens when @offset is non-zero, + * also means a programming error, except device assignment, which can check + * if a real HW is broken. + */ int msi_init(struct PCIDevice *dev, uint8_t offset, unsigned int nr_vectors, bool msi64bit, bool msi_per_vector_mask) { |