* [PATCH V5] ShellPkg: add more items for smbiosview -t 3 .
@ 2021-03-03 7:28 Mars CC Lin
2021-03-03 8:03 ` Gao, Zhichao
0 siblings, 1 reply; 3+ messages in thread
From: Mars CC Lin @ 2021-03-03 7:28 UTC (permalink / raw)
To: devel; +Cc: Zhichao Gao, Philippe Mathieu-Daude, Liming Gao
[-- Attachment #1: Type: text/plain, Size: 3112 bytes --]
https://bugzilla.tianocore.org/show_bug.cgi?id=3177
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/PrintInfo.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 = 0; Index < Struct->Type3->ContainedElementCount; Index++) {
+ 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 97e1d54fcf..20a556a175 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: 3646 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH V5] ShellPkg: add more items for smbiosview -t 3 .
2021-03-03 7:28 [PATCH V5] ShellPkg: add more items for smbiosview -t 3 Mars CC Lin
@ 2021-03-03 8:03 ` Gao, Zhichao
2021-03-05 9:26 ` [edk2-devel] " Mars CC Lin
0 siblings, 1 reply; 3+ messages in thread
From: Gao, Zhichao @ 2021-03-03 8:03 UTC (permalink / raw)
To: Mars CC Lin, devel@edk2.groups.io; +Cc: Philippe Mathieu-Daude, Liming Gao
[-- Attachment #1: Type: text/plain, Size: 4462 bytes --]
I am OK with the patch. But the patch is using incorrect "Line ending":
python ./BaseTools/Scripts/PatchCheck.py -1
Checking git commit: HEAD
ShellPkg: add more items for smbiosview -t 3 .
The commit message format passed all checks.
Code format is not valid:
* Line ending ('\n') is not CRLF
File: ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
Line: if (Struct->Hdr->Length > 0x13) {
* Line ending ('\n') is not CRLF
File: ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
Line: PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementCount);
* Line ending ('\n') is not CRLF
It is a good habit to use above check before send the patch. You should change your edit setting when you're working on edk2. Others are OK to me,
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Do not send the patch again. I would make the change. Because of it is hard freeze now, the patch would be merged after the 202102 stable create.
By the way, are you follow the development process https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process to send the patch? I am confused why I cannot extract your patch thru extractor tool.
Thanks,
Zhichao
From: Mars CC Lin <mars_cc_lin@phoenix.com>
Sent: Wednesday, March 3, 2021 3:28 PM
To: devel@edk2.groups.io
Cc: Gao, Zhichao <zhichao.gao@intel.com>; Philippe Mathieu-Daude <philmd@redhat.com>; Liming Gao <gaoliming@byosoft.com.cn>
Subject: [PATCH V5] ShellPkg: add more items for smbiosview -t 3 .
https://bugzilla.tianocore.org/show_bug.cgi?id=3177
Add ContainedElementCount, ContainedElementRecordLength and
ContainedElements for smbiosview type 3.
Signed-off-by: Mars CC Lin <mars_cc_lin@phoenix.com<mailto:mars_cc_lin@phoenix.com>>
Cc: Zhichao Gao <zhichao.gao@intel.com<mailto:zhichao.gao@intel.com>>
Cc: Philippe Mathieu-Daude <philmd@redhat.com<mailto:philmd@redhat.com>>
Cc: Liming Gao <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>
---
.../SmbiosView/PrintInfo.c | 15 +++++++++++++++
.../SmbiosView/SmbiosViewStrings.uni | 1 +
2 files changed, 16 insertions(+)
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.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 = 0; Index < Struct->Type3->ContainedElementCount; Index++) {
+ 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 97e1d54fcf..20a556a175 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: 9388 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH V5] ShellPkg: add more items for smbiosview -t 3 .
2021-03-03 8:03 ` Gao, Zhichao
@ 2021-03-05 9:26 ` Mars CC Lin
0 siblings, 0 replies; 3+ messages in thread
From: Mars CC Lin @ 2021-03-05 9:26 UTC (permalink / raw)
To: Gao, Zhichao, devel
[-- Attachment #1: Type: text/plain, Size: 65 bytes --]
Thank you for help and advice. I will review the process again.
[-- Attachment #2: Type: text/html, Size: 65 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-05 9:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-03 7:28 [PATCH V5] ShellPkg: add more items for smbiosview -t 3 Mars CC Lin
2021-03-03 8:03 ` Gao, Zhichao
2021-03-05 9:26 ` [edk2-devel] " 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