From 87623e8dd6607900dde831913c4db4059324d1f8 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sat, 29 Oct 2005 05:49:06 +0000 Subject: [PATCH] Use symbolic name rather thanhard coding the cap pointer offset for type two devices. --- sys/dev/pci/pci.c | 2 +- sys/dev/pci/pcireg.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index d5fbb359dead..1b3a3854a0c0 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -430,7 +430,7 @@ pci_read_extcap(device_t pcib, pcicfgregs *cfg) ptrptr = PCIR_CAP_PTR; break; case 2: - ptrptr = 0x14; + ptrptr = PCIR_CAP_PTR_2; break; default: return; /* no extended capabilities support */ diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h index f9495bc135f3..44b01b594631 100644 --- a/sys/dev/pci/pcireg.h +++ b/sys/dev/pci/pcireg.h @@ -166,6 +166,7 @@ /* config registers for header type 2 (CardBus) devices */ +#define PCIR_CAP_PTR_2 0x14 #define PCIR_SECSTAT_2 0x16 #define PCIR_PRIBUS_2 0x18