From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-170.mimecast.com (us-smtp-delivery-170.mimecast.com [216.205.24.170]) by mx.groups.io with SMTP id smtpd.web12.3715.1614756509315068262 for ; Tue, 02 Mar 2021 23:28:29 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@phoenix.com header.s=mimecast20170203 header.b=QtRjBpZB; spf=pass (domain: phoenix.com, ip: 216.205.24.170, mailfrom: mars_cc_lin@phoenix.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phoenix.com; s=mimecast20170203; t=1614756508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=TjnNaQ+PzR0/cwtaYqi+4yeyf0m++59y8yvRarhWJ6g=; b=QtRjBpZBFIVZc3u7Qo5I/ZCEWL6TLTitr7zS/pkvQOJf42vGNILz4uSr/xJIYMsNnU7bJ/ 6ZujZHufMxFwk64nALHCURh5d51fMQgU+RhSe9N/wAD1RS5dbEjcqyGBz1wyWMIe+K+jC3 VuZFug014wvhD2/XH8wZxR2Xt5ZSC5k= Received: from TWN-EXCHMB-13.phoenix.com (123.51.168.5 [123.51.168.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-423-y1sqgQkaOeawl8PtEfofog-1; Wed, 03 Mar 2021 02:28:25 -0500 X-MC-Unique: y1sqgQkaOeawl8PtEfofog-1 Received: from TWN-EXCHMB-13.phoenix.com (2607:f0dc:5001:ff01:3897:a901:3564:6014) by TWN-EXCHMB-13.phoenix.com (2607:f0dc:5001:ff01:3897:a901:3564:6014) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Wed, 3 Mar 2021 15:28:20 +0800 Received: from Mars-t490.phoenix.com (10.122.168.184) by TWN-EXCHMB-13.phoenix.com (10.122.170.118) with Microsoft SMTP Server id 15.0.1156.6 via Frontend Transport; Wed, 3 Mar 2021 15:28:20 +0800 From: "Mars CC Lin" To: CC: Zhichao Gao , Philippe Mathieu-Daude , Liming Gao Subject: [PATCH V5] ShellPkg: add more items for smbiosview -t 3 . Date: Wed, 3 Mar 2021 15:28:10 +0800 Message-ID: <20210303072810.942-1-mars_cc_lin@phoenix.com> X-Mailer: git-send-email 2.29.1.windows.1 MIME-Version: 1.0 Return-Path: mars_cc_lin@phoenix.com X-OrganizationHeadersPreserved: TWN-EXCHMB-13.phoenix.com X-CrossPremisesHeadersFilteredBySendConnector: TWN-EXCHMB-13.phoenix.com Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA70A150 smtp.mailfrom=mars_cc_lin@phoenix.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: phoenix.com Content-Type: multipart/alternative; boundary="MCBoundary=_12103030228270761" --MCBoundary=_12103030228270761 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=WINDOWS-1252 https://bugzilla.tianocore.org/show_bug.cgi?id=3D3177 Add ContainedElementCount, ContainedElementRecordLength and ContainedElements for smbiosview type 3. Signed-off-by: Mars CC Lin Cc: Zhichao Gao Cc: Philippe Mathieu-Daude Cc: Liming Gao --- .../SmbiosView/PrintInfo.c | 15 +++++++++++++++ .../SmbiosView/SmbiosViewStrings.uni | 1 + 2 files changed, 16 insertions(+) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintIn= fo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index 478f63078a..04e4882272 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -404,6 +404,21 @@ SmbiosPrintStructure ( if (Struct->Hdr->Length > 0x12) { PRINT_STRUCT_VALUE (Struct, Type3, NumberofPowerCords); } + if (Struct->Hdr->Length > 0x13) { + PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementCount); + } + if (Struct->Hdr->Length > 0x14) { + PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementRecordLength); + } + if (Struct->Hdr->Length > 0x15) { + for (Index =3D 0; Index < Struct->Type3->ContainedElementCount; In= dex++) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINF= O_CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1); + for (Index2 =3D 0; Index2< Struct->Type3->ContainedElementRecord= Length; Index2++) { + Print (L"%02X ", Buffer[0x15 + (Index * Struct->Type3->Contain= edElementRecordLength) + Index2]); + } + Print (L"\n"); + } + } } if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x13)) { if (Struct->Hdr->Length > (0x15 + (Struct->Type3->ContainedElementCo= unt * Struct->Type3->ContainedElementRecordLength))) { diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosV= iewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smb= iosViewStrings.uni index 97e1d54fcf..20a556a175 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStri= ngs.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStri= ngs.uni @@ -93,6 +93,7 @@ #string STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_STATE #language = en-US "Power Supply State " #string STR_SMBIOSVIEW_PRINTINFO_THERMAL_STATE #language = en-US "Thermal state " #string STR_SMBIOSVIEW_PRINTINFO_SECURITY_STATUS #language = en-US "Security Status " +#string STR_SMBIOSVIEW_PRINTINFO_CONTAINED_ELEMENT #language = en-US "Contained Element %d: " #string STR_SMBIOSVIEW_PRINTINFO_SUPOPRT #language = en-US "Support " #string STR_SMBIOSVIEW_PRINTINFO_CURRENT #language = en-US "Current " #string STR_SMBIOSVIEW_PRINTINFO_INSTALLED #language = en-US "Installed " --=20 2.29.1.windows.1 --MCBoundary=_12103030228270761 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=WINDOWS-1252 https://bugzilla.tianocore.org/show_bug.cgi?id=3D3177<= /a>
Add ContainedElementCount, ContainedElementRecordLength and
ContainedElements for smbiosview type 3.

Signed-off-by: Mars CC Lin <mars_cc_lin@phoenix.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Philippe Mathieu-Daude <philmd@redhat.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
---
.../SmbiosView/PrintInfo.c | 15 +++++++++++++++
.../SmbiosView/SmbiosViewStrings.uni | 1 +
2 files changed, 16 insertions(+)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintIn= fo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index 478f63078a..04e4882272 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -404,6 +404,21 @@ SmbiosPrintStructure (
if (Struct->Hdr->Length > 0x12) {
PRINT_STRUCT_VALUE (Struct, Type3, NumberofPowerCords);
}
+ if (Struct->Hdr->Length > 0x13) {
+ PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementCount);
+ }
+ if (Struct->Hdr->Length > 0x14) {
+ PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementRecordLength);<= BR> + }
+ if (Struct->Hdr->Length > 0x15) {
+ for (Index =3D 0; Index < Struct->Type3->ContainedElement= Count; Index++) {
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINF= O_CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1);
+ for (Index2 =3D 0; Index2< Struct->Type3->ContainedElem= entRecordLength; Index2++) {
+ Print (L"%02X ", Buffer[0x15 + (Index * Struct->T= ype3->ContainedElementRecordLength) + Index2]);
+ }
+ Print (L"\n");
+ }
+ }
}
if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length= > 0x13)) {
if (Struct->Hdr->Length > (0x15 + (Struct->Type3->Con= tainedElementCount * Struct->Type3->ContainedElementRecordLength))) {=
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosV= iewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smb= iosViewStrings.uni
index 97e1d54fcf..20a556a175 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStri= ngs.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStri= ngs.uni
@@ -93,6 +93,7 @@
#string STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_STATE #language = en-US "Power Supply State "
#string STR_SMBIOSVIEW_PRINTINFO_THERMAL_STATE #language = en-US "Thermal state "
#string STR_SMBIOSVIEW_PRINTINFO_SECURITY_STATUS #language = en-US "Security Status "
+#string STR_SMBIOSVIEW_PRINTINFO_CONTAINED_ELEMENT #language = en-US "Contained Element %d: "
#string STR_SMBIOSVIEW_PRINTINFO_SUPOPRT #language = en-US "Support "
#string STR_SMBIOSVIEW_PRINTINFO_CURRENT #language = en-US "Current "
#string STR_SMBIOSVIEW_PRINTINFO_INSTALLED #language = en-US "Installed "
--
2.29.1.windows.1
--MCBoundary=_12103030228270761--