From nobody Wed May 15 11:36:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+72318+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72318+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=phoenix.com ARC-Seal: i=1; a=rsa-sha256; t=1614654892; cv=none; d=zohomail.com; s=zohoarc; b=c83MwATNFq+oHYr9xYg4cr78GIqsoWLOTSvH6DJXBgxguk2eZ/MTjwYOr9IA/eJhOQqf728lgtg4UhMeGS8+b9h4wFAdbygRhqz+G8uUj3w9sCe7gnn2J9xGa30SrCs0cShzjaI2k+81U8sK2LpTRZxcQ6gRaZVJLU0okMm1+W0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614654892; h=Content-Type:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=Vo2/Ou1n5Sx86DX3k56nEqEyxs6NV9nvvFEoPaix4UQ=; b=FwBnwS6Sem4gg+LsO8ygEpJ6I4tsh4YnCxk9NCnYIRtX+pHJncxGMm1BT280V8IXbe5kna5UPkJqyCo08HJi/vMWESI5TlSqpaOqqhdcZhC+r1wXH5I6MST6uqpzQPAuChtjU0+A5A4MZstTnyIJGl07dr7lfJcOAIKK1Gi+ArY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72318+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1614654892250804.1433394574493; Mon, 1 Mar 2021 19:14:52 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id rGIjYY1788612x6LYpXPacxB; Mon, 01 Mar 2021 19:14:51 -0800 X-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 X-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 X-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 X-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: [edk2-devel] [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> MIME-Version: 1.0 X-OrganizationHeadersPreserved: TWN-EXCHMB-13.phoenix.com X-CrossPremisesHeadersFilteredBySendConnector: TWN-EXCHMB-13.phoenix.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: phoenix.com Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mars_cc_lin@phoenix.com X-Gm-Message-State: T7eGgAUhutpPRNl6mjoogTbYx1787277AA= Content-Type: multipart/alternative; boundary="MCBoundary=_12103012214441521" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1614654891; bh=yaqD20pVsCmd51giYY4TLT9XlOJ79VZNhAyTy8aXuo4=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=DZeoxd4jhC53IVI/slpMbF0yFJwnyoBgmZ7D7Sy2Ew9y5XZNDle3tAQNY+J4Be0czSb 7su0T075gUh+cYIWOFzruSnvglB8u7hF2GN/74uldaYmt5xsZ2GUwONMa7uRBUU9hB0Ok V4WVz9mORcMv4IQNnXL7rRVAi9M1jdQ0s5w= X-ZohoMail-DKIM: pass (identity @groups.io) --MCBoundary=_12103012214441521 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72318): https://edk2.groups.io/g/devel/message/72318 Mute This Topic: https://groups.io/mt/81017478/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --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/PrintI= nfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c<= BR> 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);=
+ }
+ for (Index =3D 0; Index < Struct->Type3->ContainedElementC= ount; Index++) {
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO= _CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1);
+ for (Index2 =3D 0; Index2< Struct->Type3->ContainedEleme= ntRecordLength; Index2++) {
+ Print (L"%02X ", Buffer[0x15 + (Index * Struct->Ty= pe3->ContainedElementRecordLength) + Index2]);
+ }
+ Print (L"\n");
+ }
}
if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Lengt= h > 0x13)) {
if (Struct->Hdr->Length > (0x15 + (Struct->Type3->Co= ntainedElementCount * Struct->Type3->ContainedElementRecordLength))) = {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smbios= ViewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Sm= biosViewStrings.uni
index 8bcba7ccf7..9433e8a25f 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStr= ings.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStr= ings.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
_._,_._,_

Gr= oups.io Links:

You receive all messages sent to this group.

Vie= w/Reply Online (#72318) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [importer@patchew.org]

_._,_._,_
=20 --MCBoundary=_12103012214441521--