X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ls-ecaps.c;h=1bd1bf7b7418582b127b26d8cd3e047689f56533;hb=6182921907ef3cc31be3394eb468b24bcd3955a8;hp=32108cd32fc0c824b5e7706ca852d69d742931b2;hpb=5c75f737b19d4a21756cc2001cce7ec164731f5a;p=pciutils.git diff --git a/ls-ecaps.c b/ls-ecaps.c index 32108cd..1bd1bf7 100644 --- a/ls-ecaps.c +++ b/ls-ecaps.c @@ -3,7 +3,9 @@ * * Copyright (c) 1997--2022 Martin Mares * - * Can be freely distributed and used under the terms of the GNU GPL. + * Can be freely distributed and used under the terms of the GNU GPL v2+. + * + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -1014,6 +1016,47 @@ dvsec_cxl_flex_bus(struct device *d, int where, int rev) } } +static void +dvsec_cxl_mld(struct device *d, int where) +{ + u16 w; + + w = get_conf_word(d, where + PCI_CXL_MLD_NUM_LD); + + /* Encodings greater than 16 are reserved */ + if (w && w <= PCI_CXL_MLD_MAX_LD) + printf("\t\tNumLogDevs: %d\n", w); +} + +static void +dvsec_cxl_function_map(struct device *d, int where) +{ + + printf("\t\tFuncMap 0: %08x\n", + (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_0))); + + printf("\t\tFuncMap 1: %08x\n", + (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_1))); + + printf("\t\tFuncMap 2: %08x\n", + (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_2))); + + printf("\t\tFuncMap 3: %08x\n", + (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_3))); + + printf("\t\tFuncMap 4: %08x\n", + (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_4))); + + printf("\t\tFuncMap 5: %08x\n", + (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_5))); + + printf("\t\tFuncMap 6: %08x\n", + (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_6))); + + printf("\t\tFuncMap 7: %08x\n", + (unsigned int)(get_conf_word(d, where + PCI_CXL_FUN_MAP_REG_7))); +} + static void cap_dvsec_cxl(struct device *d, int id, int rev, int where, int len) { @@ -1030,7 +1073,7 @@ cap_dvsec_cxl(struct device *d, int id, int rev, int where, int len) dvsec_cxl_device(d, rev, where, len); break; case 2: - printf("\t\tNon-CXL Function Map DVSEC\n"); + dvsec_cxl_function_map(d, where); break; case 3: dvsec_cxl_port(d, where, len); @@ -1048,7 +1091,7 @@ cap_dvsec_cxl(struct device *d, int id, int rev, int where, int len) dvsec_cxl_register_locator(d, where, len); break; case 9: - printf("\t\tMLD DVSEC\n"); + dvsec_cxl_mld(d, where); break; default: printf("\t\tUnknown ID %04x\n", id);