[edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 data under smbiosview

Sainadh Nagolu via groups.io posted 1 patch 1 year, 5 months ago
Failed in applying to current master (apply log)
.../SmbiosView/PrintInfo.c                     | 18 ++++++++++++------
.../SmbiosView/SmbiosViewStrings.uni           |  2 ++
2 files changed, 14 insertions(+), 6 deletions(-)
[edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 data under smbiosview
Posted by Sainadh Nagolu via groups.io 1 year, 5 months ago
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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95840): https://edk2.groups.io/g/devel/message/95840
Mute This Topic: https://groups.io/mt/94728114/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
回复: [edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 data under smbiosview
Posted by gaoliming via groups.io 1 year, 5 months ago
Sainadh:
  The change is good. Can you create pull request for this change in Edk2
project?

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Sainadh
> Nagolu via groups.io
> 发送时间: 2022年11月2日 12:30
> 收件人: devel@edk2.groups.io; Sainadh Nagolu <sainadhn@ami.com>
> 抄送: Vasudevan S <vasudevans@ami.com>; Sundaresan S
> <sundaresans@ami.com>
> 主题: [edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 data under
> smbiosview
> 
> 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/SmbiosViewS
> trings.uni
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewS
> trings.uni
> index 68211ce7ab..c24f7d5716 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewS
> trings.uni
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewS
> trings.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.
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95933): https://edk2.groups.io/g/devel/message/95933
Mute This Topic: https://groups.io/mt/94797341/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] 回复: [edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 data under smbiosview
Posted by Sainadh Nagolu via groups.io 1 year, 5 months ago
Hi Liming,

Created Pull request and passed CI check.

https://github.com/tianocore/edk2/pull/3593

Thanks,
Sainadh.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95951): https://edk2.groups.io/g/devel/message/95951
Mute This Topic: https://groups.io/mt/94797341/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


回复: [edk2-devel] 回复: [edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 data under smbiosview
Posted by gaoliming via groups.io 1 year, 5 months ago
Sainadh:

 The change is good to me. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Sainadh Nagolu via groups.io
发送时间: 2022年11月4日 19:32
收件人: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io
主题: Re: [edk2-devel] 回复: [edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 data under smbiosview

 

Hi Liming,

Created Pull request and passed CI check.

https://github.com/tianocore/edk2/pull/3593

Thanks,
Sainadh. 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96017): https://edk2.groups.io/g/devel/message/96017
Mute This Topic: https://groups.io/mt/94859924/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-