aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2026-03-10 16:50:08 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2026-03-10 16:50:08 +0000
commit9a1394957c3054c24995d684e8bc26878702dc6b (patch)
tree44997902010326a610becdd4af68fb5bbf7c4693
parent7e7a1b61531a29b4a0a5cdac66b96f420e6c66e4 (diff)
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
-rw-r--r--usr.sbin/pciconf/pciconf.c12
1 files 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;
}