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