diff options
author | Scott Long <scottl@FreeBSD.org> | 2003-09-14 06:23:19 +0000 |
---|---|---|
committer | Scott Long <scottl@FreeBSD.org> | 2003-09-14 06:23:19 +0000 |
commit | cadbc399ea141c1fc0ac23dbe2a02efac0943a5e (patch) | |
tree | d93963a6d33dd17c31728ff34034fab045cc2ae3 /sys/dev/pci/pci.c | |
parent | 30bb12a4e8f263067b22c4a7f60ecf1bf36d1a50 (diff) | |
download | src-cadbc399ea141c1fc0ac23dbe2a02efac0943a5e.tar.gz src-cadbc399ea141c1fc0ac23dbe2a02efac0943a5e.zip |
Remove most of the magic constants from the extcap parsing code.
Notes
Notes:
svn path=/head/; revision=120051
Diffstat (limited to 'sys/dev/pci/pci.c')
-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 5af67a377a66..7991b392a7af 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; |