From 1bbf246462f4f47904227c82f8b841401b6f2897 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 25 Nov 2002 21:53:14 +0000 Subject: [PATCH] Fix a couple of bugs in host_pcib_get_busno(): - If a PCI device is not present, then a 32-bit read_config() is going to return 0xffffffff not 0xffff. - For the 82454NX chipset, the MIOC that we read the bus numbers of the various host-PCI bridges from is at function (slot) 0x10 not 0x0. Approved by: re (rwatson) --- sys/dev/pci/pci_pci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 31d97f814239..a0e864ac90aa 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -457,7 +457,7 @@ host_pcib_get_busno(pci_read_config_fn read_config, int bus, int slot, int func, u_int32_t id; id = read_config(bus, slot, func, PCIR_DEVVENDOR, 4); - if (id == 0xffff) + if (id == 0xffffffff) return (0); switch (id) { @@ -488,19 +488,19 @@ host_pcib_get_busno(pci_read_config_fn read_config, int bus, int slot, int func, switch (slot) { case 0x12: /* Intel 82454NX PXB#0, Bus#A */ - *busnum = read_config(bus, 0, func, 0xd0, 1); + *busnum = read_config(bus, 0x10, func, 0xd0, 1); break; case 0x13: /* Intel 82454NX PXB#0, Bus#B */ - *busnum = read_config(bus, 0, func, 0xd1, 1) + 1; + *busnum = read_config(bus, 0x10, func, 0xd1, 1) + 1; break; case 0x14: /* Intel 82454NX PXB#1, Bus#A */ - *busnum = read_config(bus, 0, func, 0xd3, 1); + *busnum = read_config(bus, 0x10, func, 0xd3, 1); break; case 0x15: /* Intel 82454NX PXB#1, Bus#B */ - *busnum = read_config(bus, 0, func, 0xd4, 1) + 1; + *busnum = read_config(bus, 0x10, func, 0xd4, 1) + 1; break; } break;