]> mj.ucw.cz Git - pciutils.git/commitdiff
Added support for the `bridge subsystem ID' capability.
authorMartin Mares <mj@ucw.cz>
Sun, 30 Jul 2006 11:47:44 +0000 (13:47 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 30 Jul 2006 11:47:44 +0000 (13:47 +0200)
ChangeLog
lib/header.h
lspci.c

index d1ecaf40f2fafdea8e68b311015237fcf090511b..65e71dba2e764c7c4b72dfe9d5ca614b78430f0a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-07-30  Martin Mares  <mj@ucw.cz>
 
+       * lspci.c, lib/header.h: Added support for the `bridge subsystem ID'
+       capability. Contributed by Petr Vandrovec.
+
        * lspci.c (show_htype1): Fixed bug in printing of 64-bit prefetchable
        memory windows. Fix by Petr Vandrovec.
 
index ab562142358fbe755af17c642569298b63f1671e..78f92db7539d3059029e272cf755fe6d9bb9f95a 100644 (file)
 #define  PCI_CAP_ID_VNDR       0x09    /* Vendor specific */
 #define  PCI_CAP_ID_DBG                0x0A    /* Debug port */
 #define  PCI_CAP_ID_CCRC       0x0B    /* CompactPCI Central Resource Control */
+#define  PCI_CAP_ID_SSVID      0x0D    /* Bridge subsystem vendor/device ID */
 #define  PCI_CAP_ID_AGP3       0x0E    /* AGP 8x */
 #define  PCI_CAP_ID_EXP                0x10    /* PCI Express */
 #define  PCI_CAP_ID_MSIX       0x11    /* MSI-X */
 #define PCI_MSIX_PBA           8
 #define  PCI_MSIX_BIR          0x7
 
+/* Subsystem vendor/device ID for PCI bridges */
+#define PCI_SSVID_VENDOR       4
+#define PCI_SSVID_DEVICE       6
+
 /* Advanced Error Reporting */
 #define PCI_ERR_UNCOR_STATUS   4       /* Uncorrectable Error Status */
 #define  PCI_ERR_UNC_TRAIN     0x00000001      /* Training */
diff --git a/lspci.c b/lspci.c
index e231303d23c01bc1b57d41c04d9c62f3b3672986..1fae4c61176a7221cf483d5a392ca2f672ef5617 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -1271,6 +1271,22 @@ show_slotid(int cap)
         chs);
 }
 
+static void
+show_ssvid(struct device *d, int where)
+{
+  u16 subsys_v, subsys_d;
+  char ssnamebuf[256];
+
+  if (!config_fetch(d, where, 8))
+    return;
+  subsys_v = get_conf_word(d, where + PCI_SSVID_VENDOR);
+  subsys_d = get_conf_word(d, where + PCI_SSVID_DEVICE);
+  printf("Subsystem: %s\n",
+          pci_lookup_name(pacc, ssnamebuf, sizeof(ssnamebuf),
+                          PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,
+                          d->dev->vendor_id, d->dev->device_id, subsys_v, subsys_d));
+}
+
 static void
 show_aer(struct device *d UNUSED, int where UNUSED)
 {
@@ -1396,6 +1412,9 @@ show_caps(struct device *d)
            case PCI_CAP_ID_DBG:
              show_debug();
              break;
+           case PCI_CAP_ID_SSVID:
+             show_ssvid(d, where);
+             break;
            case PCI_CAP_ID_EXP:
              show_express(d, where, cap);
              can_have_ext_caps = 1;