public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements
@ 2021-01-21  2:44 Mars CC Lin
  2021-02-01  1:07 ` Gao, Zhichao
  0 siblings, 1 reply; 5+ messages in thread
From: Mars CC Lin @ 2021-01-21  2:44 UTC (permalink / raw)
  To: devel; +Cc: Philippe Mathieu-Daudé, Ray Ni, Zhichao Gao

[-- Attachment #1: Type: text/plain, Size: 2992 bytes --]

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=3177
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/PrintInfo.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);
+      }
+      for (Index = 0;Index < Struct->Type3->ContainedElementCount;Index++) {
+        UINT8 Index2 = 0;
+
+        ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1);
+        for (Index2 = 0;Index2<Struct->Type3->ContainedElementRecordLength;Index2++) {
+          Print (L"%02X ", Buffer[0x15 + (Index * Struct->Type3->ContainedElementRecordLength) + Index2]);
+        }
+        Print (L"\n");
+      }
+
     }
     if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x13)) {
       if (Struct->Hdr->Length > (0x15 + (Struct->Type3->ContainedElementCount * Struct->Type3->ContainedElementRecordLength))) {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
index 8bcba7ccf7..9433e8a25f 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.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

[-- Attachment #2: Type: text/html, Size: 3660 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements
  2021-01-21  2:44 [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements Mars CC Lin
@ 2021-02-01  1:07 ` Gao, Zhichao
  2021-02-23  2:26   ` [edk2-devel] " mars_cc_lin
  0 siblings, 1 reply; 5+ messages in thread
From: Gao, Zhichao @ 2021-02-01  1:07 UTC (permalink / raw)
  To: Mars CC Lin, devel@edk2.groups.io; +Cc: Philippe Mathieu-Daudé, Ni, Ray

[-- Attachment #1: Type: text/plain, Size: 3591 bytes --]

Hi Mars,

I cannot extract the patch. I don’t what cause this issue. Can you share your branch?

Back to the patch. Please remove the ‘*’ in the titile.

Don’t define the Index2 in a block scope, it should be defined at the begin of the function. Refer to CCS spec 2.2.1 Section 5.4.1.1:
Block scope: such type of declaration is strongly discouraged.

Thanks,
Zhichao

From: Mars CC Lin <mars_cc_lin@phoenix.com>
Sent: Thursday, January 21, 2021 10:45 AM
To: devel@edk2.groups.io
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>; Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
Subject: [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements

Cc: Philippe Mathieu-Daudé <philmd@redhat.com<mailto:philmd@redhat.com>>
Cc: Ray Ni <ray.ni@intel.com<mailto:ray.ni@intel.com>>
Cc: Zhichao Gao <zhichao.gao@intel.com<mailto:zhichao.gao@intel.com>>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3177
Signed-off-by: Mars CC Lin <mars_cc_lin@phoenix.com<mailto: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/PrintInfo.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);

+ }

+ for (Index = 0;Index < Struct->Type3->ContainedElementCount;Index++) {

+ UINT8 Index2 = 0;

+

+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1);

+ for (Index2 = 0;Index2<Struct->Type3->ContainedElementRecordLength;Index2++) {

+ Print (L"%02X ", Buffer[0x15 + (Index * Struct->Type3->ContainedElementRecordLength) + Index2]);

+ }

+ Print (L"\n");

+ }

+

}

if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x13)) {

if (Struct->Hdr->Length > (0x15 + (Struct->Type3->ContainedElementCount * Struct->Type3->ContainedElementRecordLength))) {

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
index 8bcba7ccf7..9433e8a25f 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.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

[-- Attachment #2: Type: text/html, Size: 6711 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements
  2021-02-01  1:07 ` Gao, Zhichao
@ 2021-02-23  2:26   ` mars_cc_lin
  2021-02-23  7:33     ` Gao, Zhichao
  2021-02-24  2:13     ` Mars CC Lin
  0 siblings, 2 replies; 5+ messages in thread
From: mars_cc_lin @ 2021-02-23  2:26 UTC (permalink / raw)
  To: Gao, Zhichao, devel

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

Hi Gao,

I've resend the patch with your suggestion. the title is ShellPkg: add more items for smbiosview -t 3.
Since I sent it 2 times, please refer the patch latest time.

Mars

[-- Attachment #2: Type: text/html, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements
  2021-02-23  2:26   ` [edk2-devel] " mars_cc_lin
@ 2021-02-23  7:33     ` Gao, Zhichao
  2021-02-24  2:13     ` Mars CC Lin
  1 sibling, 0 replies; 5+ messages in thread
From: Gao, Zhichao @ 2021-02-23  7:33 UTC (permalink / raw)
  To: mars_cc_lin@phoenix.com, devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 868 bytes --]

Hi Mars,

I cannot extract the patch from your email. May be there are some problems with your git config. Do you have a fork repo in git? If yes, can you help to upload the change to your own branch and share me the link? Example: https://github.com/ZhichaoGao/edk2/tree/push
The other way is attach the patch thru email or Bugzilla.

Thanks,
Zhichao

From: mars_cc_lin@phoenix.com <mars_cc_lin@phoenix.com>
Sent: Tuesday, February 23, 2021 10:26 AM
To: Gao; Gao, Zhichao <zhichao.gao@intel.com>; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements

Hi Gao,

I've resend the patch with your suggestion. the title is ShellPkg: add more items for smbiosview -t 3.
Since I sent it 2 times, please refer the patch latest time.

Mars

[-- Attachment #2: Type: text/html, Size: 3172 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements
  2021-02-23  2:26   ` [edk2-devel] " mars_cc_lin
  2021-02-23  7:33     ` Gao, Zhichao
@ 2021-02-24  2:13     ` Mars CC Lin
  1 sibling, 0 replies; 5+ messages in thread
From: Mars CC Lin @ 2021-02-24  2:13 UTC (permalink / raw)
  To: Mars CC Lin, devel

[-- Attachment #1: Type: text/plain, Size: 86 bytes --]

Hi Gao,

I've attach the patch to the bugzilla. thanks for the suggestion.

Mars

[-- Attachment #2: Type: text/html, Size: 102 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-24  2:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-21  2:44 [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements Mars CC Lin
2021-02-01  1:07 ` Gao, Zhichao
2021-02-23  2:26   ` [edk2-devel] " mars_cc_lin
2021-02-23  7:33     ` Gao, Zhichao
2021-02-24  2:13     ` Mars CC Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox