public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH] ShellPkg: Correct smbiosview strings and conditions for SMBIOS Type9
@ 2024-08-12  5:22 Lien, HoraceX
  0 siblings, 0 replies; only message in thread
From: Lien, HoraceX @ 2024-08-12  5:22 UTC (permalink / raw)
  To: devel; +Cc: HoraceX Lien, Liming Gao

From: HoraceX Lien <horacex.lien@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4826

Using smbiosview to dump SMBIOS Type9,
some code condition and string are incorrect.

Signed-off-by: HoraceX Lien <horacex.lien@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
---
 ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c  | 19 +++++++++----------
 ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c |  2 +-
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index 5c4413cbe3..a31f823304 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -3173,7 +3173,7 @@ DisplaySystemSlotId (
     //
     case 0x04:
       ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LOGICAL_MICRO_CHAN), gShellDebug1HiiHandle);
-      if ((SlotId > 0) && (SlotId < 15)) {
+      if ((SlotId > 0) && (SlotId <= 15)) {
         ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_D), gShellDebug1HiiHandle, SlotId);
       } else {
         ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_NOT_1_15), gShellDebug1HiiHandle);
@@ -3182,11 +3182,11 @@ DisplaySystemSlotId (
       break;
 
     //
-    // EISA
+    // Slot Type: EISA
     //
     case 0x05:
       ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LOGICAL_EISA_NUM), gShellDebug1HiiHandle);
-      if ((SlotId > 0) && (SlotId < 15)) {
+      if ((SlotId > 0) && (SlotId <= 15)) {
         ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_D), gShellDebug1HiiHandle, SlotId);
       } else {
         ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_NOT_1_15), gShellDebug1HiiHandle);
@@ -3202,21 +3202,20 @@ DisplaySystemSlotId (
       break;
 
     //
-    // PCMCIA
+    // Slot Type: PCMCIA
     //
     case 0x07:
       ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_IDENTIFIES_ADAPTER_NUM), gShellDebug1HiiHandle, SlotId);
       break;
 
     //
-    // Slot Type: PCI-E
+    // Slot Type: PCI 66MHz Capable, AGP, PCI-E, etc
     //
-    case 0xA5:
-      ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId);
-      break;
-
     default:
-      if (((SlotType >= 0x0E) && (SlotType <= 0x12)) || ((SlotType >= 0xA6) && (SlotType <= 0xC4))) {
+      if (((SlotType >= 0x0E) && (SlotType <= 0x13)) ||
+          ((SlotType >= 0x1F) && (SlotType <= 0x25)) ||
+          ((SlotType >= 0xA5) && (SlotType <= 0xC6)))
+      {
         ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId);
       } else {
         ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_SLOT_ID), gShellDebug1HiiHandle);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
index 36f8739d6c..0db28b66de 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
@@ -1924,7 +1924,7 @@ TABLE_ITEM  SystemSlotHeightTable[] = {
   },
   {
     0x02,
-    L" Unkown"
+    L" Unknown"
   },
   {
     0x03,
-- 
2.43.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120316): https://edk2.groups.io/g/devel/message/120316
Mute This Topic: https://groups.io/mt/107851928/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-12  5:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12  5:22 [edk2-devel] [PATCH] ShellPkg: Correct smbiosview strings and conditions for SMBIOS Type9 Lien, HoraceX

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