diff options
author | scottl <scottl@FreeBSD.org> | 2003-09-14 06:23:19 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2003-09-14 06:23:19 +0000 |
commit | 2a498c508ca123eea4d3f81cf8dab287ec603022 (patch) | |
tree | d93963a6d33dd17c31728ff34034fab045cc2ae3 /sys | |
parent | 5b00bd3787596a36c65a13b490fb3f074b7bba2d (diff) | |
download | FreeBSD-src-2a498c508ca123eea4d3f81cf8dab287ec603022.zip FreeBSD-src-2a498c508ca123eea4d3f81cf8dab287ec603022.tar.gz |
Remove most of the magic constants from the extcap parsing code.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/pci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 5af67a3..7991b39 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -402,9 +402,9 @@ pci_read_extcap(device_t pcib, pcicfgregs *cfg) #define REG(n, w) PCIB_READ_CONFIG(pcib, cfg->bus, cfg->slot, cfg->func, n, w) int ptr, nextptr, ptrptr; - switch (cfg->hdrtype) { + switch (cfg->hdrtype & PCIM_HDRTYPE) { case 0: - ptrptr = 0x34; + ptrptr = PCIR_CAP_PTR; break; case 2: ptrptr = 0x14; @@ -430,7 +430,7 @@ pci_read_extcap(device_t pcib, pcicfgregs *cfg) /* Process this entry */ switch (REG(ptr, 1)) { - case 0x01: /* PCI power management */ + case PCIY_PMG: /* PCI power management */ if (cfg->pp_cap == 0) { cfg->pp_cap = REG(ptr + PCIR_POWER_CAP, 2); cfg->pp_status = ptr + PCIR_POWER_STATUS; |