From 248a04f8aa69758d0dbe4b85262bf1de54218f00 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 30 Jul 2006 13:47:44 +0200 Subject: [PATCH] Added support for the `bridge subsystem ID' capability. --- ChangeLog | 3 +++ lib/header.h | 5 +++++ lspci.c | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index d1ecaf4..65e71db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-07-30 Martin Mares + * 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. diff --git a/lib/header.h b/lib/header.h index ab56214..78f92db 100644 --- a/lib/header.h +++ b/lib/header.h @@ -188,6 +188,7 @@ #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 */ @@ -774,6 +775,10 @@ #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 e231303..1fae4c6 100644 --- 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; -- 2.39.2