From b939be22dfab6aedd95ae4142793cbbe634227aa Mon Sep 17 00:00:00 2001 From: Gavin Shan Date: Fri, 16 Oct 2015 16:08:15 +1100 Subject: 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 Signed-off-by: Stewart Smith --- core/pci.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/pci.c') 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); -- cgit v1.1