2 This library abstract how to send/receive IPMI command.
4 Copyright (c) 2018-2021, Intel Corporation. All rights reserved.<BR>
5 Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef IPMI_COMMAND_LIB_H_
12 #define IPMI_COMMAND_LIB_H_
15 #include <IndustryStandard/Ipmi.h>
22 This function gets the IPMI Device ID.
24 @param[out] DeviceId Get device ID response.
26 @retval EFI_SUCCESS Command is sent successfully.
27 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
28 @retval Other Failure.
34 OUT IPMI_GET_DEVICE_ID_RESPONSE
*DeviceId
38 This function gets the self-test result.
40 @param[out] SelfTestResult Self test command response.
42 @retval EFI_SUCCESS Command is sent successfully.
43 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
44 @retval Other Failure.
49 IpmiGetSelfTestResult (
50 OUT IPMI_SELF_TEST_RESULT_RESPONSE
*SelfTestResult
54 This function resets watchdog timer.
56 @param[out] CompletionCode The command completion code.
58 @retval EFI_SUCCESS Command is sent successfully.
59 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
60 @retval Other Failure.
65 IpmiResetWatchdogTimer (
66 OUT UINT8
*CompletionCode
70 This function sets watchdog timer.
72 @param[in] SetWatchdogTimer Set watchdog timer request.
73 @param[out] CompletionCode The command completion code.
75 @retval EFI_SUCCESS Command is sent successfully.
76 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
77 @retval Other Failure.
83 IpmiSetWatchdogTimer (
84 IN IPMI_SET_WATCHDOG_TIMER_REQUEST
*SetWatchdogTimer
,
85 OUT UINT8
*CompletionCode
89 This function gets watchdog timer.
91 @param[out] GetWatchdogTimer Get watchdog timer response.
93 @retval EFI_SUCCESS Command is sent successfully.
94 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
95 @retval Other Failure.
100 IpmiGetWatchdogTimer (
101 OUT IPMI_GET_WATCHDOG_TIMER_RESPONSE
*GetWatchdogTimer
105 This function sets BMC global enables.
107 @param[in] SetBmcGlobalEnables Set BMC global enables command request.
108 @param[out] CompletionCode The command completion code.
110 @retval EFI_SUCCESS Command is sent successfully.
111 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
112 @retval Other Failure.
117 IpmiSetBmcGlobalEnables (
118 IN IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST
*SetBmcGlobalEnables
,
119 OUT UINT8
*CompletionCode
123 This function gets BMC global enables.
125 @param[out] GetBmcGlobalEnables Get BMC global enables command response.
127 @retval EFI_SUCCESS Command is sent successfully.
128 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
129 @retval Other Failure.
134 IpmiGetBmcGlobalEnables (
135 OUT IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE
*GetBmcGlobalEnables
139 This function clears message flag.
141 @param[in] ClearMessageFlagsRequest Clear message flags command request.
142 @param[out] CompletionCode The command completion code.
144 @retval EFI_SUCCESS Command is sent successfully.
145 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
146 @retval Other Failure.
151 IpmiClearMessageFlags (
152 IN IPMI_CLEAR_MESSAGE_FLAGS_REQUEST
*ClearMessageFlagsRequest
,
153 OUT UINT8
*CompletionCode
157 This function gets message flag.
159 @param[out] GetMessageFlagsResponse Get message flags response.
161 @retval EFI_SUCCESS Command is sent successfully.
162 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
163 @retval Other Failure.
168 IpmiGetMessageFlags (
169 OUT IPMI_GET_MESSAGE_FLAGS_RESPONSE
*GetMessageFlagsResponse
173 This function gets message.
175 @param[out] GetMessageResponse Get message command response.
176 @param[in,out] GetMessageResponseSize The size of get message response.
178 @retval EFI_SUCCESS Command is sent successfully.
179 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
180 @retval Other Failure.
186 OUT IPMI_GET_MESSAGE_RESPONSE
*GetMessageResponse
,
187 IN OUT UINT32
*GetMessageResponseSize
191 This function sends message.
193 @param[in] SendMessageRequest The send message command request.
194 @param[in] SendMessageRequestSize The size of the send message command request.
195 @param[out] SendMessageResponse The send message command response.
196 @param[in,out] SendMessageResponseSize The size of the send message command response.
197 When input, the expected size of response.
198 When output, the actual size of response.
200 @retval EFI_SUCCESS Command is sent successfully.
201 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
202 @retval Other Failure.
208 IN IPMI_SEND_MESSAGE_REQUEST
*SendMessageRequest
,
209 IN UINT32 SendMessageRequestSize
,
210 OUT IPMI_SEND_MESSAGE_RESPONSE
*SendMessageResponse
,
211 IN OUT UINT32
*SendMessageResponseSize
215 This function gets the system UUID.
217 @param[out] SystemGuid The pointer to retrieve system UUID.
219 @retval EFI_SUCCESS Command is sent successfully.
220 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
221 @retval Others Other errors.
227 OUT EFI_GUID
*SystemGuid
231 This function gets the channel information.
233 @param[in] GetChannelInfoRequest The get channel information request.
234 @param[in] GetChannelInfoResponse The get channel information response.
235 @param[in,out] GetChannelInfoResponseSize When input, the expected size of response.
236 When output, the exact size of the returned
239 @retval EFI_SUCCESS Command is sent successfully.
240 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
241 @retval Other Failure.
247 IN IPMI_GET_CHANNEL_INFO_REQUEST
*GetChannelInfoRequest
,
248 OUT IPMI_GET_CHANNEL_INFO_RESPONSE
*GetChannelInfoResponse
,
249 OUT UINT32
*GetChannelInfoResponseSize
253 // IPMI NetFnTransport
257 This function activates SOL
259 @param[in] SolActivatingRequest SOL activating request.
260 @param[out] CompletionCode The command completion code.
262 @retval EFI_SUCCESS Command is sent successfully.
263 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
264 @retval Other Failure.
270 IN IPMI_SOL_ACTIVATING_REQUEST
*SolActivatingRequest
,
271 OUT UINT8
*CompletionCode
275 This function sets SOL configuration parameters.
277 @param[in] SetConfigurationParametersRequest Set SOL configuration parameters
279 @param[in] SetConfigurationParametersRequestSize Size of the set SOL configuration
280 parameters command request.
281 @param[out] CompletionCode The command completion code.
283 @retval EFI_SUCCESS Command is sent successfully.
284 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
285 @retval Other Failure.
290 IpmiSetSolConfigurationParameters (
291 IN IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST
*SetConfigurationParametersRequest
,
292 IN UINT32 SetConfigurationParametersRequestSize
,
293 OUT UINT8
*CompletionCode
297 This function gets SOL configuration parameters.
299 @param[in] GetConfigurationParametersRequest Get SOL configuration parameters
301 @param[out] GetConfigurationParametersResponse Get SOL configuration parameters
303 @param[in,out] GetConfigurationParametersResponseSize When input, the size of the expected
305 When output, the exact size of
308 @retval EFI_SUCCESS Command is sent successfully.
309 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
310 @retval Other Failure.
315 IpmiGetSolConfigurationParameters (
316 IN IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST
*GetConfigurationParametersRequest
,
317 OUT IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE
*GetConfigurationParametersResponse
,
318 IN OUT UINT32
*GetConfigurationParametersResponseSize
322 This function gets the LAN configuration parameter.
324 @param[in] GetLanConfigurationParametersRequest Get LAN configuration parameters command request.
325 @param[in] GetLanConfigurationParametersResponse The response of the get LAN configuration parameters.
326 @param[in,out] GetLanConfigurationParametersSize When input, the expected size of response data.
327 When out, the exact size of response data.
329 @retval EFI_SUCCESS Command is sent successfully.
330 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
331 @retval Other Failure.
337 IpmiGetLanConfigurationParameters (
338 IN IPMI_GET_LAN_CONFIGURATION_PARAMETERS_REQUEST
*GetLanConfigurationParametersRequest
,
339 OUT IPMI_GET_LAN_CONFIGURATION_PARAMETERS_RESPONSE
*GetLanConfigurationParametersResponse
,
340 IN OUT UINT32
*GetLanConfigurationParametersSize
348 This function gets chassis capability.
350 @param[out] GetChassisCapabilitiesResponse Gets chassis capability command response.
352 @retval EFI_SUCCESS Command is sent successfully.
353 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
354 @retval Other Failure.
359 IpmiGetChassisCapabilities (
360 OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE
*GetChassisCapabilitiesResponse
364 This function gets chassis status.
366 @param[out] GetChassisCapabilitiesResponse The get chassis status command response.
368 @retval EFI_SUCCESS Command is sent successfully.
369 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
370 @retval Other Failure.
375 IpmiGetChassisStatus (
376 OUT IPMI_GET_CHASSIS_STATUS_RESPONSE
*GetChassisStatusResponse
380 This function sends chassis control request.
382 @param[in] ChassisControlRequest The chassis control request.
383 @param[out] CompletionCode The command completion code.
385 @retval EFI_SUCCESS Command is sent successfully.
386 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
387 @retval Other Failure.
393 IN IPMI_CHASSIS_CONTROL_REQUEST
*ChassisControlRequest
,
394 OUT UINT8
*CompletionCode
398 This function sets power restore policy.
400 @param[in] SetPowerRestireRequest The set power restore policy control
402 @param[out] SetPowerRestireResponse The response of power restore policy.
404 @retval EFI_SUCCESS Command is sent successfully.
405 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
406 @retval Other Failure.
411 IpmiSetPowerRestorePolicy (
412 IN IPMI_SET_POWER_RESTORE_POLICY_REQUEST
*SetPowerRestireRequest
,
413 OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE
*SetPowerRestireResponse
421 This function sets system boot option.
423 @param[in] BootOptionsRequest Set system boot option request.
424 @param[out] BootOptionsResponse The response of set system boot
427 @retval EFI_SUCCESS Command is sent successfully.
428 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
429 @retval Other Failure.
434 IpmiSetSystemBootOptions (
435 IN IPMI_SET_BOOT_OPTIONS_REQUEST
*BootOptionsRequest
,
436 OUT IPMI_SET_BOOT_OPTIONS_RESPONSE
*BootOptionsResponse
440 This function gets system boot option.
442 @param[in] BootOptionsRequest Get system boot option request.
443 @param[out] BootOptionsResponse The response of get system boot
446 @retval EFI_SUCCESS Command is sent successfully.
447 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
448 @retval Other Failure.
453 IpmiGetSystemBootOptions (
454 IN IPMI_GET_BOOT_OPTIONS_REQUEST
*BootOptionsRequest
,
455 OUT IPMI_GET_BOOT_OPTIONS_RESPONSE
*BootOptionsResponse
459 This function gets FRU inventory area info.
461 @param[in] GetFruInventoryAreaInfoRequest Get FRU inventory area command request.
462 @param[out] GetFruInventoryAreaInfoResponse get FRU inventory area command response.
464 @retval EFI_SUCCESS Command is sent successfully.
465 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
466 @retval Other Failure.
471 IpmiGetFruInventoryAreaInfo (
472 IN IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST
*GetFruInventoryAreaInfoRequest
,
473 OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE
*GetFruInventoryAreaInfoResponse
477 This function reads FRU data.
479 @param[in] ReadFruDataRequest Read FRU data command request.
480 @param[out] ReadFruDataResponse Read FRU data command response.
481 @param[in,out] ReadFruDataResponseSize Size of the read FRU data response.
482 When input, the expected size of response data.
483 When out, the exact size of response data.
485 @retval EFI_SUCCESS Command is sent successfully.
486 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
487 @retval Other Failure.
493 IN IPMI_READ_FRU_DATA_REQUEST
*ReadFruDataRequest
,
494 OUT IPMI_READ_FRU_DATA_RESPONSE
*ReadFruDataResponse
,
495 IN OUT UINT32
*ReadFruDataResponseSize
499 This function gets chassis capability.
501 @param[in] WriteFruDataRequest Write FRU data command request.
502 @param[in] WriteFruDataRequestSize Size of the write FRU data command request.
503 @param[out] WriteFruDataResponse Write FRU data response.
505 @retval EFI_SUCCESS Command is sent successfully.
506 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
507 @retval Other Failure.
513 IN IPMI_WRITE_FRU_DATA_REQUEST
*WriteFruDataRequest
,
514 IN UINT32 WriteFruDataRequestSize
,
515 OUT IPMI_WRITE_FRU_DATA_RESPONSE
*WriteFruDataResponse
519 This function gets SEL information.
521 @param[out] GetSelInfoResponse Get SEL information command response.
523 @retval EFI_SUCCESS Command is sent successfully.
524 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
525 @retval Other Failure.
531 OUT IPMI_GET_SEL_INFO_RESPONSE
*GetSelInfoResponse
535 This function gets SEL entry.
537 @param[in] GetSelEntryRequest Get SEL entry command request.
538 @param[out] GetSelEntryResponse Get SEL entry command response.
539 @param[in,out] GetSelEntryResponseSize Size of Get SEL entry request.
540 When input, the expected size of response data.
541 When out, the exact size of response data.
543 @retval EFI_SUCCESS Command is sent successfully.
544 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
545 @retval Other Failure.
551 IN IPMI_GET_SEL_ENTRY_REQUEST
*GetSelEntryRequest
,
552 OUT IPMI_GET_SEL_ENTRY_RESPONSE
*GetSelEntryResponse
,
553 IN OUT UINT32
*GetSelEntryResponseSize
557 This function adds SEL entry.
559 @param[in] AddSelEntryRequest Add SEL entry command request.
560 @param[out] AddSelEntryResponse Add SEL entry command response.
562 @retval EFI_SUCCESS Command is sent successfully.
563 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
564 @retval Other Failure.
570 IN IPMI_ADD_SEL_ENTRY_REQUEST
*AddSelEntryRequest
,
571 OUT IPMI_ADD_SEL_ENTRY_RESPONSE
*AddSelEntryResponse
575 This function partially adds SEL entry.
577 @param[in] PartialAddSelEntryRequest Partial add SEL entry command request.
578 @param[in] PartialAddSelEntryRequestSize Size of partial add SEL entry command request.
579 @param[out] PartialAddSelEntryResponse Partial add SEL entry command response.
581 @retval EFI_SUCCESS Command is sent successfully.
582 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
583 @retval Other Failure.
588 IpmiPartialAddSelEntry (
589 IN IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST
*PartialAddSelEntryRequest
,
590 IN UINT32 PartialAddSelEntryRequestSize
,
591 OUT IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE
*PartialAddSelEntryResponse
595 This function clears SEL entry.
597 @param[in] ClearSelRequest Clear SEL command request.
598 @param[out] ClearSelResponse Clear SEL command response.
600 @retval EFI_SUCCESS Command is sent successfully.
601 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
602 @retval Other Failure.
608 IN IPMI_CLEAR_SEL_REQUEST
*ClearSelRequest
,
609 OUT IPMI_CLEAR_SEL_RESPONSE
*ClearSelResponse
613 This function gets SEL time.
615 @param[out] GetSelTimeResponse Get SEL time command response.
617 @retval EFI_SUCCESS Command is sent successfully.
618 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
619 @retval Other Failure.
625 OUT IPMI_GET_SEL_TIME_RESPONSE
*GetSelTimeResponse
629 This function sets SEL time.
631 @param[in] SetSelTimeRequest Set SEL time command request.
632 @param[out] CompletionCode Command completion code.
634 @retval EFI_SUCCESS Command is sent successfully.
635 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
636 @retval Other Failure.
642 IN IPMI_SET_SEL_TIME_REQUEST
*SetSelTimeRequest
,
643 OUT UINT8
*CompletionCode
647 This function gets SDR repository information.
649 @param[out] GetSdrRepositoryInfoResp Get SDR repository response.
651 @retval EFI_SUCCESS Command is sent successfully.
652 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
653 @retval Other Failure.
657 IpmiGetSdrRepositoryInfo (
658 OUT IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE
*GetSdrRepositoryInfoResp
662 This function gets SDR
664 @param[in] GetSdrRequest Get SDR resquest.
665 @param[out] GetSdrResponse Get SDR response.
666 @param[in,out] GetSdrResponseSize The size of get SDR response.
667 When input, the expected size of response data.
668 When out, the exact size of response data.
670 @retval EFI_SUCCESS Command is sent successfully.
671 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
672 @retval Other Failure.
678 IN IPMI_GET_SDR_REQUEST
*GetSdrRequest
,
679 OUT IPMI_GET_SDR_RESPONSE
*GetSdrResponse
,
680 IN OUT UINT32
*GetSdrResponseSize