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.web09.3527.1614654886261283505 for ; Mon, 01 Mar 2021 19:14:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@phoenix.com header.s=mimecast20170203 header.b=vTqzbljN; 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=1614654885; 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=D1iNRQWFKLZZvtGvU/mYT/wprqURPW8LDJsl5FZmRUE=; b=vTqzbljNvb/LlIWGSYc7dTR+nn6FqQ/ecmmFjSH9dUlWpal6IHjEApaPG2vjoem9+ShEWJ 0zJNhi1DzgST7kfnvDyEXSIrG/Ck2hdR7wGrm2O7T4sk29jMzT7UFTWjB8ogbQyZiFipQp so+REWsMpEjifwab4hvZy9utGFh2qmk= 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-539-bJOt4z_ZP1mAkCN_0oXttg-1; Mon, 01 Mar 2021 22:14:42 -0500 X-MC-Unique: bJOt4z_ZP1mAkCN_0oXttg-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; Tue, 2 Mar 2021 11:14:37 +0800 Received: from Mars-t490.phoenix.com (10.122.168.185) by TWN-EXCHMB-13.phoenix.com (10.122.170.118) with Microsoft SMTP Server id 15.0.1156.6 via Frontend Transport; Tue, 2 Mar 2021 11:14:36 +0800 From: "Mars CC Lin" To: CC: , Zhichao Gao , Philippe Mathieu-Daude , Liming Gao Subject: [PATCH v3] ShellPkg: add more items for smbiosview -t 3 . Date: Tue, 2 Mar 2021 11:14:21 +0800 Message-ID: <20210302031421.1102-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=_12103012214441521" --MCBoundary=_12103012214441521 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 | 14 ++++++++++++++ .../SmbiosView/SmbiosViewStrings.uni | 1 + 2 files changed, 15 insertions(+) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintIn= fo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index a3dc7b68c4..4be6cf2df4 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -280,6 +280,7 @@ SmbiosPrintStructure ( ) { UINT8 Index; + UINT8 Index2 =3D 0; UINT8 *Buffer; =20 if (Struct =3D=3D NULL) { @@ -404,6 +405,19 @@ 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); + } + for (Index =3D 0; Index < Struct->Type3->ContainedElementCount; Inde= x++) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_= CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1); + for (Index2 =3D 0; Index2< Struct->Type3->ContainedElementRecordLe= ngth; Index2++) { + Print (L"%02X ", Buffer[0x15 + (Index * Struct->Type3->Contained= ElementRecordLength) + 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 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 " --=20 2.29.1.windows.1 --MCBoundary=_12103012214441521 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 | 14 ++++++++++++++
.../SmbiosView/SmbiosViewStrings.uni | 1 +
2 files changed, 15 insertions(+)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintIn= fo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index a3dc7b68c4..4be6cf2df4 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -280,6 +280,7 @@ SmbiosPrintStructure (
)
{
UINT8 Index;
+ UINT8 Index2 =3D 0;
UINT8 *Buffer;

if (Struct =3D=3D NULL) {
@@ -404,6 +405,19 @@ 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->ContainedElementCo= unt; Index++) {
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_= CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1);
+ for (Index2 =3D 0; Index2< Struct->Type3->ContainedElemen= tRecordLength; 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=_12103012214441521--