]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/IpmiNetFnStorageDefinitions.h
2395f2546ebdaa8d5a8fa6a6879640eeabcabc8f
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / IpmiNetFnStorageDefinitions.h
1 /** @file
2 IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
3
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
9 See IPMI specification, Appendix G, Command Assignments
10 and Appendix H, Sub-function Assignments.
11
12 Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
13 This program and the accompanying materials
14 are licensed and made available under the terms and conditions of the BSD License
15 which accompanies this distribution. The full text of the license may be found at
16 http://opensource.org/licenses/bsd-license.php
17
18 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
19 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 **/
21
22 #ifndef _IPMINETFNSTORAGEDEFINITIONS_H_
23 #define _IPMINETFNSTORAGEDEFINITIONS_H_
24
25 #pragma pack(1)
26 //
27 // Net function definition for Storage command
28 //
29 #define IPMI_NETFN_STORAGE 0x0A
30
31 //
32 // All Storage commands and their structure definitions to follow here
33 //
34
35 //
36 // Below is Definitions for FRU Inventory Commands (Chapter 34)
37 //
38
39 //
40 // Definitions for Get Fru Inventory Area Info command
41 //
42 #define IPMI_STORAGE_GET_FRU_INVENTORY_AREAINFO 0x10
43
44 //
45 // Constants and Structure definitions for "Get Fru Inventory Area Info" command to follow here
46 //
47
48 //
49 // Definitions for Get Fru Data command
50 //
51 #define IPMI_STORAGE_READ_FRU_DATA 0x11
52
53 //
54 // Constants and Structure definitions for "Get Fru Data" command to follow here
55 //
56 typedef struct {
57 UINT8 FruDeviceId;
58 UINT16 FruOffset;
59 } IPMI_FRU_COMMON_DATA;
60
61 typedef struct {
62 IPMI_FRU_COMMON_DATA Data;
63 UINT8 Count;
64 } IPMI_FRU_READ_COMMAND;
65
66 //
67 // Definitions for Write Fru Data command
68 //
69 #define IPMI_STORAGE_WRITE_FRU_DATA 0x12
70
71 //
72 // Constants and Structure definitions for "Write Fru Data" command to follow here
73 //
74 typedef struct {
75 IPMI_FRU_COMMON_DATA Data;
76 UINT8 FruData[16];
77 } IPMI_FRU_WRITE_COMMAND;
78
79 //
80 // Below is Definitions for SDR Repository (Chapter 33)
81 //
82
83 //
84 // Definitions for Get SDR Repository Info command
85 //
86 #define IPMI_STORAGE_GET_SDR_REPOSITORY_INFO 0x20
87
88 //
89 // Constants and Structure definitions for "Get SDR Repository Info" command to follow here
90 //
91 typedef struct {
92 UINT8 Version;
93 UINT16 RecordCount;
94 UINT16 FreeSpace;
95 UINT32 RecentAdditionTimeStamp;
96 UINT32 RecentEraseTimeStamp;
97 UINT8 SdrRepAllocInfoCmd : 1;
98 UINT8 SdrRepReserveCmd : 1;
99 UINT8 PartialAddSdrCmd : 1;
100 UINT8 DeleteSdrRepCmd : 1;
101 UINT8 Reserved : 1;
102 UINT8 SdrRepUpdateOp : 2;
103 UINT8 Overflow : 1;
104 } IPMI_SDR_REPOSITORY_INFO;
105
106 //
107 // Definitions for Get SDR Repository Allocateion Info command
108 //
109 #define IPMI_STORAGE_GET_SDR_REPOSITORY_ALLOCATION_INFO 0x21
110
111 //
112 // Constants and Structure definitions for "Get SDR Repository Allocateion Info" command to follow here
113 //
114
115 //
116 // Definitions for Reserve SDR Repository command
117 //
118 #define IPMI_STORAGE_RESERVE_SDR_REPOSITORY 0x22
119
120 //
121 // Constants and Structure definitions for "Reserve SDR Repository" command to follow here
122 //
123
124 //
125 // Definitions for Get SDR command
126 //
127 #define IPMI_STORAGE_GET_SDR 0x23
128
129 //
130 // Constants and Structure definitions for "Get SDR" command to follow here
131 //
132
133 typedef struct {
134 UINT16 RecordId; // 1
135 UINT8 Version; // 3
136 UINT8 RecordType; // 4
137 UINT8 RecordLength; // 5
138 UINT8 OwnerId; // 6
139 UINT8 OwnerLun; // 7
140 UINT8 SensorNumber; // 8
141 UINT8 EntityId; // 9
142 UINT8 EntityInstance; // 10
143 UINT8 EventScanningEnabled : 1; // 11
144 UINT8 EventScanningDisabled : 1; // 11
145 UINT8 InitSensorType : 1; // 11
146 UINT8 InitHysteresis : 1; // 11
147 UINT8 InitThresholds : 1; // 11
148 UINT8 InitEvent : 1; // 11
149 UINT8 InitScanning : 1; // 11
150 UINT8 Reserved : 1; // 11
151 UINT8 EventMessageControl : 2; // 12
152 UINT8 ThresholdAccessSupport : 2; // 12
153 UINT8 HysteresisSupport : 2; // 12
154 UINT8 ReArmSupport : 1; // 12
155 UINT8 IgnoreSensor : 1; // 12
156 UINT8 SensorType; // 13
157 UINT8 EventType; // 14
158 UINT8 Reserved1[7]; // 15
159 UINT8 UnitType; // 22
160 UINT8 Reserved2; // 23
161 UINT8 Linearization : 7; // 24
162 UINT8 Reserved3 : 1; // 24
163 UINT8 MLo; // 25
164 UINT8 Toleremce : 6; // 26
165 UINT8 MHi : 2; // 26
166 UINT8 BLo; // 27
167 UINT8 AccuracyLow : 6; // 28
168 UINT8 BHi : 2; // 28
169 UINT8 Reserved4 : 2; // 29
170 UINT8 AccuracyExp : 2; // 29
171 UINT8 AccuracyHi : 4; // 29
172 UINT8 BExp : 4; // 30
173 UINT8 RExp : 4; // 30
174 UINT8 NominalReadingSpscified : 1; // 31
175 UINT8 NominalMaxSpscified : 1; // 31
176 UINT8 NominalMinSpscified : 1; // 31
177 UINT8 Reserved5 : 5; // 31
178 UINT8 NominalReading; // 32
179 UINT8 Reserved6[4]; // 33
180 UINT8 UpperNonRecoverThreshold; // 37
181 UINT8 UpperCriticalThreshold; // 38
182 UINT8 UpperNonCriticalThreshold; // 39
183 UINT8 LowerNonRecoverThreshold; // 40
184 UINT8 LowerCriticalThreshold; // 41
185 UINT8 LowerNonCriticalThreshold; // 42
186 UINT8 Reserved7[5]; // 43
187 UINT8 IdStringLength; // 48
188 UINT8 AsciiIdString[16]; // 49 - 64
189 } IPMI_SDR_RECORD_STRUCT_1;
190
191 typedef struct {
192 UINT16 RecordId; // 1
193 UINT8 Version; // 3
194 UINT8 RecordType; // 4
195 UINT8 RecordLength; // 5
196 UINT8 OwnerId; // 6
197 UINT8 OwnerLun; // 7
198 UINT8 SensorNumber; // 8
199 UINT8 EntityId; // 9
200 UINT8 EntityInstance; // 10
201 UINT8 SensorScanning : 1; // 11
202 UINT8 EventScanning : 1; // 11
203 UINT8 InitSensorType : 1; // 11
204 UINT8 InitHysteresis : 1; // 11
205 UINT8 InitThresholds : 1; // 11
206 UINT8 InitEvent : 1; // 11
207 UINT8 InitScanning : 1; // 11
208 UINT8 Reserved : 1; // 11
209 UINT8 EventMessageControl : 2; // 12
210 UINT8 ThresholdAccessSupport : 2; // 12
211 UINT8 HysteresisSupport : 2; // 12
212 UINT8 ReArmSupport : 1; // 12
213 UINT8 IgnoreSensor : 1; // 12
214 UINT8 SensorType; // 13
215 UINT8 EventType; // 14
216 UINT8 Reserved1[7]; // 15
217 UINT8 UnitType; // 22
218 UINT8 Reserved2[9]; // 23
219 UINT8 IdStringLength; // 32
220 UINT8 AsciiIdString[16]; // 33 - 48
221 } IPMI_SDR_RECORD_STRUCT_2;
222
223 typedef struct {
224 UINT8 Reserved1 : 1;
225 UINT8 ControllerSlaveAddress : 7;
226 UINT8 FruDeviceId;
227 UINT8 BusId : 3;
228 UINT8 Lun : 2;
229 UINT8 Reserved : 2;
230 UINT8 LogicalFruDevice : 1;
231 UINT8 Reserved3 : 4;
232 UINT8 ChannelNumber : 4;
233 } IPMI_FRU_DATA_INFO;
234
235 typedef struct {
236 UINT16 RecordId; // 1
237 UINT8 Version; // 3
238 UINT8 RecordType; // 4
239 UINT8 RecordLength; // 5
240 IPMI_FRU_DATA_INFO FruDeviceData; // 6
241 UINT8 Reserved1; // 10
242 UINT8 DeviceType; // 11
243 UINT8 DeviceTypeModifier; // 12
244 UINT8 FruEntityId; // 13
245 UINT8 FruEntityInstance; // 14
246 UINT8 OemReserved; // 15
247 UINT8 Length : 4; // 16
248 UINT8 Reserved2 : 1; // 16
249 UINT8 StringType : 3; // 16
250 UINT8 String[16]; // 17
251 } IPMI_SDR_RECORD_STRUCT_11;
252
253 typedef struct {
254 UINT16 NextRecordId; //1
255 UINT16 RecordId; //3
256 UINT8 Version; //5
257 UINT8 RecordType; //6
258 UINT8 RecordLength; //7
259 UINT8 ManufacturerId[3]; //8
260 UINT8 StringChars[20];
261 } IPMI_SDR_RECORD_STRUCT_C0;
262
263 typedef struct {
264 UINT16 NextRecordId; //1
265 UINT16 RecordId; //3
266 UINT8 Version; //5
267 UINT8 RecordType; //6
268 UINT8 RecordLength; //7
269 } IPMI_SDR_RECORD_STRUCT_HEADER;
270
271 typedef union {
272 IPMI_SDR_RECORD_STRUCT_1 SensorType1;
273 IPMI_SDR_RECORD_STRUCT_2 SensorType2;
274 IPMI_SDR_RECORD_STRUCT_11 SensorType11;
275 IPMI_SDR_RECORD_STRUCT_C0 SensorTypeC0;
276 IPMI_SDR_RECORD_STRUCT_HEADER SensorHeader;
277 } IPMI_SENSOR_RECORD_STRUCT;
278
279 typedef struct {
280 UINT16 ReservationId;
281 UINT16 RecordId;
282 UINT8 RecordOffset;
283 UINT8 BytesToRead;
284 } IPMI_GET_SDR;
285
286 //
287 // Definitions for Add SDR command
288 //
289 #define IPMI_STORAGE_ADD_SDR 0x24
290
291 //
292 // Constants and Structure definitions for "Add SDR" command to follow here
293 //
294
295 //
296 // Definitions for Partial Add SDR command
297 //
298 #define IPMI_STORAGE_PARTIAL_ADD_SDR 0x25
299
300 //
301 // Constants and Structure definitions for "Partial Add SDR" command to follow here
302 //
303
304 //
305 // Definitions for Delete SDR command
306 //
307 #define IPMI_STORAGE_DELETE_SDR 0x26
308
309 //
310 // Constants and Structure definitions for "Delete SDR" command to follow here
311 //
312
313 //
314 // Definitions for Clear SDR Repository command
315 //
316 #define IPMI_STORAGE_CLEAR_SDR 0x27
317
318 //
319 // Constants and Structure definitions for "Clear SDR Repository" command to follow here
320 //
321
322 //
323 // Definitions for Get SDR Repository Time command
324 //
325 #define IPMI_STORAGE_GET_SDR_REPOSITORY_TIME 0x28
326
327 //
328 // Constants and Structure definitions for "Get SDR Repository Time" command to follow here
329 //
330
331 //
332 // Definitions for Set SDR Repository Time command
333 //
334 #define IPMI_STORAGE_SET_SDR_REPOSITORY_TIME 0x29
335
336 //
337 // Constants and Structure definitions for "Set SDR Repository Time" command to follow here
338 //
339
340 //
341 // Definitions for Enter SDR Repository Update Mode command
342 //
343 #define IPMI_STORAGE_ENTER_SDR_UPDATE_MODE 0x2A
344
345 //
346 // Constants and Structure definitions for "Enter SDR Repository Update Mode" command to follow here
347 //
348
349 //
350 // Definitions for Exit SDR Repository Update Mode command
351 //
352 #define IPMI_STORAGE_EXIT_SDR_UPDATE_MODE 0x2B
353
354 //
355 // Constants and Structure definitions for "Exit SDR Repository Update Mode" command to follow here
356 //
357
358 //
359 // Definitions for Run Initialize Agent command
360 //
361 #define IPMI_STORAGE_RUN_INIT_AGENT 0x2C
362
363 //
364 // Constants and Structure definitions for "Run Initialize Agent" command to follow here
365 //
366
367 //
368 // Below is Definitions for System Event Log(SEL) Commands (Chapter 31)
369 //
370
371 //
372 // Definitions for Get SEL Info command
373 //
374 #define IPMI_STORAGE_GET_SEL_INFO 0x40
375
376 //
377 // Constants and Structure definitions for "Get SEL Info" command to follow here
378 //
379 typedef struct {
380 UINT8 Version; // Version of SEL
381 UINT16 NoOfEntries; // No of Entries in the SEL
382 UINT16 FreeSpace; // Free space in Bytes
383 UINT32 RecentAddTimeStamp; // Most Recent Addition of Time Stamp
384 UINT32 RecentEraseTimeStamp; // Most Recent Erasure of Time Stamp
385 UINT8 OperationSupport; // Operation Support
386 } IPMI_SEL_INFO;
387
388 //
389 // Definitions for Get SEL Allocation Info command
390 //
391 #define IPMI_STORAGE_GET_SEL_ALLOCATION_INFO 0x41
392
393 //
394 // Constants and Structure definitions for "Get SEL Allocation Info" command to follow here
395 //
396
397 //
398 // Definitions for Reserve SEL command
399 //
400 #define IPMI_STORAGE_RESERVE_SEL 0x42
401
402 //
403 // Constants and Structure definitions for "Reserve SEL" command to follow here
404 //
405
406 //
407 // Definitions for Get SEL Entry command
408 //
409 #define IPMI_STORAGE_GET_SEL_ENTRY 0x43
410
411 //
412 // Constants and Structure definitions for "Get SEL Entry" command to follow here
413 //
414 #define IPMI_COMPLETE_SEL_RECORD 0xFF
415
416 typedef struct {
417 UINT8 ReserveId[2]; // Reservation ID, LS Byte First
418 UINT8 SelRecID[2]; // Sel Record ID, LS Byte First
419 UINT8 Offset; // Offset Into Record
420 UINT8 BytesToRead; // Bytes to be Read, 0xFF for entire record
421 } IPMI_GET_SEL_ENTRY;
422
423 //
424 // Definitions for Add SEL Entry command
425 //
426 #define IPMI_STORAGE_ADD_SEL_ENTRY 0x44
427
428 //
429 // Constants and Structure definitions for "Add SEL Entry" command to follow here
430 //
431 typedef struct {
432 UINT16 RecordId;
433 UINT8 RecordType;
434 UINT32 TimeStamp;
435 UINT16 GeneratorId;
436 UINT8 EvMRevision;
437 UINT8 SensorType;
438 UINT8 SensorNumber;
439 UINT8 EventDirType;
440 UINT8 OEMEvData1;
441 UINT8 OEMEvData2;
442 UINT8 OEMEvData3;
443 } IPMI_SEL_RECORD_DATA;
444
445 #define IPMI_SEL_SYSTEM_RECORD 0x02
446
447 #define IPMI_EVM_REVISION 0x04
448 #define IPMI_BIOS_ID 0x18
449 #define IPMI_FORMAT_REV 0x00
450 #define IPMI_FORMAT_REV1 0x01
451 #define IPMI_SOFTWARE_ID 0x01
452 #define IPMI_PLATFORM_VAL_ID 0x01
453 #define IPMI_GENERATOR_ID(i,f) ((i << 1) | (f << 1) | IPMI_SOFTWARE_ID)
454
455 #define IPMI_SENSOR_TYPE_EVENT_CODE_DISCRETE 0x6F
456
457 #define IPMI_OEM_SPECIFIC_DATA 0x02
458 #define IPMI_SENSOR_SPECIFIC_DATA 0x03
459
460 //
461 // Definitions for Partial Add SEL Entry command
462 //
463 #define IPMI_STORAGE_PARTIAL_ADD_SEL_ENTRY 0x45
464
465 //
466 // Constants and Structure definitions for "Partial Add SEL Entry" command to follow here
467 //
468
469 //
470 // Definitions for Delete SEL Entry command
471 //
472 #define IPMI_STORAGE_DELETE_SEL_ENTRY 0x46
473
474 //
475 // Constants and Structure definitions for "Delete SEL Entry" command to follow here
476 //
477 typedef struct {
478 UINT8 ReserveId[2]; // Reservation ID, LS byte first
479 UINT8 RecordToDelete[2]; // Record to Delete, LS Byte First
480 } IPMI_DELETE_SEL;
481
482 //
483 // Definitions for Clear SEL command
484 //
485 #define IPMI_STORAGE_CLEAR_SEL 0x47
486
487 //
488 // Constants and Structure definitions for "Clear SEL" command to follow here
489 //
490 typedef struct {
491 UINT8 Reserve[2]; // Reserve ID, LSB first
492 UINT8 AscC; // Ascii for 'C' (0x43)
493 UINT8 AscL; // Ascii for 'L' (0x4c)
494 UINT8 AscR; // Ascii for 'R' (0x52)
495 UINT8 Erase; // 0xAA, Initiate Erase, 0x00 Get Erase Status
496 } IPMI_CLEAR_SEL;
497
498 //
499 // Definitions for Get SEL Time command
500 //
501 #define IPMI_STORAGE_GET_SEL_TIME 0x48
502
503 //
504 // Constants and Structure definitions for "Get SEL Time" command to follow here
505 //
506
507 //
508 // Definitions for Set SEL Time command
509 //
510 #define IPMI_STORAGE_SET_SEL_TIME 0x49
511
512 //
513 // Constants and Structure definitions for "Set SEL Time" command to follow here
514 //
515
516 //
517 // Definitions for Get Auxillary Log Status command
518 //
519 #define IPMI_STORAGE_GET_AUXILLARY_LOG_STATUS 0x5A
520
521 //
522 // Constants and Structure definitions for "Get Auxillary Log Status" command to follow here
523 //
524
525 //
526 // Definitions for Set Auxillary Log Status command
527 //
528 #define IPMI_STORAGE_SET_AUXILLARY_LOG_STATUS 0x5B
529
530 //
531 // Constants and Structure definitions for "Set Auxillary Log Status" command to follow here
532 //
533 #pragma pack()
534 #endif