diff options
author | Wei Yang <weiyang@linux.vnet.ibm.com> | 2015-03-25 04:23:48 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2015-03-30 22:02:36 -0400 |
commit | b07579c0924eee1543eb6cd2c19544d15a4b5236 (patch) | |
tree | cb0f9cd7ec419b1abb41d4fd72d08528a1cc99d3 /include/linux/pci.h | |
parent | 4449f079722c86d2f6925da039835acdd8e973a8 (diff) |
PCI: Export pci_iov_virtfn_bus() and pci_iov_virtfn_devfn()
On PowerNV, some resource reservation is needed for SR-IOV VFs that don't
exist at the bootup stage. To do the match between resources and VFs, the
code need to get the VF's BDF in advance.
Rename virtfn_bus() and virtfn_devfn() to pci_iov_virtfn_bus() and
pci_iov_virtfn_devfn() and export them.
[bhelgaas: changelog, make "busnr" int]
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
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 15596582e575..99ea94835fb6 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -1669,6 +1669,9 @@ int pci_ext_cfg_avail(void); | |||
1669 | void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); | 1669 | void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); |
1670 | 1670 | ||
1671 | #ifdef CONFIG_PCI_IOV | 1671 | #ifdef CONFIG_PCI_IOV |
1672 | int pci_iov_virtfn_bus(struct pci_dev *dev, int id); | ||
1673 | int pci_iov_virtfn_devfn(struct pci_dev *dev, int id); | ||
1674 | |||
1672 | int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); | 1675 | int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); |
1673 | void pci_disable_sriov(struct pci_dev *dev); | 1676 | void pci_disable_sriov(struct pci_dev *dev); |
1674 | int pci_num_vf(struct pci_dev *dev); | 1677 | int pci_num_vf(struct pci_dev *dev); |
@@ -1677,6 +1680,14 @@ int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); | |||
1677 | int pci_sriov_get_totalvfs(struct pci_dev *dev); | 1680 | int pci_sriov_get_totalvfs(struct pci_dev *dev); |
1678 | resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno); | 1681 | resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno); |
1679 | #else | 1682 | #else |
1683 | static inline int pci_iov_virtfn_bus(struct pci_dev *dev, int id) | ||
1684 | { | ||
1685 | return -ENOSYS; | ||
1686 | } | ||
1687 | static inline int pci_iov_virtfn_devfn(struct pci_dev *dev, int id) | ||
1688 | { | ||
1689 | return -ENOSYS; | ||
1690 | } | ||
1680 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) | 1691 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) |
1681 | { return -ENODEV; } | 1692 | { return -ENODEV; } |
1682 | static inline void pci_disable_sriov(struct pci_dev *dev) { } | 1693 | static inline void pci_disable_sriov(struct pci_dev *dev) { } |