* [edk2-platforms][PATCH 0/3] IPMI changes for Redfish
@ 2022-12-23 13:26 Chang, Abner
2022-12-23 13:26 ` [edk2-platforms][PATCH 1/3] Features/IpmiFeaturePkg: Add IPMI functions Chang, Abner
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Chang, Abner @ 2022-12-23 13:26 UTC (permalink / raw)
To: devel
Cc: Isaac Oram, Nate DeSimone, Michael D Kinney, Liming Gao,
Zhiguang Liu, Nickle Wang, Igor Kulchytskyy
From: Abner Chang <abner.chang@amd.com>
BZ# 4214
This patch adds IPMI functions for building up SMBIOS 42
record for the USB NIC host interface exposed by BMC.
The corresponding updates on edk2 is in the separate pacth.
This is the part I of upstream, the follow up patche sets are:
- RedfishPlatformCredentialLib contributed by NVidia.
- Relocate IpmiCommandLib.h from edk2-platforms
to edk2/MdePkg. A NULL instance of IpmiCommandLib is created
and located under MdePkg. With above, RedfishPkg doesn't have the
dependence with edk2-platforms. The implementation of IpmiCommandLib
stays in edk2-platforms without relocation, which can be pulled in
to platform DSC as needed.
- PlatformHostInterfaceBmcUsbNic would be upstream to edk2-staging
temporarily because some requirements are necessray to be spec out
in the Redfish section in UEFI spec.
Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Abner Chang (3):
Features/IpmiFeaturePkg: Add IPMI functions
IpmiFeaturePkg/IpmiCommandLib: Add IPMI functions
IpmiFeaturePkg: Add reference of IpmiBaseLib
.../IpmiFeaturePkg/IpmiFeaturePkg.dec | 5 ++
.../Include/Library/IpmiCommandLib.h | 60 ++++++++++++++
.../IpmiCommandLib/IpmiCommandLibNetFnApp.c | 81 +++++++++++++++++++
.../IpmiCommandLibNetFnTransport.c | 36 +++++++++
4 files changed, 182 insertions(+)
--
2.37.1.windows.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [edk2-platforms][PATCH 1/3] Features/IpmiFeaturePkg: Add IPMI functions
2022-12-23 13:26 [edk2-platforms][PATCH 0/3] IPMI changes for Redfish Chang, Abner
@ 2022-12-23 13:26 ` Chang, Abner
2023-01-05 0:09 ` [edk2-devel] " Isaac Oram
2022-12-23 13:26 ` [edk2-platforms][PATCH 2/3] IpmiFeaturePkg/IpmiCommandLib: " Chang, Abner
2022-12-23 13:27 ` [edk2-platforms][PATCH 3/3] IpmiFeaturePkg: Add reference of IpmiBaseLib Chang, Abner
2 siblings, 1 reply; 8+ messages in thread
From: Chang, Abner @ 2022-12-23 13:26 UTC (permalink / raw)
To: devel; +Cc: Isaac Oram, Nate DeSimone, Liming Gao, Nickle Wang,
Igor Kulchytskyy
From: Abner Chang <abner.chang@amd.com>
Add functions to get system UUID and LAN
configuration parameter.
Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
.../Include/Library/IpmiCommandLib.h | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiCommandLib.h b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiCommandLib.h
index 18f9d123c9..c816750544 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiCommandLib.h
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiCommandLib.h
@@ -2,6 +2,8 @@
This library abstract how to send/receive IPMI command.
Copyright (c) 2018-2021, Intel Corporation. All rights reserved.<BR>
+Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
+
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -88,6 +90,43 @@ IpmiSendMessage (
IN OUT UINT32 *SendMessageResponseSize
);
+/**
+ This function gets the system UUID.
+
+ @param[out] SystemGuid The pointer to retrieve system UUID.
+
+ @retval EFI_SUCCESS UUID is returned.
+ @retval EFI_INVALID_PARAMETER SystemGuid is a NULL pointer.
+ @retval Others Other errors.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemUuid (
+ OUT EFI_GUID *SystemGuid
+ );
+
+/**
+ This function gets the channel information.
+
+ @param[in] GetChannelInfoRequest The get channel information request.
+ @param[in] GetChannelInfoResponse The get channel information response.
+ @param[in,out] GetChannelInfoResponseSize When input, the expected size of response.
+ When output, the exact size of the returned
+ response.
+
+ @retval EFI_SUCCESS Get channel information successfully.
+ @retval Others Other errors.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChannelInfo (
+ IN IPMI_GET_CHANNEL_INFO_REQUEST *GetChannelInfoRequest,
+ OUT IPMI_GET_CHANNEL_INFO_RESPONSE *GetChannelInfoResponse,
+ OUT UINT32 *GetChannelInfoResponseSize
+ );
+
//
// NetFnTransport
//
@@ -114,6 +153,27 @@ IpmiGetSolConfigurationParameters (
IN OUT UINT32 *GetConfigurationParametersResponseSize
);
+/**
+ This function gets the LAN configuration parameter.
+
+ @param[in] GetLanConfigurationParametersRequest Request data
+ @param[in] GetLanConfigurationParametersResponse Response data
+ @param[in,out] GetLanConfigurationParametersSize When input, the expected size of response data.
+ When out, the exact size of response data.
+
+ @retval EFI_SUCCESS Lan configuration parameter is returned in the response.
+ @retval Others Other errors.
+
+**/
+
+EFI_STATUS
+EFIAPI
+IpmiGetLanConfigurationParameters (
+ IN IPMI_GET_LAN_CONFIGURATION_PARAMETERS_REQUEST *GetLanConfigurationParametersRequest,
+ OUT IPMI_GET_LAN_CONFIGURATION_PARAMETERS_RESPONSE *GetLanConfigurationParametersResponse,
+ IN OUT UINT32 *GetLanConfigurationParametersSize
+ );
+
//
// NetFnChasis
//
--
2.37.1.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [edk2-platforms][PATCH 2/3] IpmiFeaturePkg/IpmiCommandLib: Add IPMI functions
2022-12-23 13:26 [edk2-platforms][PATCH 0/3] IPMI changes for Redfish Chang, Abner
2022-12-23 13:26 ` [edk2-platforms][PATCH 1/3] Features/IpmiFeaturePkg: Add IPMI functions Chang, Abner
@ 2022-12-23 13:26 ` Chang, Abner
2023-01-05 0:10 ` [edk2-devel] " Isaac Oram
2022-12-23 13:27 ` [edk2-platforms][PATCH 3/3] IpmiFeaturePkg: Add reference of IpmiBaseLib Chang, Abner
2 siblings, 1 reply; 8+ messages in thread
From: Chang, Abner @ 2022-12-23 13:26 UTC (permalink / raw)
To: devel; +Cc: Isaac Oram, Nate DeSimone, Liming Gao, Nickle Wang,
Igor Kulchytskyy
From: Abner Chang <abner.chang@amd.com>
Add functions to get system UUID and LAN
configuration parameter.
Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
.../IpmiCommandLib/IpmiCommandLibNetFnApp.c | 81 +++++++++++++++++++
.../IpmiCommandLibNetFnTransport.c | 36 +++++++++
2 files changed, 117 insertions(+)
diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
index addabc554e..e89ba27d15 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
@@ -2,6 +2,8 @@
IPMI Command - NetFnApp.
Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
+
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -245,3 +247,82 @@ IpmiSendMessage (
);
return Status;
}
+
+/**
+ This function gets the system UUID.
+
+ @param[out] SystemGuid The pointer to retrieve system UUID.
+
+ @retval EFI_SUCCESS UUID is returned.
+ @retval EFI_INVALID_PARAMETER SystemGuid is a NULL pointer.
+ @retval Others Other errors.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemUuid (
+ OUT EFI_GUID *SystemGuid
+ )
+{
+ EFI_STATUS Status;
+ IPMI_GET_SYSTEM_UUID_RESPONSE GetSystemUuidResponse;
+ UINT32 RequestSize;
+ UINT32 ResponseSize;
+
+ if (SystemGuid == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+ RequestSize = 0;
+ ResponseSize = sizeof (IPMI_GET_SYSTEM_UUID_RESPONSE);
+ Status = IpmiSubmitCommand (
+ IPMI_NETFN_APP,
+ IPMI_APP_GET_SYSTEM_GUID,
+ (VOID *)NULL,
+ RequestSize,
+ (VOID *)&GetSystemUuidResponse,
+ &ResponseSize
+ );
+ if (!EFI_ERROR (Status) && GetSystemUuidResponse.CompletionCode == IPMI_COMP_CODE_NORMAL) {
+ CopyMem (
+ (VOID *)SystemGuid,
+ (VOID *)&GetSystemUuidResponse.SystemUuid,
+ sizeof (EFI_GUID)
+ );
+ }
+ return Status;
+}
+
+/**
+ This function gets the channel information.
+
+ @param[in] GetChannelInfoRequest The get channel information request.
+ @param[in] GetChannelInfoResponse The get channel information response.
+ @param[in,out] GetChannelInfoResponseSize When input, the expected size of response.
+ When output, the exact size of the returned
+ response.
+
+ @retval EFI_SUCCESS Get channel information successfully.
+ @retval Others Other errors.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChannelInfo (
+ IN IPMI_GET_CHANNEL_INFO_REQUEST *GetChannelInfoRequest,
+ OUT IPMI_GET_CHANNEL_INFO_RESPONSE *GetChannelInfoResponse,
+ OUT UINT32 *GetChannelInfoResponseSize
+ )
+{
+ EFI_STATUS Status;
+
+ *GetChannelInfoResponseSize = sizeof (IPMI_GET_CHANNEL_INFO_RESPONSE);
+ Status = IpmiSubmitCommand (
+ IPMI_NETFN_APP,
+ IPMI_APP_GET_CHANNEL_INFO,
+ (UINT8 *)GetChannelInfoRequest,
+ sizeof (IPMI_GET_CHANNEL_INFO_REQUEST),
+ (UINT8 *)GetChannelInfoResponse,
+ GetChannelInfoResponseSize
+ );
+ return Status;
+}
diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c
index 7dfcf86126..135a905844 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c
@@ -2,6 +2,8 @@
IPMI Command - NetFnTransport.
Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
+
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -78,3 +80,37 @@ IpmiGetSolConfigurationParameters (
);
return Status;
}
+
+/**
+ This function gets the LAN configuration parameter.
+
+ @param[in] GetLanConfigurationParametersRequest Request data
+ @param[in] GetLanConfigurationParametersResponse Response data
+ @param[in,out] GetLanConfigurationParametersSize When input, the expected size of response data.
+ When out, the exact size of response data.
+
+ @retval EFI_SUCCESS Lan configuration parameter is returned in the response.
+ @retval Others Other errors.
+
+**/
+
+EFI_STATUS
+EFIAPI
+IpmiGetLanConfigurationParameters (
+ IN IPMI_GET_LAN_CONFIGURATION_PARAMETERS_REQUEST *GetLanConfigurationParametersRequest,
+ OUT IPMI_GET_LAN_CONFIGURATION_PARAMETERS_RESPONSE *GetLanConfigurationParametersResponse,
+ IN OUT UINT32 *GetLanConfigurationParametersSize
+ )
+{
+ EFI_STATUS Status;
+
+ Status = IpmiSubmitCommand (
+ IPMI_NETFN_TRANSPORT,
+ IPMI_TRANSPORT_GET_LAN_CONFIG_PARAMETERS,
+ (UINT8 *)GetLanConfigurationParametersRequest,
+ sizeof(*GetLanConfigurationParametersRequest),
+ (UINT8 *)GetLanConfigurationParametersResponse,
+ GetLanConfigurationParametersSize
+ );
+ return Status;
+}
--
2.37.1.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [edk2-platforms][PATCH 3/3] IpmiFeaturePkg: Add reference of IpmiBaseLib
2022-12-23 13:26 [edk2-platforms][PATCH 0/3] IPMI changes for Redfish Chang, Abner
2022-12-23 13:26 ` [edk2-platforms][PATCH 1/3] Features/IpmiFeaturePkg: Add IPMI functions Chang, Abner
2022-12-23 13:26 ` [edk2-platforms][PATCH 2/3] IpmiFeaturePkg/IpmiCommandLib: " Chang, Abner
@ 2022-12-23 13:27 ` Chang, Abner
2023-01-05 0:10 ` Isaac Oram
2 siblings, 1 reply; 8+ messages in thread
From: Chang, Abner @ 2022-12-23 13:27 UTC (permalink / raw)
To: devel; +Cc: Isaac Oram, Nate DeSimone, Liming Gao, Nickle Wang,
Igor Kulchytskyy
From: Abner Chang <abner.chang@amd.com>
Add reference of IpmiBaseLib
Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
.../OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
index 48f4ebf931..4344ad31be 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
@@ -8,6 +8,7 @@
# for the build infrastructure.
#
# Copyright (c) 2019-2021, Intel Corporation. All rights reserved.<BR>
+# Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -38,6 +39,10 @@
#
IpmiCommandLib|Include/Library/IpmiPlatformHookLib.h
+ ## @libraryclass Provides an API for the base IPMI library
+ #
+ IpmiBaseLib|Include/Library/IpmiBaseLib.h
+
[Guids]
gIpmiFeaturePkgTokenSpaceGuid = {0xc05283f6, 0xd6a8, 0x48f3, {0x9b, 0x59, 0xfb, 0xca, 0x71, 0x32, 0x0f, 0x12}}
--
2.37.1.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [edk2-devel] [edk2-platforms][PATCH 1/3] Features/IpmiFeaturePkg: Add IPMI functions
2022-12-23 13:26 ` [edk2-platforms][PATCH 1/3] Features/IpmiFeaturePkg: Add IPMI functions Chang, Abner
@ 2023-01-05 0:09 ` Isaac Oram
2023-01-05 16:03 ` Chang, Abner
0 siblings, 1 reply; 8+ messages in thread
From: Isaac Oram @ 2023-01-05 0:09 UTC (permalink / raw)
To: devel@edk2.groups.io, abner.chang@amd.com
Cc: Desimone, Nathaniel L, Gao, Liming, Nickle Wang, Igor Kulchytskyy
Abner,
The @param and IN, OUT tagging on the parameters do not match for IpmiGetChannelInfo and IpmiGetLanConfigurationParameters functions. Please align and comment the expected usage and input handling that the API implementation is expected to provide.
Regards,
Isaac
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang, Abner via groups.io
Sent: Friday, December 23, 2022 5:27 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>
Subject: [edk2-devel] [edk2-platforms][PATCH 1/3] Features/IpmiFeaturePkg: Add IPMI functions
From: Abner Chang <abner.chang@amd.com>
Add functions to get system UUID and LAN configuration parameter.
Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
.../Include/Library/IpmiCommandLib.h | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiCommandLib.h b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiCommandLib.h
index 18f9d123c9..c816750544 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiCommandLib.h
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/
+++ IpmiCommandLib.h
@@ -2,6 +2,8 @@
This library abstract how to send/receive IPMI command.
Copyright (c) 2018-2021, Intel Corporation. All rights reserved.<BR>
+Copyright (C) 2022 Advanced Micro Devices, Inc. All rights
+reserved.<BR>
+
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -88,6 +90,43 @@ IpmiSendMessage (
IN OUT UINT32 *SendMessageResponseSize
);
+/**
+ This function gets the system UUID.
+
+ @param[out] SystemGuid The pointer to retrieve system UUID.
+
+ @retval EFI_SUCCESS UUID is returned.
+ @retval EFI_INVALID_PARAMETER SystemGuid is a NULL pointer.
+ @retval Others Other errors.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemUuid (
+ OUT EFI_GUID *SystemGuid
+ );
+
+/**
+ This function gets the channel information.
+
+ @param[in] GetChannelInfoRequest The get channel information request.
+ @param[in] GetChannelInfoResponse The get channel information response.
+ @param[in,out] GetChannelInfoResponseSize When input, the expected size of response.
+ When output, the exact size of the returned
+ response.
+
+ @retval EFI_SUCCESS Get channel information successfully.
+ @retval Others Other errors.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChannelInfo (
+ IN IPMI_GET_CHANNEL_INFO_REQUEST *GetChannelInfoRequest,
+ OUT IPMI_GET_CHANNEL_INFO_RESPONSE *GetChannelInfoResponse,
+ OUT UINT32 *GetChannelInfoResponseSize
+ );
+
//
// NetFnTransport
//
@@ -114,6 +153,27 @@ IpmiGetSolConfigurationParameters (
IN OUT UINT32 *GetConfigurationParametersResponseSize
);
+/**
+ This function gets the LAN configuration parameter.
+
+ @param[in] GetLanConfigurationParametersRequest Request data
+ @param[in] GetLanConfigurationParametersResponse Response data
+ @param[in,out] GetLanConfigurationParametersSize When input, the expected size of response data.
+ When out, the exact size of response data.
+
+ @retval EFI_SUCCESS Lan configuration parameter is returned in the response.
+ @retval Others Other errors.
+
+**/
+
+EFI_STATUS
+EFIAPI
+IpmiGetLanConfigurationParameters (
+ IN IPMI_GET_LAN_CONFIGURATION_PARAMETERS_REQUEST *GetLanConfigurationParametersRequest,
+ OUT IPMI_GET_LAN_CONFIGURATION_PARAMETERS_RESPONSE *GetLanConfigurationParametersResponse,
+ IN OUT UINT32 *GetLanConfigurationParametersSize
+ );
+
//
// NetFnChasis
//
--
2.37.1.windows.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [edk2-devel] [edk2-platforms][PATCH 2/3] IpmiFeaturePkg/IpmiCommandLib: Add IPMI functions
2022-12-23 13:26 ` [edk2-platforms][PATCH 2/3] IpmiFeaturePkg/IpmiCommandLib: " Chang, Abner
@ 2023-01-05 0:10 ` Isaac Oram
0 siblings, 0 replies; 8+ messages in thread
From: Isaac Oram @ 2023-01-05 0:10 UTC (permalink / raw)
To: devel@edk2.groups.io, abner.chang@amd.com
Cc: Desimone, Nathaniel L, Gao, Liming, Nickle Wang, Igor Kulchytskyy
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
If you are making changes, I would note/request improvement for:
IpmiGetSystemUuid ();
Please align local variable columns as is convention in this file.
IpmiGetChannelInfo ();
Should we check that input pointers are not null? Other functions don't, so I wouldn't block commit for this, but if you are fixing other things, it seems beneficial to add some error checking.
Regards,
Isaac
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang, Abner via groups.io
Sent: Friday, December 23, 2022 5:27 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>
Subject: [edk2-devel] [edk2-platforms][PATCH 2/3] IpmiFeaturePkg/IpmiCommandLib: Add IPMI functions
From: Abner Chang <abner.chang@amd.com>
Add functions to get system UUID and LAN configuration parameter.
Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
.../IpmiCommandLib/IpmiCommandLibNetFnApp.c | 81 +++++++++++++++++++
.../IpmiCommandLibNetFnTransport.c | 36 +++++++++
2 files changed, 117 insertions(+)
diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
index addabc554e..e89ba27d15 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiComm
+++ andLib/IpmiCommandLibNetFnApp.c
@@ -2,6 +2,8 @@
IPMI Command - NetFnApp.
Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2022 Advanced Micro Devices, Inc. All rights
+ reserved.<BR>
+
SPDX-License-Identifier: BSD-2-Clause-Patent **/
@@ -245,3 +247,82 @@ IpmiSendMessage (
);
return Status;
}
+
+/**
+ This function gets the system UUID.
+
+ @param[out] SystemGuid The pointer to retrieve system UUID.
+
+ @retval EFI_SUCCESS UUID is returned.
+ @retval EFI_INVALID_PARAMETER SystemGuid is a NULL pointer.
+ @retval Others Other errors.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemUuid (
+ OUT EFI_GUID *SystemGuid
+ )
+{
+ EFI_STATUS Status;
+ IPMI_GET_SYSTEM_UUID_RESPONSE GetSystemUuidResponse;
+ UINT32 RequestSize;
+ UINT32 ResponseSize;
+
+ if (SystemGuid == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+ RequestSize = 0;
+ ResponseSize = sizeof (IPMI_GET_SYSTEM_UUID_RESPONSE);
+ Status = IpmiSubmitCommand (
+ IPMI_NETFN_APP,
+ IPMI_APP_GET_SYSTEM_GUID,
+ (VOID *)NULL,
+ RequestSize,
+ (VOID *)&GetSystemUuidResponse,
+ &ResponseSize
+ );
+ if (!EFI_ERROR (Status) && GetSystemUuidResponse.CompletionCode == IPMI_COMP_CODE_NORMAL) {
+ CopyMem (
+ (VOID *)SystemGuid,
+ (VOID *)&GetSystemUuidResponse.SystemUuid,
+ sizeof (EFI_GUID)
+ );
+ }
+ return Status;
+}
+
+/**
+ This function gets the channel information.
+
+ @param[in] GetChannelInfoRequest The get channel information request.
+ @param[in] GetChannelInfoResponse The get channel information response.
+ @param[in,out] GetChannelInfoResponseSize When input, the expected size of response.
+ When output, the exact size of the returned
+ response.
+
+ @retval EFI_SUCCESS Get channel information successfully.
+ @retval Others Other errors.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChannelInfo (
+ IN IPMI_GET_CHANNEL_INFO_REQUEST *GetChannelInfoRequest,
+ OUT IPMI_GET_CHANNEL_INFO_RESPONSE *GetChannelInfoResponse,
+ OUT UINT32 *GetChannelInfoResponseSize
+ )
+{
+ EFI_STATUS Status;
+
+ *GetChannelInfoResponseSize = sizeof
+(IPMI_GET_CHANNEL_INFO_RESPONSE);
+ Status = IpmiSubmitCommand (
+ IPMI_NETFN_APP,
+ IPMI_APP_GET_CHANNEL_INFO,
+ (UINT8 *)GetChannelInfoRequest,
+ sizeof (IPMI_GET_CHANNEL_INFO_REQUEST),
+ (UINT8 *)GetChannelInfoResponse,
+ GetChannelInfoResponseSize
+ );
+ return Status;
+}
diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c
index 7dfcf86126..135a905844 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiComm
+++ andLib/IpmiCommandLibNetFnTransport.c
@@ -2,6 +2,8 @@
IPMI Command - NetFnTransport.
Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2022 Advanced Micro Devices, Inc. All rights
+ reserved.<BR>
+
SPDX-License-Identifier: BSD-2-Clause-Patent **/
@@ -78,3 +80,37 @@ IpmiGetSolConfigurationParameters (
);
return Status;
}
+
+/**
+ This function gets the LAN configuration parameter.
+
+ @param[in] GetLanConfigurationParametersRequest Request data
+ @param[in] GetLanConfigurationParametersResponse Response data
+ @param[in,out] GetLanConfigurationParametersSize When input, the expected size of response data.
+ When out, the exact size of response data.
+
+ @retval EFI_SUCCESS Lan configuration parameter is returned in the response.
+ @retval Others Other errors.
+
+**/
+
+EFI_STATUS
+EFIAPI
+IpmiGetLanConfigurationParameters (
+ IN IPMI_GET_LAN_CONFIGURATION_PARAMETERS_REQUEST *GetLanConfigurationParametersRequest,
+ OUT IPMI_GET_LAN_CONFIGURATION_PARAMETERS_RESPONSE *GetLanConfigurationParametersResponse,
+ IN OUT UINT32 *GetLanConfigurationParametersSize
+ )
+{
+ EFI_STATUS Status;
+
+ Status = IpmiSubmitCommand (
+ IPMI_NETFN_TRANSPORT,
+ IPMI_TRANSPORT_GET_LAN_CONFIG_PARAMETERS,
+ (UINT8 *)GetLanConfigurationParametersRequest,
+ sizeof(*GetLanConfigurationParametersRequest),
+ (UINT8 *)GetLanConfigurationParametersResponse,
+ GetLanConfigurationParametersSize
+ );
+ return Status;
+}
--
2.37.1.windows.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [edk2-platforms][PATCH 3/3] IpmiFeaturePkg: Add reference of IpmiBaseLib
2022-12-23 13:27 ` [edk2-platforms][PATCH 3/3] IpmiFeaturePkg: Add reference of IpmiBaseLib Chang, Abner
@ 2023-01-05 0:10 ` Isaac Oram
0 siblings, 0 replies; 8+ messages in thread
From: Isaac Oram @ 2023-01-05 0:10 UTC (permalink / raw)
To: abner.chang@amd.com, devel@edk2.groups.io
Cc: Desimone, Nathaniel L, Gao, Liming, Nickle Wang, Igor Kulchytskyy
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
-----Original Message-----
From: abner.chang@amd.com <abner.chang@amd.com>
Sent: Friday, December 23, 2022 5:27 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>
Subject: [edk2-platforms][PATCH 3/3] IpmiFeaturePkg: Add reference of IpmiBaseLib
From: Abner Chang <abner.chang@amd.com>
Add reference of IpmiBaseLib
Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
.../OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
index 48f4ebf931..4344ad31be 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.d
+++ ec
@@ -8,6 +8,7 @@
# for the build infrastructure.
#
# Copyright (c) 2019-2021, Intel Corporation. All rights reserved.<BR>
+# Copyright (C) 2022 Advanced Micro Devices, Inc. All rights
+reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -38,6 +39,10 @@
#
IpmiCommandLib|Include/Library/IpmiPlatformHookLib.h
+ ## @libraryclass Provides an API for the base IPMI library #
+ IpmiBaseLib|Include/Library/IpmiBaseLib.h
+
[Guids]
gIpmiFeaturePkgTokenSpaceGuid = {0xc05283f6, 0xd6a8, 0x48f3, {0x9b, 0x59, 0xfb, 0xca, 0x71, 0x32, 0x0f, 0x12}}
--
2.37.1.windows.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [edk2-devel] [edk2-platforms][PATCH 1/3] Features/IpmiFeaturePkg: Add IPMI functions
2023-01-05 0:09 ` [edk2-devel] " Isaac Oram
@ 2023-01-05 16:03 ` Chang, Abner
0 siblings, 0 replies; 8+ messages in thread
From: Chang, Abner @ 2023-01-05 16:03 UTC (permalink / raw)
To: Oram, Isaac W, devel@edk2.groups.io
Cc: Desimone, Nathaniel L, Gao, Liming, Nickle Wang, Igor Kulchytskyy
[AMD Official Use Only - General]
Thanks Isaac, V2 was sent to address your comments on patch 1/3 and 2/3.
Abner
> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Thursday, January 5, 2023 8:10 AM
> To: devel@edk2.groups.io; Chang, Abner <Abner.Chang@amd.com>
> Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor
> Kulchytskyy <igork@ami.com>
> Subject: RE: [edk2-devel] [edk2-platforms][PATCH 1/3]
> Features/IpmiFeaturePkg: Add IPMI functions
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> Abner,
>
> The @param and IN, OUT tagging on the parameters do not match for
> IpmiGetChannelInfo and IpmiGetLanConfigurationParameters functions.
> Please align and comment the expected usage and input handling that the
> API implementation is expected to provide.
>
> Regards,
> Isaac
>
>
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang,
> Abner via groups.io
> Sent: Friday, December 23, 2022 5:27 AM
> To: devel@edk2.groups.io
> Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor
> Kulchytskyy <igork@ami.com>
> Subject: [edk2-devel] [edk2-platforms][PATCH 1/3]
> Features/IpmiFeaturePkg: Add IPMI functions
>
> From: Abner Chang <abner.chang@amd.com>
>
> Add functions to get system UUID and LAN configuration parameter.
>
> Signed-off-by: Abner Chang <abner.chang@amd.com>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Nickle Wang <nicklew@nvidia.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> ---
> .../Include/Library/IpmiCommandLib.h | 60 +++++++++++++++++++
> 1 file changed, 60 insertions(+)
>
> diff --git
> a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/I
> pmiCommandLib.h
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/
> IpmiCommandLib.h
> index 18f9d123c9..c816750544 100644
> ---
> a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/I
> pmiCommandLib.h
> +++
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/
> +++ IpmiCommandLib.h
> @@ -2,6 +2,8 @@
> This library abstract how to send/receive IPMI command.
>
> Copyright (c) 2018-2021, Intel Corporation. All rights reserved.<BR>
> +Copyright (C) 2022 Advanced Micro Devices, Inc. All rights
> +reserved.<BR>
> +
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
> @@ -88,6 +90,43 @@ IpmiSendMessage (
> IN OUT UINT32 *SendMessageResponseSize
> );
>
> +/**
> + This function gets the system UUID.
> +
> + @param[out] SystemGuid The pointer to retrieve system UUID.
> +
> + @retval EFI_SUCCESS UUID is returned.
> + @retval EFI_INVALID_PARAMETER SystemGuid is a NULL pointer.
> + @retval Others Other errors.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetSystemUuid (
> + OUT EFI_GUID *SystemGuid
> + );
> +
> +/**
> + This function gets the channel information.
> +
> + @param[in] GetChannelInfoRequest The get channel information
> request.
> + @param[in] GetChannelInfoResponse The get channel information
> response.
> + @param[in,out] GetChannelInfoResponseSize When input, the expected
> size of response.
> + When output, the exact size of the returned
> + response.
> +
> + @retval EFI_SUCCESS Get channel information successfully.
> + @retval Others Other errors.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetChannelInfo (
> + IN IPMI_GET_CHANNEL_INFO_REQUEST *GetChannelInfoRequest,
> + OUT IPMI_GET_CHANNEL_INFO_RESPONSE *GetChannelInfoResponse,
> + OUT UINT32 *GetChannelInfoResponseSize
> + );
> +
> //
> // NetFnTransport
> //
> @@ -114,6 +153,27 @@ IpmiGetSolConfigurationParameters (
> IN OUT UINT32
> *GetConfigurationParametersResponseSize
> );
>
> +/**
> + This function gets the LAN configuration parameter.
> +
> + @param[in] GetLanConfigurationParametersRequest Request data
> + @param[in] GetLanConfigurationParametersResponse Response data
> + @param[in,out] GetLanConfigurationParametersSize When input, the
> expected size of response data.
> + When out, the exact size of response data.
> +
> + @retval EFI_SUCCESS Lan configuration parameter is returned in the
> response.
> + @retval Others Other errors.
> +
> +**/
> +
> +EFI_STATUS
> +EFIAPI
> +IpmiGetLanConfigurationParameters (
> + IN IPMI_GET_LAN_CONFIGURATION_PARAMETERS_REQUEST
> *GetLanConfigurationParametersRequest,
> + OUT IPMI_GET_LAN_CONFIGURATION_PARAMETERS_RESPONSE
> *GetLanConfigurationParametersResponse,
> + IN OUT UINT32 *GetLanConfigurationParametersSize
> + );
> +
> //
> // NetFnChasis
> //
> --
> 2.37.1.windows.1
>
>
>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-01-05 16:03 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-23 13:26 [edk2-platforms][PATCH 0/3] IPMI changes for Redfish Chang, Abner
2022-12-23 13:26 ` [edk2-platforms][PATCH 1/3] Features/IpmiFeaturePkg: Add IPMI functions Chang, Abner
2023-01-05 0:09 ` [edk2-devel] " Isaac Oram
2023-01-05 16:03 ` Chang, Abner
2022-12-23 13:26 ` [edk2-platforms][PATCH 2/3] IpmiFeaturePkg/IpmiCommandLib: " Chang, Abner
2023-01-05 0:10 ` [edk2-devel] " Isaac Oram
2022-12-23 13:27 ` [edk2-platforms][PATCH 3/3] IpmiFeaturePkg: Add reference of IpmiBaseLib Chang, Abner
2023-01-05 0:10 ` Isaac Oram
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox