From owner-svn-src-all@FreeBSD.ORG Thu Sep 9 18:29:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AF521065698; Thu, 9 Sep 2010 18:29:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B5A48FC1D; Thu, 9 Sep 2010 18:29:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o89ITm6N016792; Thu, 9 Sep 2010 18:29:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o89ITmOI016790; Thu, 9 Sep 2010 18:29:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201009091829.o89ITmOI016790@svn.freebsd.org> From: John Baldwin Date: Thu, 9 Sep 2010 18:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212369 - head/usr.sbin/pciconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2010 18:29:49 -0000 Author: jhb Date: Thu Sep 9 18:29:48 2010 New Revision: 212369 URL: http://svn.freebsd.org/changeset/base/212369 Log: - 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 Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Thu Sep 9 18:19:15 2010 (r212368) +++ head/usr.sbin/pciconf/cap.c Thu Sep 9 18:29:48 2010 (r212369) @@ -460,20 +460,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: