diff options
author | jhb <jhb@FreeBSD.org> | 2003-08-28 21:22:25 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-08-28 21:22:25 +0000 |
commit | 51be1787c3f88a0d7f0e7acc9c80f8efe14d4107 (patch) | |
tree | a1e7aeb2faa12e05e2679df87b9fa88f7bfd5295 /sys/amd64/pci | |
parent | fed4d10a43fd7e42c8ab0e04aad88fa09632b414 (diff) | |
download | FreeBSD-src-51be1787c3f88a0d7f0e7acc9c80f8efe14d4107.zip FreeBSD-src-51be1787c3f88a0d7f0e7acc9c80f8efe14d4107.tar.gz |
- Rename PCIx_HEADERTYPE* to PCIx_HDRTYPE* so the constants aren't so long.
- Add a new PCIM_HDRTYPE constant for the field in PCIR_HDRTYPE that holds
the header type.
- Replace several magic numbers with appropriate constants for the header
type register and a couple of PCI_FUNCMAX.
- Merge to amd64 the fix to the i386 bridge code to skip devices with
unknown header types.
Requested by: imp (1, 2)
Diffstat (limited to 'sys/amd64/pci')
-rw-r--r-- | sys/amd64/pci/pci_bus.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/amd64/pci/pci_bus.c b/sys/amd64/pci/pci_bus.c index 0b8fdea..9c5ae3e 100644 --- a/sys/amd64/pci/pci_bus.c +++ b/sys/amd64/pci/pci_bus.c @@ -328,10 +328,18 @@ nexus_pcib_identify(driver_t *driver, device_t parent) for (slot = 0; slot <= PCI_SLOTMAX; slot++) { func = 0; hdrtype = nexus_pcib_read_config(0, bus, slot, func, - PCIR_HEADERTYPE, 1); + PCIR_HDRTYPE, 1); + /* + * When enumerating bus devices, the standard says that + * one should check the header type and ignore the slots whose + * header types that the software doesn't know about. We use + * this to filter out devices. + */ + if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) + continue; if ((hdrtype & PCIM_MFDEV) && (!found_orion || hdrtype != 0xff)) - pcifunchigh = 7; + pcifunchigh = PCI_FUNCMAX; else pcifunchigh = 0; for (func = 0; func <= pcifunchigh; func++) { |