From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.1046.1575447028528292883 for ; Wed, 04 Dec 2019 00:10:28 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: rangasai.v.chaganty@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Dec 2019 00:10:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,276,1571727600"; d="scan'208";a="361479534" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 04 Dec 2019 00:10:27 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Dec 2019 00:10:27 -0800 Received: from fmsmsx104.amr.corp.intel.com ([169.254.3.245]) by fmsmsx101.amr.corp.intel.com ([169.254.1.25]) with mapi id 14.03.0439.000; Wed, 4 Dec 2019 00:10:27 -0800 From: "Chaganty, Rangasai V" To: "Kubacki, Michael A" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [edk2-platforms][PATCH V2 14/47] Features/Intel/IpmiFeaturePkg: Add libraries Thread-Topic: [edk2-platforms][PATCH V2 14/47] Features/Intel/IpmiFeaturePkg: Add libraries Thread-Index: AQHVpYgxIFntmINVhE+l3wGryUZwpaepqWlA Date: Wed, 4 Dec 2019 08:10:26 +0000 Message-ID: References: <20191128010614.43628-1-michael.a.kubacki@intel.com> <20191128010614.43628-15-michael.a.kubacki@intel.com> In-Reply-To: <20191128010614.43628-15-michael.a.kubacki@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzUxZjAxMzAtZGY0Mi00MGI1LWFjZjEtZTU5NTNlYzZhMzhmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZFpVOFA1aDB3NG8zUFVUTkdxRURVcEV5Z3IydVdoRW5lTjRCdUZIYmFoeW9cL1wvT21kR1ljVGhVVnNVWHNEeE9zIn0= x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Return-Path: rangasai.v.chaganty@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sai Chaganty -----Original Message----- From: Kubacki, Michael A=20 Sent: Wednesday, November 27, 2019 5:06 PM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Gao, Liming Subject: [edk2-platforms][PATCH V2 14/47] Features/Intel/IpmiFeaturePkg: Ad= d libraries This change adds the libraries required for the IPMI feature to IpmiFeature= Pkg. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki --- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec = | 9 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc = | 72 +++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc = | 5 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/I= pmiCommandLib.inf | 32 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHook= LibNull/IpmiPlatformHookLibNull.inf | 26 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiComm= andLib.h | 235 +++++++++++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiPlat= formHookLib.h | 23 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/I= pmiCommandLibNetFnApp.c | 248 ++++++++++++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/I= pmiCommandLibNetFnChassis.c | 101 +++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/I= pmiCommandLibNetFnStorage.c | 275 ++++++++++++++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/I= pmiCommandLibNetFnTransport.c | 81 ++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHook= LibNull/IpmiPlatformHookLibNull.c | 36 +++ 12 files changed, 1143 insertions(+) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeatureP= kg.dec b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.d= ec index dfa8888e88..4c43fc5f49 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.d +++ ec @@ -22,6 +22,15 @@ [Includes] Include =20 +[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 =3D {0xc05283f6, 0xd6a8, 0x48f3, {0x9b, = 0x59, 0xfb, 0xca, 0x71, 0x32, 0x0f, 0x12}} =20 diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Ipmi= Feature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Ipm= iFeature.dsc new file mode 100644 index 0000000000..c6a385108b --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeat +++ ure.dsc @@ -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=20 +files to generate AutoGen.c and AutoGen.h files # for the build=20 +infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
# #=20 +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 featu= re. +# +####################################################################### +######### +[LibraryClasses] + ####################################### + # Edk2 Packages + ####################################### + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + =20 +BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.in +f + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf + +####################################################################### +######### +# +# Component section - list of all components that need built for this feat= ure. +# +# Note: The EDK II DSC file is not used to specify how compiled binary ima= ges get placed +# into firmware volume images. This section is just a list of module= s to compile from +# source into UEFI-compliant binaries. +# It is the FDF file that contains information on combining binary f= iles 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 requ= ired in the FDF file, +# When a module listed here is excluded from FDF file, then UEFI-com= pliant 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=20 + components and should be tested # in the package build. + =20 + OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandL + ib.inf =20 + OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/Ipm + iPlatformHookLibNull.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 a= ppended to any +# standard flags that are defined by the build proc= ess. They can be +# applied for any modules or only those modules wit= h the specific +# module style (EDK or EDKII) specified in [Compone= nts] section. +# +####################################################################### +############################ +[BuildOptions] + *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeatureP= kg.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.d= sc index 1952ba185e..623a52650f 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.d +++ sc @@ -22,3 +22,8 @@ SUPPORTED_ARCHITECTURES =3D IA32|X64 BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT SKUID_IDENTIFIER =3D DEFAULT + +# +# This package always builds the feature. +# +!include Include/IpmiFeature.dsc diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/Ipmi= CommandLib/IpmiCommandLib.inf b/Features/Intel/OutOfBandManagement/IpmiFeat= urePkg/Library/IpmiCommandLib/IpmiCommandLib.inf new file mode 100644 index 0000000000..0bdace8688 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiComm +++ andLib/IpmiCommandLib.inf @@ -0,0 +1,32 @@ +### @file +# Component description file for IPMI Command Library. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights=20 +reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # ### + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D IpmiCommandLib + FILE_GUID =3D E599C9C7-5913-40A0-8669-67282E2BEC53 + MODULE_TYPE =3D UEFI_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D 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 diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/Ipmi= PlatformHookLibNull/IpmiPlatformHookLibNull.inf b/Features/Intel/OutOfBandM= anagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLi= bNull.inf new file mode 100644 index 0000000000..ab270079aa --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlat +++ formHookLibNull/IpmiPlatformHookLibNull.inf @@ -0,0 +1,26 @@ +### @file +# Component description file for IPMI platform Library. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights=20 +reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # ### + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D IpmiPlatformHookLibNull + FILE_GUID =3D C31A5B17-81DB-4D86-B376-17711BB6E0A5 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D IpmiPlatformHookLib + +[sources] + IpmiPlatformHookLibNull.c + +[Packages] + MdePkg/MdePkg.dec + OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + +[LibraryClasses] + DebugLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Libr= ary/IpmiCommandLib.h b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/In= clude/Library/IpmiCommandLib.h new file mode 100644 index 0000000000..9b761717d4 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/ +++ IpmiCommandLib.h @@ -0,0 +1,235 @@ +/** @file + This library abstract how to send/receive IPMI command. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _IPMI_COMMAND_LIB_H_ +#define _IPMI_COMMAND_LIB_H_ + +#include +#include + +// +// 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 *SetConfigurationPara= metersRequest, + IN UINT32 SetConfigurationParam= etersRequestSize, + OUT UINT8 *CompletionCode + ); + +EFI_STATUS +EFIAPI +IpmiGetSolConfigurationParameters ( + IN IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST =20 +*GetConfigurationParametersRequest, + OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE *GetConfigurationPara= metersResponse, + IN OUT UINT32 *GetConfigurationPara= metersResponseSize + ); + +// +// NetFnChasis +// +EFI_STATUS +EFIAPI +IpmiGetChassisCapabilities ( + OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE =20 +*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 *GetFruInventoryAreaInfoR= equest, + OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE =20 +*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 diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Libr= ary/IpmiPlatformHookLib.h b/Features/Intel/OutOfBandManagement/IpmiFeatureP= kg/Include/Library/IpmiPlatformHookLib.h new file mode 100644 index 0000000000..8359e3f38b --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/ +++ IpmiPlatformHookLib.h @@ -0,0 +1,23 @@ +/** @file + This library abstract the platform specific hook for IPMI. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _IPMI_PLATFORM_UPDATE_LIB_H_ +#define _IPMI_PLATFORM_UPDATE_LIB_H_ + +#include +#include +#include + +EFI_STATUS +EFIAPI +PlatformIpmiIoRangeSet( + UINT16 IpmiIoBase + ); + +#endif + diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/Ipmi= CommandLib/IpmiCommandLibNetFnApp.c b/Features/Intel/OutOfBandManagement/Ip= miFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c new file mode 100644 index 0000000000..b57db50610 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiComm +++ andLib/IpmiCommandLibNetFnApp.c @@ -0,0 +1,248 @@ +/** @file + IPMI Command - NetFnApp. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include + +#include + +EFI_STATUS +EFIAPI +IpmiGetDeviceId ( + OUT IPMI_GET_DEVICE_ID_RESPONSE *DeviceId + ) +{ + EFI_STATUS Status; + UINT32 DataSize; + + DataSize =3D sizeof(*DeviceId); + Status =3D 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 =3D sizeof(*SelfTestResult); + Status =3D 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 =3D sizeof(*CompletionCode); + Status =3D 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 =3D sizeof(*CompletionCode); + Status =3D 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 =3D sizeof(*GetWatchdogTimer); + Status =3D 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 =3D sizeof(*CompletionCode); + Status =3D 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 =3D sizeof(*GetBmcGlobalEnables); + Status =3D 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 =3D sizeof(*CompletionCode); + Status =3D 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 =3D sizeof(*GetMessageFlagsResponse); + Status =3D 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 =3D 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 =3D IpmiSubmitCommand ( + IPMI_NETFN_APP, + IPMI_APP_SEND_MESSAGE, + (VOID *)SendMessageRequest, + SendMessageRequestSize, + (VOID *)SendMessageResponse, + SendMessageResponseSize + ); + return Status; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/Ipmi= CommandLib/IpmiCommandLibNetFnChassis.c b/Features/Intel/OutOfBandManagemen= t/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnChassis.c new file mode 100644 index 0000000000..1b86aa888e --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiComm +++ andLib/IpmiCommandLibNetFnChassis.c @@ -0,0 +1,101 @@ +/** @file + IPMI Command - NetFnChassis. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include + +#include + + +EFI_STATUS +EFIAPI +IpmiGetChassisCapabilities ( + OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE =20 +*GetChassisCapabilitiesResponse + ) +{ + EFI_STATUS Status; + UINT32 DataSize; + + DataSize =3D sizeof(*GetChassisCapabilitiesResponse); + Status =3D 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 =3D sizeof(*GetChassisStatusResponse); + Status =3D 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 =3D sizeof(*CompletionCode); + Status =3D 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 =3D sizeof(*ChassisControlResponse); + Status =3D IpmiSubmitCommand ( + IPMI_NETFN_CHASSIS, + IPMI_CHASSIS_SET_POWER_RESTORE_POLICY, + (VOID *)ChassisControlRequest, + sizeof(*ChassisControlRequest), + (VOID *)ChassisControlResponse, + &DataSize + ); + return Status; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/Ipmi= CommandLib/IpmiCommandLibNetFnStorage.c b/Features/Intel/OutOfBandManagemen= t/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnStorage.c new file mode 100644 index 0000000000..8e892c5f84 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiComm +++ andLib/IpmiCommandLibNetFnStorage.c @@ -0,0 +1,275 @@ +/** @file + IPMI Command - NetFnStorage. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include + +#include + + +EFI_STATUS +EFIAPI +IpmiGetFruInventoryAreaInfo ( + IN IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST *GetFruInventoryAreaInfoR= equest, + OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE =20 +*GetFruInventoryAreaInfoResponse + ) +{ + EFI_STATUS Status; + UINT32 DataSize; + + DataSize =3D sizeof(*GetFruInventoryAreaInfoResponse); + Status =3D 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 =3D 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 =3D sizeof(*WriteFruDataResponse); + Status =3D 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 =3D sizeof(*GetSelInfoResponse); + Status =3D 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 =3D 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 =3D sizeof(*AddSelEntryResponse); + Status =3D 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 =3D sizeof(*PartialAddSelEntryResponse); + Status =3D 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 =3D sizeof(*ClearSelResponse); + Status =3D 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 =3D sizeof(*GetSelTimeResponse); + Status =3D 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 =3D sizeof(*CompletionCode); + Status =3D 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 =3D sizeof(*GetSdrRepositoryInfoResp); + Status =3D 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 =3D IpmiSubmitCommand ( + IPMI_NETFN_STORAGE, + IPMI_STORAGE_GET_SDR, + (VOID *)GetSdrRequest, + sizeof(*GetSdrRequest), + (VOID *)GetSdrResponse, + GetSdrResponseSize + ); + return Status; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/Ipmi= CommandLib/IpmiCommandLibNetFnTransport.c b/Features/Intel/OutOfBandManagem= ent/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c new file mode 100644 index 0000000000..3b9b17b909 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiComm +++ andLib/IpmiCommandLibNetFnTransport.c @@ -0,0 +1,81 @@ +/** @file + IPMI Command - NetFnTransport. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include + +#include + + +EFI_STATUS +EFIAPI +IpmiSolActivating ( + IN IPMI_SOL_ACTIVATING_REQUEST *SolActivatingRequest, + OUT UINT8 *CompletionCode + ) +{ + EFI_STATUS Status; + UINT32 DataSize; + + DataSize =3D sizeof(*CompletionCode); + Status =3D 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 *SetConfigurationPara= metersRequest, + IN UINT32 SetConfigurationParam= etersRequestSize, + OUT UINT8 *CompletionCode + ) +{ + EFI_STATUS Status; + UINT32 DataSize; + + DataSize =3D sizeof(*CompletionCode); + Status =3D 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 =20 +*GetConfigurationParametersRequest, + OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE *GetConfigurationPara= metersResponse, + IN OUT UINT32 *GetConfigurationPara= metersResponseSize + ) +{ + EFI_STATUS Status; + + Status =3D IpmiSubmitCommand ( + IPMI_NETFN_TRANSPORT, + IPMI_TRANSPORT_GET_SOL_CONFIG_PARAM, + (VOID *)GetConfigurationParametersRequest, + sizeof(*GetConfigurationParametersRequest), + (VOID *)GetConfigurationParametersResponse, + GetConfigurationParametersResponseSize + ); + return Status; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/Ipmi= PlatformHookLibNull/IpmiPlatformHookLibNull.c b/Features/Intel/OutOfBandMan= agement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibN= ull.c new file mode 100644 index 0000000000..bdc8d23827 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlat +++ formHookLibNull/IpmiPlatformHookLibNull.c @@ -0,0 +1,36 @@ +/** @file + IPMI platform hook library. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +// +// Prototype definitions for IPMI Platform Update Library // EFI_STATUS=20 +EFIAPI PlatformIpmiIoRangeSet( + UINT16 IpmiIoBase + ) +/*++ + + Routine Description: + + This function sets IPMI Io range + + Arguments: + + IpmiIoBase + + Returns: + + Status + +--*/ +{ + return EFI_SUCCESS; +} -- 2.16.2.windows.1