public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/3] Add NULL IpmiCommandLib instance
@ 2022-12-28  4:59 Chang, Abner
  2022-12-28  4:59 ` [PATCH 1/3] MdeModulePkg/Include: Add IpmiCommandLib header file Chang, Abner
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Chang, Abner @ 2022-12-28  4:59 UTC (permalink / raw)
  To: devel
  Cc: Jian J Wang, Liming Gao, Nickle Wang, Igor Kulchytskyy,
	Isaac Oram, Nate DeSimone

From: Abner Chang <abner.chang@amd.com>

BZ# 4231
This patch adds a NULL instance of IpmiCommandLib to remove
the dependence between edk2 and edk2-platform packages.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>

Abner Chang (3):
  MdeModulePkg/Include: Add IpmiCommandLib header file
  MdeModulePkg/IpmiCommandLib: Add NULL instance library
  MdeModulePkg: Add IpmiCommandLib

 MdeModulePkg/MdeModulePkg.dec                 |   4 +
 MdeModulePkg/MdeModulePkg.dsc                 |   2 +
 .../BaseIpmiCommandLibNull.inf                |  32 +
 MdeModulePkg/Include/Library/IpmiCommandLib.h | 683 ++++++++++++++++++
 .../IpmiCommandLibNetFnApp.c                  | 252 +++++++
 .../IpmiCommandLibNetFnChassis.c              | 123 ++++
 .../IpmiCommandLibNetFnStorage.c              | 248 +++++++
 .../IpmiCommandLibNetFnTransport.c            | 100 +++
 8 files changed, 1444 insertions(+)
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
 create mode 100644 MdeModulePkg/Include/Library/IpmiCommandLib.h
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnApp.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnChassis.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnStorage.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnTransport.c

-- 
2.37.1.windows.1


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

* [PATCH 1/3] MdeModulePkg/Include: Add IpmiCommandLib header file
  2022-12-28  4:59 [PATCH 0/3] Add NULL IpmiCommandLib instance Chang, Abner
@ 2022-12-28  4:59 ` Chang, Abner
  2023-01-13  0:11   ` [edk2-devel] " Isaac Oram
  2022-12-28  4:59 ` [PATCH 2/3] MdeModulePkg/IpmiCommandLib: Add NULL instance library Chang, Abner
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Chang, Abner @ 2022-12-28  4:59 UTC (permalink / raw)
  To: devel
  Cc: Jian J Wang, Liming Gao, Nickle Wang, Igor Kulchytskyy,
	Isaac Oram, Nate DeSimone

From: Abner Chang <abner.chang@amd.com>

Add IpmiCommandLib to MdeModulePkg. This header file is
copied from edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg\Include\Library. Having this header file in
edk2 to avoid the dependence of edk2 module with edk2-platfrom.
The NULL instance of IpmiCommandLib under MdeModulePkg has
to be implemented for the same reason.
IpmiCommandLib.h in edk2-platforms should be removed once
this patch set is merged. Expect no impacts on edk2-platforms
because MdeModulePkg is referred in INF file by all edk2
modules under edk2-platforms that use IpmiCommandLib.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 MdeModulePkg/Include/Library/IpmiCommandLib.h | 683 ++++++++++++++++++
 1 file changed, 683 insertions(+)
 create mode 100644 MdeModulePkg/Include/Library/IpmiCommandLib.h

