[Skiboot] [PATCH 1/6] PCI: Cache PCI device IDs
Alistair Popple
alistair at popple.id.au
Fri Oct 16 16:08:15 AEDT 2015
From: Gavin Shan <gwshan at linux.vnet.ibm.com>
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 at linux.vnet.ibm.com>
---
core/pci.c | 5 +++++
include/pci.h | 3 +++
2 files changed, 8 insertions(+)
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);
diff --git a/include/pci.h b/include/pci.h
index f74c961..ca3f949 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -138,6 +138,9 @@ struct pci_device {
uint8_t subordinate_bus;
uint32_t scan_map;
+ uint32_t vdid;
+ uint32_t sub_vdid;
+ uint32_t class;
uint64_t cap_list;
uint32_t cap[64];
uint32_t mps; /* Max payload size capability */
--
2.1.4
More information about the Skiboot
mailing list