aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2015-03-25 04:23:52 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2015-03-30 22:02:37 -0400
commita8b2f8288a3fdef8d93efef2b1ead7563004275e (patch)
tree40f3d68896c56cb4e67b48d006f367eb28cf1b34 /arch/powerpc/include
parentd74b9027a4dafa44d3a3c2a44ce135e50a13ec10 (diff)
powerpc/pci: Create pci_dn for VFs
pci_dn is the extension of PCI device node and is created from device node. Unfortunately, VFs are enabled dynamically by PF's driver and they don't have corresponding device nodes and pci_dn, which is required to access VFs' config spaces. The patch creates pci_dn for VFs in pcibios_sriov_enable() on their PF, and removes pci_dn for VFs in pcibios_sriov_disable() on their PF. When VF's pci_dn is created, it's put to the child list of the pci_dn of PF's upstream bridge. The pci_dn is linked to pci_dev during early fixup time to setup the fast path. [bhelgaas: add ifdef around add_one_dev_pci_info(), use dev_printk()] Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 2c6dc2a3d14a..ece30f589398 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -156,6 +156,7 @@ struct iommu_table;
156 156
157struct pci_dn { 157struct pci_dn {
158 int flags; 158 int flags;
159#define PCI_DN_FLAG_IOV_VF 0x01
159 160
160 int busno; /* pci bus number */ 161 int busno; /* pci bus number */
161 int devfn; /* pci device and function number */ 162 int devfn; /* pci device and function number */
@@ -188,6 +189,8 @@ struct pci_dn {
188extern struct pci_dn *pci_get_pdn_by_devfn(struct pci_bus *bus, 189extern struct pci_dn *pci_get_pdn_by_devfn(struct pci_bus *bus,
189 int devfn); 190 int devfn);
190extern struct pci_dn *pci_get_pdn(struct pci_dev *pdev); 191extern struct pci_dn *pci_get_pdn(struct pci_dev *pdev);
192extern struct pci_dn *add_dev_pci_data(struct pci_dev *pdev);
193extern void remove_dev_pci_data(struct pci_dev *pdev);
191extern void *update_dn_pci_info(struct device_node *dn, void *data); 194extern void *update_dn_pci_info(struct device_node *dn, void *data);
192 195
193static inline int pci_device_from_OF_node(struct device_node *np, 196static inline int pci_device_from_OF_node(struct device_node *np,