public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Subject: [PATCH] Modify IPMI_GET_SYSTEM_UUID_RESPONSE to use IPMI_GUID.
@ 2023-06-29 20:16 Aaron Pop
  2023-06-30  3:45 ` Chang, Abner
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Pop @ 2023-06-29 20:16 UTC (permalink / raw)
  To: devel; +Cc: Abner.Chang, michael.d.kinney

IPMI specification's Get Device Guid Command says that data is returned in
"least signification byte first" and "this is the reverse of convention
described in RFC4122". IPMI_GET_SYSTEM_UUID_RESPONSE is defined to use
EFI_GUID, which is reverse format of Ipmi specification.  Correcting
IPMI_GET_SYSTEM_UUID_RESPONSE to use IPMI_GUID.

Signed-off-by: Aaron Pop <aaronpop@linux.microsoft.com>
---
  MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 18 ++++++++++++++++--
  1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h 
b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
index b6bc91f46c..afdc2dc30b 100644
--- a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
@@ -14,6 +14,7 @@
    Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>
    Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
    Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
+  Copyright (c) Microsoft Corporation.
    SPDX-License-Identifier: BSD-2-Clause-Patent
  **/

@@ -488,9 +489,22 @@ typedef struct {
  //
  #define IPMI_APP_GET_SYSTEM_GUID  0x37

+//
+// In IPMI, GUID are stored least-significant byte first.
+// The order of fields are the reverse of convention described in 
[RFC4122].
+// Note: This definition is used for both the IPMI_APP_GET_SYSTEM_GUID
+// and IPMI_APP_GET_DEVICE_GUID.
+//
+typedef struct {
+  UINT8     Data4[8];
+  UINT16    Data3;
+  UINT16    Data2;
+  UINT32    Data1;
+} IPMI_GUID;
+
  typedef struct {
-  UINT8       CompletionCode;
-  EFI_GUID    SystemUuid;
+  UINT8        CompletionCode;
+  IPMI_GUID    SystemUuid;
  } IPMI_GET_SYSTEM_UUID_RESPONSE;

  //
-- 
2.41.0.windows.1


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

* Re: Subject: [PATCH] Modify IPMI_GET_SYSTEM_UUID_RESPONSE to use IPMI_GUID.
  2023-06-29 20:16 Subject: [PATCH] Modify IPMI_GET_SYSTEM_UUID_RESPONSE to use IPMI_GUID Aaron Pop
@ 2023-06-30  3:45 ` Chang, Abner
  0 siblings, 0 replies; 2+ messages in thread
From: Chang, Abner @ 2023-06-30  3:45 UTC (permalink / raw)
  To: Aaron Pop, devel@edk2.groups.io; +Cc: michael.d.kinney@intel.com

[AMD Official Use Only - General]

> -----Original Message-----
> From: Aaron Pop <aaronpop@linux.microsoft.com>
> Sent: Friday, June 30, 2023 4:17 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <Abner.Chang@amd.com>; michael.d.kinney@intel.com
> Subject: Subject: [PATCH] Modify IPMI_GET_SYSTEM_UUID_RESPONSE to use
> IPMI_GUID.
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> IPMI specification's Get Device Guid Command says that data is returned in
> "least signification byte first" and "this is the reverse of convention
> described in RFC4122". IPMI_GET_SYSTEM_UUID_RESPONSE is defined to use
> EFI_GUID, which is reverse format of Ipmi specification.  Correcting
> IPMI_GET_SYSTEM_UUID_RESPONSE to use IPMI_GUID.
>
> Signed-off-by: Aaron Pop <aaronpop@linux.microsoft.com>
> ---
>   MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 18
> ++++++++++++++++--
>   1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> index b6bc91f46c..afdc2dc30b 100644
> --- a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> +++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> @@ -14,6 +14,7 @@
>     Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>
>     Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
>     Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
> +  Copyright (c) Microsoft Corporation.
>     SPDX-License-Identifier: BSD-2-Clause-Patent
>   **/
>
> @@ -488,9 +489,22 @@ typedef struct {
>   //
>   #define IPMI_APP_GET_SYSTEM_GUID  0x37
>
> +//
> +// In IPMI, GUID are stored least-significant byte first.
> +// The order of fields are the reverse of convention described in
> [RFC4122].
> +// Note: This definition is used for both the IPMI_APP_GET_SYSTEM_GUID
> +// and IPMI_APP_GET_DEVICE_GUID.
> +//
> +typedef struct {
> +  UINT8     Data4[8];
> +  UINT16    Data3;
> +  UINT16    Data2;
> +  UINT32    Data1;
> +} IPMI_GUID;
> +
>   typedef struct {
> -  UINT8       CompletionCode;
> -  EFI_GUID    SystemUuid;
> +  UINT8        CompletionCode;
> +  IPMI_GUID    SystemUuid;
>   } IPMI_GET_SYSTEM_UUID_RESPONSE;
>
Hi Aaron,
Thanks for this contribution.
Due to the return value is in EFI_GUID format as the UEFI friendly implementation, we have to convert IPMI_GUID to EFI_GUID as a return value.

Thanks
Abner

>   //
> --
> 2.41.0.windows.1


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

end of thread, other threads:[~2023-06-30  3:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-29 20:16 Subject: [PATCH] Modify IPMI_GET_SYSTEM_UUID_RESPONSE to use IPMI_GUID Aaron Pop
2023-06-30  3:45 ` Chang, Abner

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