aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r--drivers/pci/pci.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index f73bcbedf37c..5ff4d25bf0e9 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -243,6 +243,7 @@ extern int pci_iov_init(struct pci_dev *dev);
243extern void pci_iov_release(struct pci_dev *dev); 243extern void pci_iov_release(struct pci_dev *dev);
244extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, 244extern int pci_iov_resource_bar(struct pci_dev *dev, int resno,
245 enum pci_bar_type *type); 245 enum pci_bar_type *type);
246extern int pci_sriov_resource_alignment(struct pci_dev *dev, int resno);
246extern void pci_restore_iov_state(struct pci_dev *dev); 247extern void pci_restore_iov_state(struct pci_dev *dev);
247extern int pci_iov_bus_range(struct pci_bus *bus); 248extern int pci_iov_bus_range(struct pci_bus *bus);
248 249
@@ -298,4 +299,16 @@ static inline int pci_ats_enabled(struct pci_dev *dev)
298} 299}
299#endif /* CONFIG_PCI_IOV */ 300#endif /* CONFIG_PCI_IOV */
300 301
302static inline int pci_resource_alignment(struct pci_dev *dev,
303 struct resource *res)
304{
305#ifdef CONFIG_PCI_IOV
306 int resno = res - dev->resource;
307
308 if (resno >= PCI_IOV_RESOURCES && resno <= PCI_IOV_RESOURCE_END)
309 return pci_sriov_resource_alignment(dev, resno);
310#endif
311 return resource_alignment(res);
312}
313
301#endif /* DRIVERS_PCI_H */ 314#endif /* DRIVERS_PCI_H */