You've already forked edk2-platforms
mirror of
https://github.com/Dasharo/edk2-platforms.git
synced 2026-03-06 14:51:43 -08:00
Features/Intel/IpmiFeaturePkg: Add libraries
This change adds the libraries required for the IPMI feature to IpmiFeaturePkg. Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com> Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com> Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
## @file
|
||||
# This is a build description file for the Intelligent Platform Management Interface (IPMI) advanced feature.
|
||||
# This file should be included into another package DSC file to build this feature.
|
||||
#
|
||||
# The DEC files are used by the utilities that parse DSC and
|
||||
# INF files to generate AutoGen.c and AutoGen.h files
|
||||
# for the build infrastructure.
|
||||
#
|
||||
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
##
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Defines Section - statements that will be processed to create a Makefile.
|
||||
#
|
||||
################################################################################
|
||||
[Defines]
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Library Class section - list of all Library Classes needed by this feature.
|
||||
#
|
||||
################################################################################
|
||||
[LibraryClasses]
|
||||
#######################################
|
||||
# Edk2 Packages
|
||||
#######################################
|
||||
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
|
||||
BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
|
||||
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
||||
IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Component section - list of all components that need built for this feature.
|
||||
#
|
||||
# Note: The EDK II DSC file is not used to specify how compiled binary images get placed
|
||||
# into firmware volume images. This section is just a list of modules to compile from
|
||||
# source into UEFI-compliant binaries.
|
||||
# It is the FDF file that contains information on combining binary files into firmware
|
||||
# volume images, whose concept is beyond UEFI and is described in PI specification.
|
||||
# There may also be modules listed in this section that are not required in the FDF file,
|
||||
# When a module listed here is excluded from FDF file, then UEFI-compliant binary will be
|
||||
# generated for it, but the binary will not be put into any firmware volume.
|
||||
#
|
||||
################################################################################
|
||||
[Components]
|
||||
#####################################
|
||||
# IPMI Feature Package
|
||||
#####################################
|
||||
|
||||
# Add library instances here that are not included in package components and should be tested
|
||||
# in the package build.
|
||||
OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf
|
||||
OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf
|
||||
|
||||
# Add components here that should be included in the package build.
|
||||
|
||||
###################################################################################################
|
||||
#
|
||||
# BuildOptions Section - Define the module specific tool chain flags that should be used as
|
||||
# the default flags for a module. These flags are appended to any
|
||||
# standard flags that are defined by the build process. They can be
|
||||
# applied for any modules or only those modules with the specific
|
||||
# module style (EDK or EDKII) specified in [Components] section.
|
||||
#
|
||||
###################################################################################################
|
||||
[BuildOptions]
|
||||
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
@@ -0,0 +1,235 @@
|
||||
/** @file
|
||||
This library abstract how to send/receive IPMI command.
|
||||
|
||||
Copyright (c) 2018, Intel Corporation. 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>
|
||||
|
||||
//
|
||||
// NetFnApp
|
||||
//
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetDeviceId (
|
||||
OUT IPMI_GET_DEVICE_ID_RESPONSE *DeviceId
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSelfTestResult (
|
||||
OUT IPMI_SELF_TEST_RESULT_RESPONSE *SelfTestResult
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiResetWatchdogTimer (
|
||||
OUT UINT8 *CompletionCode
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSetWatchdogTimer (
|
||||
IN IPMI_SET_WATCHDOG_TIMER_REQUEST *SetWatchdogTimer,
|
||||
OUT UINT8 *CompletionCode
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetWatchdogTimer (
|
||||
OUT IPMI_GET_WATCHDOG_TIMER_RESPONSE *GetWatchdogTimer
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSetBmcGlobalEnables (
|
||||
IN IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST *SetBmcGlobalEnables,
|
||||
OUT UINT8 *CompletionCode
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetBmcGlobalEnables (
|
||||
OUT IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE *GetBmcGlobalEnables
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiClearMessageFlags (
|
||||
IN IPMI_CLEAR_MESSAGE_FLAGS_REQUEST *ClearMessageFlagsRequest,
|
||||
OUT UINT8 *CompletionCode
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetMessageFlags (
|
||||
OUT IPMI_GET_MESSAGE_FLAGS_RESPONSE *GetMessageFlagsResponse
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetMessage (
|
||||
OUT IPMI_GET_MESSAGE_RESPONSE *GetMessageResponse,
|
||||
IN OUT UINT32 *GetMessageResponseSize
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSendMessage (
|
||||
IN IPMI_SEND_MESSAGE_REQUEST *SendMessageRequest,
|
||||
IN UINT32 SendMessageRequestSize,
|
||||
OUT IPMI_SEND_MESSAGE_RESPONSE *SendMessageResponse,
|
||||
IN OUT UINT32 *SendMessageResponseSize
|
||||
);
|
||||
|
||||
//
|
||||
// NetFnTransport
|
||||
//
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSolActivating (
|
||||
IN IPMI_SOL_ACTIVATING_REQUEST *SolActivatingRequest,
|
||||
OUT UINT8 *CompletionCode
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSetSolConfigurationParameters (
|
||||
IN IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST *SetConfigurationParametersRequest,
|
||||
IN UINT32 SetConfigurationParametersRequestSize,
|
||||
OUT UINT8 *CompletionCode
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSolConfigurationParameters (
|
||||
IN IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST *GetConfigurationParametersRequest,
|
||||
OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE *GetConfigurationParametersResponse,
|
||||
IN OUT UINT32 *GetConfigurationParametersResponseSize
|
||||
);
|
||||
|
||||
//
|
||||
// NetFnChasis
|
||||
//
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetChassisCapabilities (
|
||||
OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE *GetChassisCapabilitiesResponse
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetChassisStatus (
|
||||
OUT IPMI_GET_CHASSIS_STATUS_RESPONSE *GetChassisStatusResponse
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiChassisControl (
|
||||
IN IPMI_CHASSIS_CONTROL_REQUEST *ChassisControlRequest,
|
||||
OUT UINT8 *CompletionCode
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSetPowerRestorePolicy (
|
||||
IN IPMI_SET_POWER_RESTORE_POLICY_REQUEST *ChassisControlRequest,
|
||||
OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE *ChassisControlResponse
|
||||
);
|
||||
|
||||
//
|
||||
// NetFnStorage
|
||||
//
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetFruInventoryAreaInfo (
|
||||
IN IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST *GetFruInventoryAreaInfoRequest,
|
||||
OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE *GetFruInventoryAreaInfoResponse
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiReadFruData (
|
||||
IN IPMI_READ_FRU_DATA_REQUEST *ReadFruDataRequest,
|
||||
OUT IPMI_READ_FRU_DATA_RESPONSE *ReadFruDataResponse,
|
||||
IN OUT UINT32 *ReadFruDataResponseSize
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiWriteFruData (
|
||||
IN IPMI_WRITE_FRU_DATA_REQUEST *WriteFruDataRequest,
|
||||
IN UINT32 WriteFruDataRequestSize,
|
||||
OUT IPMI_WRITE_FRU_DATA_RESPONSE *WriteFruDataResponse
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSelInfo (
|
||||
OUT IPMI_GET_SEL_INFO_RESPONSE *GetSelInfoResponse
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSelEntry (
|
||||
IN IPMI_GET_SEL_ENTRY_REQUEST *GetSelEntryRequest,
|
||||
OUT IPMI_GET_SEL_ENTRY_RESPONSE *GetSelEntryResponse,
|
||||
IN OUT UINT32 *GetSelEntryResponseSize
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiAddSelEntry (
|
||||
IN IPMI_ADD_SEL_ENTRY_REQUEST *AddSelEntryRequest,
|
||||
OUT IPMI_ADD_SEL_ENTRY_RESPONSE *AddSelEntryResponse
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiPartialAddSelEntry (
|
||||
IN IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST *PartialAddSelEntryRequest,
|
||||
IN UINT32 PartialAddSelEntryRequestSize,
|
||||
OUT IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE *PartialAddSelEntryResponse
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiClearSel (
|
||||
IN IPMI_CLEAR_SEL_REQUEST *ClearSelRequest,
|
||||
OUT IPMI_CLEAR_SEL_RESPONSE *ClearSelResponse
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSelTime (
|
||||
OUT IPMI_GET_SEL_TIME_RESPONSE *GetSelTimeResponse
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSetSelTime (
|
||||
IN IPMI_SET_SEL_TIME_REQUEST *SetSelTimeRequest,
|
||||
OUT UINT8 *CompletionCode
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSdrRepositoryInfo (
|
||||
OUT IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE *GetSdrRepositoryInfoResp
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSdr (
|
||||
IN IPMI_GET_SDR_REQUEST *GetSdrRequest,
|
||||
OUT IPMI_GET_SDR_RESPONSE *GetSdrResponse,
|
||||
IN OUT UINT32 *GetSdrResponseSize
|
||||
);
|
||||
|
||||
#endif
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/** @file
|
||||
This library abstract the platform specific hook for IPMI.
|
||||
|
||||
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _IPMI_PLATFORM_UPDATE_LIB_H_
|
||||
#define _IPMI_PLATFORM_UPDATE_LIB_H_
|
||||
|
||||
#include <Uefi.h>
|
||||
#include <IndustryStandard/Acpi.h>
|
||||
#include <Protocol/Smbios.h>
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PlatformIpmiIoRangeSet(
|
||||
UINT16 IpmiIoBase
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,6 +22,15 @@
|
||||
[Includes]
|
||||
Include
|
||||
|
||||
[LibraryClasses]
|
||||
## @libraryclass Provides services to send IPMI commands.
|
||||
#
|
||||
IpmiCommandLib|Include/Library/IpmiCommandLib.inf
|
||||
|
||||
## @libraryclass Provides an API for platform-specific IPMI hooks.
|
||||
#
|
||||
IpmiCommandLib|Include/Library/IpmiPlatformHookLib.h
|
||||
|
||||
[Guids]
|
||||
gIpmiFeaturePkgTokenSpaceGuid = {0xc05283f6, 0xd6a8, 0x48f3, {0x9b, 0x59, 0xfb, 0xca, 0x71, 0x32, 0x0f, 0x12}}
|
||||
|
||||
|
||||
@@ -22,3 +22,8 @@
|
||||
SUPPORTED_ARCHITECTURES = IA32|X64
|
||||
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
|
||||
SKUID_IDENTIFIER = DEFAULT
|
||||
|
||||
#
|
||||
# This package always builds the feature.
|
||||
#
|
||||
!include Include/IpmiFeature.dsc
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
### @file
|
||||
# Component description file for IPMI Command Library.
|
||||
#
|
||||
# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
###
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = IpmiCommandLib
|
||||
FILE_GUID = E599C9C7-5913-40A0-8669-67282E2BEC53
|
||||
MODULE_TYPE = UEFI_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = IpmiCommandLib
|
||||
|
||||
[sources]
|
||||
IpmiCommandLibNetFnApp.c
|
||||
IpmiCommandLibNetFnTransport.c
|
||||
IpmiCommandLibNetFnChassis.c
|
||||
IpmiCommandLibNetFnStorage.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseMemoryLib
|
||||
DebugLib
|
||||
IpmiLib
|
||||
+248
@@ -0,0 +1,248 @@
|
||||
/** @file
|
||||
IPMI Command - NetFnApp.
|
||||
|
||||
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <PiPei.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/IpmiLib.h>
|
||||
|
||||
#include <IndustryStandard/Ipmi.h>
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetDeviceId (
|
||||
OUT IPMI_GET_DEVICE_ID_RESPONSE *DeviceId
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*DeviceId);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_APP,
|
||||
IPMI_APP_GET_DEVICE_ID,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)DeviceId,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSelfTestResult (
|
||||
OUT IPMI_SELF_TEST_RESULT_RESPONSE *SelfTestResult
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*SelfTestResult);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_APP,
|
||||
IPMI_APP_GET_SELFTEST_RESULTS,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)SelfTestResult,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiResetWatchdogTimer (
|
||||
OUT UINT8 *CompletionCode
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*CompletionCode);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_APP,
|
||||
IPMI_APP_RESET_WATCHDOG_TIMER,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)CompletionCode,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSetWatchdogTimer (
|
||||
IN IPMI_SET_WATCHDOG_TIMER_REQUEST *SetWatchdogTimer,
|
||||
OUT UINT8 *CompletionCode
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*CompletionCode);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_APP,
|
||||
IPMI_APP_SET_WATCHDOG_TIMER,
|
||||
(VOID *)SetWatchdogTimer,
|
||||
sizeof(*SetWatchdogTimer),
|
||||
(VOID *)CompletionCode,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetWatchdogTimer (
|
||||
OUT IPMI_GET_WATCHDOG_TIMER_RESPONSE *GetWatchdogTimer
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*GetWatchdogTimer);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_APP,
|
||||
IPMI_APP_GET_WATCHDOG_TIMER,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)GetWatchdogTimer,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSetBmcGlobalEnables (
|
||||
IN IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST *SetBmcGlobalEnables,
|
||||
OUT UINT8 *CompletionCode
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*CompletionCode);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_APP,
|
||||
IPMI_APP_SET_BMC_GLOBAL_ENABLES,
|
||||
(VOID *)SetBmcGlobalEnables,
|
||||
sizeof(*SetBmcGlobalEnables),
|
||||
(VOID *)CompletionCode,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetBmcGlobalEnables (
|
||||
OUT IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE *GetBmcGlobalEnables
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*GetBmcGlobalEnables);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_APP,
|
||||
IPMI_APP_GET_BMC_GLOBAL_ENABLES,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)GetBmcGlobalEnables,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiClearMessageFlags (
|
||||
IN IPMI_CLEAR_MESSAGE_FLAGS_REQUEST *ClearMessageFlagsRequest,
|
||||
OUT UINT8 *CompletionCode
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*CompletionCode);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_APP,
|
||||
IPMI_APP_CLEAR_MESSAGE_FLAGS,
|
||||
(VOID *)ClearMessageFlagsRequest,
|
||||
sizeof(*ClearMessageFlagsRequest),
|
||||
(VOID *)CompletionCode,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetMessageFlags (
|
||||
OUT IPMI_GET_MESSAGE_FLAGS_RESPONSE *GetMessageFlagsResponse
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*GetMessageFlagsResponse);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_APP,
|
||||
IPMI_APP_GET_MESSAGE_FLAGS,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)GetMessageFlagsResponse,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetMessage (
|
||||
OUT IPMI_GET_MESSAGE_RESPONSE *GetMessageResponse,
|
||||
IN OUT UINT32 *GetMessageResponseSize
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_APP,
|
||||
IPMI_APP_GET_MESSAGE,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)GetMessageResponse,
|
||||
GetMessageResponseSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSendMessage (
|
||||
IN IPMI_SEND_MESSAGE_REQUEST *SendMessageRequest,
|
||||
IN UINT32 SendMessageRequestSize,
|
||||
OUT IPMI_SEND_MESSAGE_RESPONSE *SendMessageResponse,
|
||||
IN OUT UINT32 *SendMessageResponseSize
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_APP,
|
||||
IPMI_APP_SEND_MESSAGE,
|
||||
(VOID *)SendMessageRequest,
|
||||
SendMessageRequestSize,
|
||||
(VOID *)SendMessageResponse,
|
||||
SendMessageResponseSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
/** @file
|
||||
IPMI Command - NetFnChassis.
|
||||
|
||||
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <PiPei.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/IpmiLib.h>
|
||||
|
||||
#include <IndustryStandard/Ipmi.h>
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetChassisCapabilities (
|
||||
OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE *GetChassisCapabilitiesResponse
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*GetChassisCapabilitiesResponse);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_CHASSIS,
|
||||
IPMI_CHASSIS_GET_CAPABILITIES,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)GetChassisCapabilitiesResponse,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetChassisStatus (
|
||||
OUT IPMI_GET_CHASSIS_STATUS_RESPONSE *GetChassisStatusResponse
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*GetChassisStatusResponse);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_CHASSIS,
|
||||
IPMI_CHASSIS_GET_STATUS,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)GetChassisStatusResponse,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiChassisControl (
|
||||
IN IPMI_CHASSIS_CONTROL_REQUEST *ChassisControlRequest,
|
||||
OUT UINT8 *CompletionCode
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*CompletionCode);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_CHASSIS,
|
||||
IPMI_CHASSIS_CONTROL,
|
||||
(VOID *)ChassisControlRequest,
|
||||
sizeof(*ChassisControlRequest),
|
||||
(VOID *)CompletionCode,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSetPowerRestorePolicy (
|
||||
IN IPMI_SET_POWER_RESTORE_POLICY_REQUEST *ChassisControlRequest,
|
||||
OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE *ChassisControlResponse
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*ChassisControlResponse);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_CHASSIS,
|
||||
IPMI_CHASSIS_SET_POWER_RESTORE_POLICY,
|
||||
(VOID *)ChassisControlRequest,
|
||||
sizeof(*ChassisControlRequest),
|
||||
(VOID *)ChassisControlResponse,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
+275
@@ -0,0 +1,275 @@
|
||||
/** @file
|
||||
IPMI Command - NetFnStorage.
|
||||
|
||||
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <PiPei.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/IpmiLib.h>
|
||||
|
||||
#include <IndustryStandard/Ipmi.h>
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetFruInventoryAreaInfo (
|
||||
IN IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST *GetFruInventoryAreaInfoRequest,
|
||||
OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE *GetFruInventoryAreaInfoResponse
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*GetFruInventoryAreaInfoResponse);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_GET_FRU_INVENTORY_AREAINFO,
|
||||
(VOID *)GetFruInventoryAreaInfoRequest,
|
||||
sizeof(*GetFruInventoryAreaInfoRequest),
|
||||
(VOID *)GetFruInventoryAreaInfoResponse,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiReadFruData (
|
||||
IN IPMI_READ_FRU_DATA_REQUEST *ReadFruDataRequest,
|
||||
OUT IPMI_READ_FRU_DATA_RESPONSE *ReadFruDataResponse,
|
||||
IN OUT UINT32 *ReadFruDataResponseSize
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_READ_FRU_DATA,
|
||||
(VOID *)ReadFruDataRequest,
|
||||
sizeof(*ReadFruDataRequest),
|
||||
(VOID *)ReadFruDataResponse,
|
||||
ReadFruDataResponseSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiWriteFruData (
|
||||
IN IPMI_WRITE_FRU_DATA_REQUEST *WriteFruDataRequest,
|
||||
IN UINT32 WriteFruDataRequestSize,
|
||||
OUT IPMI_WRITE_FRU_DATA_RESPONSE *WriteFruDataResponse
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*WriteFruDataResponse);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_WRITE_FRU_DATA,
|
||||
(VOID *)WriteFruDataRequest,
|
||||
WriteFruDataRequestSize,
|
||||
(VOID *)WriteFruDataResponse,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSelInfo (
|
||||
OUT IPMI_GET_SEL_INFO_RESPONSE *GetSelInfoResponse
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*GetSelInfoResponse);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_GET_SEL_INFO,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)GetSelInfoResponse,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSelEntry (
|
||||
IN IPMI_GET_SEL_ENTRY_REQUEST *GetSelEntryRequest,
|
||||
OUT IPMI_GET_SEL_ENTRY_RESPONSE *GetSelEntryResponse,
|
||||
IN OUT UINT32 *GetSelEntryResponseSize
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_GET_SEL_ENTRY,
|
||||
(VOID *)GetSelEntryRequest,
|
||||
sizeof(*GetSelEntryRequest),
|
||||
(VOID *)GetSelEntryResponse,
|
||||
GetSelEntryResponseSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiAddSelEntry (
|
||||
IN IPMI_ADD_SEL_ENTRY_REQUEST *AddSelEntryRequest,
|
||||
OUT IPMI_ADD_SEL_ENTRY_RESPONSE *AddSelEntryResponse
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*AddSelEntryResponse);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_ADD_SEL_ENTRY,
|
||||
(VOID *)AddSelEntryRequest,
|
||||
sizeof(*AddSelEntryRequest),
|
||||
(VOID *)AddSelEntryResponse,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiPartialAddSelEntry (
|
||||
IN IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST *PartialAddSelEntryRequest,
|
||||
IN UINT32 PartialAddSelEntryRequestSize,
|
||||
OUT IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE *PartialAddSelEntryResponse
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*PartialAddSelEntryResponse);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_PARTIAL_ADD_SEL_ENTRY,
|
||||
(VOID *)PartialAddSelEntryRequest,
|
||||
PartialAddSelEntryRequestSize,
|
||||
(VOID *)PartialAddSelEntryResponse,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiClearSel (
|
||||
IN IPMI_CLEAR_SEL_REQUEST *ClearSelRequest,
|
||||
OUT IPMI_CLEAR_SEL_RESPONSE *ClearSelResponse
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*ClearSelResponse);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_CLEAR_SEL,
|
||||
(VOID *)ClearSelRequest,
|
||||
sizeof(*ClearSelRequest),
|
||||
(VOID *)ClearSelResponse,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSelTime (
|
||||
OUT IPMI_GET_SEL_TIME_RESPONSE *GetSelTimeResponse
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*GetSelTimeResponse);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_GET_SEL_TIME,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)GetSelTimeResponse,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSetSelTime (
|
||||
IN IPMI_SET_SEL_TIME_REQUEST *SetSelTimeRequest,
|
||||
OUT UINT8 *CompletionCode
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*CompletionCode);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_SET_SEL_TIME,
|
||||
(VOID *)SetSelTimeRequest,
|
||||
sizeof(*SetSelTimeRequest),
|
||||
(VOID *)CompletionCode,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSdrRepositoryInfo (
|
||||
OUT IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE *GetSdrRepositoryInfoResp
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*GetSdrRepositoryInfoResp);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_GET_SDR_REPOSITORY_INFO,
|
||||
NULL,
|
||||
0,
|
||||
(VOID *)GetSdrRepositoryInfoResp,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSdr (
|
||||
IN IPMI_GET_SDR_REQUEST *GetSdrRequest,
|
||||
OUT IPMI_GET_SDR_RESPONSE *GetSdrResponse,
|
||||
IN OUT UINT32 *GetSdrResponseSize
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_STORAGE,
|
||||
IPMI_STORAGE_GET_SDR,
|
||||
(VOID *)GetSdrRequest,
|
||||
sizeof(*GetSdrRequest),
|
||||
(VOID *)GetSdrResponse,
|
||||
GetSdrResponseSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/** @file
|
||||
IPMI Command - NetFnTransport.
|
||||
|
||||
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <PiPei.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/IpmiLib.h>
|
||||
|
||||
#include <IndustryStandard/Ipmi.h>
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSolActivating (
|
||||
IN IPMI_SOL_ACTIVATING_REQUEST *SolActivatingRequest,
|
||||
OUT UINT8 *CompletionCode
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*CompletionCode);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_TRANSPORT,
|
||||
IPMI_TRANSPORT_SOL_ACTIVATING,
|
||||
(VOID *)SolActivatingRequest,
|
||||
sizeof(*SolActivatingRequest),
|
||||
(VOID *)CompletionCode,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiSetSolConfigurationParameters (
|
||||
IN IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST *SetConfigurationParametersRequest,
|
||||
IN UINT32 SetConfigurationParametersRequestSize,
|
||||
OUT UINT8 *CompletionCode
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 DataSize;
|
||||
|
||||
DataSize = sizeof(*CompletionCode);
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_TRANSPORT,
|
||||
IPMI_TRANSPORT_SET_SOL_CONFIG_PARAM,
|
||||
(VOID *)SetConfigurationParametersRequest,
|
||||
SetConfigurationParametersRequestSize,
|
||||
(VOID *)CompletionCode,
|
||||
&DataSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IpmiGetSolConfigurationParameters (
|
||||
IN IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST *GetConfigurationParametersRequest,
|
||||
OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE *GetConfigurationParametersResponse,
|
||||
IN OUT UINT32 *GetConfigurationParametersResponseSize
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = IpmiSubmitCommand (
|
||||
IPMI_NETFN_TRANSPORT,
|
||||
IPMI_TRANSPORT_GET_SOL_CONFIG_PARAM,
|
||||
(VOID *)GetConfigurationParametersRequest,
|
||||
sizeof(*GetConfigurationParametersRequest),
|
||||
(VOID *)GetConfigurationParametersResponse,
|
||||
GetConfigurationParametersResponseSize
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
/** @file
|
||||
IPMI platform hook library.
|
||||
|
||||
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <Library/IpmiPlatformHookLib.h>
|
||||
|
||||
//
|
||||
// Prototype definitions for IPMI Platform Update Library
|
||||
//
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PlatformIpmiIoRangeSet(
|
||||
UINT16 IpmiIoBase
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function sets IPMI Io range
|
||||
|
||||
Arguments:
|
||||
|
||||
IpmiIoBase
|
||||
|
||||
Returns:
|
||||
|
||||
Status
|
||||
|
||||
--*/
|
||||
{
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
### @file
|
||||
# Component description file for IPMI platform Library.
|
||||
#
|
||||
# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
###
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = IpmiPlatformHookLibNull
|
||||
FILE_GUID = C31A5B17-81DB-4D86-B376-17711BB6E0A5
|
||||
MODULE_TYPE = BASE
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = IpmiPlatformHookLib
|
||||
|
||||
[sources]
|
||||
IpmiPlatformHookLibNull.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
DebugLib
|
||||
Reference in New Issue
Block a user