aboutsummaryrefslogtreecommitdiff
path: root/core/pci.c
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2015-10-16 16:08:15 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-10-26 14:12:31 +1100
commitb939be22dfab6aedd95ae4142793cbbe634227aa (patch)
tree12a9052ecdb0818cbbbeed38489fd8e1849a5827 /core/pci.c
parent28e66d034d73c7223e9261dc4dce6f33a6515553 (diff)
downloadskiboot-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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/pci.c b/core/pci.c
index 92ff2cf..a8015cb 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -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);