Define PCI_MAXHDRTYPE to be 2. We know about header types 0, 1 and 2.

Update the MI device scanning code to use PCI_MAXHDRTYPE rather than
the hard coded 2.
This commit is contained in:
Warner Losh 2003-08-01 21:45:56 +00:00
parent b48b87f9cd
commit 8d50cc0e3e
2 changed files with 2 additions and 10 deletions

View File

@ -835,7 +835,7 @@ pci_add_children(device_t dev, int busno, size_t dinfo_size)
pcifunchigh = 0; pcifunchigh = 0;
f = 0; f = 0;
hdrtype = REG(PCIR_HEADERTYPE, 1); hdrtype = REG(PCIR_HEADERTYPE, 1);
if ((hdrtype & ~PCIM_MFDEV) > 2) if ((hdrtype & ~PCIM_MFDEV) > PCI_MAXHDRTYPE)
continue; continue;
if (hdrtype & PCIM_MFDEV) if (hdrtype & PCIM_MFDEV)
pcifunchigh = PCI_FUNCMAX; pcifunchigh = PCI_FUNCMAX;

View File

@ -43,6 +43,7 @@
#define PCI_SLOTMAX 31 #define PCI_SLOTMAX 31
#define PCI_FUNCMAX 7 #define PCI_FUNCMAX 7
#define PCI_REGMAX 255 #define PCI_REGMAX 255
#define PCI_MAXHDRTYPE 2
/* PCI config header registers for all devices */ /* PCI config header registers for all devices */
@ -311,12 +312,3 @@
#define PCIXM_STATUS_MAXSPLITS 0x0380 /* Maximum Split Transactions */ #define PCIXM_STATUS_MAXSPLITS 0x0380 /* Maximum Split Transactions */
#define PCIXM_STATUS_MAXCRDS 0x1C00 /* Maximum Cumulative Read Size */ #define PCIXM_STATUS_MAXCRDS 0x1C00 /* Maximum Cumulative Read Size */
#define PCIXM_STATUS_RCVDSCEM 0x2000 /* Received a Split Comp w/Error msg */ #define PCIXM_STATUS_RCVDSCEM 0x2000 /* Received a Split Comp w/Error msg */
#if 0
/* some PCI vendor definitions (only used to identify ancient devices !!! */
#define PCIV_INTEL 0x8086
#define PCID_INTEL_SATURN 0x0483
#define PCID_INTEL_ORION 0x84c4
#endif