diff options
author | jhb <jhb@FreeBSD.org> | 2010-09-09 18:29:48 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2010-09-09 18:29:48 +0000 |
commit | a7b4070f1f143143442a97cffdf24fc59814851f (patch) | |
tree | 564729d7e34d6b2c6be9a19692b60c1e3ec7d127 /usr.sbin | |
parent | fb1020a5f21646f357c1757de08934526b735fce (diff) | |
download | FreeBSD-src-a7b4070f1f143143442a97cffdf24fc59814851f.zip FreeBSD-src-a7b4070f1f143143442a97cffdf24fc59814851f.tar.gz |
- Use 'sta' to hold the PCIR_STATUS register value instead of 'cmd' when
walking the capability list.
- Use constants for PCI header types instead of magic numbers.
MFC after: 1 week
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pciconf/cap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index f324321..9e6a671 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -460,20 +460,20 @@ cap_pciaf(int fd, struct pci_conf *p, uint8_t ptr) void list_caps(int fd, struct pci_conf *p) { - uint16_t cmd; + uint16_t sta; uint8_t ptr, cap; /* Are capabilities present for this device? */ - cmd = read_config(fd, &p->pc_sel, PCIR_STATUS, 2); - if (!(cmd & PCIM_STATUS_CAPPRESENT)) + sta = read_config(fd, &p->pc_sel, PCIR_STATUS, 2); + if (!(sta & PCIM_STATUS_CAPPRESENT)) return; switch (p->pc_hdr & PCIM_HDRTYPE) { - case 0: - case 1: + case PCIM_HDRTYPE_NORMAL: + case PCIM_HDRTYPE_BRIDGE: ptr = PCIR_CAP_PTR; break; - case 2: + case PCIM_HDRTYPE_CARDBUS: ptr = PCIR_CAP_PTR_2; break; default: |