aboutsummaryrefslogtreecommitdiff
path: root/include/pci.h
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2017-02-10 12:19:58 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-02-16 16:50:53 +1100
commitaf23374372850b69cb1351523c2a5cf34db4a968 (patch)
treef5d938707ceb9a4c4cc86cb52fc89cda9d68654a /include/pci.h
parenteeed7e762030c6df704da7dd92f650ebdf412ebf (diff)
downloadskiboot-af23374372850b69cb1351523c2a5cf34db4a968.zip
skiboot-af23374372850b69cb1351523c2a5cf34db4a968.tar.gz
skiboot-af23374372850b69cb1351523c2a5cf34db4a968.tar.bz2
core/pci: Introduce separate function to initialize PCIe capability
The logic initializing device's PCIe capability is resident in the function pci_scan_one() from day one. It's because information (e.g. vendor/device IDs) aren't stored into PCI device instance in old days. Now, the PCI device instance contains all information required to initialize its PCIe capability and others. This moves the logic initializing PCIe capability from pci_scan_one() to separate functions, pci_init_capabilities() and pci_init_pcie_cap(). pci_scan_one() is simplified to make code maintaining a bit easier. Also, it will allow us to intorduce separate functions to initialize other capabilities as we're doing for PCIe capability. This also exports pci_init_capabilities() so that it can be reused by SRIOV VFs in future. No logical changes introduced by this. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include/pci.h')
-rw-r--r--include/pci.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/pci.h b/include/pci.h
index 92e3dce..c018e56 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -399,6 +399,7 @@ extern void pci_add_device_nodes(struct phb *phb,
extern int64_t pci_find_cap(struct phb *phb, uint16_t bdfn, uint8_t cap);
extern int64_t pci_find_ecap(struct phb *phb, uint16_t bdfn, uint16_t cap,
uint8_t *version);
+extern void pci_init_capabilities(struct phb *phb, struct pci_device *pd);
extern void pci_device_init(struct phb *phb, struct pci_device *pd);
extern struct pci_device *pci_walk_dev(struct phb *phb,
struct pci_device *pd,