public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ShellPkg:Improved Smbios Type 9 data under smbiosview
@ 2022-11-02  4:30 Sainadh Nagolu
  2022-11-04  1:08 ` 回复: [edk2-devel] " gaoliming
  0 siblings, 1 reply; 11+ messages in thread
From: Sainadh Nagolu @ 2022-11-02  4:30 UTC (permalink / raw)
  To: devel@edk2.groups.io, Sainadh Nagolu; +Cc: Vasudevan S, Sundaresan S

Added spec version check while publishing new fields, added Slot Pitch field which was missing and corrected the publishing order as per Smbios spec.

Signed-off-by: Sainadh Nagolu <sainadhn@ami.com>

---
 .../SmbiosView/PrintInfo.c                     | 18 ++++++++++++------
 .../SmbiosView/SmbiosViewStrings.uni           |  2 ++
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index bf5306205b..595de36b40 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -638,12 +638,18 @@ SmbiosPrintStructure (
             ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DATA_BUS_WIDTH), gShellDebug1HiiHandle, PeerGroupPtr[Index].DataBusWidth);

           }



-          // Since PeerGroups has a variable number of entries, new fields added after PeerGroups are defined in

-          // a extended structure. Those fields can be referenced using SMBIOS_TABLE_TYPE9_EXTENDED structure.

-          Type9ExtendedStruct = (SMBIOS_TABLE_TYPE9_EXTENDED *)((UINT8 *)PeerGroupPtr + (PeerGroupCount * sizeof (MISC_SLOT_PEER_GROUP)));

-          DisplaySystemSlotHeight (Type9ExtendedStruct->SlotHeight, Option);

-          DisplaySystemSlotPhysicalWidth (Type9ExtendedStruct->SlotPhysicalWidth, Option);

-          DisplaySystemSlotInformation (Type9ExtendedStruct->SlotInformation, Option);

+

+          if (AE_SMBIOS_VERSION (0x3, 0x4)) {

+              // Since PeerGroups has a variable number of entries, new fields added after PeerGroups are defined in

+              // a extended structure. Those fields can be referenced using SMBIOS_TABLE_TYPE9_EXTENDED structure.

+              Type9ExtendedStruct = (SMBIOS_TABLE_TYPE9_EXTENDED *)((UINT8 *)PeerGroupPtr + (PeerGroupCount * sizeof (MISC_SLOT_PEER_GROUP)));

+              DisplaySystemSlotInformation (Type9ExtendedStruct->SlotInformation, Option);

+              DisplaySystemSlotPhysicalWidth (Type9ExtendedStruct->SlotPhysicalWidth, Option);

+              ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_PITCH), gShellDebug1HiiHandle, Type9ExtendedStruct->SlotPitch);

+              if (AE_SMBIOS_VERSION (0x3, 0x5)) {

+                  DisplaySystemSlotHeight (Type9ExtendedStruct->SlotHeight, Option);

+              }

+          }

         }

       }



diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
index 68211ce7ab..c24f7d5716 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
@@ -1,6 +1,7 @@
 // /**

 //

 // Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>

+// Copyright (c) 1985 - 2022, American Megatrends International LLC.<BR>

 // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR>

 // (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP<BR>

 // SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -417,6 +418,7 @@
 #string STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_INFORMATION       #language en-US "System Slot Information: "

 #string STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_HEIGHT            #language en-US "System Slot Height: "

 #string STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_PHYSICAL_WIDTH    #language en-US "System Slot Physical Width: "

+#string STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_PITCH             #language en-US "Slot Pitch: %d\r\n"

 #string STR_SMBIOSVIEW_QUERYTABLE_ONBOARD_DEVICE_TYPE           #language en-US "Onboard Device Type: "

 #string STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_EVENT_LOG_TYPE         #language en-US "System Event Log Type: "

 #string STR_SMBIOSVIEW_QUERYTABLE_EVENT_LOG_VAR_DATA_FORMAT     #language en-US "Event Log Variable Data Format Types: "

--
2.36.0.windows.1
-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.

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

end of thread, other threads:[~2022-11-11  4:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-02  4:30 [PATCH] ShellPkg:Improved Smbios Type 9 data under smbiosview Sainadh Nagolu
2022-11-04  1:08 ` 回复: [edk2-devel] " gaoliming
2022-11-04 11:32   ` [edk2-devel] " Sainadh Nagolu
2022-11-07  4:18     ` 回复: " gaoliming
     [not found]     ` <1725327F623FD031.22635@groups.io>
2022-11-08  1:17       ` gaoliming
2022-11-10  3:56         ` [edk2-devel] " Sainadh Nagolu
2022-11-10  7:32           ` 回复: " gaoliming
2022-11-10  7:35             ` [edk2-devel] " Sainadh Nagolu
2022-11-11  0:47               ` 回复: " gaoliming
     [not found]               ` <17266143818D3E06.2299@groups.io>
2022-11-11  3:52                 ` gaoliming
2022-11-11  4:18                   ` [edk2-devel] " Sainadh Nagolu

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