aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 8ce2f2d9ab63..c2e491e04063 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -265,6 +265,7 @@ struct pci_dev {
265 unsigned int is_pcie:1; 265 unsigned int is_pcie:1;
266 unsigned int state_saved:1; 266 unsigned int state_saved:1;
267 unsigned int is_physfn:1; 267 unsigned int is_physfn:1;
268 unsigned int is_virtfn:1;
268 pci_dev_flags_t dev_flags; 269 pci_dev_flags_t dev_flags;
269 atomic_t enable_cnt; /* pci_enable_device has been called */ 270 atomic_t enable_cnt; /* pci_enable_device has been called */
270 271
@@ -279,7 +280,10 @@ struct pci_dev {
279#endif 280#endif
280 struct pci_vpd *vpd; 281 struct pci_vpd *vpd;
281#ifdef CONFIG_PCI_IOV 282#ifdef CONFIG_PCI_IOV
282 struct pci_sriov *sriov; /* SR-IOV capability related */ 283 union {
284 struct pci_sriov *sriov; /* SR-IOV capability related */
285 struct pci_dev *physfn; /* the PF this VF is associated with */
286 };
283#endif 287#endif
284}; 288};
285 289
@@ -1212,5 +1216,18 @@ int pci_ext_cfg_avail(struct pci_dev *dev);
1212 1216
1213void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); 1217void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
1214 1218
1219#ifdef CONFIG_PCI_IOV
1220extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
1221extern void pci_disable_sriov(struct pci_dev *dev);
1222#else
1223static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1224{
1225 return -ENODEV;
1226}
1227static inline void pci_disable_sriov(struct pci_dev *dev)
1228{
1229}
1230#endif
1231
1215#endif /* __KERNEL__ */ 1232#endif /* __KERNEL__ */
1216#endif /* LINUX_PCI_H */ 1233#endif /* LINUX_PCI_H */