aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Widawsky <ben.widawsky@intel.com>2020-07-31 12:12:42 -0700
committerJaxon Haws <jaxon.haws@amd.com>2022-09-29 16:00:59 -0500
commit6c1382049899e6b77720bc1b0209588a51a5cca2 (patch)
tree99dde78bf7d83bad0542d27ab8f1315ff9f7a17b
parentccf5ff415fac5f978a4cd5d6ada1ca1846cf201b (diff)
downloadpciutils-6c1382049899e6b77720bc1b0209588a51a5cca2.tar.gz
cxl: Make id check more explicit
Currently only type 0 DVSEC caps are handled. Moving this check will allow more robust type handling in the future. Should be no functional change. Signed-off-by: Ben Widawsky <ben.widawsky@intel.com> Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
-rw-r--r--ls-ecaps.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ls-ecaps.c b/ls-ecaps.c
index 3c4bb13..196a7be 100644
--- a/ls-ecaps.c
+++ b/ls-ecaps.c
@@ -690,7 +690,7 @@ cap_rcec(struct device *d, int where)
}
static void
-cap_dvsec_cxl(struct device *d, int where)
+cap_dvsec_cxl(struct device *d, int id, int where)
{
u16 w;
@@ -698,6 +698,9 @@ cap_dvsec_cxl(struct device *d, int where)
if (verbose < 2)
return;
+ if (id != 0)
+ return;
+
if (!config_fetch(d, where + PCI_CXL_CAP, 12))
return;
@@ -734,8 +737,8 @@ cap_dvsec(struct device *d, int where)
u16 id = get_conf_long(d, where + PCI_DVSEC_HEADER2);
printf("Vendor=%04x ID=%04x Rev=%d Len=%d", vendor, id, rev, len);
- if (vendor == PCI_DVSEC_VENDOR_ID_CXL && id == PCI_DVSEC_ID_CXL && len >= 16)
- cap_dvsec_cxl(d, where);
+ if (vendor == PCI_DVSEC_VENDOR_ID_CXL && len >= 16)
+ cap_dvsec_cxl(d, id, where);
else
printf(" <?>\n");
}