TianoCore EDK2 master
Loading...
Searching...
No Matches
PeiIpmiLibIpmiPpi.c
Go to the documentation of this file.
1
9#include <PiPei.h>
10#include <Ppi/IpmiPpi.h>
11#include <Library/IpmiLib.h>
13#include <Library/DebugLib.h>
14
34EFIAPI
36 IN UINT8 NetFunction,
37 IN UINT8 Command,
38 IN UINT8 *RequestData,
39 IN UINT32 RequestDataSize,
40 OUT UINT8 *ResponseData,
41 IN OUT UINT32 *ResponseDataSize
42 )
43{
44 EFI_STATUS Status;
45 PEI_IPMI_PPI *IpmiPpi;
46
47 Status = PeiServicesLocatePpi (
48 &gPeiIpmiPpiGuid,
49 0,
50 NULL,
51 (VOID **)&IpmiPpi
52 );
53 if (EFI_ERROR (Status)) {
54 //
55 // Ipmi Ppi is not installed. So, IPMI device is not present.
56 //
57 DEBUG ((DEBUG_ERROR, "IpmiSubmitCommand in Pei Phase under SMS Status - %r\n", Status));
58 return EFI_NOT_FOUND;
59 }
60
61 Status = IpmiPpi->IpmiSubmitCommand (
62 IpmiPpi,
63 NetFunction,
64 Command,
65 RequestData,
66 RequestDataSize,
67 ResponseData,
68 ResponseDataSize
69 );
70 if (EFI_ERROR (Status)) {
71 return Status;
72 }
73
74 return EFI_SUCCESS;
75}
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define DEBUG(Expression)
Definition: DebugLib.h:434
EFI_STATUS EFIAPI IpmiSubmitCommand(IN UINT8 NetFunction, IN UINT8 Command, IN UINT8 *RequestData, IN UINT32 RequestDataSize, OUT UINT8 *ResponseData, IN OUT UINT32 *ResponseDataSize)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112