diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2015-10-16 16:08:15 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-10-26 14:12:31 +1100 |
commit | b939be22dfab6aedd95ae4142793cbbe634227aa (patch) | |
tree | 12a9052ecdb0818cbbbeed38489fd8e1849a5827 /core/pci.c | |
parent | 28e66d034d73c7223e9261dc4dce6f33a6515553 (diff) | |
download | skiboot-b939be22dfab6aedd95ae4142793cbbe634227aa.zip skiboot-b939be22dfab6aedd95ae4142793cbbe634227aa.tar.gz skiboot-b939be22dfab6aedd95ae4142793cbbe634227aa.tar.bz2 |
PCI: Cache PCI device IDs
The patch caches IDs (vendor, device, sub-vendor, sub-device and
class) for PCI devices. Those IDs could be used to identify one
specific PCI device later.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/pci.c')
-rw-r--r-- | core/pci.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -161,6 +161,11 @@ static struct pci_device *pci_scan_one(struct phb *phb, struct pci_device *paren goto fail; } pd->bdfn = bdfn; + pd->vdid = vdid; + pci_cfg_read32(phb, bdfn, PCI_CFG_SUBSYS_VENDOR_ID, &pd->sub_vdid); + pci_cfg_read32(phb, bdfn, PCI_CFG_REV_ID, &pd->class); + pd->class >>= 8; + pd->parent = parent; list_head_init(&pd->pcrf); list_head_init(&pd->children); |