diff --git a/MdeModulePkg/Include/Library/IpmiCommandLib.h b/MdeModulePkg/Include/Library/IpmiCommandLib.h
new file mode 100644
index 00000000000..cac8123411f
--- /dev/null
+++ b/MdeModulePkg/Include/Library/IpmiCommandLib.h
@@ -0,0 +1,683 @@
+/** @file
+  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
+
+**/
+
+#ifndef IPMI_COMMAND_LIB_H_
+#define IPMI_COMMAND_LIB_H_
+
+#include <Uefi.h>
+#include <IndustryStandard/Ipmi.h>
+
+//
+// IPMI NetFnApp
+//
+
+/**
+  This function gets the IPMI Device ID.
+
+  @param[out] DeviceId  Get device ID response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetDeviceId (
+  OUT IPMI_GET_DEVICE_ID_RESPONSE  *DeviceId
+  );
+
+/**
+  This function gets the self-test result.
+
+  @param[out] SelfTestResult  Self test command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelfTestResult (
+  OUT IPMI_SELF_TEST_RESULT_RESPONSE  *SelfTestResult
+  );
+
+/**
+  This function resets watchdog timer.
+
+  @param[out] CompletionCode  The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiResetWatchdogTimer (
+  OUT UINT8  *CompletionCode
+  );
+
+/**
+  This function sets watchdog timer.
+
+  @param[in] SetWatchdogTimer  Set watchdog timer request.
+  @param[out] CompletionCode   The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetWatchdogTimer (
+  IN  IPMI_SET_WATCHDOG_TIMER_REQUEST  *SetWatchdogTimer,
+  OUT UINT8                            *CompletionCode
+  );
+
+/**
+  This function gets watchdog timer.
+
+  @param[out] GetWatchdogTimer  Get watchdog timer response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetWatchdogTimer (
+  OUT IPMI_GET_WATCHDOG_TIMER_RESPONSE  *GetWatchdogTimer
+  );
+
+/**
+  This function sets BMC global enables.
+
+  @param[in]  SetBmcGlobalEnables    Set BMC global enables command request.
+  @param[out] CompletionCode         The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetBmcGlobalEnables (
+  IN  IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST  *SetBmcGlobalEnables,
+  OUT UINT8                                *CompletionCode
+  );
+
+/**
+  This function gets BMC global enables.
+
+  @param[out]  GetBmcGlobalEnables  Get BMC global enables command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetBmcGlobalEnables (
+  OUT IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE  *GetBmcGlobalEnables
+  );
+
+/**
+  This function clears message flag.
+
+  @param[in]    ClearMessageFlagsRequest  Clear message flags command request.
+  @param[out]   CompletionCode            The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiClearMessageFlags (
+  IN  IPMI_CLEAR_MESSAGE_FLAGS_REQUEST  *ClearMessageFlagsRequest,
+  OUT UINT8                             *CompletionCode
+  );
+
+/**
+  This function gets message flag.
+
+  @param[out]    GetMessageFlagsResponse  Get message flags response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetMessageFlags (
+  OUT IPMI_GET_MESSAGE_FLAGS_RESPONSE  *GetMessageFlagsResponse
+  );
+
+/**
+  This function gets message.
+
+  @param[out]     GetMessageResponse      Get message command response.
+  @param[in,out]  GetMessageResponseSize  The size of get message response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetMessage (
+  OUT IPMI_GET_MESSAGE_RESPONSE  *GetMessageResponse,
+  IN OUT UINT32                  *GetMessageResponseSize
+  );
+
+/**
+  This function sends message.
+
+  @param[in]     SendMessageRequest        The send message command request.
+  @param[in]     SendMessageRequestSize    The size of the send message command request.
+  @param[out]    SendMessageResponse       The send message command response.
+  @param[in,out] SendMessageResponseSize   The size of the send message command response.
+                                           When input, the expected size of response.
+                                           When output, the actual size of response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSendMessage (
+  IN  IPMI_SEND_MESSAGE_REQUEST   *SendMessageRequest,
+  IN  UINT32                      SendMessageRequestSize,
+  OUT IPMI_SEND_MESSAGE_RESPONSE  *SendMessageResponse,
+  IN OUT UINT32                   *SendMessageResponseSize
+  );
+
+/**
+  This function gets the system UUID.
+
+  @param[out] SystemGuid   The pointer to retrieve system UUID.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @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            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChannelInfo (
+  IN  IPMI_GET_CHANNEL_INFO_REQUEST   *GetChannelInfoRequest,
+  OUT IPMI_GET_CHANNEL_INFO_RESPONSE  *GetChannelInfoResponse,
+  OUT UINT32                          *GetChannelInfoResponseSize
+  );
+
+//
+// IPMI NetFnTransport
+//
+
+/**
+  This function activates SOL
+
+  @param[in]      SolActivatingRequest    SOL activating request.
+  @param[out]     CompletionCode          The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSolActivating (
+  IN  IPMI_SOL_ACTIVATING_REQUEST  *SolActivatingRequest,
+  OUT UINT8                        *CompletionCode
+  );
+
+/**
+  This function sets SOL configuration parameters.
+
+  @param[in]      SetConfigurationParametersRequest      Set SOL configuration parameters
+                                                         command request.
+  @param[in]      SetConfigurationParametersRequestSize  Size of the set SOL configuration
+                                                         parameters command request.
+  @param[out]     CompletionCode                         The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSolConfigurationParameters (
+  IN  IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST  *SetConfigurationParametersRequest,
+  IN  UINT32                                         SetConfigurationParametersRequestSize,
+  OUT UINT8                                          *CompletionCode
+  );
+
+/**
+  This function gets SOL configuration parameters.
+
+  @param[in]      GetConfigurationParametersRequest        Get SOL configuration parameters
+                                                           command request.
+  @param[out]     GetConfigurationParametersResponse       Get SOL configuration parameters
+                                                           response.
+  @param[in,out]  GetConfigurationParametersResponseSize   When input, the size of the expected
+                                                           response.
+                                                           When output, the exact size of
+                                                           expect response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSolConfigurationParameters (
+  IN  IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST   *GetConfigurationParametersRequest,
+  OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE  *GetConfigurationParametersResponse,
+  IN OUT UINT32                                       *GetConfigurationParametersResponseSize
+  );
+
+/**
+  This function gets the LAN configuration parameter.
+
+  @param[in]     GetLanConfigurationParametersRequest   Get LAN configuration parameters command request.
+  @param[in]     GetLanConfigurationParametersResponse  The response of the get LAN configuration parameters.
+  @param[in,out] GetLanConfigurationParametersSize      When input, the expected size of response data.
+                                                        When out, the exact  size of response data.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+
+EFI_STATUS
+EFIAPI
+IpmiGetLanConfigurationParameters (
+  IN   IPMI_GET_LAN_CONFIGURATION_PARAMETERS_REQUEST   *GetLanConfigurationParametersRequest,
+  OUT  IPMI_GET_LAN_CONFIGURATION_PARAMETERS_RESPONSE  *GetLanConfigurationParametersResponse,
+  IN OUT UINT32                                        *GetLanConfigurationParametersSize
+  );
+
+//
+// IPMI NetFnChasis
+//
+
+/**
+  This function gets chassis capability.
+
+  @param[out] GetChassisCapabilitiesResponse  Gets chassis capability command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChassisCapabilities (
+  OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE  *GetChassisCapabilitiesResponse
+  );
+
+/**
+  This function gets chassis status.
+
+  @param[out] GetChassisCapabilitiesResponse  The get chassis status command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChassisStatus (
+  OUT IPMI_GET_CHASSIS_STATUS_RESPONSE  *GetChassisStatusResponse
+  );
+
+/**
+  This function sends chassis control request.
+
+  @param[in]  ChassisControlRequest  The chassis control request.
+  @param[out] CompletionCode         The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiChassisControl (
+  IN IPMI_CHASSIS_CONTROL_REQUEST  *ChassisControlRequest,
+  OUT UINT8                        *CompletionCode
+  );
+
+/**
+  This function sets power restore policy.
+
+  @param[in]  SetPowerRestireRequest    The set power restore policy control
+                                        command request.
+  @param[out] SetPowerRestireResponse   The response of power restore policy.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetPowerRestorePolicy (
+  IN  IPMI_SET_POWER_RESTORE_POLICY_REQUEST   *SetPowerRestireRequest,
+  OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE  *SetPowerRestireResponse
+  );
+
+//
+// IPMI NetFnStorage
+//
+
+/**
+  This function sets system boot option.
+
+  @param[in]  BootOptionsRequest    Set system boot option request.
+  @param[out] BootOptionsResponse   The response of set system boot
+                                    option request.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSystemBootOptions (
+  IN  IPMI_SET_BOOT_OPTIONS_REQUEST   *BootOptionsRequest,
+  OUT IPMI_SET_BOOT_OPTIONS_RESPONSE  *BootOptionsResponse
+  );
+
+/**
+  This function gets system boot option.
+
+  @param[in]  BootOptionsRequest    Get system boot option request.
+  @param[out] BootOptionsResponse   The response of get system boot
+                                    option request.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemBootOptions (
+  IN  IPMI_GET_BOOT_OPTIONS_REQUEST   *BootOptionsRequest,
+  OUT IPMI_GET_BOOT_OPTIONS_RESPONSE  *BootOptionsResponse
+  );
+
+/**
+  This function gets FRU inventory area info.
+
+  @param[in]  GetFruInventoryAreaInfoRequest    Get FRU inventory area command request.
+  @param[out] GetFruInventoryAreaInfoResponse   get FRU inventory area command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetFruInventoryAreaInfo (
+  IN  IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST   *GetFruInventoryAreaInfoRequest,
+  OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE  *GetFruInventoryAreaInfoResponse
+  );
+
+/**
+  This function reads FRU data.
+
+  @param[in]      ReadFruDataRequest       Read FRU data command request.
+  @param[out]     ReadFruDataResponse      Read FRU data command response.
+  @param[in,out]  ReadFruDataResponseSize  Size of the read FRU data response.
+                                           When input, the expected size of response data.
+                                           When out, the exact  size of response data.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiReadFruData (
+  IN  IPMI_READ_FRU_DATA_REQUEST   *ReadFruDataRequest,
+  OUT IPMI_READ_FRU_DATA_RESPONSE  *ReadFruDataResponse,
+  IN OUT UINT32                    *ReadFruDataResponseSize
+  );
+
+/**
+  This function gets chassis capability.
+
+  @param[in]    WriteFruDataRequest      Write FRU data command request.
+  @param[in]    WriteFruDataRequestSize  Size of the write FRU data command request.
+  @param[out]   WriteFruDataResponse     Write FRU data response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiWriteFruData (
+  IN  IPMI_WRITE_FRU_DATA_REQUEST   *WriteFruDataRequest,
+  IN  UINT32                        WriteFruDataRequestSize,
+  OUT IPMI_WRITE_FRU_DATA_RESPONSE  *WriteFruDataResponse
+  );
+
+/**
+  This function gets SEL information.
+
+  @param[out]    GetSelInfoResponse    Get SEL information command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelInfo (
+  OUT IPMI_GET_SEL_INFO_RESPONSE  *GetSelInfoResponse
+  );
+
+/**
+  This function gets SEL entry.
+
+  @param[in]      GetSelEntryRequest       Get SEL entry command request.
+  @param[out]     GetSelEntryResponse      Get SEL entry command response.
+  @param[in,out]  GetSelEntryResponseSize  Size of Get SEL entry request.
+                                           When input, the expected size of response data.
+                                           When out, the exact  size of response data.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelEntry (
+  IN IPMI_GET_SEL_ENTRY_REQUEST    *GetSelEntryRequest,
+  OUT IPMI_GET_SEL_ENTRY_RESPONSE  *GetSelEntryResponse,
+  IN OUT UINT32                    *GetSelEntryResponseSize
+  );
+
+/**
+  This function adds SEL entry.
+
+  @param[in]    AddSelEntryRequest       Add SEL entry command request.
+  @param[out]   AddSelEntryResponse      Add SEL entry command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiAddSelEntry (
+  IN IPMI_ADD_SEL_ENTRY_REQUEST    *AddSelEntryRequest,
+  OUT IPMI_ADD_SEL_ENTRY_RESPONSE  *AddSelEntryResponse
+  );
+
+/**
+  This function partially adds SEL entry.
+
+  @param[in]    PartialAddSelEntryRequest      Partial add SEL entry command request.
+  @param[in]    PartialAddSelEntryRequestSize  Size of partial add SEL entry command request.
+  @param[out]   PartialAddSelEntryResponse     Partial add SEL entry command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiPartialAddSelEntry (
+  IN IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST    *PartialAddSelEntryRequest,
+  IN UINT32                                PartialAddSelEntryRequestSize,
+  OUT IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE  *PartialAddSelEntryResponse
+  );
+
+/**
+  This function clears SEL entry.
+
+  @param[in]    ClearSelRequest      Clear SEL command request.
+  @param[out]   ClearSelResponse     Clear SEL command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiClearSel (
+  IN IPMI_CLEAR_SEL_REQUEST    *ClearSelRequest,
+  OUT IPMI_CLEAR_SEL_RESPONSE  *ClearSelResponse
+  );
+
+/**
+  This function gets SEL time.
+
+  @param[out]   GetSelTimeResponse    Get SEL time command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelTime (
+  OUT IPMI_GET_SEL_TIME_RESPONSE  *GetSelTimeResponse
+  );
+
+/**
+  This function sets SEL time.
+
+  @param[in]    SetSelTimeRequest    Set SEL time command request.
+  @param[out]   CompletionCode       Command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSelTime (
+  IN IPMI_SET_SEL_TIME_REQUEST  *SetSelTimeRequest,
+  OUT UINT8                     *CompletionCode
+  );
+
+/**
+  This function gets SDR repository information.
+
+  @param[out]    GetSdrRepositoryInfoResp    Get SDR repository response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSdrRepositoryInfo (
+  OUT IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE  *GetSdrRepositoryInfoResp
+  );
+
+/**
+  This function gets SDR
+
+  @param[in]      GetSdrRequest        Get SDR resquest.
+  @param[out]     GetSdrResponse       Get SDR response.
+  @param[in,out]  GetSdrResponseSize   The size of get SDR response.
+                                        When input, the expected size of response data.
+                                        When out, the exact  size of response data.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSdr (
+  IN  IPMI_GET_SDR_REQUEST   *GetSdrRequest,
+  OUT IPMI_GET_SDR_RESPONSE  *GetSdrResponse,
+  IN OUT UINT32              *GetSdrResponseSize
+  );
+
+#endif
-- 
2.37.1.windows.1


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

* [PATCH 2/3] MdeModulePkg/IpmiCommandLib: Add NULL instance library
  2022-12-28  4:59 [PATCH 0/3] Add NULL IpmiCommandLib instance Chang, Abner
  2022-12-28  4:59 ` [PATCH 1/3] MdeModulePkg/Include: Add IpmiCommandLib header file Chang, Abner
@ 2022-12-28  4:59 ` Chang, Abner
  2023-01-13  0:29   ` Isaac Oram
  2022-12-28  4:59 ` [PATCH 3/3] MdeModulePkg: Add IpmiCommandLib Chang, Abner
  2022-12-29 17:31 ` [edk2-devel] [PATCH 0/3] Add NULL IpmiCommandLib instance Michael D Kinney
  3 siblings, 1 reply; 10+ messages in thread
From: Chang, Abner @ 2022-12-28  4:59 UTC (permalink / raw)
  To: devel
  Cc: Jian J Wang, Liming Gao, Nickle Wang, Igor Kulchytskyy,
	Isaac Oram, Nate DeSimone

From: Abner Chang <abner.chang@amd.com>

The NULL instance of IpmiCommandLib library under
MdeModulePkg as the default IpmiCommandLib instance
used by the modules under edk2.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 .../BaseIpmiCommandLibNull.inf                |  34 +++
 .../IpmiCommandLibNetFnApp.c                  | 252 ++++++++++++++++++
 .../IpmiCommandLibNetFnChassis.c              | 123 +++++++++
 .../IpmiCommandLibNetFnStorage.c              | 248 +++++++++++++++++
 .../IpmiCommandLibNetFnTransport.c            | 100 +++++++
 5 files changed, 757 insertions(+)
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnApp.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnChassis.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnStorage.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnTransport.c

diff --git a/MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf b/MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
new file mode 100644
index 00000000000..d486539658f
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
@@ -0,0 +1,34 @@
+## @file
+# NULL instance of IpmiCommandLib
+#
+# Component description file for IPMI Command Library.
+#
+# 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
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = BaseIpmiCommandLibNull
+  FILE_GUID                      = 63F06EF8-B78A-4E7E-823E-D11A21059669
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = IpmiCommandLib
+
+[sources]
+  IpmiCommandLibNetFnApp.c
+  IpmiCommandLibNetFnTransport.c
+  IpmiCommandLibNetFnChassis.c
+  IpmiCommandLibNetFnStorage.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+
diff --git a/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnApp.c b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnApp.c
new file mode 100644
index 00000000000..4f0c49b048c
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnApp.c
@@ -0,0 +1,252 @@
+/** @file
+  IPMI Command - NetFnApp NULL instance library.
+
+  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
+**/
+#include <Uefi.h>
+#include <IndustryStandard/Ipmi.h>
+
+/**
+  This function gets the IPMI Device ID.
+
+  @param[out] DeviceId  Get device ID response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetDeviceId (
+  OUT IPMI_GET_DEVICE_ID_RESPONSE  *DeviceId
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets the self-test result.
+
+  @param[out] SelfTestResult  Self test command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelfTestResult (
+  OUT IPMI_SELF_TEST_RESULT_RESPONSE  *SelfTestResult
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function resets watchdog timer.
+
+  @param[out] CompletionCode  The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiResetWatchdogTimer (
+  OUT UINT8  *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets watchdog timer.
+
+  @param[in] SetWatchdogTimer  Set watchdog timer request.
+  @param[out] CompletionCode   The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetWatchdogTimer (
+  IN  IPMI_SET_WATCHDOG_TIMER_REQUEST  *SetWatchdogTimer,
+  OUT UINT8                            *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets watchdog timer.
+
+  @param[out] GetWatchdogTimer  Get watchdog timer response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetWatchdogTimer (
+  OUT IPMI_GET_WATCHDOG_TIMER_RESPONSE  *GetWatchdogTimer
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets BMC global enables.
+
+  @param[in]  SetBmcGlobalEnables    Set BMC global enables command request.
+  @param[out] CompletionCode         The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetBmcGlobalEnables (
+  IN  IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST  *SetBmcGlobalEnables,
+  OUT UINT8                                *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets BMC global enables.
+
+  @param[out]  GetBmcGlobalEnables  Get BMC global enables command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetBmcGlobalEnables (
+  OUT IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE  *GetBmcGlobalEnables
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function clears message flag.
+
+  @param[in]    ClearMessageFlagsRequest  Clear message flags command Request.
+  @param[out]   CompletionCode            The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiClearMessageFlags (
+  IN  IPMI_CLEAR_MESSAGE_FLAGS_REQUEST  *ClearMessageFlagsRequest,
+  OUT UINT8                             *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets message flags.
+
+  @param[out]    GetMessageFlagsResponse  Get message flags response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetMessageFlags (
+  OUT IPMI_GET_MESSAGE_FLAGS_RESPONSE  *GetMessageFlagsResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets message.
+
+  @param[out]     GetMessageResponse      Get message command response.
+  @param[in,out]  GetMessageResponseSize  The size of get message response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetMessage (
+  OUT IPMI_GET_MESSAGE_RESPONSE  *GetMessageResponse,
+  IN OUT UINT32                  *GetMessageResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sends message.
+
+  @param[in]     SendMessageRequest        The send message command request.
+  @param[in]     SendMessageRequestSize    The size of the send message command request.
+  @param[out]    SendMessageResponse       The send message command response.
+  @param[in,out] SendMessageResponseSize   The size of the send message command response.
+                                           When input, the expected size of response.
+                                           When output, the actual size of response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSendMessage (
+  IN  IPMI_SEND_MESSAGE_REQUEST   *SendMessageRequest,
+  IN  UINT32                      SendMessageRequestSize,
+  OUT IPMI_SEND_MESSAGE_RESPONSE  *SendMessageResponse,
+  IN OUT UINT32                   *SendMessageResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets the system UUID.
+
+  @param[out] SystemGuid   The pointer to retrieve system UUID.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemUuid (
+  OUT EFI_GUID  *SystemGuid
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets the channel information.
+
+  @param[in] GetChannelInfoRequest           The get channel information request.
+  @param[out] GetChannelInfoResponse         The get channel information response.
+  @param[out] GetChannelInfoResponseSize     When input, the expected size of response.
+                                             When output, the exact size of the returned
+                                                          response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChannelInfo (
+  IN  IPMI_GET_CHANNEL_INFO_REQUEST   *GetChannelInfoRequest,
+  OUT IPMI_GET_CHANNEL_INFO_RESPONSE  *GetChannelInfoResponse,
+  OUT UINT32                          *GetChannelInfoResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnChassis.c b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnChassis.c
new file mode 100644
index 00000000000..32126b466bb
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnChassis.c
@@ -0,0 +1,123 @@
+/** @file
+  IPMI Command - NetFnChassis NULL instance library.
+
+  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
+**/
+#include <Uefi.h>
+#include <IndustryStandard/Ipmi.h>
+
+/**
+  This function gets chassis capability.
+
+  @param[out] GetChassisCapabilitiesResponse  Gets chassis capability command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChassisCapabilities (
+  OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE  *GetChassisCapabilitiesResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets chassis status.
+
+  @param[out] GetChassisStatusResponse  The get chassis status command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChassisStatus (
+  OUT IPMI_GET_CHASSIS_STATUS_RESPONSE  *GetChassisStatusResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sends chassis control request.
+
+  @param[in]  ChassisControlRequest  The chassis control request.
+  @param[out] CompletionCode         The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiChassisControl (
+  IN IPMI_CHASSIS_CONTROL_REQUEST  *ChassisControlRequest,
+  OUT UINT8                        *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets power restore policy.
+
+  @param[in]  ChassisControlRequest    The set power restore policy control
+                                       command request.
+  @param[out] ChassisControlResponse   The response of power restore policy.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetPowerRestorePolicy (
+  IN  IPMI_SET_POWER_RESTORE_POLICY_REQUEST   *ChassisControlRequest,
+  OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE  *ChassisControlResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets system boot option.
+
+  @param[in]  BootOptionsRequest    Set system boot option request.
+  @param[out] BootOptionsResponse   The response of set system boot
+                                    option request.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSystemBootOptions (
+  IN  IPMI_SET_BOOT_OPTIONS_REQUEST   *BootOptionsRequest,
+  OUT IPMI_SET_BOOT_OPTIONS_RESPONSE  *BootOptionsResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets system boot option.
+
+  @param[in]  BootOptionsRequest    Get system boot option request.
+  @param[out] BootOptionsResponse   The response of get system boot
+                                    option request.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemBootOptions (
+  IN  IPMI_GET_BOOT_OPTIONS_REQUEST   *BootOptionsRequest,
+  OUT IPMI_GET_BOOT_OPTIONS_RESPONSE  *BootOptionsResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnStorage.c b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnStorage.c
new file mode 100644
index 00000000000..c94f55fbdaf
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnStorage.c
@@ -0,0 +1,248 @@
+/** @file
+  IPMI Command - NetFnStorage NULL instance library.
+
+  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
+**/
+#include <Uefi.h>
+#include <IndustryStandard/Ipmi.h>
+
+/**
+  This function gets FRU inventory area info.
+
+  @param[in]  GetFruInventoryAreaInfoRequest    Get FRU inventory area command request.
+  @param[out] GetFruInventoryAreaInfoResponse   get FRU inventory area command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetFruInventoryAreaInfo (
+  IN  IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST   *GetFruInventoryAreaInfoRequest,
+  OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE  *GetFruInventoryAreaInfoResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function reads FRU data.
+
+  @param[in]      ReadFruDataRequest       Read FRU data command request.
+  @param[out]     ReadFruDataResponse      Read FRU data command response.
+  @param[in,out]  ReadFruDataResponseSize  Size of the read FRU data response.
+                                           When input, the expected size of response data.
+                                           When out, the exact  size of response data.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiReadFruData (
+  IN  IPMI_READ_FRU_DATA_REQUEST   *ReadFruDataRequest,
+  OUT IPMI_READ_FRU_DATA_RESPONSE  *ReadFruDataResponse,
+  IN OUT UINT32                    *ReadFruDataResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets chassis capability.
+
+  @param[in]    WriteFruDataRequest      Write FRU data command request.
+  @param[in]    WriteFruDataRequestSize  Size of the write FRU data command request.
+  @param[out]   WriteFruDataResponse     Write FRU data response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiWriteFruData (
+  IN  IPMI_WRITE_FRU_DATA_REQUEST   *WriteFruDataRequest,
+  IN  UINT32                        WriteFruDataRequestSize,
+  OUT IPMI_WRITE_FRU_DATA_RESPONSE  *WriteFruDataResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SEL information.
+
+  @param[out]    GetSelInfoResponse    Get SEL information command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelInfo (
+  OUT IPMI_GET_SEL_INFO_RESPONSE  *GetSelInfoResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SEL entry.
+
+  @param[in]      GetSelEntryRequest       Get SEL entry command request.
+  @param[out]     GetSelEntryResponse      Get SEL entry command response.
+  @param[in,out]  GetSelEntryResponseSize  Size of Get SEL entry request.
+                                           When input, the expected size of response data.
+                                           When out, the exact  size of response data.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelEntry (
+  IN IPMI_GET_SEL_ENTRY_REQUEST    *GetSelEntryRequest,
+  OUT IPMI_GET_SEL_ENTRY_RESPONSE  *GetSelEntryResponse,
+  IN OUT UINT32                    *GetSelEntryResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function adds SEL entry.
+
+  @param[in]    AddSelEntryRequest       Add SEL entry command request.
+  @param[out]   AddSelEntryResponse      Add SEL entry command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiAddSelEntry (
+  IN IPMI_ADD_SEL_ENTRY_REQUEST    *AddSelEntryRequest,
+  OUT IPMI_ADD_SEL_ENTRY_RESPONSE  *AddSelEntryResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function partially adds SEL entry.
+
+  @param[in]    PartialAddSelEntryRequest      Partial add SEL entry command request.
+  @param[in]    PartialAddSelEntryRequestSize  Size of partial add SEL entry command request.
+  @param[out]   PartialAddSelEntryResponse     Partial add SEL entry command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiPartialAddSelEntry (
+  IN IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST    *PartialAddSelEntryRequest,
+  IN UINT32                                PartialAddSelEntryRequestSize,
+  OUT IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE  *PartialAddSelEntryResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function clears SEL entry.
+
+  @param[in]    ClearSelRequest      Clear SEL command request.
+  @param[out]   ClearSelResponse     Clear SEL command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiClearSel (
+  IN IPMI_CLEAR_SEL_REQUEST    *ClearSelRequest,
+  OUT IPMI_CLEAR_SEL_RESPONSE  *ClearSelResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SEL time.
+
+  @param[out]   GetSelTimeResponse    Get SEL time command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelTime (
+  OUT IPMI_GET_SEL_TIME_RESPONSE  *GetSelTimeResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets SEL time.
+
+  @param[in]    SetSelTimeRequest    Set SEL time command request.
+  @param[out]   CompletionCode       Command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSelTime (
+  IN IPMI_SET_SEL_TIME_REQUEST  *SetSelTimeRequest,
+  OUT UINT8                     *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SDR repository information.
+
+  @param[out]    GetSdrRepositoryInfoResp    Get SDR repository response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSdrRepositoryInfo (
+  OUT IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE  *GetSdrRepositoryInfoResp
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SDR
+
+  @param[in]      GetSdrRequest        Get SDR resquest.
+  @param[out]     GetSdrResponse       Get SDR response.
+  @param[in,out]  GetSdrResponseSize   The size of get SDR response.
+                                        When input, the expected size of response data.
+                                        When out, the exact  size of response data.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSdr (
+  IN  IPMI_GET_SDR_REQUEST   *GetSdrRequest,
+  OUT IPMI_GET_SDR_RESPONSE  *GetSdrResponse,
+  IN OUT UINT32              *GetSdrResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnTransport.c b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnTransport.c
new file mode 100644
index 00000000000..219de5bc7da
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnTransport.c
@@ -0,0 +1,100 @@
+/** @file
+  IPMI Command - NetFnTransport NULL instance library.
+
+  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
+**/
+#include <Uefi.h>
+#include <IndustryStandard/Ipmi.h>
+
+/**
+  This function activates SOL
+
+  @param[in]      SolActivatingRequest    SOL activating request.
+  @param[out]     CompletionCode          The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSolActivating (
+  IN  IPMI_SOL_ACTIVATING_REQUEST  *SolActivatingRequest,
+  OUT UINT8                        *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets SOL configuration parameters.
+
+  @param[in]      SetConfigurationParametersRequest      Set SOL configuration parameters
+                                                         command request.
+  @param[in]      SetConfigurationParametersRequestSize  Size of set SOL configuration
+                                                         parameters command request.
+  @param[out]     CompletionCode                         The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSolConfigurationParameters (
+  IN  IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST  *SetConfigurationParametersRequest,
+  IN  UINT32                                         SetConfigurationParametersRequestSize,
+  OUT UINT8                                          *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SOL configuration parameters.
+
+  @param[in]      GetConfigurationParametersRequest        Get SOL configuration parameters
+                                                           command request.
+  @param[out]     GetConfigurationParametersResponse       Get SOL configuration parameters
+                                                           response.
+  @param[in,out]  GetConfigurationParametersResponseSize   When input, the size of expect response.
+                                                           When output, the exact size of
+                                                           expect response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSolConfigurationParameters (
+  IN  IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST   *GetConfigurationParametersRequest,
+  OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE  *GetConfigurationParametersResponse,
+  IN OUT UINT32                                       *GetConfigurationParametersResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets the LAN configuration parameter.
+
+  @param[in]     GetLanConfigurationParametersRequest   Request data
+  @param[out]    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
+  )
+{
+  return EFI_UNSUPPORTED;
+}
-- 
2.37.1.windows.1


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

* [PATCH 3/3] MdeModulePkg: Add IpmiCommandLib
  2022-12-28  4:59 [PATCH 0/3] Add NULL IpmiCommandLib instance Chang, Abner
  2022-12-28  4:59 ` [PATCH 1/3] MdeModulePkg/Include: Add IpmiCommandLib header file Chang, Abner
  2022-12-28  4:59 ` [PATCH 2/3] MdeModulePkg/IpmiCommandLib: Add NULL instance library Chang, Abner
@ 2022-12-28  4:59 ` Chang, Abner
  2023-01-13  0:30   ` Isaac Oram
  2022-12-29 17:31 ` [edk2-devel] [PATCH 0/3] Add NULL IpmiCommandLib instance Michael D Kinney
  3 siblings, 1 reply; 10+ messages in thread
From: Chang, Abner @ 2022-12-28  4:59 UTC (permalink / raw)
  To: devel
  Cc: Jian J Wang, Liming Gao, Nickle Wang, Igor Kulchytskyy,
	Isaac Oram, Nate DeSimone

From: Abner Chang <abner.chang@amd.com>

Add IpmiCommandLib to MdeModulePkg DEC/DSC
files.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 MdeModulePkg/MdeModulePkg.dec | 4 ++++
 MdeModulePkg/MdeModulePkg.dsc | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index be5e829ca9c..1c2eff3a319 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -117,6 +117,10 @@
   #
   IpmiLib|Include/Library/IpmiLib.h
 
+  ## @libraryclass  Provides interfaces to send/receive IPMI command.
+  #
+  IpmiCommandLib|Include/Library/IpmiCommandLib.h
+
   ## @libraryclass  Provides interfaces for platform to return root bridge information to PciHostBridgeDxe driver.
   #
   PciHostBridgeLib|Include/Library/PciHostBridgeLib.h
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 659482ab737..79f0d0b1fe1 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -104,6 +104,7 @@
   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
   MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf
   VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
+  IpmiCommandLib|MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
 
 [LibraryClasses.EBC.PEIM]
   IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
@@ -333,6 +334,7 @@
   MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
   MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
   MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
+  MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
   MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
   MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf
   MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
-- 
2.37.1.windows.1


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

* Re: [edk2-devel] [PATCH 0/3] Add NULL IpmiCommandLib instance
  2022-12-28  4:59 [PATCH 0/3] Add NULL IpmiCommandLib instance Chang, Abner
                   ` (2 preceding siblings ...)
  2022-12-28  4:59 ` [PATCH 3/3] MdeModulePkg: Add IpmiCommandLib Chang, Abner
@ 2022-12-29 17:31 ` Michael D Kinney
  2022-12-30  4:09   ` Chang, Abner
  3 siblings, 1 reply; 10+ messages in thread
From: Michael D Kinney @ 2022-12-29 17:31 UTC (permalink / raw)
  To: devel@edk2.groups.io, abner.chang@amd.com, Kinney, Michael D
  Cc: Wang, Jian J, Gao, Liming, Nickle Wang, Igor Kulchytskyy,
	Oram, Isaac W, Desimone, Nathaniel L, Kinney, Michael D

Hi Abner,

Since this is moving content from edk2-platforms to edk2, we need to make sure that migration
is coordinated with the edk2-platforms owners for the IPMPI feature and we have a transition plan
for all downstream platform DSC files to use the content from the new location.  These types
of changes can be very disruptive.

Also, since IPMI is an industry standard, it is allowed to add libraries that support industry
standards to the MdePkg.  How was MdeModulePkg selected vs MdePkg?

Thanks,

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang, Abner via groups.io
> Sent: Tuesday, December 27, 2022 8:59 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor
> Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-devel] [PATCH 0/3] Add NULL IpmiCommandLib instance
> 
> From: Abner Chang <abner.chang@amd.com>
> 
> BZ# 4231
> This patch adds a NULL instance of IpmiCommandLib to remove
> the dependence between edk2 and edk2-platform packages.
> 
> Signed-off-by: Abner Chang <abner.chang@amd.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Nickle Wang <nicklew@nvidia.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> 
> Abner Chang (3):
>   MdeModulePkg/Include: Add IpmiCommandLib header file
>   MdeModulePkg/IpmiCommandLib: Add NULL instance library
>   MdeModulePkg: Add IpmiCommandLib
> 
>  MdeModulePkg/MdeModulePkg.dec                 |   4 +
>  MdeModulePkg/MdeModulePkg.dsc                 |   2 +
>  .../BaseIpmiCommandLibNull.inf                |  32 +
>  MdeModulePkg/Include/Library/IpmiCommandLib.h | 683 ++++++++++++++++++
>  .../IpmiCommandLibNetFnApp.c                  | 252 +++++++
>  .../IpmiCommandLibNetFnChassis.c              | 123 ++++
>  .../IpmiCommandLibNetFnStorage.c              | 248 +++++++
>  .../IpmiCommandLibNetFnTransport.c            | 100 +++
>  8 files changed, 1444 insertions(+)
>  create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
>  create mode 100644 MdeModulePkg/Include/Library/IpmiCommandLib.h
>  create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnApp.c
>  create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnChassis.c
>  create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnStorage.c
>  create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnTransport.c
> 
> --
> 2.37.1.windows.1
> 
> 
> 
> 
> 


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

* Re: [edk2-devel] [PATCH 0/3] Add NULL IpmiCommandLib instance
  2022-12-29 17:31 ` [edk2-devel] [PATCH 0/3] Add NULL IpmiCommandLib instance Michael D Kinney
@ 2022-12-30  4:09   ` Chang, Abner
  0 siblings, 0 replies; 10+ messages in thread
From: Chang, Abner @ 2022-12-30  4:09 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Wang, Jian J, Gao, Liming, Nickle Wang, Igor Kulchytskyy,
	Oram, Isaac W, Desimone, Nathaniel L

[-- Attachment #1: Type: text/plain, Size: 4901 bytes --]

[AMD Official Use Only - General]

Sure Mike, I had CC IPMI owners to review edk2 IPMI related patch sets.
This change doesn't have a big impact on edk2-platforms because all the references of IpmiCommandLib under edk2-platfoms are in IpmiFeaturePkg itself. The old IpmiCommandLib.h will be still under IpmiFeaturePkg/include for now, but the definitions of new functions should be added
to the one under MdeModulePkg. However the edk2-platorms one should be removed soon (it is better) or later (means the IpmiFeaturePkg re-architecture, email attached).

IPMI is the industry standard however the implementation of API for each NetFn is not, this is the first consideration I had. Second, there is already a IpmiLib under MdeModulePkg that led me to create IpmiCommandLib under MdeModulePkg. 
BTW, there is problem we have to fix, IpmiLib provide the function to send/receive IPMI NetFn, while the same function provided by IpmiFeaturePkg under edk2-platform has the different library class naming, which is IpmiBaseLib.

Thanks
Abner

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Friday, December 30, 2022 1:32 AM
> To: devel@edk2.groups.io; Chang, Abner <Abner.Chang@amd.com>; Kinney,
> Michael D <michael.d.kinney@intel.com>
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor
> Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>;
> Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Kinney, Michael
> D <michael.d.kinney@intel.com>
> Subject: RE: [edk2-devel] [PATCH 0/3] Add NULL IpmiCommandLib instance
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Hi Abner,
> 
> Since this is moving content from edk2-platforms to edk2, we need to make
> sure that migration is coordinated with the edk2-platforms owners for the
> IPMPI feature and we have a transition plan for all downstream platform DSC
> files to use the content from the new location.  These types of changes can
> be very disruptive.
> 
> Also, since IPMI is an industry standard, it is allowed to add libraries that
> support industry standards to the MdePkg.  How was MdeModulePkg
> selected vs MdePkg?
> 
> Thanks,
> 
> Mike
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang,
> > Abner via groups.io
> > Sent: Tuesday, December 27, 2022 8:59 PM
> > To: devel@edk2.groups.io
> > Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> > <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor
> > Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>;
> > Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> > Subject: [edk2-devel] [PATCH 0/3] Add NULL IpmiCommandLib instance
> >
> > From: Abner Chang <abner.chang@amd.com>
> >
> > BZ# 4231
> > This patch adds a NULL instance of IpmiCommandLib to remove the
> > dependence between edk2 and edk2-platform packages.
> >
> > Signed-off-by: Abner Chang <abner.chang@amd.com>
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Nickle Wang <nicklew@nvidia.com>
> > Cc: Igor Kulchytskyy <igork@ami.com>
> > Cc: Isaac Oram <isaac.w.oram@intel.com>
> > Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> >
> > Abner Chang (3):
> >   MdeModulePkg/Include: Add IpmiCommandLib header file
> >   MdeModulePkg/IpmiCommandLib: Add NULL instance library
> >   MdeModulePkg: Add IpmiCommandLib
> >
> >  MdeModulePkg/MdeModulePkg.dec                 |   4 +
> >  MdeModulePkg/MdeModulePkg.dsc                 |   2 +
> >  .../BaseIpmiCommandLibNull.inf                |  32 +
> >  MdeModulePkg/Include/Library/IpmiCommandLib.h | 683
> ++++++++++++++++++
> >  .../IpmiCommandLibNetFnApp.c                  | 252 +++++++
> >  .../IpmiCommandLibNetFnChassis.c              | 123 ++++
> >  .../IpmiCommandLibNetFnStorage.c              | 248 +++++++
> >  .../IpmiCommandLibNetFnTransport.c            | 100 +++
> >  8 files changed, 1444 insertions(+)
> >  create mode 100644
> >
> MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibN
> ull.inf
> >  create mode 100644 MdeModulePkg/Include/Library/IpmiCommandLib.h
> >  create mode 100644
> >
> MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFn
> App.c
> >  create mode 100644
> >
> MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFn
> Chassis
> > .c  create mode 100644
> >
> MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnS
> torage
> > .c  create mode 100644
> >
> MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnT
> ranspo
> > rt.c
> >
> > --
> > 2.37.1.windows.1
> >
> >
> >
> > 
> >

[-- Attachment #2: Type: message/rfc822, Size: 117837 bytes --]

[-- Attachment #2.1.1.1: Type: text/plain, Size: 2592 bytes --]

[AMD Official Use Only - General]



Thanks and sure, I will kick off the discussion on the mailing list.



Regards,

Abner



From: Oram, Isaac W <isaac.w.oram@intel.com>
Sent: Saturday, October 22, 2022 4:34 AM
To: Chang, Abner <Abner.Chang@amd.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Cc: nicklew@nvidia.com; Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>
Subject: RE: Propose the ManageabilityPkg under edk2-platform/Features



        Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.



Abner,



>From my perspective, this looks reasonable.  I think that we need to have the actual discussion on the mailing list so that our various customers can weigh in on the design and implementation.



Regards,

Isaac





From: Chang, Abner <Abner.Chang@amd.com<mailto:Abner.Chang@amd.com>>
Sent: Wednesday, October 19, 2022 11:08 PM
To: Gao, Liming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com<mailto:nathaniel.l.desimone@intel.com>>; Oram, Isaac W <isaac.w.oram@intel.com<mailto:isaac.w.oram@intel.com>>
Cc: nicklew@nvidia.com<mailto:nicklew@nvidia.com>; Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com<mailto:AbdulLateef.Attar@amd.com>>
Subject: Propose the ManageabilityPkg under edk2-platform/Features



[AMD Official Use Only - General]



Hi Liming, Nate and Isaac,

This is Abner from AMD. I am writing to let you know that Nvidia and AMD is going propose a new package ManageabilityPkg under edk2-platforms/Features. We would like to provide the Feature driver, Protocol driver instance and transport implementation that includes PLDM, MCTP, IPMI and KCS industry standard under ManageabilityPkg for the server management. The concept of this package is to provide the driver stacks as shown in the below drafting,







We may also pull IpmiFeaturePkg out of Intel/OutOfBandManagement folder. Thus the IpmiFeaturePkg can be referred by the edk2 driver (e.g., Modules under RedfishPkg) without the Intel folder in the INF package section or add edk2-platforms/Feature/Intel to the PACKAGES_PATH (add edk2-platform to packages path is required) for the build. We will take care the backward compatibility issues of IpmiFeaturePkg relocation, however can only cover the issues in the scope of edk2-platform.



How do you think?



Thanks and Regards,

Abner




[-- Attachment #2.1.1.2: Type: text/html, Size: 7510 bytes --]

[-- Attachment #2.1.2: image001.png --]
[-- Type: image/png, Size: 77555 bytes --]

[-- Attachment #3: Type: message/rfc822, Size: 9154 bytes --]

[-- Attachment #3.1.1: Type: text/plain, Size: 1530 bytes --]

[AMD Official Use Only - General]


Hi all,

In order to having the full edk2 driver stack for the server manageability, we are going to propose a new package ManageabilityPkg under edk2-platforms/Features. We would like to have a package that can provide a simple framework to flexibly accommodate the manageability feature driver (e.g. PLDM, IPMI, Redfish), Protocol driver instance (e.g. MCTP) and transport implementation (e.g. KCS/I2C/PCIe VDM) for the server management. Below are the steps we would take for this work,

1.      The first step we would take is to move IpmiFeaturePkg out of edk2-platforms/Features/Intel/OutOfBandManagement/. Thus the IpmiFeaturePkg can be referred by the edk2 driver (e.g., Modules under RedfishPkg) without the Intel folder in the INF package section or add edk2-platforms/Features/Intel to the PACKAGES_PATH for the build (add edk2-platforms/Features to packages path is still required). We will take care of the backward compatibility issues of IpmiFeaturePkg relocation, however we can only cover the build issues in the scope of edk2-platforms repo.
2.      After this we will abstract the transport implementation from  IPMI Transport protocol, so the IPMI protocol can flexibly  incorporate with other transport implementations.
3.      Add IPMI feature driver/library (e.g. IPMI Redfish bootstrap account Credential)
4.      Add MCTP and PLDM driver stack with the same concept as IpmiFeaturePkg



Any recommendations to this work?

Thanks

Abner








[-- Attachment #3.1.2: Type: text/html, Size: 5593 bytes --]

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

* Re: [edk2-devel] [PATCH 1/3] MdeModulePkg/Include: Add IpmiCommandLib header file
  2022-12-28  4:59 ` [PATCH 1/3] MdeModulePkg/Include: Add IpmiCommandLib header file Chang, Abner
@ 2023-01-13  0:11   ` Isaac Oram
  2023-01-13  6:04     ` Chang, Abner
  0 siblings, 1 reply; 10+ messages in thread
From: Isaac Oram @ 2023-01-13  0:11 UTC (permalink / raw)
  To: devel@edk2.groups.io, abner.chang@amd.com
  Cc: Wang, Jian J, Gao, Liming, Nickle Wang, Igor Kulchytskyy,
	Desimone, Nathaniel L

Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>

Typos in SetPowerRestireRequest and SetPowerRestireResponse in function comment block and parameters.
35 instances of successly should perhaps be successfully.
344: NetFnChasis should perhaps be NetFnChassis.

Regards,
Isaac

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang, Abner via groups.io
Sent: Tuesday, December 27, 2022 8:59 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [edk2-devel] [PATCH 1/3] MdeModulePkg/Include: Add IpmiCommandLib header file

From: Abner Chang <abner.chang@amd.com>

Add IpmiCommandLib to MdeModulePkg. This header file is copied from edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg\Include\Library. Having this header file in
edk2 to avoid the dependence of edk2 module with edk2-platfrom.
The NULL instance of IpmiCommandLib under MdeModulePkg has to be implemented for the same reason.
IpmiCommandLib.h in edk2-platforms should be removed once this patch set is merged. Expect no impacts on edk2-platforms because MdeModulePkg is referred in INF file by all edk2 modules under edk2-platforms that use IpmiCommandLib.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 MdeModulePkg/Include/Library/IpmiCommandLib.h | 683 ++++++++++++++++++
 1 file changed, 683 insertions(+)
 create mode 100644 MdeModulePkg/Include/Library/IpmiCommandLib.h

diff --git a/MdeModulePkg/Include/Library/IpmiCommandLib.h b/MdeModulePkg/Include/Library/IpmiCommandLib.h
new file mode 100644
index 00000000000..cac8123411f
--- /dev/null
+++ b/MdeModulePkg/Include/Library/IpmiCommandLib.h
@@ -0,0 +1,683 @@
+/** @file
+  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
+
+**/
+
+#ifndef IPMI_COMMAND_LIB_H_
+#define IPMI_COMMAND_LIB_H_
+
+#include <Uefi.h>
+#include <IndustryStandard/Ipmi.h>
+
+//
+// IPMI NetFnApp
+//
+
+/**
+  This function gets the IPMI Device ID.
+
+  @param[out] DeviceId  Get device ID response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetDeviceId (
+  OUT IPMI_GET_DEVICE_ID_RESPONSE  *DeviceId
+  );
+
+/**
+  This function gets the self-test result.
+
+  @param[out] SelfTestResult  Self test command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelfTestResult (
+  OUT IPMI_SELF_TEST_RESULT_RESPONSE  *SelfTestResult
+  );
+
+/**
+  This function resets watchdog timer.
+
+  @param[out] CompletionCode  The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiResetWatchdogTimer (
+  OUT UINT8  *CompletionCode
+  );
+
+/**
+  This function sets watchdog timer.
+
+  @param[in] SetWatchdogTimer  Set watchdog timer request.
+  @param[out] CompletionCode   The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetWatchdogTimer (
+  IN  IPMI_SET_WATCHDOG_TIMER_REQUEST  *SetWatchdogTimer,
+  OUT UINT8                            *CompletionCode
+  );
+
+/**
+  This function gets watchdog timer.
+
+  @param[out] GetWatchdogTimer  Get watchdog timer response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetWatchdogTimer (
+  OUT IPMI_GET_WATCHDOG_TIMER_RESPONSE  *GetWatchdogTimer
+  );
+
+/**
+  This function sets BMC global enables.
+
+  @param[in]  SetBmcGlobalEnables    Set BMC global enables command request.
+  @param[out] CompletionCode         The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetBmcGlobalEnables (
+  IN  IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST  *SetBmcGlobalEnables,
+  OUT UINT8                                *CompletionCode
+  );
+
+/**
+  This function gets BMC global enables.
+
+  @param[out]  GetBmcGlobalEnables  Get BMC global enables command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetBmcGlobalEnables (
+  OUT IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE  *GetBmcGlobalEnables
+  );
+
+/**
+  This function clears message flag.
+
+  @param[in]    ClearMessageFlagsRequest  Clear message flags command request.
+  @param[out]   CompletionCode            The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiClearMessageFlags (
+  IN  IPMI_CLEAR_MESSAGE_FLAGS_REQUEST  *ClearMessageFlagsRequest,
+  OUT UINT8                             *CompletionCode
+  );
+
+/**
+  This function gets message flag.
+
+  @param[out]    GetMessageFlagsResponse  Get message flags response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetMessageFlags (
+  OUT IPMI_GET_MESSAGE_FLAGS_RESPONSE  *GetMessageFlagsResponse
+  );
+
+/**
+  This function gets message.
+
+  @param[out]     GetMessageResponse      Get message command response.
+  @param[in,out]  GetMessageResponseSize  The size of get message response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetMessage (
+  OUT IPMI_GET_MESSAGE_RESPONSE  *GetMessageResponse,
+  IN OUT UINT32                  *GetMessageResponseSize
+  );
+
+/**
+  This function sends message.
+
+  @param[in]     SendMessageRequest        The send message command request.
+  @param[in]     SendMessageRequestSize    The size of the send message command request.
+  @param[out]    SendMessageResponse       The send message command response.
+  @param[in,out] SendMessageResponseSize   The size of the send message command response.
+                                           When input, the expected size of response.
+                                           When output, the actual size of response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSendMessage (
+  IN  IPMI_SEND_MESSAGE_REQUEST   *SendMessageRequest,
+  IN  UINT32                      SendMessageRequestSize,
+  OUT IPMI_SEND_MESSAGE_RESPONSE  *SendMessageResponse,
+  IN OUT UINT32                   *SendMessageResponseSize
+  );
+
+/**
+  This function gets the system UUID.
+
+  @param[out] SystemGuid   The pointer to retrieve system UUID.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @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            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChannelInfo (
+  IN  IPMI_GET_CHANNEL_INFO_REQUEST   *GetChannelInfoRequest,
+  OUT IPMI_GET_CHANNEL_INFO_RESPONSE  *GetChannelInfoResponse,
+  OUT UINT32                          *GetChannelInfoResponseSize
+  );
+
+//
+// IPMI NetFnTransport
+//
+
+/**
+  This function activates SOL
+
+  @param[in]      SolActivatingRequest    SOL activating request.
+  @param[out]     CompletionCode          The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSolActivating (
+  IN  IPMI_SOL_ACTIVATING_REQUEST  *SolActivatingRequest,
+  OUT UINT8                        *CompletionCode
+  );
+
+/**
+  This function sets SOL configuration parameters.
+
+  @param[in]      SetConfigurationParametersRequest      Set SOL configuration parameters
+                                                         command request.
+  @param[in]      SetConfigurationParametersRequestSize  Size of the set SOL configuration
+                                                         parameters command request.
+  @param[out]     CompletionCode                         The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSolConfigurationParameters (
+  IN  IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST  *SetConfigurationParametersRequest,
+  IN  UINT32                                         SetConfigurationParametersRequestSize,
+  OUT UINT8                                          *CompletionCode
+  );
+
+/**
+  This function gets SOL configuration parameters.
+
+  @param[in]      GetConfigurationParametersRequest        Get SOL configuration parameters
+                                                           command request.
+  @param[out]     GetConfigurationParametersResponse       Get SOL configuration parameters
+                                                           response.
+  @param[in,out]  GetConfigurationParametersResponseSize   When input, the size of the expected
+                                                           response.
+                                                           When output, the exact size of
+                                                           expect response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSolConfigurationParameters (
+  IN  IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST   *GetConfigurationParametersRequest,
+  OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE  *GetConfigurationParametersResponse,
+  IN OUT UINT32                                       *GetConfigurationParametersResponseSize
+  );
+
+/**
+  This function gets the LAN configuration parameter.
+
+  @param[in]     GetLanConfigurationParametersRequest   Get LAN configuration parameters command request.
+  @param[in]     GetLanConfigurationParametersResponse  The response of the get LAN configuration parameters.
+  @param[in,out] GetLanConfigurationParametersSize      When input, the expected size of response data.
+                                                        When out, the exact  size of response data.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+
+EFI_STATUS
+EFIAPI
+IpmiGetLanConfigurationParameters (
+  IN   IPMI_GET_LAN_CONFIGURATION_PARAMETERS_REQUEST   *GetLanConfigurationParametersRequest,
+  OUT  IPMI_GET_LAN_CONFIGURATION_PARAMETERS_RESPONSE  *GetLanConfigurationParametersResponse,
+  IN OUT UINT32                                        *GetLanConfigurationParametersSize
+  );
+
+//
+// IPMI NetFnChasis
+//
+
+/**
+  This function gets chassis capability.
+
+  @param[out] GetChassisCapabilitiesResponse  Gets chassis capability command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChassisCapabilities (
+  OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE  
+*GetChassisCapabilitiesResponse
+  );
+
+/**
+  This function gets chassis status.
+
+  @param[out] GetChassisCapabilitiesResponse  The get chassis status command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChassisStatus (
+  OUT IPMI_GET_CHASSIS_STATUS_RESPONSE  *GetChassisStatusResponse
+  );
+
+/**
+  This function sends chassis control request.
+
+  @param[in]  ChassisControlRequest  The chassis control request.
+  @param[out] CompletionCode         The command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiChassisControl (
+  IN IPMI_CHASSIS_CONTROL_REQUEST  *ChassisControlRequest,
+  OUT UINT8                        *CompletionCode
+  );
+
+/**
+  This function sets power restore policy.
+
+  @param[in]  SetPowerRestireRequest    The set power restore policy control
+                                        command request.
+  @param[out] SetPowerRestireResponse   The response of power restore policy.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetPowerRestorePolicy (
+  IN  IPMI_SET_POWER_RESTORE_POLICY_REQUEST   *SetPowerRestireRequest,
+  OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE  *SetPowerRestireResponse
+  );
+
+//
+// IPMI NetFnStorage
+//
+
+/**
+  This function sets system boot option.
+
+  @param[in]  BootOptionsRequest    Set system boot option request.
+  @param[out] BootOptionsResponse   The response of set system boot
+                                    option request.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSystemBootOptions (
+  IN  IPMI_SET_BOOT_OPTIONS_REQUEST   *BootOptionsRequest,
+  OUT IPMI_SET_BOOT_OPTIONS_RESPONSE  *BootOptionsResponse
+  );
+
+/**
+  This function gets system boot option.
+
+  @param[in]  BootOptionsRequest    Get system boot option request.
+  @param[out] BootOptionsResponse   The response of get system boot
+                                    option request.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemBootOptions (
+  IN  IPMI_GET_BOOT_OPTIONS_REQUEST   *BootOptionsRequest,
+  OUT IPMI_GET_BOOT_OPTIONS_RESPONSE  *BootOptionsResponse
+  );
+
+/**
+  This function gets FRU inventory area info.
+
+  @param[in]  GetFruInventoryAreaInfoRequest    Get FRU inventory area command request.
+  @param[out] GetFruInventoryAreaInfoResponse   get FRU inventory area command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetFruInventoryAreaInfo (
+  IN  IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST   *GetFruInventoryAreaInfoRequest,
+  OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE  
+*GetFruInventoryAreaInfoResponse
+  );
+
+/**
+  This function reads FRU data.
+
+  @param[in]      ReadFruDataRequest       Read FRU data command request.
+  @param[out]     ReadFruDataResponse      Read FRU data command response.
+  @param[in,out]  ReadFruDataResponseSize  Size of the read FRU data response.
+                                           When input, the expected size of response data.
+                                           When out, the exact  size of response data.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiReadFruData (
+  IN  IPMI_READ_FRU_DATA_REQUEST   *ReadFruDataRequest,
+  OUT IPMI_READ_FRU_DATA_RESPONSE  *ReadFruDataResponse,
+  IN OUT UINT32                    *ReadFruDataResponseSize
+  );
+
+/**
+  This function gets chassis capability.
+
+  @param[in]    WriteFruDataRequest      Write FRU data command request.
+  @param[in]    WriteFruDataRequestSize  Size of the write FRU data command request.
+  @param[out]   WriteFruDataResponse     Write FRU data response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiWriteFruData (
+  IN  IPMI_WRITE_FRU_DATA_REQUEST   *WriteFruDataRequest,
+  IN  UINT32                        WriteFruDataRequestSize,
+  OUT IPMI_WRITE_FRU_DATA_RESPONSE  *WriteFruDataResponse
+  );
+
+/**
+  This function gets SEL information.
+
+  @param[out]    GetSelInfoResponse    Get SEL information command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelInfo (
+  OUT IPMI_GET_SEL_INFO_RESPONSE  *GetSelInfoResponse
+  );
+
+/**
+  This function gets SEL entry.
+
+  @param[in]      GetSelEntryRequest       Get SEL entry command request.
+  @param[out]     GetSelEntryResponse      Get SEL entry command response.
+  @param[in,out]  GetSelEntryResponseSize  Size of Get SEL entry request.
+                                           When input, the expected size of response data.
+                                           When out, the exact  size of response data.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelEntry (
+  IN IPMI_GET_SEL_ENTRY_REQUEST    *GetSelEntryRequest,
+  OUT IPMI_GET_SEL_ENTRY_RESPONSE  *GetSelEntryResponse,
+  IN OUT UINT32                    *GetSelEntryResponseSize
+  );
+
+/**
+  This function adds SEL entry.
+
+  @param[in]    AddSelEntryRequest       Add SEL entry command request.
+  @param[out]   AddSelEntryResponse      Add SEL entry command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiAddSelEntry (
+  IN IPMI_ADD_SEL_ENTRY_REQUEST    *AddSelEntryRequest,
+  OUT IPMI_ADD_SEL_ENTRY_RESPONSE  *AddSelEntryResponse
+  );
+
+/**
+  This function partially adds SEL entry.
+
+  @param[in]    PartialAddSelEntryRequest      Partial add SEL entry command request.
+  @param[in]    PartialAddSelEntryRequestSize  Size of partial add SEL entry command request.
+  @param[out]   PartialAddSelEntryResponse     Partial add SEL entry command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiPartialAddSelEntry (
+  IN IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST    *PartialAddSelEntryRequest,
+  IN UINT32                                PartialAddSelEntryRequestSize,
+  OUT IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE  *PartialAddSelEntryResponse
+  );
+
+/**
+  This function clears SEL entry.
+
+  @param[in]    ClearSelRequest      Clear SEL command request.
+  @param[out]   ClearSelResponse     Clear SEL command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiClearSel (
+  IN IPMI_CLEAR_SEL_REQUEST    *ClearSelRequest,
+  OUT IPMI_CLEAR_SEL_RESPONSE  *ClearSelResponse
+  );
+
+/**
+  This function gets SEL time.
+
+  @param[out]   GetSelTimeResponse    Get SEL time command response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelTime (
+  OUT IPMI_GET_SEL_TIME_RESPONSE  *GetSelTimeResponse
+  );
+
+/**
+  This function sets SEL time.
+
+  @param[in]    SetSelTimeRequest    Set SEL time command request.
+  @param[out]   CompletionCode       Command completion code.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSelTime (
+  IN IPMI_SET_SEL_TIME_REQUEST  *SetSelTimeRequest,
+  OUT UINT8                     *CompletionCode
+  );
+
+/**
+  This function gets SDR repository information.
+
+  @param[out]    GetSdrRepositoryInfoResp    Get SDR repository response.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSdrRepositoryInfo (
+  OUT IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE  *GetSdrRepositoryInfoResp
+  );
+
+/**
+  This function gets SDR
+
+  @param[in]      GetSdrRequest        Get SDR resquest.
+  @param[out]     GetSdrResponse       Get SDR response.
+  @param[in,out]  GetSdrResponseSize   The size of get SDR response.
+                                        When input, the expected size of response data.
+                                        When out, the exact  size of response data.
+
+  @retval EFI_SUCCESS            Command is sent successly.
+  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
+  @retval Other                  Failure.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSdr (
+  IN  IPMI_GET_SDR_REQUEST   *GetSdrRequest,
+  OUT IPMI_GET_SDR_RESPONSE  *GetSdrResponse,
+  IN OUT UINT32              *GetSdrResponseSize
+  );
+
+#endif
--
2.37.1.windows.1







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

* Re: [PATCH 2/3] MdeModulePkg/IpmiCommandLib: Add NULL instance library
  2022-12-28  4:59 ` [PATCH 2/3] MdeModulePkg/IpmiCommandLib: Add NULL instance library Chang, Abner
@ 2023-01-13  0:29   ` Isaac Oram
  0 siblings, 0 replies; 10+ messages in thread
From: Isaac Oram @ 2023-01-13  0:29 UTC (permalink / raw)
  To: abner.chang@amd.com, devel@edk2.groups.io
  Cc: Wang, Jian J, Gao, Liming, Nickle Wang, Igor Kulchytskyy,
	Desimone, Nathaniel L

Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>

You could change EFI_UNSUPPORTED to RETURN_UNSUPPORTED.  I am not sure why patchcheck doesn't complain.
There are five instances of "exact  size" which oddly has two spaces between the words.

Regards,
Isaac

-----Original Message-----
From: abner.chang@amd.com <abner.chang@amd.com> 
Sent: Tuesday, December 27, 2022 8:59 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [PATCH 2/3] MdeModulePkg/IpmiCommandLib: Add NULL instance library

From: Abner Chang <abner.chang@amd.com>

The NULL instance of IpmiCommandLib library under MdeModulePkg as the default IpmiCommandLib instance used by the modules under edk2.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 .../BaseIpmiCommandLibNull.inf                |  34 +++
 .../IpmiCommandLibNetFnApp.c                  | 252 ++++++++++++++++++
 .../IpmiCommandLibNetFnChassis.c              | 123 +++++++++
 .../IpmiCommandLibNetFnStorage.c              | 248 +++++++++++++++++
 .../IpmiCommandLibNetFnTransport.c            | 100 +++++++
 5 files changed, 757 insertions(+)
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnApp.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnChassis.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnStorage.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnTransport.c

diff --git a/MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf b/MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
new file mode 100644
index 00000000000..d486539658f
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull
+++ .inf
@@ -0,0 +1,34 @@
+## @file
+# NULL instance of IpmiCommandLib
+#
+# Component description file for IPMI Command Library.
+#
+# 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 # 
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = BaseIpmiCommandLibNull
+  FILE_GUID                      = 63F06EF8-B78A-4E7E-823E-D11A21059669
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = IpmiCommandLib
+
+[sources]
+  IpmiCommandLibNetFnApp.c
+  IpmiCommandLibNetFnTransport.c
+  IpmiCommandLibNetFnChassis.c
+  IpmiCommandLibNetFnStorage.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+
diff --git a/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnApp.c b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnApp.c
new file mode 100644
index 00000000000..4f0c49b048c
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnApp
+++ .c
@@ -0,0 +1,252 @@
+/** @file
+  IPMI Command - NetFnApp NULL instance library.
+
+  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 **/ #include <Uefi.h> 
+#include <IndustryStandard/Ipmi.h>
+
+/**
+  This function gets the IPMI Device ID.
+
+  @param[out] DeviceId  Get device ID response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetDeviceId (
+  OUT IPMI_GET_DEVICE_ID_RESPONSE  *DeviceId
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets the self-test result.
+
+  @param[out] SelfTestResult  Self test command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelfTestResult (
+  OUT IPMI_SELF_TEST_RESULT_RESPONSE  *SelfTestResult
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function resets watchdog timer.
+
+  @param[out] CompletionCode  The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiResetWatchdogTimer (
+  OUT UINT8  *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets watchdog timer.
+
+  @param[in] SetWatchdogTimer  Set watchdog timer request.
+  @param[out] CompletionCode   The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetWatchdogTimer (
+  IN  IPMI_SET_WATCHDOG_TIMER_REQUEST  *SetWatchdogTimer,
+  OUT UINT8                            *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets watchdog timer.
+
+  @param[out] GetWatchdogTimer  Get watchdog timer response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetWatchdogTimer (
+  OUT IPMI_GET_WATCHDOG_TIMER_RESPONSE  *GetWatchdogTimer
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets BMC global enables.
+
+  @param[in]  SetBmcGlobalEnables    Set BMC global enables command request.
+  @param[out] CompletionCode         The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetBmcGlobalEnables (
+  IN  IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST  *SetBmcGlobalEnables,
+  OUT UINT8                                *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets BMC global enables.
+
+  @param[out]  GetBmcGlobalEnables  Get BMC global enables command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetBmcGlobalEnables (
+  OUT IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE  *GetBmcGlobalEnables
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function clears message flag.
+
+  @param[in]    ClearMessageFlagsRequest  Clear message flags command Request.
+  @param[out]   CompletionCode            The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiClearMessageFlags (
+  IN  IPMI_CLEAR_MESSAGE_FLAGS_REQUEST  *ClearMessageFlagsRequest,
+  OUT UINT8                             *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets message flags.
+
+  @param[out]    GetMessageFlagsResponse  Get message flags response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetMessageFlags (
+  OUT IPMI_GET_MESSAGE_FLAGS_RESPONSE  *GetMessageFlagsResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets message.
+
+  @param[out]     GetMessageResponse      Get message command response.
+  @param[in,out]  GetMessageResponseSize  The size of get message response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetMessage (
+  OUT IPMI_GET_MESSAGE_RESPONSE  *GetMessageResponse,
+  IN OUT UINT32                  *GetMessageResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sends message.
+
+  @param[in]     SendMessageRequest        The send message command request.
+  @param[in]     SendMessageRequestSize    The size of the send message command request.
+  @param[out]    SendMessageResponse       The send message command response.
+  @param[in,out] SendMessageResponseSize   The size of the send message command response.
+                                           When input, the expected size of response.
+                                           When output, the actual size of response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSendMessage (
+  IN  IPMI_SEND_MESSAGE_REQUEST   *SendMessageRequest,
+  IN  UINT32                      SendMessageRequestSize,
+  OUT IPMI_SEND_MESSAGE_RESPONSE  *SendMessageResponse,
+  IN OUT UINT32                   *SendMessageResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets the system UUID.
+
+  @param[out] SystemGuid   The pointer to retrieve system UUID.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemUuid (
+  OUT EFI_GUID  *SystemGuid
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets the channel information.
+
+  @param[in] GetChannelInfoRequest           The get channel information request.
+  @param[out] GetChannelInfoResponse         The get channel information response.
+  @param[out] GetChannelInfoResponseSize     When input, the expected size of response.
+                                             When output, the exact size of the returned
+                                                          response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChannelInfo (
+  IN  IPMI_GET_CHANNEL_INFO_REQUEST   *GetChannelInfoRequest,
+  OUT IPMI_GET_CHANNEL_INFO_RESPONSE  *GetChannelInfoResponse,
+  OUT UINT32                          *GetChannelInfoResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnChassis.c b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnChassis.c
new file mode 100644
index 00000000000..32126b466bb
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnCha
+++ ssis.c
@@ -0,0 +1,123 @@
+/** @file
+  IPMI Command - NetFnChassis NULL instance library.
+
+  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 **/ #include <Uefi.h> 
+#include <IndustryStandard/Ipmi.h>
+
+/**
+  This function gets chassis capability.
+
+  @param[out] GetChassisCapabilitiesResponse  Gets chassis capability command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChassisCapabilities (
+  OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE  
+*GetChassisCapabilitiesResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets chassis status.
+
+  @param[out] GetChassisStatusResponse  The get chassis status command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetChassisStatus (
+  OUT IPMI_GET_CHASSIS_STATUS_RESPONSE  *GetChassisStatusResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sends chassis control request.
+
+  @param[in]  ChassisControlRequest  The chassis control request.
+  @param[out] CompletionCode         The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiChassisControl (
+  IN IPMI_CHASSIS_CONTROL_REQUEST  *ChassisControlRequest,
+  OUT UINT8                        *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets power restore policy.
+
+  @param[in]  ChassisControlRequest    The set power restore policy control
+                                       command request.
+  @param[out] ChassisControlResponse   The response of power restore policy.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetPowerRestorePolicy (
+  IN  IPMI_SET_POWER_RESTORE_POLICY_REQUEST   *ChassisControlRequest,
+  OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE  *ChassisControlResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets system boot option.
+
+  @param[in]  BootOptionsRequest    Set system boot option request.
+  @param[out] BootOptionsResponse   The response of set system boot
+                                    option request.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSystemBootOptions (
+  IN  IPMI_SET_BOOT_OPTIONS_REQUEST   *BootOptionsRequest,
+  OUT IPMI_SET_BOOT_OPTIONS_RESPONSE  *BootOptionsResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets system boot option.
+
+  @param[in]  BootOptionsRequest    Get system boot option request.
+  @param[out] BootOptionsResponse   The response of get system boot
+                                    option request.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSystemBootOptions (
+  IN  IPMI_GET_BOOT_OPTIONS_REQUEST   *BootOptionsRequest,
+  OUT IPMI_GET_BOOT_OPTIONS_RESPONSE  *BootOptionsResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnStorage.c b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnStorage.c
new file mode 100644
index 00000000000..c94f55fbdaf
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnSto
+++ rage.c
@@ -0,0 +1,248 @@
+/** @file
+  IPMI Command - NetFnStorage NULL instance library.
+
+  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 **/ #include <Uefi.h> 
+#include <IndustryStandard/Ipmi.h>
+
+/**
+  This function gets FRU inventory area info.
+
+  @param[in]  GetFruInventoryAreaInfoRequest    Get FRU inventory area command request.
+  @param[out] GetFruInventoryAreaInfoResponse   get FRU inventory area command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetFruInventoryAreaInfo (
+  IN  IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST   *GetFruInventoryAreaInfoRequest,
+  OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE  
+*GetFruInventoryAreaInfoResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function reads FRU data.
+
+  @param[in]      ReadFruDataRequest       Read FRU data command request.
+  @param[out]     ReadFruDataResponse      Read FRU data command response.
+  @param[in,out]  ReadFruDataResponseSize  Size of the read FRU data response.
+                                           When input, the expected size of response data.
+                                           When out, the exact  size of response data.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiReadFruData (
+  IN  IPMI_READ_FRU_DATA_REQUEST   *ReadFruDataRequest,
+  OUT IPMI_READ_FRU_DATA_RESPONSE  *ReadFruDataResponse,
+  IN OUT UINT32                    *ReadFruDataResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets chassis capability.
+
+  @param[in]    WriteFruDataRequest      Write FRU data command request.
+  @param[in]    WriteFruDataRequestSize  Size of the write FRU data command request.
+  @param[out]   WriteFruDataResponse     Write FRU data response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiWriteFruData (
+  IN  IPMI_WRITE_FRU_DATA_REQUEST   *WriteFruDataRequest,
+  IN  UINT32                        WriteFruDataRequestSize,
+  OUT IPMI_WRITE_FRU_DATA_RESPONSE  *WriteFruDataResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SEL information.
+
+  @param[out]    GetSelInfoResponse    Get SEL information command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelInfo (
+  OUT IPMI_GET_SEL_INFO_RESPONSE  *GetSelInfoResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SEL entry.
+
+  @param[in]      GetSelEntryRequest       Get SEL entry command request.
+  @param[out]     GetSelEntryResponse      Get SEL entry command response.
+  @param[in,out]  GetSelEntryResponseSize  Size of Get SEL entry request.
+                                           When input, the expected size of response data.
+                                           When out, the exact  size of response data.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelEntry (
+  IN IPMI_GET_SEL_ENTRY_REQUEST    *GetSelEntryRequest,
+  OUT IPMI_GET_SEL_ENTRY_RESPONSE  *GetSelEntryResponse,
+  IN OUT UINT32                    *GetSelEntryResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function adds SEL entry.
+
+  @param[in]    AddSelEntryRequest       Add SEL entry command request.
+  @param[out]   AddSelEntryResponse      Add SEL entry command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiAddSelEntry (
+  IN IPMI_ADD_SEL_ENTRY_REQUEST    *AddSelEntryRequest,
+  OUT IPMI_ADD_SEL_ENTRY_RESPONSE  *AddSelEntryResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function partially adds SEL entry.
+
+  @param[in]    PartialAddSelEntryRequest      Partial add SEL entry command request.
+  @param[in]    PartialAddSelEntryRequestSize  Size of partial add SEL entry command request.
+  @param[out]   PartialAddSelEntryResponse     Partial add SEL entry command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiPartialAddSelEntry (
+  IN IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST    *PartialAddSelEntryRequest,
+  IN UINT32                                PartialAddSelEntryRequestSize,
+  OUT IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE  *PartialAddSelEntryResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function clears SEL entry.
+
+  @param[in]    ClearSelRequest      Clear SEL command request.
+  @param[out]   ClearSelResponse     Clear SEL command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiClearSel (
+  IN IPMI_CLEAR_SEL_REQUEST    *ClearSelRequest,
+  OUT IPMI_CLEAR_SEL_RESPONSE  *ClearSelResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SEL time.
+
+  @param[out]   GetSelTimeResponse    Get SEL time command response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelTime (
+  OUT IPMI_GET_SEL_TIME_RESPONSE  *GetSelTimeResponse
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets SEL time.
+
+  @param[in]    SetSelTimeRequest    Set SEL time command request.
+  @param[out]   CompletionCode       Command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSelTime (
+  IN IPMI_SET_SEL_TIME_REQUEST  *SetSelTimeRequest,
+  OUT UINT8                     *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SDR repository information.
+
+  @param[out]    GetSdrRepositoryInfoResp    Get SDR repository response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSdrRepositoryInfo (
+  OUT IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE  *GetSdrRepositoryInfoResp
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SDR
+
+  @param[in]      GetSdrRequest        Get SDR resquest.
+  @param[out]     GetSdrResponse       Get SDR response.
+  @param[in,out]  GetSdrResponseSize   The size of get SDR response.
+                                        When input, the expected size of response data.
+                                        When out, the exact  size of response data.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSdr (
+  IN  IPMI_GET_SDR_REQUEST   *GetSdrRequest,
+  OUT IPMI_GET_SDR_RESPONSE  *GetSdrResponse,
+  IN OUT UINT32              *GetSdrResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnTransport.c b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnTransport.c
new file mode 100644
index 00000000000..219de5bc7da
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiCommandLibNull/IpmiCommandLibNetFnTra
+++ nsport.c
@@ -0,0 +1,100 @@
+/** @file
+  IPMI Command - NetFnTransport NULL instance library.
+
+  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 **/ #include <Uefi.h> 
+#include <IndustryStandard/Ipmi.h>
+
+/**
+  This function activates SOL
+
+  @param[in]      SolActivatingRequest    SOL activating request.
+  @param[out]     CompletionCode          The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSolActivating (
+  IN  IPMI_SOL_ACTIVATING_REQUEST  *SolActivatingRequest,
+  OUT UINT8                        *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function sets SOL configuration parameters.
+
+  @param[in]      SetConfigurationParametersRequest      Set SOL configuration parameters
+                                                         command request.
+  @param[in]      SetConfigurationParametersRequestSize  Size of set SOL configuration
+                                                         parameters command request.
+  @param[out]     CompletionCode                         The command completion code.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiSetSolConfigurationParameters (
+  IN  IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST  *SetConfigurationParametersRequest,
+  IN  UINT32                                         SetConfigurationParametersRequestSize,
+  OUT UINT8                                          *CompletionCode
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets SOL configuration parameters.
+
+  @param[in]      GetConfigurationParametersRequest        Get SOL configuration parameters
+                                                           command request.
+  @param[out]     GetConfigurationParametersResponse       Get SOL configuration parameters
+                                                           response.
+  @param[in,out]  GetConfigurationParametersResponseSize   When input, the size of expect response.
+                                                           When output, the exact size of
+                                                           expect response.
+
+  @retval EFI_UNSUPPORTED  Unsupported in the NULL lib.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSolConfigurationParameters (
+  IN  IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST   *GetConfigurationParametersRequest,
+  OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE  *GetConfigurationParametersResponse,
+  IN OUT UINT32                                       *GetConfigurationParametersResponseSize
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function gets the LAN configuration parameter.
+
+  @param[in]     GetLanConfigurationParametersRequest   Request data
+  @param[out]    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
+  )
+{
+  return EFI_UNSUPPORTED;
+}
--
2.37.1.windows.1


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

* Re: [PATCH 3/3] MdeModulePkg: Add IpmiCommandLib
  2022-12-28  4:59 ` [PATCH 3/3] MdeModulePkg: Add IpmiCommandLib Chang, Abner
@ 2023-01-13  0:30   ` Isaac Oram
  0 siblings, 0 replies; 10+ messages in thread
From: Isaac Oram @ 2023-01-13  0:30 UTC (permalink / raw)
  To: abner.chang@amd.com, devel@edk2.groups.io
  Cc: Wang, Jian J, Gao, Liming, Nickle Wang, Igor Kulchytskyy,
	Desimone, Nathaniel L

Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>

-----Original Message-----
From: abner.chang@amd.com <abner.chang@amd.com> 
Sent: Tuesday, December 27, 2022 8:59 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [PATCH 3/3] MdeModulePkg: Add IpmiCommandLib

From: Abner Chang <abner.chang@amd.com>

Add IpmiCommandLib to MdeModulePkg DEC/DSC files.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 MdeModulePkg/MdeModulePkg.dec | 4 ++++
 MdeModulePkg/MdeModulePkg.dsc | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index be5e829ca9c..1c2eff3a319 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -117,6 +117,10 @@
   #
   IpmiLib|Include/Library/IpmiLib.h
 
+  ## @libraryclass  Provides interfaces to send/receive IPMI command.
+  #
+  IpmiCommandLib|Include/Library/IpmiCommandLib.h
+
   ## @libraryclass  Provides interfaces for platform to return root bridge information to PciHostBridgeDxe driver.
   #
   PciHostBridgeLib|Include/Library/PciHostBridgeLib.h
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 659482ab737..79f0d0b1fe1 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -104,6 +104,7 @@
   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
   MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf
   VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
+  
+ IpmiCommandLib|MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCom
+ mandLibNull.inf
 
 [LibraryClasses.EBC.PEIM]
   IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
@@ -333,6 +334,7 @@
   MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
   MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
   MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
+  
+ MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
   MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
   MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf
   MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
--
2.37.1.windows.1


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

* Re: [edk2-devel] [PATCH 1/3] MdeModulePkg/Include: Add IpmiCommandLib header file
  2023-01-13  0:11   ` [edk2-devel] " Isaac Oram
@ 2023-01-13  6:04     ` Chang, Abner
  0 siblings, 0 replies; 10+ messages in thread
From: Chang, Abner @ 2023-01-13  6:04 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io
  Cc: Wang, Jian J, Gao, Liming, Nickle Wang, Igor Kulchytskyy,
	Desimone, Nathaniel L

[AMD Official Use Only - General]

Thanks for catching these typos in patches. V2 is sent to address them.

Abner

> -----Original Message-----
> From: Oram, Isaac W <isaac.w.oram@intel.com>
> Sent: Friday, January 13, 2023 8:11 AM
> To: devel@edk2.groups.io; Chang, Abner <Abner.Chang@amd.com>
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor
> Kulchytskyy <igork@ami.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: RE: [edk2-devel] [PATCH 1/3] MdeModulePkg/Include: Add
> IpmiCommandLib header file
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
> 
> Typos in SetPowerRestireRequest and SetPowerRestireResponse in function
> comment block and parameters.
> 35 instances of successly should perhaps be successfully.
> 344: NetFnChasis should perhaps be NetFnChassis.
> 
> Regards,
> Isaac
> 
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang,
> Abner via groups.io
> Sent: Tuesday, December 27, 2022 8:59 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Nickle Wang <nicklew@nvidia.com>; Igor
> Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>;
> Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> Subject: [edk2-devel] [PATCH 1/3] MdeModulePkg/Include: Add
> IpmiCommandLib header file
> 
> From: Abner Chang <abner.chang@amd.com>
> 
> Add IpmiCommandLib to MdeModulePkg. This header file is copied from
> edk2-platforms/Features/Intel/OutOfBandManagement/
> IpmiFeaturePkg\Include\Library. Having this header file in
> edk2 to avoid the dependence of edk2 module with edk2-platfrom.
> The NULL instance of IpmiCommandLib under MdeModulePkg has to be
> implemented for the same reason.
> IpmiCommandLib.h in edk2-platforms should be removed once this patch set
> is merged. Expect no impacts on edk2-platforms because MdeModulePkg is
> referred in INF file by all edk2 modules under edk2-platforms that use
> IpmiCommandLib.
> 
> Signed-off-by: Abner Chang <abner.chang@amd.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Nickle Wang <nicklew@nvidia.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> ---
>  MdeModulePkg/Include/Library/IpmiCommandLib.h | 683
> ++++++++++++++++++
>  1 file changed, 683 insertions(+)
>  create mode 100644 MdeModulePkg/Include/Library/IpmiCommandLib.h
> 
> diff --git a/MdeModulePkg/Include/Library/IpmiCommandLib.h
> b/MdeModulePkg/Include/Library/IpmiCommandLib.h
> new file mode 100644
> index 00000000000..cac8123411f
> --- /dev/null
> +++ b/MdeModulePkg/Include/Library/IpmiCommandLib.h
> @@ -0,0 +1,683 @@
> +/** @file
> +  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
> +
> +**/
> +
> +#ifndef IPMI_COMMAND_LIB_H_
> +#define IPMI_COMMAND_LIB_H_
> +
> +#include <Uefi.h>
> +#include <IndustryStandard/Ipmi.h>
> +
> +//
> +// IPMI NetFnApp
> +//
> +
> +/**
> +  This function gets the IPMI Device ID.
> +
> +  @param[out] DeviceId  Get device ID response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetDeviceId (
> +  OUT IPMI_GET_DEVICE_ID_RESPONSE  *DeviceId
> +  );
> +
> +/**
> +  This function gets the self-test result.
> +
> +  @param[out] SelfTestResult  Self test command response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetSelfTestResult (
> +  OUT IPMI_SELF_TEST_RESULT_RESPONSE  *SelfTestResult
> +  );
> +
> +/**
> +  This function resets watchdog timer.
> +
> +  @param[out] CompletionCode  The command completion code.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiResetWatchdogTimer (
> +  OUT UINT8  *CompletionCode
> +  );
> +
> +/**
> +  This function sets watchdog timer.
> +
> +  @param[in] SetWatchdogTimer  Set watchdog timer request.
> +  @param[out] CompletionCode   The command completion code.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiSetWatchdogTimer (
> +  IN  IPMI_SET_WATCHDOG_TIMER_REQUEST  *SetWatchdogTimer,
> +  OUT UINT8                            *CompletionCode
> +  );
> +
> +/**
> +  This function gets watchdog timer.
> +
> +  @param[out] GetWatchdogTimer  Get watchdog timer response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetWatchdogTimer (
> +  OUT IPMI_GET_WATCHDOG_TIMER_RESPONSE  *GetWatchdogTimer
> +  );
> +
> +/**
> +  This function sets BMC global enables.
> +
> +  @param[in]  SetBmcGlobalEnables    Set BMC global enables command
> request.
> +  @param[out] CompletionCode         The command completion code.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiSetBmcGlobalEnables (
> +  IN  IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST  *SetBmcGlobalEnables,
> +  OUT UINT8                                *CompletionCode
> +  );
> +
> +/**
> +  This function gets BMC global enables.
> +
> +  @param[out]  GetBmcGlobalEnables  Get BMC global enables command
> response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetBmcGlobalEnables (
> +  OUT IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE
> *GetBmcGlobalEnables
> +  );
> +
> +/**
> +  This function clears message flag.
> +
> +  @param[in]    ClearMessageFlagsRequest  Clear message flags command
> request.
> +  @param[out]   CompletionCode            The command completion code.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiClearMessageFlags (
> +  IN  IPMI_CLEAR_MESSAGE_FLAGS_REQUEST  *ClearMessageFlagsRequest,
> +  OUT UINT8                             *CompletionCode
> +  );
> +
> +/**
> +  This function gets message flag.
> +
> +  @param[out]    GetMessageFlagsResponse  Get message flags response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetMessageFlags (
> +  OUT IPMI_GET_MESSAGE_FLAGS_RESPONSE
> *GetMessageFlagsResponse
> +  );
> +
> +/**
> +  This function gets message.
> +
> +  @param[out]     GetMessageResponse      Get message command
> response.
> +  @param[in,out]  GetMessageResponseSize  The size of get message
> response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetMessage (
> +  OUT IPMI_GET_MESSAGE_RESPONSE  *GetMessageResponse,
> +  IN OUT UINT32                  *GetMessageResponseSize
> +  );
> +
> +/**
> +  This function sends message.
> +
> +  @param[in]     SendMessageRequest        The send message command
> request.
> +  @param[in]     SendMessageRequestSize    The size of the send message
> command request.
> +  @param[out]    SendMessageResponse       The send message command
> response.
> +  @param[in,out] SendMessageResponseSize   The size of the send
> message command response.
> +                                           When input, the expected size of response.
> +                                           When output, the actual size of response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiSendMessage (
> +  IN  IPMI_SEND_MESSAGE_REQUEST   *SendMessageRequest,
> +  IN  UINT32                      SendMessageRequestSize,
> +  OUT IPMI_SEND_MESSAGE_RESPONSE  *SendMessageResponse,
> +  IN OUT UINT32                   *SendMessageResponseSize
> +  );
> +
> +/**
> +  This function gets the system UUID.
> +
> +  @param[out] SystemGuid   The pointer to retrieve system UUID.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @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            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetChannelInfo (
> +  IN  IPMI_GET_CHANNEL_INFO_REQUEST   *GetChannelInfoRequest,
> +  OUT IPMI_GET_CHANNEL_INFO_RESPONSE  *GetChannelInfoResponse,
> +  OUT UINT32                          *GetChannelInfoResponseSize
> +  );
> +
> +//
> +// IPMI NetFnTransport
> +//
> +
> +/**
> +  This function activates SOL
> +
> +  @param[in]      SolActivatingRequest    SOL activating request.
> +  @param[out]     CompletionCode          The command completion code.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiSolActivating (
> +  IN  IPMI_SOL_ACTIVATING_REQUEST  *SolActivatingRequest,
> +  OUT UINT8                        *CompletionCode
> +  );
> +
> +/**
> +  This function sets SOL configuration parameters.
> +
> +  @param[in]      SetConfigurationParametersRequest      Set SOL
> configuration parameters
> +                                                         command request.
> +  @param[in]      SetConfigurationParametersRequestSize  Size of the set
> SOL configuration
> +                                                         parameters command request.
> +  @param[out]     CompletionCode                         The command completion
> code.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiSetSolConfigurationParameters (
> +  IN  IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST
> *SetConfigurationParametersRequest,
> +  IN  UINT32                                         SetConfigurationParametersRequestSize,
> +  OUT UINT8                                          *CompletionCode
> +  );
> +
> +/**
> +  This function gets SOL configuration parameters.
> +
> +  @param[in]      GetConfigurationParametersRequest        Get SOL
> configuration parameters
> +                                                           command request.
> +  @param[out]     GetConfigurationParametersResponse       Get SOL
> configuration parameters
> +                                                           response.
> +  @param[in,out]  GetConfigurationParametersResponseSize   When input,
> the size of the expected
> +                                                           response.
> +                                                           When output, the exact size of
> +                                                           expect response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetSolConfigurationParameters (
> +  IN  IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST
> *GetConfigurationParametersRequest,
> +  OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE
> *GetConfigurationParametersResponse,
> +  IN OUT UINT32
> *GetConfigurationParametersResponseSize
> +  );
> +
> +/**
> +  This function gets the LAN configuration parameter.
> +
> +  @param[in]     GetLanConfigurationParametersRequest   Get LAN
> configuration parameters command request.
> +  @param[in]     GetLanConfigurationParametersResponse  The response of
> the get LAN configuration parameters.
> +  @param[in,out] GetLanConfigurationParametersSize      When input, the
> expected size of response data.
> +                                                        When out, the exact  size of response data.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +
> +EFI_STATUS
> +EFIAPI
> +IpmiGetLanConfigurationParameters (
> +  IN   IPMI_GET_LAN_CONFIGURATION_PARAMETERS_REQUEST
> *GetLanConfigurationParametersRequest,
> +  OUT  IPMI_GET_LAN_CONFIGURATION_PARAMETERS_RESPONSE
> *GetLanConfigurationParametersResponse,
> +  IN OUT UINT32                                        *GetLanConfigurationParametersSize
> +  );
> +
> +//
> +// IPMI NetFnChasis
> +//
> +
> +/**
> +  This function gets chassis capability.
> +
> +  @param[out] GetChassisCapabilitiesResponse  Gets chassis capability
> command response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetChassisCapabilities (
> +  OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE
> +*GetChassisCapabilitiesResponse
> +  );
> +
> +/**
> +  This function gets chassis status.
> +
> +  @param[out] GetChassisCapabilitiesResponse  The get chassis status
> command response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetChassisStatus (
> +  OUT IPMI_GET_CHASSIS_STATUS_RESPONSE  *GetChassisStatusResponse
> +  );
> +
> +/**
> +  This function sends chassis control request.
> +
> +  @param[in]  ChassisControlRequest  The chassis control request.
> +  @param[out] CompletionCode         The command completion code.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiChassisControl (
> +  IN IPMI_CHASSIS_CONTROL_REQUEST  *ChassisControlRequest,
> +  OUT UINT8                        *CompletionCode
> +  );
> +
> +/**
> +  This function sets power restore policy.
> +
> +  @param[in]  SetPowerRestireRequest    The set power restore policy
> control
> +                                        command request.
> +  @param[out] SetPowerRestireResponse   The response of power restore
> policy.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiSetPowerRestorePolicy (
> +  IN  IPMI_SET_POWER_RESTORE_POLICY_REQUEST
> *SetPowerRestireRequest,
> +  OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE
> *SetPowerRestireResponse
> +  );
> +
> +//
> +// IPMI NetFnStorage
> +//
> +
> +/**
> +  This function sets system boot option.
> +
> +  @param[in]  BootOptionsRequest    Set system boot option request.
> +  @param[out] BootOptionsResponse   The response of set system boot
> +                                    option request.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiSetSystemBootOptions (
> +  IN  IPMI_SET_BOOT_OPTIONS_REQUEST   *BootOptionsRequest,
> +  OUT IPMI_SET_BOOT_OPTIONS_RESPONSE  *BootOptionsResponse
> +  );
> +
> +/**
> +  This function gets system boot option.
> +
> +  @param[in]  BootOptionsRequest    Get system boot option request.
> +  @param[out] BootOptionsResponse   The response of get system boot
> +                                    option request.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetSystemBootOptions (
> +  IN  IPMI_GET_BOOT_OPTIONS_REQUEST   *BootOptionsRequest,
> +  OUT IPMI_GET_BOOT_OPTIONS_RESPONSE  *BootOptionsResponse
> +  );
> +
> +/**
> +  This function gets FRU inventory area info.
> +
> +  @param[in]  GetFruInventoryAreaInfoRequest    Get FRU inventory area
> command request.
> +  @param[out] GetFruInventoryAreaInfoResponse   get FRU inventory area
> command response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetFruInventoryAreaInfo (
> +  IN  IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST
> *GetFruInventoryAreaInfoRequest,
> +  OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE
> +*GetFruInventoryAreaInfoResponse
> +  );
> +
> +/**
> +  This function reads FRU data.
> +
> +  @param[in]      ReadFruDataRequest       Read FRU data command request.
> +  @param[out]     ReadFruDataResponse      Read FRU data command
> response.
> +  @param[in,out]  ReadFruDataResponseSize  Size of the read FRU data
> response.
> +                                           When input, the expected size of response data.
> +                                           When out, the exact  size of response data.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiReadFruData (
> +  IN  IPMI_READ_FRU_DATA_REQUEST   *ReadFruDataRequest,
> +  OUT IPMI_READ_FRU_DATA_RESPONSE  *ReadFruDataResponse,
> +  IN OUT UINT32                    *ReadFruDataResponseSize
> +  );
> +
> +/**
> +  This function gets chassis capability.
> +
> +  @param[in]    WriteFruDataRequest      Write FRU data command request.
> +  @param[in]    WriteFruDataRequestSize  Size of the write FRU data
> command request.
> +  @param[out]   WriteFruDataResponse     Write FRU data response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiWriteFruData (
> +  IN  IPMI_WRITE_FRU_DATA_REQUEST   *WriteFruDataRequest,
> +  IN  UINT32                        WriteFruDataRequestSize,
> +  OUT IPMI_WRITE_FRU_DATA_RESPONSE  *WriteFruDataResponse
> +  );
> +
> +/**
> +  This function gets SEL information.
> +
> +  @param[out]    GetSelInfoResponse    Get SEL information command
> response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetSelInfo (
> +  OUT IPMI_GET_SEL_INFO_RESPONSE  *GetSelInfoResponse
> +  );
> +
> +/**
> +  This function gets SEL entry.
> +
> +  @param[in]      GetSelEntryRequest       Get SEL entry command request.
> +  @param[out]     GetSelEntryResponse      Get SEL entry command response.
> +  @param[in,out]  GetSelEntryResponseSize  Size of Get SEL entry request.
> +                                           When input, the expected size of response data.
> +                                           When out, the exact  size of response data.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetSelEntry (
> +  IN IPMI_GET_SEL_ENTRY_REQUEST    *GetSelEntryRequest,
> +  OUT IPMI_GET_SEL_ENTRY_RESPONSE  *GetSelEntryResponse,
> +  IN OUT UINT32                    *GetSelEntryResponseSize
> +  );
> +
> +/**
> +  This function adds SEL entry.
> +
> +  @param[in]    AddSelEntryRequest       Add SEL entry command request.
> +  @param[out]   AddSelEntryResponse      Add SEL entry command response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiAddSelEntry (
> +  IN IPMI_ADD_SEL_ENTRY_REQUEST    *AddSelEntryRequest,
> +  OUT IPMI_ADD_SEL_ENTRY_RESPONSE  *AddSelEntryResponse
> +  );
> +
> +/**
> +  This function partially adds SEL entry.
> +
> +  @param[in]    PartialAddSelEntryRequest      Partial add SEL entry command
> request.
> +  @param[in]    PartialAddSelEntryRequestSize  Size of partial add SEL entry
> command request.
> +  @param[out]   PartialAddSelEntryResponse     Partial add SEL entry
> command response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiPartialAddSelEntry (
> +  IN IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST
> *PartialAddSelEntryRequest,
> +  IN UINT32                                PartialAddSelEntryRequestSize,
> +  OUT IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE
> *PartialAddSelEntryResponse
> +  );
> +
> +/**
> +  This function clears SEL entry.
> +
> +  @param[in]    ClearSelRequest      Clear SEL command request.
> +  @param[out]   ClearSelResponse     Clear SEL command response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiClearSel (
> +  IN IPMI_CLEAR_SEL_REQUEST    *ClearSelRequest,
> +  OUT IPMI_CLEAR_SEL_RESPONSE  *ClearSelResponse
> +  );
> +
> +/**
> +  This function gets SEL time.
> +
> +  @param[out]   GetSelTimeResponse    Get SEL time command response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetSelTime (
> +  OUT IPMI_GET_SEL_TIME_RESPONSE  *GetSelTimeResponse
> +  );
> +
> +/**
> +  This function sets SEL time.
> +
> +  @param[in]    SetSelTimeRequest    Set SEL time command request.
> +  @param[out]   CompletionCode       Command completion code.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiSetSelTime (
> +  IN IPMI_SET_SEL_TIME_REQUEST  *SetSelTimeRequest,
> +  OUT UINT8                     *CompletionCode
> +  );
> +
> +/**
> +  This function gets SDR repository information.
> +
> +  @param[out]    GetSdrRepositoryInfoResp    Get SDR repository response.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetSdrRepositoryInfo (
> +  OUT IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE
> *GetSdrRepositoryInfoResp
> +  );
> +
> +/**
> +  This function gets SDR
> +
> +  @param[in]      GetSdrRequest        Get SDR resquest.
> +  @param[out]     GetSdrResponse       Get SDR response.
> +  @param[in,out]  GetSdrResponseSize   The size of get SDR response.
> +                                        When input, the expected size of response data.
> +                                        When out, the exact  size of response data.
> +
> +  @retval EFI_SUCCESS            Command is sent successly.
> +  @retval EFI_NOT_AVAILABLE_YET  Transport interface is not ready yet.
> +  @retval Other                  Failure.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +IpmiGetSdr (
> +  IN  IPMI_GET_SDR_REQUEST   *GetSdrRequest,
> +  OUT IPMI_GET_SDR_RESPONSE  *GetSdrResponse,
> +  IN OUT UINT32              *GetSdrResponseSize
> +  );
> +
> +#endif
> --
> 2.37.1.windows.1
> 
> 
> 
> 
> 

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

end of thread, other threads:[~2023-01-13  6:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-28  4:59 [PATCH 0/3] Add NULL IpmiCommandLib instance Chang, Abner
2022-12-28  4:59 ` [PATCH 1/3] MdeModulePkg/Include: Add IpmiCommandLib header file Chang, Abner
2023-01-13  0:11   ` [edk2-devel] " Isaac Oram
2023-01-13  6:04     ` Chang, Abner
2022-12-28  4:59 ` [PATCH 2/3] MdeModulePkg/IpmiCommandLib: Add NULL instance library Chang, Abner
2023-01-13  0:29   ` Isaac Oram
2022-12-28  4:59 ` [PATCH 3/3] MdeModulePkg: Add IpmiCommandLib Chang, Abner
2023-01-13  0:30   ` Isaac Oram
2022-12-29 17:31 ` [edk2-devel] [PATCH 0/3] Add NULL IpmiCommandLib instance Michael D Kinney
2022-12-30  4:09   ` Chang, Abner

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