Format BDF (bus, device, fn) and vendor:device debug output in a more user-readable format.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/pciinit.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/pciinit.c b/src/pciinit.c index 0d8758e..ebd8152 100644 --- a/src/pciinit.c +++ b/src/pciinit.c @@ -235,8 +235,8 @@ static void pci_bios_init_device(struct pci_device *pci) u16 bdf = pci->bdf; int pin, pic_irq;
- dprintf(1, "PCI: bus=%d devfn=0x%02x: vendor_id=0x%04x device_id=0x%04x\n" - , pci_bdf_to_bus(bdf), pci_bdf_to_devfn(bdf) + dprintf(1, "PCI: init bdf=%02x:%02x.%x id=%04x:%04x\n" + , pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf), pci_bdf_to_fn(bdf) , pci->vendor, pci->device); pci_init_device(pci_class_tbl, pci, NULL);
@@ -507,9 +507,11 @@ static void pci_bios_map_device_in_bus(int bus) struct pci_device *pci;
foreachpci(pci) { - if (pci_bdf_to_bus(pci->bdf) != bus) + u16 bdf = pci->bdf; + if (pci_bdf_to_bus(bdf) != bus) continue; - dprintf(1, "PCI: map device bus %d, bfd 0x%x\n", bus, pci->bdf); + dprintf(1, "PCI: map device bdf=%02x:%02x.%x\n" + , pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf), pci_bdf_to_fn(bdf)); pci_bios_map_device(&busses[bus], pci); } }