Date: Mon, 20 Sep 2010 19:25:15 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r212921 - stable/8/usr.sbin/pciconf Message-ID: <201009201925.o8KJPFWT064569@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Mon Sep 20 19:25:15 2010 New Revision: 212921 URL: http://svn.freebsd.org/changeset/base/212921 Log: MFC 212369: - 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. Modified: stable/8/usr.sbin/pciconf/cap.c Directory Properties: stable/8/usr.sbin/pciconf/ (props changed) Modified: stable/8/usr.sbin/pciconf/cap.c ============================================================================== --- stable/8/usr.sbin/pciconf/cap.c Mon Sep 20 19:20:37 2010 (r212920) +++ stable/8/usr.sbin/pciconf/cap.c Mon Sep 20 19:25:15 2010 (r212921) @@ -458,20 +458,20 @@ cap_pciaf(int fd, struct pci_conf *p, ui 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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009201925.o8KJPFWT064569>