summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoredhay <edhaya.chandran@arm.com>2025-04-02 12:17:21 +0530
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-04-02 22:21:39 +0000
commit59805c7697c801be8b08e5169bc2300d821c419d (patch)
tree02474eacb9f8923c853833f4189476747d50cdcf
parent7e8cd3235367b260f0df34f1f9ce84290a4a4e4c (diff)
downloadedk2-59805c7697c801be8b08e5169bc2300d821c419d.zip
edk2-59805c7697c801be8b08e5169bc2300d821c419d.tar.gz
edk2-59805c7697c801be8b08e5169bc2300d821c419d.tar.bz2
ShellPkg/SmbiosView: Decode for InterfaceTypeSpecificData of SMBIOS type42
ShellPkg/SmbiosView tool changes for InterfaceTypeSpecificData decode and print Previously, the InterfaceTypeSpecificData of SMBIOS type42 table was dumped as hex in the SmbiosView tool output This commit adds decode, interpretation and print as per SMBIOS spec version 3.8.0 Signed-off-by: G Edhaya Chandran <edhaya.chandran@arm.com>
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index 54e0887..c4406b1 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -1294,8 +1294,43 @@ SmbiosPrintStructure (
case 42:
DisplayMCHostInterfaceType (Struct->Type42->InterfaceType, Option);
if (AE_SMBIOS_VERSION (0x3, 0x2)) {
+ UINT32 DataValue = 0;
PRINT_STRUCT_VALUE_H (Struct, Type42, InterfaceTypeSpecificDataLength);
- PRINT_BIT_FIELD (Struct, Type42, InterfaceTypeSpecificData, Struct->Type42->InterfaceTypeSpecificDataLength);
+ if (Struct->Type42->InterfaceTypeSpecificDataLength < 4) {
+ ShellPrintEx (-1, -1, L"WARNING: InterfaceTypeSpecificDataLength should be >= 4.\n");
+ }
+
+ ShellPrintEx (-1, -1, L"InterfaceTypeSpecificData\n");
+ // Decode and interpret InterfaceTypeSpecificData based on the InterfaceType
+ switch (Struct->Type42->InterfaceType) {
+ case MCHostInterfaceTypeOemDefined:
+ // The first four bytes are the vendor ID (MSB first), as assigned by the Internet Assigned Numbers Authority (IANA) as "Enterprise Number".
+ // See https://www.iana.org/assignments/enterprise-numbers.txt
+ ShellPrintEx (-1, -1, L"Vendor ID (IANA Enterprise Number): %d", (UINT32)*(Struct->Type42->InterfaceTypeSpecificData));
+ break;
+
+ // As defined in MCTP Host Interface Specification, DSP0256
+ case MCHostInterfaceTypeMMBI:
+ // For MCTP interface type of MMBI; this defines the pointer to the MMBI capability descriptor, as defined in DSP0282, Section 7.1
+ DataValue = *(UINT32 *)Struct->Type42->InterfaceTypeSpecificData;
+ ShellPrintEx (-1, -1, L"Pointer to MMBI capability descriptor: 0x%x\n", DataValue);
+ break;
+
+ case MCHostInterfaceTypeI2C_SMBUS:
+ case MCHostInterfaceTypeI3C:
+ case MCHostInterfaceTypeKCS:
+ // switch case fall through
+ // For MCTP interface type of I2C, I3C, KCS; this value is reserved and must be 0
+ DataValue = *(UINT32 *)Struct->Type42->InterfaceTypeSpecificData;
+ ShellPrintEx (-1, -1, L"For Interface type I2C, I3C or KCS, InterfaceTypeSpecificData is reserved and must be 0.\n");
+ ShellPrintEx (-1, -1, L"Actual value is : 0x%x\n", DataValue);
+ break;
+
+ default:
+ // The decoding is not defined for these values in SMBIOS 3.8.0. The value is dumped
+ PRINT_BIT_FIELD (Struct, Type42, InterfaceTypeSpecificData, Struct->Type42->InterfaceTypeSpecificDataLength);
+ break;
+ }
}
break;