From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-170.mimecast.com (us-smtp-delivery-170.mimecast.com [63.128.21.170]) by mx.groups.io with SMTP id smtpd.web12.1689.1611197100591371697 for ; Wed, 20 Jan 2021 18:45:00 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@phoenix.com header.s=mimecast20170203 header.b=WGLKzsBc; spf=pass (domain: phoenix.com, ip: 63.128.21.170, mailfrom: mars_cc_lin@phoenix.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phoenix.com; s=mimecast20170203; t=1611197099; 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=+e0Erivt2P1CkVagKUZ5K20yWvQVysIOHixFjfExfN8=; b=WGLKzsBcvBHdSBLjTt4k2L/qQmKuuwiwKd8OdquUmp8SVq86A0jktxkyZaimcstx/qou3q ypLOBX/gS5YJdTSaZv62y3gi2m7BSjs7NFvb6DQzW6mAraqQhCQeYlZ+IgWpKI8eVW4KZF vKvUeZaj2QNs+j75UDQydNRl9rF/AsI= 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-320-1ArQw71kMG67T1JweZAlDA-1; Wed, 20 Jan 2021 21:44:56 -0500 X-MC-Unique: 1ArQw71kMG67T1JweZAlDA-1 X-CrossPremisesHeadersFilteredBySendConnector: TWN-EXCHMB-13.phoenix.com 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; Thu, 21 Jan 2021 10:44:50 +0800 Received: from Mars-t490.phoenix.com (10.122.169.52) by TWN-EXCHMB-13.phoenix.com (10.122.170.118) with Microsoft SMTP Server id 15.0.1156.6 via Frontend Transport; Thu, 21 Jan 2021 10:44:50 +0800 From: Mars CC Lin To: CC: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ray Ni , Zhichao Gao Subject: [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements Date: Thu, 21 Jan 2021 10:44:48 +0800 Message-ID: <20210121024448.624-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 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=_12101202144580631" --MCBoundary=_12101202144580631 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Philippe Mathieu-Daud=C3=A9 Cc: Ray Ni Cc: Zhichao Gao Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3177 Signed-off-by: Mars CC Lin --- .../SmbiosView/PrintInfo.c | 16 ++++++++++++++++ .../SmbiosView/SmbiosViewStrings.uni | 1 + 2 files changed, 17 insertions(+) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintIn= fo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index a3dc7b68c4..36c743d45b 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -404,6 +404,22 @@ SmbiosPrintStructure ( if (Struct->Hdr->Length > 0x12) {=0D PRINT_STRUCT_VALUE (Struct, Type3, NumberofPowerCords);=0D }=0D + if (Struct->Hdr->Length > 0x13) {=0D + PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementCount);=0D + }=0D + if (Struct->Hdr->Length > 0x14) {=0D + PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementRecordLength);= =0D + }=0D + for (Index =3D 0;Index < Struct->Type3->ContainedElementCount;Index+= +) {=0D + UINT8 Index2 =3D 0;=0D +=0D + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_= CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1);=0D + for (Index2 =3D 0;Index2Type3->ContainedElementRecordLeng= th;Index2++) {=0D + Print (L"%02X ", Buffer[0x15 + (Index * Struct->Type3->Contained= ElementRecordLength) + Index2]);=0D + }=0D + Print (L"\n");=0D + }=0D +=0D }=0D if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x13)) {=0D if (Struct->Hdr->Length > (0x15 + (Struct->Type3->ContainedElementCo= unt * Struct->Type3->ContainedElementRecordLength))) {=0D diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosV= iewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smb= iosViewStrings.uni index 8bcba7ccf7..9433e8a25f 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 "=0D #string STR_SMBIOSVIEW_PRINTINFO_THERMAL_STATE #language = en-US "Thermal state "=0D #string STR_SMBIOSVIEW_PRINTINFO_SECURITY_STATUS #language = en-US "Security Status "=0D +#string STR_SMBIOSVIEW_PRINTINFO_CONTAINED_ELEMENT #language = en-US "Contained Element %d: "=0D #string STR_SMBIOSVIEW_PRINTINFO_SUPOPRT #language = en-US "Support "=0D #string STR_SMBIOSVIEW_PRINTINFO_CURRENT #language = en-US "Current "=0D #string STR_SMBIOSVIEW_PRINTINFO_INSTALLED #language = en-US "Installed "=0D --=20 2.29.1.windows.1 --MCBoundary=_12101202144580631 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8 Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3177
Signed-off-by: Mars CC Lin <mars_cc_lin@phoenix.com>
---
.../SmbiosView/PrintInfo.c | 16 ++++++++++++++++
.../SmbiosView/SmbiosViewStrings.uni | 1 +
2 files changed, 17 insertions(+)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintIn= fo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index a3dc7b68c4..36c743d45b 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -404,6 +404,22 @@ 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>
+ }

+ for (Index =3D 0;Index < Struct->Type3->ContainedElementCou= nt;Index++) {

+ UINT8 Index2 =3D 0;

+

+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_= CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1);

+ for (Index2 =3D 0;Index2<Struct->Type3->ContainedElementR= ecordLength;Index2++) {

+ Print (L"%02X ", Buffer[0x15 + (Index * Struct->Typ= e3->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 8bcba7ccf7..9433e8a25f 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=_12101202144580631--