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.646.1573861758068923011 for ; Fri, 15 Nov 2019 15:49:18 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: nathaniel.l.desimone@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Nov 2019 15:49:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,310,1569308400"; d="scan'208";a="288701957" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by orsmga001.jf.intel.com with ESMTP; 15 Nov 2019 15:49:17 -0800 Received: from orsmsx163.amr.corp.intel.com (10.22.240.88) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 15 Nov 2019 15:49:17 -0800 Received: from orsmsx114.amr.corp.intel.com ([169.254.8.67]) by ORSMSX163.amr.corp.intel.com ([169.254.9.212]) with mapi id 14.03.0439.000; Fri, 15 Nov 2019 15:49:17 -0800 From: "Nate DeSimone" To: "devel@edk2.groups.io" , "Kubacki, Michael A" CC: "Chaganty, Rangasai V" , "Gao, Liming" Subject: Re: [edk2-devel] [edk2-platforms][PATCH V1 17/49] Features/Intel/IpmiFeaturePkg: Add libraries Thread-Topic: [edk2-devel] [edk2-platforms][PATCH V1 17/49] Features/Intel/IpmiFeaturePkg: Add libraries Thread-Index: AQHVmdKXlVfHNsK970KeG8jVMdX92aeMqxZg Date: Fri, 15 Nov 2019 23:49:16 +0000 Message-ID: <02A34F284D1DA44BB705E61F7180EF0AB5BDB221@ORSMSX114.amr.corp.intel.com> References: <20191113032816.4056-1-michael.a.kubacki@intel.com> <20191113032816.4056-18-michael.a.kubacki@intel.com> In-Reply-To: <20191113032816.4056-18-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjMwMmE1ZmMtODE3MS00OGJkLWI1OTgtOTQ2NTJhNTVkOTAxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRFVhcUV5QlwvaWtcLzFBWm81ckNEYlpsTUFYVDZrV2YxTmtKMzlQUUFuRnR4QlV0VTU0VGZxM00zem1IQTRkdmRHIn0= x-ctpclassification: CTP_NT x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Return-Path: nathaniel.l.desimone@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 1. IpmiFeaturePkg/Include/Library/IpmiCommandLib.h - Update copyright year 2. IpmiFeaturePkg/Include/Library/IpmiPlatformHookLib.h - Update copyright= year 3. IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c - Update= copyright year 4. IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnChassis.c - Up= date copyright year 5. IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnStorage.c - Up= date copyright year 6. IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c - = Update copyright year 7. IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.= c - Update copyright year -----Original Message----- From: devel@edk2.groups.io On Behalf Of Kubacki, Mi= chael A Sent: Tuesday, November 12, 2019 7:28 PM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Gao, Liming Subject: [edk2-devel] [edk2-platforms][PATCH V1 17/49] Features/Intel/Ipmi= FeaturePkg: Add libraries This change adds the libraries required for the IPMI feature to IpmiFeatur= ePkg. 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/= IpmiCommandLib.inf | 32 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHoo= kLibNull/IpmiPlatformHookLibNull.inf | 26 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiCom= mandLib.h | 235 +++++++++++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiPla= tformHookLib.h | 23 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/= IpmiCommandLibNetFnApp.c | 248 ++++++++++++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/= IpmiCommandLibNetFnChassis.c | 101 +++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/= IpmiCommandLibNetFnStorage.c | 275 ++++++++++++++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/= IpmiCommandLibNetFnTransport.c | 81 ++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHoo= kLibNull/IpmiPlatformHookLibNull.c | 36 +++ 12 files changed, 1143 insertions(+) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeature= Pkg.dec b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.= dec 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/Ipm= iFeature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Ip= miFeature.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 Managemen= t Interface (IPMI) advanced feature. +# This file should be included into another package DSC file to build thi= s 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 Makefil= e. +# +####################################################################### +######### +[Defines] + +####################################################################### +######### +# +# Library Class section - list of all Library Classes needed by this feat= ure. +# +####################################################################### +######### +[LibraryClasses] + ####################################### + # Edk2 Packages + ####################################### + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + +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 fea= ture. +# +# Note: The EDK II DSC file is not used to specify how compiled binary im= ages get placed +# into firmware volume images. This section is just a list of modul= es 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 P= I specification. +# There may also be modules listed in this section that are not req= uired in the FDF file, +# When a module listed here is excluded from FDF file, then UEFI-co= mpliant binary will be +# generated for it, but the binary will not be put into any firmwar= e 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. + + OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandL + ib.inf + 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 = appended to any +# standard flags that are defined by the build pro= cess. They can be +# applied for any modules or only those modules wi= th the specific +# module style (EDK or EDKII) specified in [Compon= ents] section. +# +####################################################################### +############################ +[BuildOptions] + *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeature= Pkg.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.= dsc 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/Ipm= iCommandLib/IpmiCommandLib.inf b/Features/Intel/OutOfBandManagement/IpmiFea= turePkg/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/Ipm= iPlatformHookLibNull/IpmiPlatformHookLibNull.inf b/Features/Intel/OutOfBand= Management/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookL= ibNull.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/Lib= rary/IpmiCommandLib.h b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/I= nclude/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 *SetConfigurationPar= ametersRequest, + IN UINT32 SetConfigurationPara= metersRequestSize, + OUT UINT8 *CompletionCode + ); + +EFI_STATUS +EFIAPI +IpmiGetSolConfigurationParameters ( + IN IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST +*GetConfigurationParametersRequest, + OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE *GetConfigurationPar= ametersResponse, + IN OUT UINT32 *GetConfigurationPar= ametersResponseSize + ); + +// +// 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 *GetFruInventoryAreaInfo= Request, + 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 diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Lib= rary/IpmiPlatformHookLib.h b/Features/Intel/OutOfBandManagement/IpmiFeature= Pkg/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/Ipm= iCommandLib/IpmiCommandLibNetFnApp.c b/Features/Intel/OutOfBandManagement/I= pmiFeaturePkg/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/Ipm= iCommandLib/IpmiCommandLibNetFnChassis.c b/Features/Intel/OutOfBandManageme= nt/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 +*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/Ipm= iCommandLib/IpmiCommandLibNetFnStorage.c b/Features/Intel/OutOfBandManageme= nt/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 *GetFruInventoryAreaInfo= Request, + OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE +*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/Ipm= iCommandLib/IpmiCommandLibNetFnTransport.c b/Features/Intel/OutOfBandManage= ment/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 *SetConfigurationPar= ametersRequest, + IN UINT32 SetConfigurationPara= metersRequestSize, + 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 +*GetConfigurationParametersRequest, + OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE *GetConfigurationPar= ametersResponse, + IN OUT UINT32 *GetConfigurationPar= ametersResponseSize + ) +{ + 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/Ipm= iPlatformHookLibNull/IpmiPlatformHookLibNull.c b/Features/Intel/OutOfBandMa= nagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLib= Null.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