aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-08-01 12:51:28 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-08-01 12:51:28 -0700
commita56f1a4e63e9fc38294a2b96d1672d3fa532a7a8 (patch)
tree9ccca257fcc204c5d3c7c50cea4a2ffe30082b82 /com32/lib
parentb4bf076bd5a5ba6ed8f3b7f70cd1c2a0544a8502 (diff)
downloadsyslinux-elf-a56f1a4e63e9fc38294a2b96d1672d3fa532a7a8.tar.gz
syslinux-elf-a56f1a4e63e9fc38294a2b96d1672d3fa532a7a8.tar.xz
syslinux-elf-a56f1a4e63e9fc38294a2b96d1672d3fa532a7a8.zip
pci: store device address
When scanning PCI devices, store the device address for reference. Based on a patch by Sebastian Herbszt. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/lib')
-rw-r--r--com32/lib/pci/scan.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c
index be1a7222..1c3f526b 100644
--- a/com32/lib/pci/scan.c
+++ b/com32/lib/pci/scan.c
@@ -363,6 +363,9 @@ int pci_scan(struct pci_bus_list * pci_bus_list, struct pci_device_list * pci_de
for (dev = 0; dev < MAX_PCI_DEVICES ; dev++) {
maxfunc = 1; /* Assume a single-function device */
for (func = 0; func < maxfunc; func++) {
+ struct pci_device *pci_device =
+ &pci_device_list->pci_device[pci_device_list->count];
+
a = pci_mkaddr(bus, dev, func, 0);
did = pci_readl(a);
@@ -378,15 +381,16 @@ int pci_scan(struct pci_bus_list * pci_bus_list, struct pci_device_list * pci_de
rid = pci_readb(a + 0x08);
sid = pci_readl(a + 0x2c);
- struct pci_device *pci_device =
- &pci_device_list->
- pci_device[pci_device_list->count];
+
+ pci_device->addr = a;
pci_device->product = did >> 16;
pci_device->sub_product = sid >> 16;
pci_device->vendor = (did << 16) >> 16;
pci_device->sub_vendor = (sid << 16) >> 16;
pci_device->revision = rid;
pci_device_list->count++;
+ pci_device++;
+
dprintf
("Scanning: BUS %02x DID %08x (%04x:%04x) SID %08x RID %02x\n",
bus, did, did >> 16, (did << 16) >> 16,