summaryrefslogtreecommitdiff
path: root/backport/backport-include/linux/pci.h
diff options
context:
space:
mode:
authorOmer Dagan <omer.dagan@tandemg.com>2018-10-03 09:18:09 +0000
committerJohannes Berg <johannes.berg@intel.com>2018-11-05 08:16:20 +0100
commit162a6b312f1b439cf0cf191564b21df0d3393564 (patch)
treeb4a7e1cbf527f7443bbd96f216ac396f89a57ec2 /backport/backport-include/linux/pci.h
parent6f2b0d73e567844a8c8766218c4e34739643b029 (diff)
add support for pci_alloc_irq_vectors
add support for function in kernels under 4.8 function is a wrapper around 'pci_enable_msi_block' or 'pci_enable_msi_range' depending on the kernel version the min\max number of interrupts was overridden to always use the max number of interrupts which seems correct since it was not supported in the old APIs Signed-off-by: Omer Dagan <omer.dagan@tandemg.com> [use GPL expert as everything in backports, remove unused ifdef] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'backport/backport-include/linux/pci.h')
-rw-r--r--backport/backport-include/linux/pci.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
index 67ac40fc..531f5a47 100644
--- a/backport/backport-include/linux/pci.h
+++ b/backport/backport-include/linux/pci.h
@@ -134,6 +134,25 @@ static inline int pci_vfs_assigned(struct pci_dev *dev)
#endif /* LINUX_VERSION_IS_LESS(3,10,0) */
+#if LINUX_VERSION_IS_LESS(4,8,0)
+#define pci_alloc_irq_vectors LINUX_BACKPORT(pci_alloc_irq_vectors)
+#ifdef CONFIG_PCI_MSI
+int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
+ unsigned int max_vecs, unsigned int flags);
+#else
+static inline int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
+ unsigned int max_vecs, unsigned int flags)
+{ return -ENOSYS; }
+#endif
+#endif
+
+#if LINUX_VERSION_IS_LESS(4,8,0)
+#define pci_free_irq_vectors LINUX_BACKPORT(pci_free_irq_vectors)
+static inline void pci_free_irq_vectors(struct pci_dev *dev)
+{
+}
+#endif
+
#if LINUX_VERSION_IS_LESS(3,14,0)
#define pci_enable_msi_range LINUX_BACKPORT(pci_enable_msi_range)
#ifdef CONFIG_PCI_MSI