]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/IpmiCommandLib.h
MdeModulePkg/Include: Add IpmiCommandLib header file
[mirror_edk2.git] / MdeModulePkg / Include / Library / IpmiCommandLib.h
1 /** @file
2 This library abstract how to send/receive IPMI command.
3
4 Copyright (c) 2018-2021, Intel Corporation. All rights reserved.<BR>
5 Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef IPMI_COMMAND_LIB_H_
12 #define IPMI_COMMAND_LIB_H_
13
14 #include <Uefi.h>
15 #include <IndustryStandard/Ipmi.h>
16
17 //
18 // IPMI NetFnApp
19 //
20
21 /**
22 This function gets the IPMI Device ID.
23
24 @param[out] DeviceId Get device ID response.
25
26 @retval EFI_SUCCESS Command is sent successfully.
27 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
28 @retval Other Failure.
29
30 **/
31 EFI_STATUS
32 EFIAPI
33 IpmiGetDeviceId (
34 OUT IPMI_GET_DEVICE_ID_RESPONSE *DeviceId
35 );
36
37 /**
38 This function gets the self-test result.
39
40 @param[out] SelfTestResult Self test command response.
41
42 @retval EFI_SUCCESS Command is sent successfully.
43 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
44 @retval Other Failure.
45
46 **/
47 EFI_STATUS
48 EFIAPI
49 IpmiGetSelfTestResult (
50 OUT IPMI_SELF_TEST_RESULT_RESPONSE *SelfTestResult
51 );
52
53 /**
54 This function resets watchdog timer.
55
56 @param[out] CompletionCode The command completion code.
57
58 @retval EFI_SUCCESS Command is sent successfully.
59 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
60 @retval Other Failure.
61
62 **/
63 EFI_STATUS
64 EFIAPI
65 IpmiResetWatchdogTimer (
66 OUT UINT8 *CompletionCode
67 );
68
69 /**
70 This function sets watchdog timer.
71
72 @param[in] SetWatchdogTimer Set watchdog timer request.
73 @param[out] CompletionCode The command completion code.
74
75 @retval EFI_SUCCESS Command is sent successfully.
76 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
77 @retval Other Failure.
78
79
80 **/
81 EFI_STATUS
82 EFIAPI
83 IpmiSetWatchdogTimer (
84 IN IPMI_SET_WATCHDOG_TIMER_REQUEST *SetWatchdogTimer,
85 OUT UINT8 *CompletionCode
86 );
87
88 /**
89 This function gets watchdog timer.
90
91 @param[out] GetWatchdogTimer Get watchdog timer response.
92
93 @retval EFI_SUCCESS Command is sent successfully.
94 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
95 @retval Other Failure.
96
97 **/
98 EFI_STATUS
99 EFIAPI
100 IpmiGetWatchdogTimer (
101 OUT IPMI_GET_WATCHDOG_TIMER_RESPONSE *GetWatchdogTimer
102 );
103
104 /**
105 This function sets BMC global enables.
106
107 @param[in] SetBmcGlobalEnables Set BMC global enables command request.
108 @param[out] CompletionCode The command completion code.
109
110 @retval EFI_SUCCESS Command is sent successfully.
111 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
112 @retval Other Failure.
113
114 **/
115 EFI_STATUS
116 EFIAPI
117 IpmiSetBmcGlobalEnables (
118 IN IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST *SetBmcGlobalEnables,
119 OUT UINT8 *CompletionCode
120 );
121
122 /**
123 This function gets BMC global enables.
124
125 @param[out] GetBmcGlobalEnables Get BMC global enables command response.
126
127 @retval EFI_SUCCESS Command is sent successfully.
128 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
129 @retval Other Failure.
130
131 **/
132 EFI_STATUS
133 EFIAPI
134 IpmiGetBmcGlobalEnables (
135 OUT IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE *GetBmcGlobalEnables
136 );
137
138 /**
139 This function clears message flag.
140
141 @param[in] ClearMessageFlagsRequest Clear message flags command request.
142 @param[out] CompletionCode The command completion code.
143
144 @retval EFI_SUCCESS Command is sent successfully.
145 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
146 @retval Other Failure.
147
148 **/
149 EFI_STATUS
150 EFIAPI
151 IpmiClearMessageFlags (
152 IN IPMI_CLEAR_MESSAGE_FLAGS_REQUEST *ClearMessageFlagsRequest,
153 OUT UINT8 *CompletionCode
154 );
155
156 /**
157 This function gets message flag.
158
159 @param[out] GetMessageFlagsResponse Get message flags response.
160
161 @retval EFI_SUCCESS Command is sent successfully.
162 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
163 @retval Other Failure.
164
165 **/
166 EFI_STATUS
167 EFIAPI
168 IpmiGetMessageFlags (
169 OUT IPMI_GET_MESSAGE_FLAGS_RESPONSE *GetMessageFlagsResponse
170 );
171
172 /**
173 This function gets message.
174
175 @param[out] GetMessageResponse Get message command response.
176 @param[in,out] GetMessageResponseSize The size of get message response.
177
178 @retval EFI_SUCCESS Command is sent successfully.
179 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
180 @retval Other Failure.
181
182 **/
183 EFI_STATUS
184 EFIAPI
185 IpmiGetMessage (
186 OUT IPMI_GET_MESSAGE_RESPONSE *GetMessageResponse,
187 IN OUT UINT32 *GetMessageResponseSize
188 );
189
190 /**
191 This function sends message.
192
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.
199
200 @retval EFI_SUCCESS Command is sent successfully.
201 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
202 @retval Other Failure.
203
204 **/
205 EFI_STATUS
206 EFIAPI
207 IpmiSendMessage (
208 IN IPMI_SEND_MESSAGE_REQUEST *SendMessageRequest,
209 IN UINT32 SendMessageRequestSize,
210 OUT IPMI_SEND_MESSAGE_RESPONSE *SendMessageResponse,
211 IN OUT UINT32 *SendMessageResponseSize
212 );
213
214 /**
215 This function gets the system UUID.
216
217 @param[out] SystemGuid The pointer to retrieve system UUID.
218
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.
222
223 **/
224 EFI_STATUS
225 EFIAPI
226 IpmiGetSystemUuid (
227 OUT EFI_GUID *SystemGuid
228 );
229
230 /**
231 This function gets the channel information.
232
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
237 response.
238
239 @retval EFI_SUCCESS Command is sent successfully.
240 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
241 @retval Other Failure.
242
243 **/
244 EFI_STATUS
245 EFIAPI
246 IpmiGetChannelInfo (
247 IN IPMI_GET_CHANNEL_INFO_REQUEST *GetChannelInfoRequest,
248 OUT IPMI_GET_CHANNEL_INFO_RESPONSE *GetChannelInfoResponse,
249 OUT UINT32 *GetChannelInfoResponseSize
250 );
251
252 //
253 // IPMI NetFnTransport
254 //
255
256 /**
257 This function activates SOL
258
259 @param[in] SolActivatingRequest SOL activating request.
260 @param[out] CompletionCode The command completion code.
261
262 @retval EFI_SUCCESS Command is sent successfully.
263 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
264 @retval Other Failure.
265
266 **/
267 EFI_STATUS
268 EFIAPI
269 IpmiSolActivating (
270 IN IPMI_SOL_ACTIVATING_REQUEST *SolActivatingRequest,
271 OUT UINT8 *CompletionCode
272 );
273
274 /**
275 This function sets SOL configuration parameters.
276
277 @param[in] SetConfigurationParametersRequest Set SOL configuration parameters
278 command request.
279 @param[in] SetConfigurationParametersRequestSize Size of the set SOL configuration
280 parameters command request.
281 @param[out] CompletionCode The command completion code.
282
283 @retval EFI_SUCCESS Command is sent successfully.
284 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
285 @retval Other Failure.
286
287 **/
288 EFI_STATUS
289 EFIAPI
290 IpmiSetSolConfigurationParameters (
291 IN IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST *SetConfigurationParametersRequest,
292 IN UINT32 SetConfigurationParametersRequestSize,
293 OUT UINT8 *CompletionCode
294 );
295
296 /**
297 This function gets SOL configuration parameters.
298
299 @param[in] GetConfigurationParametersRequest Get SOL configuration parameters
300 command request.
301 @param[out] GetConfigurationParametersResponse Get SOL configuration parameters
302 response.
303 @param[in,out] GetConfigurationParametersResponseSize When input, the size of the expected
304 response.
305 When output, the exact size of
306 expect response.
307
308 @retval EFI_SUCCESS Command is sent successfully.
309 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
310 @retval Other Failure.
311
312 **/
313 EFI_STATUS
314 EFIAPI
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
319 );
320
321 /**
322 This function gets the LAN configuration parameter.
323
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.
328
329 @retval EFI_SUCCESS Command is sent successfully.
330 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
331 @retval Other Failure.
332
333 **/
334
335 EFI_STATUS
336 EFIAPI
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
341 );
342
343 //
344 // IPMI NetFnChassis
345 //
346
347 /**
348 This function gets chassis capability.
349
350 @param[out] GetChassisCapabilitiesResponse Gets chassis capability command response.
351
352 @retval EFI_SUCCESS Command is sent successfully.
353 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
354 @retval Other Failure.
355
356 **/
357 EFI_STATUS
358 EFIAPI
359 IpmiGetChassisCapabilities (
360 OUT IPMI_GET_CHASSIS_CAPABILITIES_RESPONSE *GetChassisCapabilitiesResponse
361 );
362
363 /**
364 This function gets chassis status.
365
366 @param[out] GetChassisCapabilitiesResponse The get chassis status command response.
367
368 @retval EFI_SUCCESS Command is sent successfully.
369 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
370 @retval Other Failure.
371
372 **/
373 EFI_STATUS
374 EFIAPI
375 IpmiGetChassisStatus (
376 OUT IPMI_GET_CHASSIS_STATUS_RESPONSE *GetChassisStatusResponse
377 );
378
379 /**
380 This function sends chassis control request.
381
382 @param[in] ChassisControlRequest The chassis control request.
383 @param[out] CompletionCode The command completion code.
384
385 @retval EFI_SUCCESS Command is sent successfully.
386 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
387 @retval Other Failure.
388
389 **/
390 EFI_STATUS
391 EFIAPI
392 IpmiChassisControl (
393 IN IPMI_CHASSIS_CONTROL_REQUEST *ChassisControlRequest,
394 OUT UINT8 *CompletionCode
395 );
396
397 /**
398 This function sets power restore policy.
399
400 @param[in] SetPowerRestireRequest The set power restore policy control
401 command request.
402 @param[out] SetPowerRestireResponse The response of power restore policy.
403
404 @retval EFI_SUCCESS Command is sent successfully.
405 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
406 @retval Other Failure.
407
408 **/
409 EFI_STATUS
410 EFIAPI
411 IpmiSetPowerRestorePolicy (
412 IN IPMI_SET_POWER_RESTORE_POLICY_REQUEST *SetPowerRestireRequest,
413 OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE *SetPowerRestireResponse
414 );
415
416 //
417 // IPMI NetFnStorage
418 //
419
420 /**
421 This function sets system boot option.
422
423 @param[in] BootOptionsRequest Set system boot option request.
424 @param[out] BootOptionsResponse The response of set system boot
425 option request.
426
427 @retval EFI_SUCCESS Command is sent successfully.
428 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
429 @retval Other Failure.
430
431 **/
432 EFI_STATUS
433 EFIAPI
434 IpmiSetSystemBootOptions (
435 IN IPMI_SET_BOOT_OPTIONS_REQUEST *BootOptionsRequest,
436 OUT IPMI_SET_BOOT_OPTIONS_RESPONSE *BootOptionsResponse
437 );
438
439 /**
440 This function gets system boot option.
441
442 @param[in] BootOptionsRequest Get system boot option request.
443 @param[out] BootOptionsResponse The response of get system boot
444 option request.
445
446 @retval EFI_SUCCESS Command is sent successfully.
447 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
448 @retval Other Failure.
449
450 **/
451 EFI_STATUS
452 EFIAPI
453 IpmiGetSystemBootOptions (
454 IN IPMI_GET_BOOT_OPTIONS_REQUEST *BootOptionsRequest,
455 OUT IPMI_GET_BOOT_OPTIONS_RESPONSE *BootOptionsResponse
456 );
457
458 /**
459 This function gets FRU inventory area info.
460
461 @param[in] GetFruInventoryAreaInfoRequest Get FRU inventory area command request.
462 @param[out] GetFruInventoryAreaInfoResponse get FRU inventory area command response.
463
464 @retval EFI_SUCCESS Command is sent successfully.
465 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
466 @retval Other Failure.
467
468 **/
469 EFI_STATUS
470 EFIAPI
471 IpmiGetFruInventoryAreaInfo (
472 IN IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST *GetFruInventoryAreaInfoRequest,
473 OUT IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE *GetFruInventoryAreaInfoResponse
474 );
475
476 /**
477 This function reads FRU data.
478
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.
484
485 @retval EFI_SUCCESS Command is sent successfully.
486 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
487 @retval Other Failure.
488
489 **/
490 EFI_STATUS
491 EFIAPI
492 IpmiReadFruData (
493 IN IPMI_READ_FRU_DATA_REQUEST *ReadFruDataRequest,
494 OUT IPMI_READ_FRU_DATA_RESPONSE *ReadFruDataResponse,
495 IN OUT UINT32 *ReadFruDataResponseSize
496 );
497
498 /**
499 This function gets chassis capability.
500
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.
504
505 @retval EFI_SUCCESS Command is sent successfully.
506 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
507 @retval Other Failure.
508
509 **/
510 EFI_STATUS
511 EFIAPI
512 IpmiWriteFruData (
513 IN IPMI_WRITE_FRU_DATA_REQUEST *WriteFruDataRequest,
514 IN UINT32 WriteFruDataRequestSize,
515 OUT IPMI_WRITE_FRU_DATA_RESPONSE *WriteFruDataResponse
516 );
517
518 /**
519 This function gets SEL information.
520
521 @param[out] GetSelInfoResponse Get SEL information command response.
522
523 @retval EFI_SUCCESS Command is sent successfully.
524 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
525 @retval Other Failure.
526
527 **/
528 EFI_STATUS
529 EFIAPI
530 IpmiGetSelInfo (
531 OUT IPMI_GET_SEL_INFO_RESPONSE *GetSelInfoResponse
532 );
533
534 /**
535 This function gets SEL entry.
536
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.
542
543 @retval EFI_SUCCESS Command is sent successfully.
544 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
545 @retval Other Failure.
546
547 **/
548 EFI_STATUS
549 EFIAPI
550 IpmiGetSelEntry (
551 IN IPMI_GET_SEL_ENTRY_REQUEST *GetSelEntryRequest,
552 OUT IPMI_GET_SEL_ENTRY_RESPONSE *GetSelEntryResponse,
553 IN OUT UINT32 *GetSelEntryResponseSize
554 );
555
556 /**
557 This function adds SEL entry.
558
559 @param[in] AddSelEntryRequest Add SEL entry command request.
560 @param[out] AddSelEntryResponse Add SEL entry command response.
561
562 @retval EFI_SUCCESS Command is sent successfully.
563 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
564 @retval Other Failure.
565
566 **/
567 EFI_STATUS
568 EFIAPI
569 IpmiAddSelEntry (
570 IN IPMI_ADD_SEL_ENTRY_REQUEST *AddSelEntryRequest,
571 OUT IPMI_ADD_SEL_ENTRY_RESPONSE *AddSelEntryResponse
572 );
573
574 /**
575 This function partially adds SEL entry.
576
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.
580
581 @retval EFI_SUCCESS Command is sent successfully.
582 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
583 @retval Other Failure.
584
585 **/
586 EFI_STATUS
587 EFIAPI
588 IpmiPartialAddSelEntry (
589 IN IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST *PartialAddSelEntryRequest,
590 IN UINT32 PartialAddSelEntryRequestSize,
591 OUT IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE *PartialAddSelEntryResponse
592 );
593
594 /**
595 This function clears SEL entry.
596
597 @param[in] ClearSelRequest Clear SEL command request.
598 @param[out] ClearSelResponse Clear SEL command response.
599
600 @retval EFI_SUCCESS Command is sent successfully.
601 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
602 @retval Other Failure.
603
604 **/
605 EFI_STATUS
606 EFIAPI
607 IpmiClearSel (
608 IN IPMI_CLEAR_SEL_REQUEST *ClearSelRequest,
609 OUT IPMI_CLEAR_SEL_RESPONSE *ClearSelResponse
610 );
611
612 /**
613 This function gets SEL time.
614
615 @param[out] GetSelTimeResponse Get SEL time command response.
616
617 @retval EFI_SUCCESS Command is sent successfully.
618 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
619 @retval Other Failure.
620
621 **/
622 EFI_STATUS
623 EFIAPI
624 IpmiGetSelTime (
625 OUT IPMI_GET_SEL_TIME_RESPONSE *GetSelTimeResponse
626 );
627
628 /**
629 This function sets SEL time.
630
631 @param[in] SetSelTimeRequest Set SEL time command request.
632 @param[out] CompletionCode Command completion code.
633
634 @retval EFI_SUCCESS Command is sent successfully.
635 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
636 @retval Other Failure.
637
638 **/
639 EFI_STATUS
640 EFIAPI
641 IpmiSetSelTime (
642 IN IPMI_SET_SEL_TIME_REQUEST *SetSelTimeRequest,
643 OUT UINT8 *CompletionCode
644 );
645
646 /**
647 This function gets SDR repository information.
648
649 @param[out] GetSdrRepositoryInfoResp Get SDR repository response.
650
651 @retval EFI_SUCCESS Command is sent successfully.
652 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
653 @retval Other Failure.
654 **/
655 EFI_STATUS
656 EFIAPI
657 IpmiGetSdrRepositoryInfo (
658 OUT IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE *GetSdrRepositoryInfoResp
659 );
660
661 /**
662 This function gets SDR
663
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.
669
670 @retval EFI_SUCCESS Command is sent successfully.
671 @retval EFI_NOT_AVAILABLE_YET Transport interface is not ready yet.
672 @retval Other Failure.
673
674 **/
675 EFI_STATUS
676 EFIAPI
677 IpmiGetSdr (
678 IN IPMI_GET_SDR_REQUEST *GetSdrRequest,
679 OUT IPMI_GET_SDR_RESPONSE *GetSdrResponse,
680 IN OUT UINT32 *GetSdrResponseSize
681 );
682
683 #endif