Skip to content

Commit 2bfde62

Browse files
YangGangUEFImergify[bot]
authored andcommitted
ShellPkg/SmbiosView: Support print Protocol Records of SMBIOS type42
SmbiosView tool changes for Protocol Records info decode and print. This commit adds the following decoding functionality: First, it prints the `MCHostInterfaceProtocol Number`, then print the `ProtocolType` with the prefix #x(0 based index), and finally dump `ProtocolTypeData` as hex. Signed-off-by: Yang Gang <[email protected]>
1 parent 1fe2504 commit 2bfde62

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

  • ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView

ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,11 @@ SmbiosPrintStructure (
12821282
// Management Controller Host Interface (Type 42)
12831283
//
12841284
case 42:
1285+
MC_HOST_INTERFACE_PROTOCOL_RECORD *MCHostInterfaceProtocolRecord;
1286+
UINT8 *RecordsPointer;
1287+
UINT8 MCHostInterfaceProtocolNumber;
1288+
UINT8 ProtocolTypeDataLen;
1289+
12851290
DisplayMCHostInterfaceType (Struct->Type42->InterfaceType, Option);
12861291
if (AE_SMBIOS_VERSION (0x3, 0x2)) {
12871292
UINT32 DataValue = 0;
@@ -1321,6 +1326,40 @@ SmbiosPrintStructure (
13211326
PRINT_BIT_FIELD (Struct, Type42, InterfaceTypeSpecificData, Struct->Type42->InterfaceTypeSpecificDataLength);
13221327
break;
13231328
}
1329+
1330+
RecordsPointer = (UINT8 *)(&Struct->Type42->InterfaceTypeSpecificData[0] + Struct->Type42->InterfaceTypeSpecificDataLength);
1331+
MCHostInterfaceProtocolNumber = *RecordsPointer;
1332+
ShellPrintDefaultEx (L"MCHostInterfaceProtocol Number: %d\n", MCHostInterfaceProtocolNumber);
1333+
MCHostInterfaceProtocolRecord = (MC_HOST_INTERFACE_PROTOCOL_RECORD *)(RecordsPointer + 1);
1334+
1335+
for (Index = 0; Index < MCHostInterfaceProtocolNumber; Index++) {
1336+
ProtocolTypeDataLen = MCHostInterfaceProtocolRecord->ProtocolTypeDataLen;
1337+
ShellPrintDefaultEx (L"#%d MCHostInterfaceProtocolType: ", Index);
1338+
switch (MCHostInterfaceProtocolRecord->ProtocolType) {
1339+
case MCHostInterfaceProtocolTypeIPMI:
1340+
ShellPrintDefaultEx (L"IPMI\n");
1341+
break;
1342+
1343+
case MCHostInterfaceProtocolTypeMCTP:
1344+
ShellPrintDefaultEx (L"MCTP\n");
1345+
break;
1346+
1347+
case MCHostInterfaceProtocolTypeRedfishOverIP:
1348+
ShellPrintDefaultEx (L"RedfishOverIP\n");
1349+
break;
1350+
1351+
case MCHostInterfaceProtocolTypeOemDefined:
1352+
ShellPrintDefaultEx (L"OemDefined\n");
1353+
break;
1354+
1355+
default:
1356+
ShellPrintDefaultEx (L"Reserved\n");
1357+
break;
1358+
}
1359+
1360+
PRINT_SMBIOS_BIT_FIELD (Struct, MCHostInterfaceProtocolRecord->ProtocolTypeData, ProtocolTypeData, ProtocolTypeDataLen);
1361+
MCHostInterfaceProtocolRecord = (MC_HOST_INTERFACE_PROTOCOL_RECORD *)((UINT8 *)MCHostInterfaceProtocolRecord + ProtocolTypeDataLen);
1362+
}
13241363
}
13251364

13261365
break;

0 commit comments

Comments
 (0)