git: 9a1394957c30 - main - pciconf: Use the exported values of bus numbers for PCI bridges
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 10 Mar 2026 16:53:57 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=9a1394957c3054c24995d684e8bc26878702dc6b
commit 9a1394957c3054c24995d684e8bc26878702dc6b
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-03-10 16:50:08 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-03-10 16:50:08 +0000
pciconf: Use the exported values of bus numbers for PCI bridges
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D55772
---
usr.sbin/pciconf/pciconf.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c
index 6c26621ae186..48520687197b 100644
--- a/usr.sbin/pciconf/pciconf.c
+++ b/usr.sbin/pciconf/pciconf.c
@@ -339,13 +339,9 @@ list_devs(const char *name, int verbose, int bars, int bridge, int caps,
}
static void
-print_bus_range(int fd, struct pci_conf *p, int secreg, int subreg)
+print_bus_range(struct pci_conf *p)
{
- uint8_t secbus, subbus;
-
- secbus = read_config(fd, &p->pc_sel, secreg, 1);
- subbus = read_config(fd, &p->pc_sel, subreg, 1);
- printf(" bus range = %u-%u\n", secbus, subbus);
+ printf(" bus range = %u-%u\n", p->pc_secbus, p->pc_subbus);
}
static void
@@ -511,11 +507,11 @@ list_bridge(int fd, struct pci_conf *p)
switch (p->pc_hdr & PCIM_HDRTYPE) {
case PCIM_HDRTYPE_BRIDGE:
- print_bus_range(fd, p, PCIR_SECBUS_1, PCIR_SUBBUS_1);
+ print_bus_range(p);
print_bridge_windows(fd, p);
break;
case PCIM_HDRTYPE_CARDBUS:
- print_bus_range(fd, p, PCIR_SECBUS_2, PCIR_SUBBUS_2);
+ print_bus_range(p);
print_cardbus_windows(fd, p);
break;
}