hc
2024-03-22 a0752693d998599af469473b8dc239ef973a012f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/** @file
  IPMI common hook functions
 
  @copyright
  Copyright 2014 - 2021 Intel Corporation. <BR>
  SPDX-License-Identifier: BSD-2-Clause-Patent
**/
 
#include "IpmiHooks.h"
 
EFI_STATUS
IpmiSendCommand (
  IN      IPMI_TRANSPORT               *This,
  IN      UINT8                        NetFunction,
  IN      UINT8                        Lun,
  IN      UINT8                        Command,
  IN      UINT8                        *CommandData,
  IN      UINT32                       CommandDataSize,
  IN OUT  UINT8                        *ResponseData,
  IN OUT  UINT32                       *ResponseDataSize
  )
/*++
 
Routine Description:
 
  Send Ipmi Command in the right mode: HECI or KCS,  to the
  appropiate device, ME or BMC.
 
Arguments:
 
  This              - Pointer to IPMI protocol instance
  NetFunction       - Net Function of command to send
  Lun               - LUN of command to send
  Command           - IPMI command to send
  CommandData       - Pointer to command data buffer, if needed
  CommandDataSize   - Size of command data buffer
  ResponseData      - Pointer to response data buffer
  ResponseDataSize  - Pointer to response data buffer size
 
Returns:
 
  EFI_INVALID_PARAMETER - One of the input values is bad
  EFI_DEVICE_ERROR      - IPMI command failed
  EFI_BUFFER_TOO_SMALL  - Response buffer is too small
  EFI_UNSUPPORTED       - Command is not supported by BMC
  EFI_SUCCESS           - Command completed successfully
 
--*/
{
  //
  // This Will be unchanged ( BMC/KCS style )
  //
  return IpmiSendCommandToBmc (
           This,
           NetFunction,
           Lun,
           Command,
           CommandData,
           (UINT8) CommandDataSize,
           ResponseData,
           (UINT8*) ResponseDataSize,
           NULL
           );
} // IpmiSendCommand()
 
EFI_STATUS
IpmiGetBmcStatus (
  IN IPMI_TRANSPORT                *This,
  OUT BMC_STATUS                   *BmcStatus,
  OUT SM_COM_ADDRESS               *ComAddress
  )
/*++
 
Routine Description:
 
  Updates the BMC status and returns the Com Address
 
Arguments:
 
  This        - Pointer to IPMI protocol instance
  BmcStatus   - BMC status
  ComAddress  - Com Address
 
Returns:
 
  EFI_SUCCESS - Success
 
--*/
{
  return IpmiBmcStatus (
           This,
           BmcStatus,
           ComAddress,
           NULL
           );
}