aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Widawsky <ben.widawsky@intel.com>2020-07-31 12:37:15 -0700
committerJaxon Haws <jaxon.haws@amd.com>2022-09-30 14:41:06 -0500
commit0d4491cb4520e11eca129c44d3fe9d27109187dc (patch)
tree64b3ee2592f315c6efac13048220b520673d3209
parent9535c7aa0f64591428e8c436b9dc4dffebb27665 (diff)
downloadpciutils-0d4491cb4520e11eca129c44d3fe9d27109187dc.tar.gz
cxl: Rework caps to new function
This will help upcoming caps Signed-off-by: Ben Widawsky <ben.widawsky@intel.com> Co-authored-by: Jaxon Haws <jaxon.haws@amd.com> Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
-rw-r--r--ls-ecaps.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/ls-ecaps.c b/ls-ecaps.c
index b080a19..432d95a 100644
--- a/ls-ecaps.c
+++ b/ls-ecaps.c
@@ -690,18 +690,12 @@ cap_rcec(struct device *d, int where)
}
static void
-cap_dvsec_cxl(struct device *d, int id, int where)
+dvsec_cxl_device(struct device *d, int where, int rev)
{
u16 w;
- printf(": CXL\n");
- if (verbose < 2)
- return;
-
- if (id != 0)
- return;
-
- if (!config_fetch(d, where + PCI_CXL_CAP, PCI_CXL_DEV_LEN - PCI_CXL_CAP))
+ /* Legacy 1.1 revs aren't handled */
+ if (rev < 1)
return;
w = get_conf_word(d, where + PCI_CXL_CAP);
@@ -720,6 +714,26 @@ cap_dvsec_cxl(struct device *d, int id, int where)
}
static void
+cap_dvsec_cxl(struct device *d, int id, int where)
+{
+ u8 rev;
+
+ printf(": CXL\n");
+ if (verbose < 2)
+ return;
+
+ if (id != 0)
+ return;
+
+ rev = BITS(get_conf_byte(d, where + 0x6), 0, 4);
+
+ if (!config_fetch(d, where, PCI_CXL_DEV_LEN))
+ return;
+
+ dvsec_cxl_device(d, where, rev);
+}
+
+static void
cap_dvsec(struct device *d, int where)
{
printf("Designated Vendor-Specific: ");