From owner-svn-src-stable-7@FreeBSD.ORG Tue May 19 15:33:41 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C13F01065670; Tue, 19 May 2009 15:33:41 +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 93DCD8FC0C; Tue, 19 May 2009 15:33:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4JFXf0B001937; Tue, 19 May 2009 15:33:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4JFXf2e001935; Tue, 19 May 2009 15:33:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905191533.n4JFXf2e001935@svn.freebsd.org> From: John Baldwin Date: Tue, 19 May 2009 15:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192386 - in stable/7: sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2009 15:33:42 -0000 Author: jhb Date: Tue May 19 15:33:41 2009 New Revision: 192386 URL: http://svn.freebsd.org/changeset/base/192386 Log: MFC: Add SATA and PCI Advanced Features capabilities reporting. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/pci/pcireg.h stable/7/usr.sbin/pciconf/ (props changed) stable/7/usr.sbin/pciconf/cap.c Modified: stable/7/sys/dev/pci/pcireg.h ============================================================================== --- stable/7/sys/dev/pci/pcireg.h Tue May 19 14:51:48 2009 (r192385) +++ stable/7/sys/dev/pci/pcireg.h Tue May 19 15:33:41 2009 (r192386) @@ -113,6 +113,8 @@ #define PCIY_SECDEV 0x0f /* Secure Device */ #define PCIY_EXPRESS 0x10 /* PCI Express */ #define PCIY_MSIX 0x11 /* MSI-X */ +#define PCIY_SATA 0x12 /* SATA */ +#define PCIY_PCIAF 0x13 /* PCI Advanced Features */ /* config registers for header type 0 devices */ @@ -640,3 +642,12 @@ #define PCIM_MSIX_BIR_BAR_20 4 #define PCIM_MSIX_BIR_BAR_24 5 #define PCIM_MSIX_VCTRL_MASK 0x1 + +/* PCI Advanced Features definitions */ +#define PCIR_PCIAF_CAP 0x3 +#define PCIM_PCIAFCAP_TP 0x01 +#define PCIM_PCIAFCAP_FLR 0x02 +#define PCIR_PCIAF_CTRL 0x4 +#define PCIR_PCIAFCTRL_FLR 0x01 +#define PCIR_PCIAF_STATUS 0x5 +#define PCIR_PCIAFSTATUS_TP 0x01 Modified: stable/7/usr.sbin/pciconf/cap.c ============================================================================== --- stable/7/usr.sbin/pciconf/cap.c Tue May 19 14:51:48 2009 (r192385) +++ stable/7/usr.sbin/pciconf/cap.c Tue May 19 15:33:41 2009 (r192386) @@ -437,6 +437,24 @@ cap_msix(int fd, struct pci_conf *p, uin printf(" enabled"); } +static void +cap_sata(int fd, struct pci_conf *p, uint8_t ptr) +{ + + printf("SATA Index-Data Pair"); +} + +static void +cap_pciaf(int fd, struct pci_conf *p, uint8_t ptr) +{ + uint8_t cap; + + cap = read_config(fd, &p->pc_sel, ptr + PCIR_PCIAF_CAP, 1); + printf("PCI Advanced Features:%s%s", + cap & PCIM_PCIAFCAP_FLR ? " FLR" : "", + cap & PCIM_PCIAFCAP_TP ? " TP" : ""); +} + void list_caps(int fd, struct pci_conf *p) { @@ -499,6 +517,12 @@ list_caps(int fd, struct pci_conf *p) case PCIY_MSIX: cap_msix(fd, p, ptr); break; + case PCIY_SATA: + cap_sata(fd, p, ptr); + break; + case PCIY_PCIAF: + cap_pciaf(fd, p, ptr); + break; default: printf("unknown"); break;