2 IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
4 This file contains all NetFn Storage commands, including:
5 FRU Inventory Commands (Chapter 34)
6 SDR Repository (Chapter 33)
7 System Event Log(SEL) Commands (Chapter 31)
8 SEL Record Formats (Chapter 32)
10 See IPMI specification, Appendix G, Command Assignments
11 and Appendix H, Sub-function Assignments.
13 Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>
14 This program and the accompanying materials
15 are licensed and made available under the terms and conditions of the BSD License
16 which accompanies this distribution. The full text of the license may be found at
17 http://opensource.org/licenses/bsd-license.php
19 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
20 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
23 #ifndef _IPMI_NET_FN_STORAGE_H_
24 #define _IPMI_NET_FN_STORAGE_H_
28 // Net function definition for Storage command
30 #define IPMI_NETFN_STORAGE 0x0A
33 // All Storage commands and their structure definitions to follow here
37 // Below is Definitions for FRU Inventory Commands (Chapter 34)
41 // Definitions for Get Fru Inventory Area Info command
43 #define IPMI_STORAGE_GET_FRU_INVENTORY_AREAINFO 0x10
46 // Constants and Structure definitions for "Get Fru Inventory Area Info" command to follow here
50 } IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST
;
54 UINT16 InventoryAreaSize
;
56 } IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE
;
59 // Definitions for Read Fru Data command
61 #define IPMI_STORAGE_READ_FRU_DATA 0x11
64 // Constants and Structure definitions for "Read Fru Data" command to follow here
69 } IPMI_FRU_COMMON_DATA
;
72 IPMI_FRU_COMMON_DATA Data
;
74 } IPMI_FRU_READ_COMMAND
;
78 UINT16 InventoryOffset
;
80 } IPMI_READ_FRU_DATA_REQUEST
;
86 } IPMI_READ_FRU_DATA_RESPONSE
;
89 // Definitions for Write Fru Data command
91 #define IPMI_STORAGE_WRITE_FRU_DATA 0x12
94 // Constants and Structure definitions for "Write Fru Data" command to follow here
97 IPMI_FRU_COMMON_DATA Data
;
99 } IPMI_FRU_WRITE_COMMAND
;
103 UINT16 InventoryOffset
;
105 } IPMI_WRITE_FRU_DATA_REQUEST
;
108 UINT8 CompletionCode
;
110 } IPMI_WRITE_FRU_DATA_RESPONSE
;
113 // Below is Definitions for SDR Repository (Chapter 33)
117 // Definitions for Get SDR Repository Info command
119 #define IPMI_STORAGE_GET_SDR_REPOSITORY_INFO 0x20
122 // Constants and Structure definitions for "Get SDR Repository Info" command to follow here
125 UINT8 CompletionCode
;
129 UINT32 RecentAdditionTimeStamp
;
130 UINT32 RecentEraseTimeStamp
;
131 UINT8 SdrRepAllocInfoCmd
: 1;
132 UINT8 SdrRepReserveCmd
: 1;
133 UINT8 PartialAddSdrCmd
: 1;
134 UINT8 DeleteSdrRepCmd
: 1;
136 UINT8 SdrRepUpdateOp
: 2;
138 } IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE
;
141 // Definitions for Get SDR Repository Allocateion Info command
143 #define IPMI_STORAGE_GET_SDR_REPOSITORY_ALLOCATION_INFO 0x21
146 // Constants and Structure definitions for "Get SDR Repository Allocateion Info" command to follow here
150 // Definitions for Reserve SDR Repository command
152 #define IPMI_STORAGE_RESERVE_SDR_REPOSITORY 0x22
155 // Constants and Structure definitions for "Reserve SDR Repository" command to follow here
158 UINT8 CompletionCode
;
159 UINT8 ReservationId
[2]; // Reservation ID. LS byte first.
160 } IPMI_RESERVE_SDR_REPOSITORY_RESPONSE
;
163 // Definitions for Get SDR command
165 #define IPMI_STORAGE_GET_SDR 0x23
168 // Constants and Structure definitions for "Get SDR" command to follow here
172 UINT16 RecordId
; // 1
174 UINT8 RecordType
; // 4
175 UINT8 RecordLength
; // 5
178 UINT8 SensorNumber
; // 8
180 UINT8 EntityInstance
; // 10
181 UINT8 EventScanningEnabled
: 1; // 11
182 UINT8 EventScanningDisabled
: 1; // 11
183 UINT8 InitSensorType
: 1; // 11
184 UINT8 InitHysteresis
: 1; // 11
185 UINT8 InitThresholds
: 1; // 11
186 UINT8 InitEvent
: 1; // 11
187 UINT8 InitScanning
: 1; // 11
188 UINT8 Reserved
: 1; // 11
189 UINT8 EventMessageControl
: 2; // 12
190 UINT8 ThresholdAccessSupport
: 2; // 12
191 UINT8 HysteresisSupport
: 2; // 12
192 UINT8 ReArmSupport
: 1; // 12
193 UINT8 IgnoreSensor
: 1; // 12
194 UINT8 SensorType
; // 13
195 UINT8 EventType
; // 14
196 UINT8 Reserved1
[7]; // 15
197 UINT8 UnitType
; // 22
198 UINT8 Reserved2
; // 23
199 UINT8 Linearization
: 7; // 24
200 UINT8 Reserved3
: 1; // 24
202 UINT8 Toleremce
: 6; // 26
205 UINT8 AccuracyLow
: 6; // 28
207 UINT8 Reserved4
: 2; // 29
208 UINT8 AccuracyExp
: 2; // 29
209 UINT8 AccuracyHi
: 4; // 29
210 UINT8 BExp
: 4; // 30
211 UINT8 RExp
: 4; // 30
212 UINT8 NominalReadingSpscified
: 1; // 31
213 UINT8 NominalMaxSpscified
: 1; // 31
214 UINT8 NominalMinSpscified
: 1; // 31
215 UINT8 Reserved5
: 5; // 31
216 UINT8 NominalReading
; // 32
217 UINT8 Reserved6
[4]; // 33
218 UINT8 UpperNonRecoverThreshold
; // 37
219 UINT8 UpperCriticalThreshold
; // 38
220 UINT8 UpperNonCriticalThreshold
; // 39
221 UINT8 LowerNonRecoverThreshold
; // 40
222 UINT8 LowerCriticalThreshold
; // 41
223 UINT8 LowerNonCriticalThreshold
; // 42
224 UINT8 Reserved7
[5]; // 43
225 UINT8 IdStringLength
; // 48
226 UINT8 AsciiIdString
[16]; // 49 - 64
227 } IPMI_SDR_RECORD_STRUCT_1
;
230 UINT16 RecordId
; // 1
232 UINT8 RecordType
; // 4
233 UINT8 RecordLength
; // 5
236 UINT8 SensorNumber
; // 8
238 UINT8 EntityInstance
; // 10
239 UINT8 SensorScanning
: 1; // 11
240 UINT8 EventScanning
: 1; // 11
241 UINT8 InitSensorType
: 1; // 11
242 UINT8 InitHysteresis
: 1; // 11
243 UINT8 InitThresholds
: 1; // 11
244 UINT8 InitEvent
: 1; // 11
245 UINT8 InitScanning
: 1; // 11
246 UINT8 Reserved
: 1; // 11
247 UINT8 EventMessageControl
: 2; // 12
248 UINT8 ThresholdAccessSupport
: 2; // 12
249 UINT8 HysteresisSupport
: 2; // 12
250 UINT8 ReArmSupport
: 1; // 12
251 UINT8 IgnoreSensor
: 1; // 12
252 UINT8 SensorType
; // 13
253 UINT8 EventType
; // 14
254 UINT8 Reserved1
[7]; // 15
255 UINT8 UnitType
; // 22
256 UINT8 Reserved2
[9]; // 23
257 UINT8 IdStringLength
; // 32
258 UINT8 AsciiIdString
[16]; // 33 - 48
259 } IPMI_SDR_RECORD_STRUCT_2
;
263 UINT8 ControllerSlaveAddress
: 7;
268 UINT8 LogicalFruDevice
: 1;
270 UINT8 ChannelNumber
: 4;
271 } IPMI_FRU_DATA_INFO
;
274 UINT16 RecordId
; // 1
276 UINT8 RecordType
; // 4
277 UINT8 RecordLength
; // 5
278 IPMI_FRU_DATA_INFO FruDeviceData
; // 6
279 UINT8 Reserved1
; // 10
280 UINT8 DeviceType
; // 11
281 UINT8 DeviceTypeModifier
; // 12
282 UINT8 FruEntityId
; // 13
283 UINT8 FruEntityInstance
; // 14
284 UINT8 OemReserved
; // 15
285 UINT8 Length
: 4; // 16
286 UINT8 Reserved2
: 1; // 16
287 UINT8 StringType
: 3; // 16
288 UINT8 String
[16]; // 17
289 } IPMI_SDR_RECORD_STRUCT_11
;
294 UINT8 RecordType
; //4
295 UINT8 RecordLength
; //5
296 UINT8 ManufacturerId
[3]; //6
297 UINT8 StringChars
[20];
298 } IPMI_SDR_RECORD_STRUCT_C0
;
303 UINT8 RecordType
; //4
304 UINT8 RecordLength
; //5
305 } IPMI_SDR_RECORD_STRUCT_HEADER
;
308 IPMI_SDR_RECORD_STRUCT_1 SensorType1
;
309 IPMI_SDR_RECORD_STRUCT_2 SensorType2
;
310 IPMI_SDR_RECORD_STRUCT_11 SensorType11
;
311 IPMI_SDR_RECORD_STRUCT_C0 SensorTypeC0
;
312 IPMI_SDR_RECORD_STRUCT_HEADER SensorHeader
;
313 } IPMI_SENSOR_RECORD_STRUCT
;
316 UINT16 ReservationId
;
320 } IPMI_GET_SDR_REQUEST
;
323 UINT8 CompletionCode
;
325 IPMI_SENSOR_RECORD_STRUCT RecordData
;
326 } IPMI_GET_SDR_RESPONSE
;
329 // Definitions for Add SDR command
331 #define IPMI_STORAGE_ADD_SDR 0x24
334 // Constants and Structure definitions for "Add SDR" command to follow here
338 // Definitions for Partial Add SDR command
340 #define IPMI_STORAGE_PARTIAL_ADD_SDR 0x25
343 // Constants and Structure definitions for "Partial Add SDR" command to follow here
347 // Definitions for Delete SDR command
349 #define IPMI_STORAGE_DELETE_SDR 0x26
352 // Constants and Structure definitions for "Delete SDR" command to follow here
356 // Definitions for Clear SDR Repository command
358 #define IPMI_STORAGE_CLEAR_SDR 0x27
361 // Constants and Structure definitions for "Clear SDR Repository" command to follow here
365 // Definitions for Get SDR Repository Time command
367 #define IPMI_STORAGE_GET_SDR_REPOSITORY_TIME 0x28
370 // Constants and Structure definitions for "Get SDR Repository Time" command to follow here
374 // Definitions for Set SDR Repository Time command
376 #define IPMI_STORAGE_SET_SDR_REPOSITORY_TIME 0x29
379 // Constants and Structure definitions for "Set SDR Repository Time" command to follow here
383 // Definitions for Enter SDR Repository Update Mode command
385 #define IPMI_STORAGE_ENTER_SDR_UPDATE_MODE 0x2A
388 // Constants and Structure definitions for "Enter SDR Repository Update Mode" command to follow here
392 // Definitions for Exit SDR Repository Update Mode command
394 #define IPMI_STORAGE_EXIT_SDR_UPDATE_MODE 0x2B
397 // Constants and Structure definitions for "Exit SDR Repository Update Mode" command to follow here
401 // Definitions for Run Initialize Agent command
403 #define IPMI_STORAGE_RUN_INIT_AGENT 0x2C
406 // Constants and Structure definitions for "Run Initialize Agent" command to follow here
410 // Below is Definitions for System Event Log(SEL) Commands (Chapter 31)
414 // Definitions for Get SEL Info command
416 #define IPMI_STORAGE_GET_SEL_INFO 0x40
419 // Constants and Structure definitions for "Get SEL Info" command to follow here
421 #define IPMI_GET_SEL_INFO_OPERATION_SUPPORT_GET_SEL_ALLOCATION_INFO_CMD BIT0
422 #define IPMI_GET_SEL_INFO_OPERATION_SUPPORT_RESERVE_SEL_CMD BIT1
423 #define IPMI_GET_SEL_INFO_OPERATION_SUPPORT_PARTIAL_ADD_SEL_ENTRY_CMD BIT2
424 #define IPMI_GET_SEL_INFO_OPERATION_SUPPORT_DELETE_SEL_CMD BIT3
425 #define IPMI_GET_SEL_INFO_OPERATION_SUPPORT_OVERFLOW_FLAG BIT7
428 UINT8 CompletionCode
;
429 UINT8 Version
; // Version of SEL
430 UINT16 NoOfEntries
; // No of Entries in the SEL
431 UINT16 FreeSpace
; // Free space in Bytes
432 UINT32 RecentAddTimeStamp
; // Most Recent Addition of Time Stamp
433 UINT32 RecentEraseTimeStamp
; // Most Recent Erasure of Time Stamp
434 UINT8 OperationSupport
; // Operation Support
435 } IPMI_GET_SEL_INFO_RESPONSE
;
438 // Definitions for Get SEL Allocation Info command
440 #define IPMI_STORAGE_GET_SEL_ALLOCATION_INFO 0x41
443 // Constants and Structure definitions for "Get SEL Allocation Info" command to follow here
447 // Definitions for Reserve SEL command
449 #define IPMI_STORAGE_RESERVE_SEL 0x42
452 // Constants and Structure definitions for "Reserve SEL" command to follow here
455 UINT8 CompletionCode
;
456 UINT8 ReservationId
[2]; // Reservation ID. LS byte first.
457 } IPMI_RESERVE_SEL_RESPONSE
;
460 // Definitions for Get SEL Entry command
462 #define IPMI_STORAGE_GET_SEL_ENTRY 0x43
465 // Constants and Structure definitions for "Get SEL Entry" command to follow here
469 // Below is Definitions for SEL Record Formats (Chapter 32)
483 } IPMI_SEL_EVENT_RECORD_DATA
;
487 UINT8 RecordType
; // C0h-DFh = OEM system event record
489 UINT8 ManufacturerId
[3];
491 } IPMI_TIMESTAMPED_OEM_SEL_RECORD_DATA
;
495 UINT8 RecordType
; // E0h-FFh = OEM system event record
496 UINT8 OEMDefined
[13];
497 } IPMI_NON_TIMESTAMPED_OEM_SEL_RECORD_DATA
;
500 UINT8 ReserveId
[2]; // Reservation ID, LS Byte First
501 UINT8 SelRecID
[2]; // Sel Record ID, LS Byte First
502 UINT8 Offset
; // Offset Into Record
503 UINT8 BytesToRead
; // Bytes to be Read, 0xFF for entire record
504 } IPMI_GET_SEL_ENTRY_REQUEST
;
507 UINT8 CompletionCode
;
508 UINT16 NextSelRecordId
; // Next SEL Record ID, LS Byte first
509 IPMI_SEL_EVENT_RECORD_DATA RecordData
;
510 } IPMI_GET_SEL_ENTRY_RESPONSE
;
513 // Definitions for Add SEL Entry command
515 #define IPMI_STORAGE_ADD_SEL_ENTRY 0x44
518 // Constants and Structure definitions for "Add SEL Entry" command to follow here
521 IPMI_SEL_EVENT_RECORD_DATA RecordData
;
522 } IPMI_ADD_SEL_ENTRY_REQUEST
;
525 UINT8 CompletionCode
;
526 UINT16 RecordId
; // Record ID for added record, LS Byte first
527 } IPMI_ADD_SEL_ENTRY_RESPONSE
;
530 // Definitions for Partial Add SEL Entry command
532 #define IPMI_STORAGE_PARTIAL_ADD_SEL_ENTRY 0x45
535 // Constants and Structure definitions for "Partial Add SEL Entry" command to follow here
538 UINT16 ReservationId
;
540 UINT8 OffsetIntoRecord
;
543 } IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST
;
546 UINT8 CompletionCode
;
548 } IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE
;
551 // Definitions for Delete SEL Entry command
553 #define IPMI_STORAGE_DELETE_SEL_ENTRY 0x46
556 // Constants and Structure definitions for "Delete SEL Entry" command to follow here
559 UINT8 ReserveId
[2]; // Reservation ID, LS byte first
560 UINT8 RecordToDelete
[2]; // Record to Delete, LS Byte First
561 } IPMI_DELETE_SEL_ENTRY_REQUEST
;
563 #define IPMI_DELETE_SEL_ENTRY_RESPONSE_TYPE_UNSUPPORTED 0x80
564 #define IPMI_DELETE_SEL_ENTRY_RESPONSE_ERASE_IN_PROGRESS 0x81
567 UINT8 CompletionCode
;
568 UINT16 RecordId
; // Record ID added. LS byte first
569 } IPMI_DELETE_SEL_ENTRY_RESPONSE
;
572 // Definitions for Clear SEL command
574 #define IPMI_STORAGE_CLEAR_SEL 0x47
577 // Constants and Structure definitions for "Clear SEL" command to follow here
579 #define IPMI_CLEAR_SEL_REQUEST_C_CHAR_ASCII 0x43
580 #define IPMI_CLEAR_SEL_REQUEST_L_CHAR_ASCII 0x4C
581 #define IPMI_CLEAR_SEL_REQUEST_R_CHAR_ASCII 0x52
582 #define IPMI_CLEAR_SEL_REQUEST_INITIALIZE_ERASE 0xAA
583 #define IPMI_CLEAR_SEL_REQUEST_GET_ERASE_STATUS 0x00
586 UINT8 Reserve
[2]; // Reserve ID, LSB first
587 UINT8 AscC
; // Ascii for 'C' (0x43)
588 UINT8 AscL
; // Ascii for 'L' (0x4c)
589 UINT8 AscR
; // Ascii for 'R' (0x52)
590 UINT8 Erase
; // 0xAA, Initiate Erase, 0x00 Get Erase Status
591 } IPMI_CLEAR_SEL_REQUEST
;
593 #define IPMI_CLEAR_SEL_RESPONSE_ERASURE_IN_PROGRESS 0x00
594 #define IPMI_CLEAR_SEL_RESPONSE_ERASURE_COMPLETED 0x01
597 UINT8 CompletionCode
;
598 UINT8 ErasureProgress
;
599 } IPMI_CLEAR_SEL_RESPONSE
;
602 // Definitions for Get SEL Time command
604 #define IPMI_STORAGE_GET_SEL_TIME 0x48
607 // Constants and Structure definitions for "Get SEL Time" command to follow here
610 UINT8 CompletionCode
;
611 UINT32 Timestamp
; // Present Timestamp clock reading. LS byte first.
612 } IPMI_GET_SEL_TIME_RESPONSE
;
615 // Definitions for Set SEL Time command
617 #define IPMI_STORAGE_SET_SEL_TIME 0x49
620 // Constants and Structure definitions for "Set SEL Time" command to follow here
624 } IPMI_SET_SEL_TIME_REQUEST
;
627 // Definitions for Get Auxillary Log Status command
629 #define IPMI_STORAGE_GET_AUXILLARY_LOG_STATUS 0x5A
632 // Constants and Structure definitions for "Get Auxillary Log Status" command to follow here
636 // Definitions for Set Auxillary Log Status command
638 #define IPMI_STORAGE_SET_AUXILLARY_LOG_STATUS 0x5B
641 // Constants and Structure definitions for "Set Auxillary Log Status" command to follow here
645 // Definitions for Get SEL Time UTC Offset command
647 #define IPMI_STORAGE_GET_SEL_TIME_UTC_OFFSET 0x5C
650 // Constants and Structure definitions for "Get SEL Time UTC Offset" command to follow here
653 UINT8 CompletionCode
;
655 // 16-bit, 2s-complement signed integer for the offset in minutes from UTC to SEL Time.
656 // LS-byte first. (ranges from -1440 to 1440)
659 } IPMI_GET_SEL_TIME_UTC_OFFSET_RESPONSE
;
662 // Definitions for Set SEL Time UTC Offset command
664 #define IPMI_STORAGE_SET_SEL_TIME_UTC_OFFSET 0x5D
667 // Constants and Structure definitions for "Set SEL Time UTC Offset" command to follow here
670 #define IPMI_COMPLETE_SEL_RECORD 0xFF
672 #define IPMI_SEL_SYSTEM_RECORD 0x02
673 #define IPMI_SEL_OEM_TIME_STAMP_RECORD_START 0xC0
674 #define IPMI_SEL_OEM_TIME_STAMP_RECORD_END 0xDF
675 #define IPMI_SEL_OEM_NO_TIME_STAMP_RECORD_START 0xE0
676 #define IPMI_SEL_OEM_NO_TIME_STAMP_RECORD_END 0xFF
678 #define IPMI_SEL_EVENT_DIR(EventDirType) (EventDirType >> 7)
679 #define IPMI_SEL_EVENT_DIR_ASSERTION_EVENT 0x00
680 #define IPMI_SEL_EVENT_DIR_DEASSERTION_EVENT 0x01
682 #define IPMI_SEL_EVENT_TYPE(EventDirType) (EventDirType & 0x7F)
684 // Event/Reading Type Code Ranges (Chapter 42)
686 #define IPMI_SEL_EVENT_TYPE_UNSPECIFIED 0x00
687 #define IPMI_SEL_EVENT_TYPE_THRESHOLD 0x01
688 #define IPMI_SEL_EVENT_TYPE_GENERIC_START 0x02
689 #define IPMI_SEL_EVENT_TYPE_GENERIC_END 0x0C
690 #define IPMI_SEL_EVENT_TYPE_SENSOR_SPECIFIC 0x6F
691 #define IPMI_SEL_EVENT_TYPE_OEM_START 0x70
692 #define IPMI_SEL_EVENT_TYPE_OEM_END 0x7F
694 #define SOFTWARE_ID_FROM_GENERATOR_ID(GeneratorId) ((GeneratorId & 0xFF) >> 1)
696 // System Software IDs definitions (Section 5.5)
698 #define IPMI_SWID_BIOS_RANGE_START 0x00
699 #define IPMI_SWID_BIOS_RANGE_END 0x0F
700 #define IPMI_SWID_SMI_HANDLER_RANGE_START 0x10
701 #define IPMI_SWID_SMI_HANDLER_RANGE_END 0x1F
702 #define IPMI_SWID_SMS_RANGE_START 0x20
703 #define IPMI_SWID_SMS_RANGE_END 0x2F
704 #define IPMI_SWID_OEM_RANGE_START 0x30
705 #define IPMI_SWID_OEM_RANGE_END 0x3F
706 #define IPMI_SWID_REMOTE_CONSOLE_RANGE_START 0x40
707 #define IPMI_SWID_REMOTE_CONSOLE_RANGE_END 0x46
708 #define IPMI_SWID_TERMINAL_REMOTE_CONSOLE_ID 0x47
710 #define SLAVE_ADDRESS_FROM_GENERATOR_ID(GeneratorId) ((GeneratorId & 0xFF) >> 1)
711 #define LUN_FROM_GENERATOR_ID(GeneratorId) ((GeneratorId >> 8) & 0x03)
712 #define CHANNEL_NUMBER_FROM_GENERATOR_ID(GeneratorId) ((GeneratorId >> 12) & 0x0F)
714 #define IPMI_EVM_REVISION 0x04
715 #define IPMI_BIOS_ID 0x18
716 #define IPMI_FORMAT_REV 0x00
717 #define IPMI_FORMAT_REV1 0x01
718 #define IPMI_SOFTWARE_ID 0x01
719 #define IPMI_PLATFORM_VAL_ID 0x01
720 #define IPMI_GENERATOR_ID(i,f) ((i << 1) | (f << 1) | IPMI_SOFTWARE_ID)
722 #define IPMI_SENSOR_TYPE_EVENT_CODE_DISCRETE 0x6F
724 #define IPMI_OEM_SPECIFIC_DATA 0x02
725 #define IPMI_SENSOR_SPECIFIC_DATA 0x03