diff options
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 174e5392e51e..59a98e2ee2c6 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -612,6 +612,9 @@ extern void pci_remove_bus_device(struct pci_dev *dev); | |||
612 | extern void pci_stop_bus_device(struct pci_dev *dev); | 612 | extern void pci_stop_bus_device(struct pci_dev *dev); |
613 | void pci_setup_cardbus(struct pci_bus *bus); | 613 | void pci_setup_cardbus(struct pci_bus *bus); |
614 | extern void pci_sort_breadthfirst(void); | 614 | extern void pci_sort_breadthfirst(void); |
615 | #define dev_is_pci(d) ((d)->bus == &pci_bus_type) | ||
616 | #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) | ||
617 | #define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) | ||
615 | 618 | ||
616 | /* Generic PCI functions exported to card drivers */ | 619 | /* Generic PCI functions exported to card drivers */ |
617 | 620 | ||
@@ -1129,6 +1132,9 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | |||
1129 | unsigned int devfn) | 1132 | unsigned int devfn) |
1130 | { return NULL; } | 1133 | { return NULL; } |
1131 | 1134 | ||
1135 | #define dev_is_pci(d) (false) | ||
1136 | #define dev_is_pf(d) (false) | ||
1137 | #define dev_num_vf(d) (0) | ||
1132 | #endif /* CONFIG_PCI */ | 1138 | #endif /* CONFIG_PCI */ |
1133 | 1139 | ||
1134 | /* Include architecture-dependent settings and functions */ | 1140 | /* Include architecture-dependent settings and functions */ |
@@ -1286,6 +1292,7 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); | |||
1286 | extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); | 1292 | extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); |
1287 | extern void pci_disable_sriov(struct pci_dev *dev); | 1293 | extern void pci_disable_sriov(struct pci_dev *dev); |
1288 | extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); | 1294 | extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); |
1295 | extern int pci_num_vf(struct pci_dev *dev); | ||
1289 | #else | 1296 | #else |
1290 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) | 1297 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) |
1291 | { | 1298 | { |
@@ -1298,6 +1305,10 @@ static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) | |||
1298 | { | 1305 | { |
1299 | return IRQ_NONE; | 1306 | return IRQ_NONE; |
1300 | } | 1307 | } |
1308 | static inline int pci_num_vf(struct pci_dev *dev) | ||
1309 | { | ||
1310 | return 0; | ||
1311 | } | ||
1301 | #endif | 1312 | #endif |
1302 | 1313 | ||
1303 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) | 1314 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) |