Skip to content

Commit

Permalink
Change IpmiBaseLibNull to BASE library type (#160)
Browse files Browse the repository at this point in the history
## Description

The IpmiBaseLibNull implementation currently restricts its library types
and consumes libraries that it does not use. This change cleans up and
generalizes the NULL imlementation.

- [x] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

Local build

## Integration Instructions

N/A
  • Loading branch information
cfernald authored Sep 20, 2023
1 parent d1f7ecb commit 0f3834b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions IpmiFeaturePkg/Include/Library/IpmiBaseLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
@retval EFI_NOT_FOUND Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
IpmiSubmitCommand (
IN UINT8 NetFunction,
IN UINT8 Command,
Expand All @@ -49,6 +50,7 @@ IpmiSubmitCommand (
@retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
GetBmcStatus (
OUT BMC_STATUS *BmcStatus,
OUT SM_COM_ADDRESS *ComAddress
Expand Down
2 changes: 2 additions & 0 deletions IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ STATIC IPMI_TRANSPORT *mIpmiTransport = NULL;
@retval EFI_NOT_FOUND Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
IpmiSubmitCommand (
IN UINT8 NetFunction,
IN UINT8 Command,
Expand Down Expand Up @@ -70,6 +71,7 @@ IpmiSubmitCommand (
@retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
GetBmcStatus (
OUT BMC_STATUS *BmcStatus,
OUT SM_COM_ADDRESS *ComAddress
Expand Down
6 changes: 3 additions & 3 deletions IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include <Uefi.h>
#include <Library/BaseLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DxeServicesLib.h>
#include <Library/DebugLib.h>
#include <Library/IpmiBaseLib.h>
#include <Ppi/IpmiTransportPpi.h>

/**
Sends a IPMI command to the BMC and returns the response.
Expand All @@ -28,6 +26,7 @@
@retval EFI_NOT_FOUND Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
IpmiSubmitCommand (
IN UINT8 NetFunction,
IN UINT8 Command,
Expand All @@ -50,6 +49,7 @@ IpmiSubmitCommand (
@retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
GetBmcStatus (
OUT BMC_STATUS *BmcStatus,
OUT SM_COM_ADDRESS *ComAddress
Expand Down
7 changes: 3 additions & 4 deletions IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
#
# @copyright
# Copyright 2011 - 2021 Intel Corporation. <BR>
# Copyright (c) Microsoft Corporation
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

[Defines]
INF_VERSION = 0x00010005
BASE_NAME = IpmiBaseLibNull
FILE_GUID = 3444CF4F-8B88-4579-9A95-2E7678C0E945
MODULE_TYPE = DXE_SMM_DRIVER
MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = IpmiBaseLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER SMM_CORE
LIBRARY_CLASS = IpmiBaseLib

#
# The following information is for reference only and not required by the build tools.
Expand All @@ -28,8 +29,6 @@

[LibraryClasses]
BaseLib
UefiBootServicesTableLib
DxeServicesLib
DebugLib

[Guids]
Expand Down
2 changes: 2 additions & 0 deletions IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@retval EFI_NOT_FOUND Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
IpmiSubmitCommand (
IN UINT8 NetFunction,
IN UINT8 Command,
Expand Down Expand Up @@ -68,6 +69,7 @@ IpmiSubmitCommand (
@retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
GetBmcStatus (
OUT BMC_STATUS *BmcStatus,
OUT SM_COM_ADDRESS *ComAddress
Expand Down
2 changes: 2 additions & 0 deletions IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ STATIC IPMI_TRANSPORT *mIpmiTransport = NULL;
@retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
IpmiSubmitCommand (
IN UINT8 NetFunction,
IN UINT8 Command,
Expand Down Expand Up @@ -72,6 +73,7 @@ IpmiSubmitCommand (
@retval EFI_NOT_FOUND Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
GetBmcStatus (
OUT BMC_STATUS *BmcStatus,
OUT SM_COM_ADDRESS *ComAddress
Expand Down
2 changes: 2 additions & 0 deletions IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ STATIC UINT8 ResponseBuffer[MOCK_BASE_IPMI_BUFFER_SIZE];
@retval EFI_NOT_FOUND Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
IpmiSubmitCommand (
IN UINT8 NetFunction,
IN UINT8 Command,
Expand Down Expand Up @@ -82,6 +83,7 @@ IpmiSubmitCommand (
@retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet.
**/
EFI_STATUS
EFIAPI
GetBmcStatus (
OUT BMC_STATUS *BmcStatus,
OUT SM_COM_ADDRESS *ComAddress
Expand Down

0 comments on commit 0f3834b

Please sign in to comment.