svn commit: r192386 - in stable/7: sys sys/contrib/pf
sys/dev/ath/ath_hal sys/dev/cxgb sys/dev/pci usr.sbin/pciconf
John Baldwin
jhb at FreeBSD.org
Tue May 19 15:33:42 UTC 2009
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;
More information about the svn-src-stable
mailing list