TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmIpmiLibSmmIpmiProtocol.c
Go to the documentation of this file.
1
9#include <PiSmm.h>
11#include <Library/IpmiLib.h>
13#include <Library/DebugLib.h>
14
15IPMI_PROTOCOL *mIpmiProtocol = NULL;
16
36EFIAPI
38 IN UINT8 NetFunction,
39 IN UINT8 Command,
40 IN UINT8 *RequestData,
41 IN UINT32 RequestDataSize,
42 OUT UINT8 *ResponseData,
43 IN OUT UINT32 *ResponseDataSize
44 )
45{
46 EFI_STATUS Status;
47
48 if (mIpmiProtocol == NULL) {
49 Status = gSmst->SmmLocateProtocol (
50 &gSmmIpmiProtocolGuid,
51 NULL,
52 (VOID **)&mIpmiProtocol
53 );
54 if (EFI_ERROR (Status)) {
55 //
56 // Smm Ipmi Protocol is not installed. So, IPMI device is not present.
57 //
58 DEBUG ((DEBUG_ERROR, "IpmiSubmitCommand for SMM Status - %r\n", Status));
59 return EFI_NOT_FOUND;
60 }
61 }
62
63 Status = mIpmiProtocol->IpmiSubmitCommand (
64 mIpmiProtocol,
65 NetFunction,
66 Command,
67 RequestData,
68 RequestDataSize,
69 ResponseData,
70 ResponseDataSize
71 );
72 if (EFI_ERROR (Status)) {
73 return Status;
74 }
75
76 return EFI_SUCCESS;
77}
#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_SMM_SYSTEM_TABLE2 * gSmst
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