ShellPkg/SmbiosView: Update SmbiosView for SMBIOS3.2.0

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1099

Update SmbiosView to parse the new definitions which
are introduced in SMBIOS3.2.0

V2:
1. Add structure length check before dump the fileds in
Type 9 and Type 17 in case some fileds are not organized
and reported by drivers.
2. Dump the InterfaceTypeSpecificData in Type 42.

V3:
1. Correct the structure length in Type17.
2. Remove the redundant check "if (PeerGroupCount > 0)" in Type 9.
3. Use the Uint16 filed instead of Bits field in union
MEMORY_DEVICE_OPERATING_MODE_CAPABILITY to dump data.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Dandan Bi
2018-08-27 13:21:48 +08:00
committed by Star Zeng
parent 79e4f2a56a
commit 7475ac5157
4 changed files with 237 additions and 19 deletions

View File

@ -543,22 +543,45 @@ SmbiosPrintStructure (
// System Slots (Type 9)
//
case 9:
PRINT_PENDING_STRING (Struct, Type9, SlotDesignation);
DisplaySystemSlotType (Struct->Type9->SlotType, Option);
DisplaySystemSlotDataBusWidth (Struct->Type9->SlotDataBusWidth, Option);
DisplaySystemSlotCurrentUsage (Struct->Type9->CurrentUsage, Option);
DisplaySystemSlotLength (Struct->Type9->SlotLength, Option);
DisplaySystemSlotId (
Struct->Type9->SlotID,
Struct->Type9->SlotType,
Option
);
DisplaySlotCharacteristics1 (*(UINT8 *) &(Struct->Type9->SlotCharacteristics1), Option);
DisplaySlotCharacteristics2 (*(UINT8 *) &(Struct->Type9->SlotCharacteristics2), Option);
if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0xD)) {
PRINT_STRUCT_VALUE_H (Struct, Type9, SegmentGroupNum);
PRINT_STRUCT_VALUE_H (Struct, Type9, BusNum);
PRINT_STRUCT_VALUE_H (Struct, Type9, DevFuncNum);
{
MISC_SLOT_PEER_GROUP *PeerGroupPtr;
UINT8 PeerGroupCount;
PRINT_PENDING_STRING (Struct, Type9, SlotDesignation);
DisplaySystemSlotType (Struct->Type9->SlotType, Option);
DisplaySystemSlotDataBusWidth (Struct->Type9->SlotDataBusWidth, Option);
DisplaySystemSlotCurrentUsage (Struct->Type9->CurrentUsage, Option);
DisplaySystemSlotLength (Struct->Type9->SlotLength, Option);
DisplaySystemSlotId (
Struct->Type9->SlotID,
Struct->Type9->SlotType,
Option
);
DisplaySlotCharacteristics1 (*(UINT8 *) &(Struct->Type9->SlotCharacteristics1), Option);
DisplaySlotCharacteristics2 (*(UINT8 *) &(Struct->Type9->SlotCharacteristics2), Option);
if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0xD)) {
PRINT_STRUCT_VALUE_H (Struct, Type9, SegmentGroupNum);
PRINT_STRUCT_VALUE_H (Struct, Type9, BusNum);
PRINT_STRUCT_VALUE_H (Struct, Type9, DevFuncNum);
}
if (AE_SMBIOS_VERSION (0x3, 0x2)) {
if (Struct->Hdr->Length > 0x11) {
PRINT_STRUCT_VALUE (Struct, Type9, DataBusWidth);
}
if (Struct->Hdr->Length > 0x12) {
PRINT_STRUCT_VALUE (Struct, Type9, PeerGroupingCount);
PeerGroupCount = Struct->Type9->PeerGroupingCount;
PeerGroupPtr = Struct->Type9->PeerGroups;
for (Index = 0; Index < PeerGroupCount; Index++) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SLOT_PEER_GROUPS), gShellDebug1HiiHandle, Index + 1);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SEGMENT_GROUP_NUM), gShellDebug1HiiHandle, PeerGroupPtr[Index].SegmentGroupNum);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BUS_NUM), gShellDebug1HiiHandle, PeerGroupPtr[Index].BusNum);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_FUNC_NUM), gShellDebug1HiiHandle, PeerGroupPtr[Index].DevFuncNum);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DATA_BUS_WIDTH), gShellDebug1HiiHandle, PeerGroupPtr[Index].DataBusWidth);
}
}
}
}
break;
@ -755,6 +778,29 @@ SmbiosPrintStructure (
PRINT_STRUCT_VALUE (Struct, Type17, MaximumVoltage);
PRINT_STRUCT_VALUE (Struct, Type17, ConfiguredVoltage);
}
if (AE_SMBIOS_VERSION (0x3, 0x2)) {
if (Struct->Hdr->Length > 0x28) {
DisplayMemoryDeviceMemoryTechnology (Struct->Type17->MemoryTechnology, Option);
DisplayMemoryDeviceMemoryOperatingModeCapability (Struct->Type17->MemoryOperatingModeCapability.Uint16, Option);
PRINT_PENDING_STRING (Struct, Type17, FirwareVersion);
PRINT_STRUCT_VALUE_H (Struct, Type17, ModuleManufacturerID);
PRINT_STRUCT_VALUE_H (Struct, Type17, ModuleProductID);
PRINT_STRUCT_VALUE_H (Struct, Type17, MemorySubsystemControllerManufacturerID);
PRINT_STRUCT_VALUE_H (Struct, Type17, MemorySubsystemControllerProductID);
}
if (Struct->Hdr->Length > 0x34) {
PRINT_STRUCT_VALUE_H (Struct, Type17, NonVolatileSize);
}
if (Struct->Hdr->Length > 0x3C) {
PRINT_STRUCT_VALUE_H (Struct, Type17, VolatileSize);
}
if (Struct->Hdr->Length > 0x44) {
PRINT_STRUCT_VALUE_H (Struct, Type17, CacheSize);
}
if (Struct->Hdr->Length > 0x4C) {
PRINT_STRUCT_VALUE_H (Struct, Type17, LogicalSize);
}
}
break;
//
@ -1108,6 +1154,10 @@ SmbiosPrintStructure (
//
case 42:
DisplayMCHostInterfaceType (Struct->Type42->InterfaceType, Option);
if (AE_SMBIOS_VERSION (0x3, 0x2)) {
PRINT_STRUCT_VALUE_H (Struct, Type42, InterfaceTypeSpecificDataLength);
PRINT_BIT_FIELD (Struct, Type42, InterfaceTypeSpecificData, Struct->Type42->InterfaceTypeSpecificDataLength);
}
break;
//
@ -2111,6 +2161,10 @@ DisplayProcessorFamily (
Print (L"Intel Core i3 processor\n");
break;
case 0xCF:
Print (L"Intel Core i9 processor\n");
break;
case 0xD2:
Print (L"ViaC7M\n");
break;