diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-14 14:38:00 -0700 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-14 14:38:00 -0700 |
commit | c128856b48b1a7132166c6b37a53b086d549fbde (patch) | |
tree | c4c1bb2baa1e25a436f09efb17a8304364bf7901 /include/linux/pci.h | |
parent | c80ef97ae4848c4592f0fac9c06d7f436862a28d (diff) | |
parent | 94cccde648d32abe61e2d0d1b18178f3027f1a78 (diff) | |
download | blackbird-obmc-linux-c128856b48b1a7132166c6b37a53b086d549fbde.tar.gz blackbird-obmc-linux-c128856b48b1a7132166c6b37a53b086d549fbde.zip |
Merge branch 'pci/msi' into next
* pci/msi:
vfio: Use pci_enable_msi_range() and pci_enable_msix_range()
ahci: Use pci_enable_msi_range() instead of pci_enable_msi_block()
ahci: Fix broken fallback to single MSI mode
PCI/MSI: Add pci_enable_msi_exact() and pci_enable_msix_exact()
PCI/MSI: Fix cut-and-paste errors in documentation
PCI/MSI: Add pci_enable_msi() documentation back
PCI/MSI: Fix pci_msix_vec_count() htmldocs failure
PCI/MSI: Fix leak of msi_attrs
PCI/MSI: Check kmalloc() return value, fix leak of name
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 60ab8d782f8c..1e26fc602adc 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1171,8 +1171,23 @@ void msi_remove_pci_irq_vectors(struct pci_dev *dev); void pci_restore_msi_state(struct pci_dev *dev); int pci_msi_enabled(void); int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec); +static inline int pci_enable_msi_exact(struct pci_dev *dev, int nvec) +{ + int rc = pci_enable_msi_range(dev, nvec, nvec); + if (rc < 0) + return rc; + return 0; +} int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, int minvec, int maxvec); +static inline int pci_enable_msix_exact(struct pci_dev *dev, + struct msix_entry *entries, int nvec) +{ + int rc = pci_enable_msix_range(dev, entries, nvec, nvec); + if (rc < 0) + return rc; + return 0; +} #else static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; } static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec) @@ -1191,9 +1206,14 @@ static inline int pci_msi_enabled(void) { return 0; } static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec) { return -ENOSYS; } +static inline int pci_enable_msi_exact(struct pci_dev *dev, int nvec) +{ return -ENOSYS; } static inline int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, int minvec, int maxvec) { return -ENOSYS; } +static inline int pci_enable_msix_exact(struct pci_dev *dev, + struct msix_entry *entries, int nvec) +{ return -ENOSYS; } #endif #ifdef CONFIG_PCIEPORTBUS |