Ronak Kanabar | 1ae366f | 2023-06-07 01:21:56 +0530 | [diff] [blame^] | 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 | SEL Record Formats (Chapter 32) |
| 9 | |
| 10 | See IPMI specification, Appendix G, Command Assignments |
| 11 | and Appendix H, Sub-function Assignments. |
| 12 | |
| 13 | Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR> |
| 14 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 15 | **/ |
| 16 | |
| 17 | #ifndef _IPMI_NET_FN_STORAGE_H_ |
| 18 | #define _IPMI_NET_FN_STORAGE_H_ |
| 19 | |
| 20 | #pragma pack(1) |
| 21 | // |
| 22 | // Net function definition for Storage command |
| 23 | // |
| 24 | #define IPMI_NETFN_STORAGE 0x0A |
| 25 | |
| 26 | // |
| 27 | // All Storage commands and their structure definitions to follow here |
| 28 | // |
| 29 | |
| 30 | // |
| 31 | // Below is Definitions for FRU Inventory Commands (Chapter 34) |
| 32 | // |
| 33 | |
| 34 | // |
| 35 | // Definitions for Get Fru Inventory Area Info command |
| 36 | // |
| 37 | #define IPMI_STORAGE_GET_FRU_INVENTORY_AREAINFO 0x10 |
| 38 | |
| 39 | // |
| 40 | // Constants and Structure definitions for "Get Fru Inventory Area Info" command to follow here |
| 41 | // |
| 42 | typedef struct { |
| 43 | UINT8 DeviceId; |
| 44 | } IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST; |
| 45 | |
| 46 | typedef struct { |
| 47 | UINT8 CompletionCode; |
| 48 | UINT16 InventoryAreaSize; |
| 49 | UINT8 AccessType; |
| 50 | } IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE; |
| 51 | |
| 52 | // |
| 53 | // Definitions for Read Fru Data command |
| 54 | // |
| 55 | #define IPMI_STORAGE_READ_FRU_DATA 0x11 |
| 56 | |
| 57 | // |
| 58 | // Constants and Structure definitions for "Read Fru Data" command to follow here |
| 59 | // |
| 60 | typedef struct { |
| 61 | UINT8 FruDeviceId; |
| 62 | UINT16 FruOffset; |
| 63 | } IPMI_FRU_COMMON_DATA; |
| 64 | |
| 65 | typedef struct { |
| 66 | IPMI_FRU_COMMON_DATA Data; |
| 67 | UINT8 Count; |
| 68 | } IPMI_FRU_READ_COMMAND; |
| 69 | |
| 70 | typedef struct { |
| 71 | UINT8 DeviceId; |
| 72 | UINT16 InventoryOffset; |
| 73 | UINT8 CountToRead; |
| 74 | } IPMI_READ_FRU_DATA_REQUEST; |
| 75 | |
| 76 | typedef struct { |
| 77 | UINT8 CompletionCode; |
| 78 | UINT8 CountReturned; |
| 79 | UINT8 Data[0]; |
| 80 | } IPMI_READ_FRU_DATA_RESPONSE; |
| 81 | |
| 82 | // |
| 83 | // Definitions for Write Fru Data command |
| 84 | // |
| 85 | #define IPMI_STORAGE_WRITE_FRU_DATA 0x12 |
| 86 | |
| 87 | // |
| 88 | // Constants and Structure definitions for "Write Fru Data" command to follow here |
| 89 | // |
| 90 | typedef struct { |
| 91 | IPMI_FRU_COMMON_DATA Data; |
| 92 | UINT8 FruData[16]; |
| 93 | } IPMI_FRU_WRITE_COMMAND; |
| 94 | |
| 95 | typedef struct { |
| 96 | UINT8 DeviceId; |
| 97 | UINT16 InventoryOffset; |
| 98 | UINT8 Data[0]; |
| 99 | } IPMI_WRITE_FRU_DATA_REQUEST; |
| 100 | |
| 101 | typedef struct { |
| 102 | UINT8 CompletionCode; |
| 103 | UINT8 CountWritten; |
| 104 | } IPMI_WRITE_FRU_DATA_RESPONSE; |
| 105 | |
| 106 | // |
| 107 | // Below is Definitions for SDR Repository (Chapter 33) |
| 108 | // |
| 109 | |
| 110 | // |
| 111 | // Definitions for Get SDR Repository Info command |
| 112 | // |
| 113 | #define IPMI_STORAGE_GET_SDR_REPOSITORY_INFO 0x20 |
| 114 | |
| 115 | // |
| 116 | // Constants and Structure definitions for "Get SDR Repository Info" command to follow here |
| 117 | // |
| 118 | typedef union { |
| 119 | struct { |
| 120 | UINT8 SdrRepAllocInfoCmd : 1; |
| 121 | UINT8 SdrRepReserveCmd : 1; |
| 122 | UINT8 PartialAddSdrCmd : 1; |
| 123 | UINT8 DeleteSdrRepCmd : 1; |
| 124 | UINT8 Reserved : 1; |
| 125 | UINT8 SdrRepUpdateOp : 2; |
| 126 | UINT8 Overflow : 1; |
| 127 | } Bits; |
| 128 | UINT8 Uint8; |
| 129 | } IPMI_SDR_OPERATION_SUPPORT; |
| 130 | |
| 131 | typedef struct { |
| 132 | UINT8 CompletionCode; |
| 133 | UINT8 Version; |
| 134 | UINT16 RecordCount; |
| 135 | UINT16 FreeSpace; |
| 136 | UINT32 RecentAdditionTimeStamp; |
| 137 | UINT32 RecentEraseTimeStamp; |
| 138 | IPMI_SDR_OPERATION_SUPPORT OperationSupport; |
| 139 | } IPMI_GET_SDR_REPOSITORY_INFO_RESPONSE; |
| 140 | |
| 141 | // |
| 142 | // Definitions for Get SDR Repository Allocateion Info command |
| 143 | // |
| 144 | #define IPMI_STORAGE_GET_SDR_REPOSITORY_ALLOCATION_INFO 0x21 |
| 145 | |
| 146 | // |
| 147 | // Constants and Structure definitions for "Get SDR Repository Allocateion Info" command to follow here |
| 148 | // |
| 149 | |
| 150 | // |
| 151 | // Definitions for Reserve SDR Repository command |
| 152 | // |
| 153 | #define IPMI_STORAGE_RESERVE_SDR_REPOSITORY 0x22 |
| 154 | |
| 155 | // |
| 156 | // Constants and Structure definitions for "Reserve SDR Repository" command to follow here |
| 157 | // |
| 158 | typedef struct { |
| 159 | UINT8 CompletionCode; |
| 160 | UINT8 ReservationId[2]; // Reservation ID. LS byte first. |
| 161 | } IPMI_RESERVE_SDR_REPOSITORY_RESPONSE; |
| 162 | |
| 163 | // |
| 164 | // Definitions for Get SDR command |
| 165 | // |
| 166 | #define IPMI_STORAGE_GET_SDR 0x23 |
| 167 | |
| 168 | // |
| 169 | // Constants and Structure definitions for "Get SDR" command to follow here |
| 170 | // |
| 171 | typedef union { |
| 172 | struct { |
| 173 | UINT8 EventScanningEnabled : 1; |
| 174 | UINT8 EventScanningDisabled : 1; |
| 175 | UINT8 InitSensorType : 1; |
| 176 | UINT8 InitHysteresis : 1; |
| 177 | UINT8 InitThresholds : 1; |
| 178 | UINT8 InitEvent : 1; |
| 179 | UINT8 InitScanning : 1; |
| 180 | UINT8 SettableSensor : 1; |
| 181 | } Bits; |
| 182 | UINT8 Uint8; |
| 183 | } IPMI_SDR_RECORD_SENSOR_INIT; |
| 184 | |
| 185 | typedef union { |
| 186 | struct { |
| 187 | UINT8 EventMessageControl : 2; |
| 188 | UINT8 ThresholdAccessSupport : 2; |
| 189 | UINT8 HysteresisSupport : 2; |
| 190 | UINT8 ReArmSupport : 1; |
| 191 | UINT8 IgnoreSensor : 1; |
| 192 | } Bits; |
| 193 | UINT8 Uint8; |
| 194 | } IPMI_SDR_RECORD_SENSOR_CAP; |
| 195 | |
| 196 | typedef union { |
| 197 | struct { |
| 198 | UINT8 Linearization : 7; |
| 199 | UINT8 Reserved : 1; |
| 200 | } Bits; |
| 201 | UINT8 Uint8; |
| 202 | } IPMI_SDR_RECORD_LINEARIZATION; |
| 203 | |
| 204 | typedef union { |
| 205 | struct { |
| 206 | UINT8 Toleremce : 6; |
| 207 | UINT8 MHi : 2; |
| 208 | } Bits; |
| 209 | UINT8 Uint8; |
| 210 | } IPMI_SDR_RECORD_M_TOLERANCE; |
| 211 | |
| 212 | typedef union { |
| 213 | struct { |
| 214 | UINT8 AccuracyLow : 6; |
| 215 | UINT8 BHi : 2; |
| 216 | } Bits; |
| 217 | UINT8 Uint8; |
| 218 | } IPMI_SDR_RECORD_B_ACCURACY; |
| 219 | |
| 220 | typedef union { |
| 221 | struct { |
| 222 | UINT8 Reserved : 2; |
| 223 | UINT8 AccuracyExp : 2; |
| 224 | UINT8 AccuracyHi : 4; |
| 225 | } Bits; |
| 226 | UINT8 Uint8; |
| 227 | } IPMI_SDR_RECORD_ACCURACY_SENSOR_DIR; |
| 228 | |
| 229 | typedef union { |
| 230 | struct { |
| 231 | UINT8 BExp : 4; |
| 232 | UINT8 RExp : 4; |
| 233 | } Bits; |
| 234 | UINT8 Uint8; |
| 235 | } IPMI_SDR_RECORD_R_EXP_B_EXP; |
| 236 | |
| 237 | typedef union { |
| 238 | struct { |
| 239 | UINT8 NominalReadingSpscified : 1; |
| 240 | UINT8 NominalMaxSpscified : 1; |
| 241 | UINT8 NominalMinSpscified : 1; |
| 242 | UINT8 Reserved : 5; |
| 243 | } Bits; |
| 244 | UINT8 Uint8; |
| 245 | } IPMI_SDR_RECORD_ANALOG_FLAGS; |
| 246 | |
| 247 | typedef struct { |
| 248 | UINT16 RecordId; // 1 |
| 249 | UINT8 Version; // 3 |
| 250 | UINT8 RecordType; // 4 |
| 251 | UINT8 RecordLength; // 5 |
| 252 | UINT8 OwnerId; // 6 |
| 253 | UINT8 OwnerLun; // 7 |
| 254 | UINT8 SensorNumber; // 8 |
| 255 | UINT8 EntityId; // 9 |
| 256 | UINT8 EntityInstance; // 10 |
| 257 | IPMI_SDR_RECORD_SENSOR_INIT SensorInitialization; // 11 |
| 258 | IPMI_SDR_RECORD_SENSOR_CAP SensorCapabilities; // 12 |
| 259 | UINT8 SensorType; // 13 |
| 260 | UINT8 EventType; // 14 |
| 261 | UINT8 Reserved1[7]; // 15 |
| 262 | UINT8 UnitType; // 22 |
| 263 | UINT8 Reserved2; // 23 |
| 264 | IPMI_SDR_RECORD_LINEARIZATION Linearization; // 24 |
| 265 | UINT8 MLo; // 25 |
| 266 | IPMI_SDR_RECORD_M_TOLERANCE MHiTolerance; // 26 |
| 267 | UINT8 BLo; // 27 |
| 268 | IPMI_SDR_RECORD_B_ACCURACY BHiAccuracyLo; // 28 |
| 269 | IPMI_SDR_RECORD_ACCURACY_SENSOR_DIR AccuracySensorDirection; // 29 |
| 270 | IPMI_SDR_RECORD_R_EXP_B_EXP RExpBExp; // 30 |
| 271 | IPMI_SDR_RECORD_ANALOG_FLAGS AnalogFlags; // 31 |
| 272 | UINT8 NominalReading; // 32 |
| 273 | UINT8 Reserved3[4]; // 33 |
| 274 | UINT8 UpperNonRecoverThreshold; // 37 |
| 275 | UINT8 UpperCriticalThreshold; // 38 |
| 276 | UINT8 UpperNonCriticalThreshold; // 39 |
| 277 | UINT8 LowerNonRecoverThreshold; // 40 |
| 278 | UINT8 LowerCriticalThreshold; // 41 |
| 279 | UINT8 LowerNonCriticalThreshold; // 42 |
| 280 | UINT8 Reserved4[5]; // 43 |
| 281 | UINT8 IdStringLength; // 48 |
| 282 | UINT8 AsciiIdString[16]; // 49 - 64 |
| 283 | } IPMI_SDR_RECORD_STRUCT_1; |
| 284 | |
| 285 | typedef struct { |
| 286 | UINT16 RecordId; // 1 |
| 287 | UINT8 Version; // 3 |
| 288 | UINT8 RecordType; // 4 |
| 289 | UINT8 RecordLength; // 5 |
| 290 | UINT8 OwnerId; // 6 |
| 291 | UINT8 OwnerLun; // 7 |
| 292 | UINT8 SensorNumber; // 8 |
| 293 | UINT8 EntityId; // 9 |
| 294 | UINT8 EntityInstance; // 10 |
| 295 | IPMI_SDR_RECORD_SENSOR_INIT SensorInitialization; // 11 |
| 296 | IPMI_SDR_RECORD_SENSOR_CAP SensorCapabilities; // 12 |
| 297 | UINT8 SensorType; // 13 |
| 298 | UINT8 EventType; // 14 |
| 299 | UINT8 Reserved1[7]; // 15 |
| 300 | UINT8 UnitType; // 22 |
| 301 | UINT8 Reserved2[9]; // 23 |
| 302 | UINT8 IdStringLength; // 32 |
| 303 | UINT8 AsciiIdString[16]; // 33 - 48 |
| 304 | } IPMI_SDR_RECORD_STRUCT_2; |
| 305 | |
| 306 | typedef union { |
| 307 | struct { |
| 308 | UINT8 Reserved1 : 1; |
| 309 | UINT8 ControllerSlaveAddress : 7; |
| 310 | UINT8 FruDeviceId; |
| 311 | UINT8 BusId : 3; |
| 312 | UINT8 Lun : 2; |
| 313 | UINT8 Reserved2 : 2; |
| 314 | UINT8 LogicalFruDevice : 1; |
| 315 | UINT8 Reserved3 : 4; |
| 316 | UINT8 ChannelNumber : 4; |
| 317 | } Bits; |
| 318 | UINT32 Uint32; |
| 319 | } IPMI_FRU_DATA_INFO; |
| 320 | |
| 321 | typedef union { |
| 322 | struct { |
| 323 | UINT8 Length : 4; |
| 324 | UINT8 Reserved : 1; |
| 325 | UINT8 StringType : 3; |
| 326 | } Bits; |
| 327 | UINT8 Uint8; |
| 328 | } IPMI_SDR_RECORD_DEV_ID_STR_TYPE_LENGTH; |
| 329 | |
| 330 | typedef struct { |
| 331 | UINT16 RecordId; // 1 |
| 332 | UINT8 Version; // 3 |
| 333 | UINT8 RecordType; // 4 |
| 334 | UINT8 RecordLength; // 5 |
| 335 | IPMI_FRU_DATA_INFO FruDeviceData; // 6 |
| 336 | UINT8 Reserved; // 10 |
| 337 | UINT8 DeviceType; // 11 |
| 338 | UINT8 DeviceTypeModifier; // 12 |
| 339 | UINT8 FruEntityId; // 13 |
| 340 | UINT8 FruEntityInstance; // 14 |
| 341 | UINT8 OemReserved; // 15 |
| 342 | IPMI_SDR_RECORD_DEV_ID_STR_TYPE_LENGTH StringTypeLength; // 16 |
| 343 | UINT8 String[16]; // 17 |
| 344 | } IPMI_SDR_RECORD_STRUCT_11; |
| 345 | |
| 346 | typedef struct { |
| 347 | UINT16 RecordId; // 1 |
| 348 | UINT8 Version; // 3 |
| 349 | UINT8 RecordType; // 4 |
| 350 | UINT8 RecordLength; // 5 |
| 351 | UINT8 ManufacturerId[3]; // 6 |
| 352 | UINT8 StringChars[20]; |
| 353 | } IPMI_SDR_RECORD_STRUCT_C0; |
| 354 | |
| 355 | typedef struct { |
| 356 | UINT16 RecordId; // 1 |
| 357 | UINT8 Version; // 3 |
| 358 | UINT8 RecordType; // 4 |
| 359 | UINT8 RecordLength; // 5 |
| 360 | } IPMI_SDR_RECORD_STRUCT_HEADER; |
| 361 | |
| 362 | typedef union { |
| 363 | IPMI_SDR_RECORD_STRUCT_1 SensorType1; |
| 364 | IPMI_SDR_RECORD_STRUCT_2 SensorType2; |
| 365 | IPMI_SDR_RECORD_STRUCT_11 SensorType11; |
| 366 | IPMI_SDR_RECORD_STRUCT_C0 SensorTypeC0; |
| 367 | IPMI_SDR_RECORD_STRUCT_HEADER SensorHeader; |
| 368 | } IPMI_SENSOR_RECORD_STRUCT; |
| 369 | |
| 370 | typedef struct { |
| 371 | UINT16 ReservationId; |
| 372 | UINT16 RecordId; |
| 373 | UINT8 RecordOffset; |
| 374 | UINT8 BytesToRead; |
| 375 | } IPMI_GET_SDR_REQUEST; |
| 376 | |
| 377 | typedef struct { |
| 378 | UINT8 CompletionCode; |
| 379 | UINT16 NextRecordId; |
| 380 | IPMI_SENSOR_RECORD_STRUCT RecordData; |
| 381 | } IPMI_GET_SDR_RESPONSE; |
| 382 | |
| 383 | // |
| 384 | // Definitions for Add SDR command |
| 385 | // |
| 386 | #define IPMI_STORAGE_ADD_SDR 0x24 |
| 387 | |
| 388 | // |
| 389 | // Constants and Structure definitions for "Add SDR" command to follow here |
| 390 | // |
| 391 | |
| 392 | // |
| 393 | // Definitions for Partial Add SDR command |
| 394 | // |
| 395 | #define IPMI_STORAGE_PARTIAL_ADD_SDR 0x25 |
| 396 | |
| 397 | // |
| 398 | // Constants and Structure definitions for "Partial Add SDR" command to follow here |
| 399 | // |
| 400 | |
| 401 | // |
| 402 | // Definitions for Delete SDR command |
| 403 | // |
| 404 | #define IPMI_STORAGE_DELETE_SDR 0x26 |
| 405 | |
| 406 | // |
| 407 | // Constants and Structure definitions for "Delete SDR" command to follow here |
| 408 | // |
| 409 | |
| 410 | // |
| 411 | // Definitions for Clear SDR Repository command |
| 412 | // |
| 413 | #define IPMI_STORAGE_CLEAR_SDR 0x27 |
| 414 | |
| 415 | // |
| 416 | // Constants and Structure definitions for "Clear SDR Repository" command to follow here |
| 417 | // |
| 418 | |
| 419 | // |
| 420 | // Definitions for Get SDR Repository Time command |
| 421 | // |
| 422 | #define IPMI_STORAGE_GET_SDR_REPOSITORY_TIME 0x28 |
| 423 | |
| 424 | // |
| 425 | // Constants and Structure definitions for "Get SDR Repository Time" command to follow here |
| 426 | // |
| 427 | |
| 428 | // |
| 429 | // Definitions for Set SDR Repository Time command |
| 430 | // |
| 431 | #define IPMI_STORAGE_SET_SDR_REPOSITORY_TIME 0x29 |
| 432 | |
| 433 | // |
| 434 | // Constants and Structure definitions for "Set SDR Repository Time" command to follow here |
| 435 | // |
| 436 | |
| 437 | // |
| 438 | // Definitions for Enter SDR Repository Update Mode command |
| 439 | // |
| 440 | #define IPMI_STORAGE_ENTER_SDR_UPDATE_MODE 0x2A |
| 441 | |
| 442 | // |
| 443 | // Constants and Structure definitions for "Enter SDR Repository Update Mode" command to follow here |
| 444 | // |
| 445 | |
| 446 | // |
| 447 | // Definitions for Exit SDR Repository Update Mode command |
| 448 | // |
| 449 | #define IPMI_STORAGE_EXIT_SDR_UPDATE_MODE 0x2B |
| 450 | |
| 451 | // |
| 452 | // Constants and Structure definitions for "Exit SDR Repository Update Mode" command to follow here |
| 453 | // |
| 454 | |
| 455 | // |
| 456 | // Definitions for Run Initialize Agent command |
| 457 | // |
| 458 | #define IPMI_STORAGE_RUN_INIT_AGENT 0x2C |
| 459 | |
| 460 | // |
| 461 | // Constants and Structure definitions for "Run Initialize Agent" command to follow here |
| 462 | // |
| 463 | |
| 464 | // |
| 465 | // Below is Definitions for System Event Log(SEL) Commands (Chapter 31) |
| 466 | // |
| 467 | |
| 468 | // |
| 469 | // Definitions for Get SEL Info command |
| 470 | // |
| 471 | #define IPMI_STORAGE_GET_SEL_INFO 0x40 |
| 472 | |
| 473 | // |
| 474 | // Constants and Structure definitions for "Get SEL Info" command to follow here |
| 475 | // |
| 476 | #define IPMI_GET_SEL_INFO_OPERATION_SUPPORT_GET_SEL_ALLOCATION_INFO_CMD BIT0 |
| 477 | #define IPMI_GET_SEL_INFO_OPERATION_SUPPORT_RESERVE_SEL_CMD BIT1 |
| 478 | #define IPMI_GET_SEL_INFO_OPERATION_SUPPORT_PARTIAL_ADD_SEL_ENTRY_CMD BIT2 |
| 479 | #define IPMI_GET_SEL_INFO_OPERATION_SUPPORT_DELETE_SEL_CMD BIT3 |
| 480 | #define IPMI_GET_SEL_INFO_OPERATION_SUPPORT_OVERFLOW_FLAG BIT7 |
| 481 | |
| 482 | typedef struct { |
| 483 | UINT8 CompletionCode; |
| 484 | UINT8 Version; // Version of SEL |
| 485 | UINT16 NoOfEntries; // No of Entries in the SEL |
| 486 | UINT16 FreeSpace; // Free space in Bytes |
| 487 | UINT32 RecentAddTimeStamp; // Most Recent Addition of Time Stamp |
| 488 | UINT32 RecentEraseTimeStamp; // Most Recent Erasure of Time Stamp |
| 489 | UINT8 OperationSupport; // Operation Support |
| 490 | } IPMI_GET_SEL_INFO_RESPONSE; |
| 491 | |
| 492 | // |
| 493 | // Definitions for Get SEL Allocation Info command |
| 494 | // |
| 495 | #define IPMI_STORAGE_GET_SEL_ALLOCATION_INFO 0x41 |
| 496 | |
| 497 | // |
| 498 | // Constants and Structure definitions for "Get SEL Allocation Info" command to follow here |
| 499 | // |
| 500 | |
| 501 | // |
| 502 | // Definitions for Reserve SEL command |
| 503 | // |
| 504 | #define IPMI_STORAGE_RESERVE_SEL 0x42 |
| 505 | |
| 506 | // |
| 507 | // Constants and Structure definitions for "Reserve SEL" command to follow here |
| 508 | // |
| 509 | typedef struct { |
| 510 | UINT8 CompletionCode; |
| 511 | UINT8 ReservationId[2]; // Reservation ID. LS byte first. |
| 512 | } IPMI_RESERVE_SEL_RESPONSE; |
| 513 | |
| 514 | // |
| 515 | // Definitions for Get SEL Entry command |
| 516 | // |
| 517 | #define IPMI_STORAGE_GET_SEL_ENTRY 0x43 |
| 518 | |
| 519 | // |
| 520 | // Constants and Structure definitions for "Get SEL Entry" command to follow here |
| 521 | // |
| 522 | |
| 523 | // |
| 524 | // Below is Definitions for SEL Record Formats (Chapter 32) |
| 525 | // |
| 526 | typedef struct { |
| 527 | UINT16 RecordId; |
| 528 | UINT8 RecordType; |
| 529 | UINT32 TimeStamp; |
| 530 | UINT16 GeneratorId; |
| 531 | UINT8 EvMRevision; |
| 532 | UINT8 SensorType; |
| 533 | UINT8 SensorNumber; |
| 534 | UINT8 EventDirType; |
| 535 | UINT8 OEMEvData1; |
| 536 | UINT8 OEMEvData2; |
| 537 | UINT8 OEMEvData3; |
| 538 | } IPMI_SEL_EVENT_RECORD_DATA; |
| 539 | |
| 540 | typedef struct { |
| 541 | UINT16 RecordId; |
| 542 | UINT8 RecordType; // C0h-DFh = OEM system event record |
| 543 | UINT32 TimeStamp; |
| 544 | UINT8 ManufacturerId[3]; |
| 545 | UINT8 OEMDefined[6]; |
| 546 | } IPMI_TIMESTAMPED_OEM_SEL_RECORD_DATA; |
| 547 | |
| 548 | typedef struct { |
| 549 | UINT16 RecordId; |
| 550 | UINT8 RecordType; // E0h-FFh = OEM system event record |
| 551 | UINT8 OEMDefined[13]; |
| 552 | } IPMI_NON_TIMESTAMPED_OEM_SEL_RECORD_DATA; |
| 553 | |
| 554 | typedef struct { |
| 555 | UINT8 ReserveId[2]; // Reservation ID, LS Byte First |
| 556 | UINT8 SelRecID[2]; // Sel Record ID, LS Byte First |
| 557 | UINT8 Offset; // Offset Into Record |
| 558 | UINT8 BytesToRead; // Bytes to be Read, 0xFF for entire record |
| 559 | } IPMI_GET_SEL_ENTRY_REQUEST; |
| 560 | |
| 561 | typedef struct { |
| 562 | UINT8 CompletionCode; |
| 563 | UINT16 NextSelRecordId; // Next SEL Record ID, LS Byte first |
| 564 | IPMI_SEL_EVENT_RECORD_DATA RecordData; |
| 565 | } IPMI_GET_SEL_ENTRY_RESPONSE; |
| 566 | |
| 567 | // |
| 568 | // Definitions for Add SEL Entry command |
| 569 | // |
| 570 | #define IPMI_STORAGE_ADD_SEL_ENTRY 0x44 |
| 571 | |
| 572 | // |
| 573 | // Constants and Structure definitions for "Add SEL Entry" command to follow here |
| 574 | // |
| 575 | typedef struct { |
| 576 | IPMI_SEL_EVENT_RECORD_DATA RecordData; |
| 577 | } IPMI_ADD_SEL_ENTRY_REQUEST; |
| 578 | |
| 579 | typedef struct { |
| 580 | UINT8 CompletionCode; |
| 581 | UINT16 RecordId; // Record ID for added record, LS Byte first |
| 582 | } IPMI_ADD_SEL_ENTRY_RESPONSE; |
| 583 | |
| 584 | // |
| 585 | // Definitions for Partial Add SEL Entry command |
| 586 | // |
| 587 | #define IPMI_STORAGE_PARTIAL_ADD_SEL_ENTRY 0x45 |
| 588 | |
| 589 | // |
| 590 | // Constants and Structure definitions for "Partial Add SEL Entry" command to follow here |
| 591 | // |
| 592 | typedef struct { |
| 593 | UINT16 ReservationId; |
| 594 | UINT16 RecordId; |
| 595 | UINT8 OffsetIntoRecord; |
| 596 | UINT8 InProgress; |
| 597 | UINT8 RecordData[0]; |
| 598 | } IPMI_PARTIAL_ADD_SEL_ENTRY_REQUEST; |
| 599 | |
| 600 | typedef struct { |
| 601 | UINT8 CompletionCode; |
| 602 | UINT16 RecordId; |
| 603 | } IPMI_PARTIAL_ADD_SEL_ENTRY_RESPONSE; |
| 604 | |
| 605 | // |
| 606 | // Definitions for Delete SEL Entry command |
| 607 | // |
| 608 | #define IPMI_STORAGE_DELETE_SEL_ENTRY 0x46 |
| 609 | |
| 610 | // |
| 611 | // Constants and Structure definitions for "Delete SEL Entry" command to follow here |
| 612 | // |
| 613 | typedef struct { |
| 614 | UINT8 ReserveId[2]; // Reservation ID, LS byte first |
| 615 | UINT8 RecordToDelete[2]; // Record to Delete, LS Byte First |
| 616 | } IPMI_DELETE_SEL_ENTRY_REQUEST; |
| 617 | |
| 618 | #define IPMI_DELETE_SEL_ENTRY_RESPONSE_TYPE_UNSUPPORTED 0x80 |
| 619 | #define IPMI_DELETE_SEL_ENTRY_RESPONSE_ERASE_IN_PROGRESS 0x81 |
| 620 | |
| 621 | typedef struct { |
| 622 | UINT8 CompletionCode; |
| 623 | UINT16 RecordId; // Record ID added. LS byte first |
| 624 | } IPMI_DELETE_SEL_ENTRY_RESPONSE; |
| 625 | |
| 626 | // |
| 627 | // Definitions for Clear SEL command |
| 628 | // |
| 629 | #define IPMI_STORAGE_CLEAR_SEL 0x47 |
| 630 | |
| 631 | // |
| 632 | // Constants and Structure definitions for "Clear SEL" command to follow here |
| 633 | // |
| 634 | #define IPMI_CLEAR_SEL_REQUEST_C_CHAR_ASCII 0x43 |
| 635 | #define IPMI_CLEAR_SEL_REQUEST_L_CHAR_ASCII 0x4C |
| 636 | #define IPMI_CLEAR_SEL_REQUEST_R_CHAR_ASCII 0x52 |
| 637 | #define IPMI_CLEAR_SEL_REQUEST_INITIALIZE_ERASE 0xAA |
| 638 | #define IPMI_CLEAR_SEL_REQUEST_GET_ERASE_STATUS 0x00 |
| 639 | |
| 640 | typedef struct { |
| 641 | UINT8 Reserve[2]; // Reserve ID, LSB first |
| 642 | UINT8 AscC; // Ascii for 'C' (0x43) |
| 643 | UINT8 AscL; // Ascii for 'L' (0x4c) |
| 644 | UINT8 AscR; // Ascii for 'R' (0x52) |
| 645 | UINT8 Erase; // 0xAA, Initiate Erase, 0x00 Get Erase Status |
| 646 | } IPMI_CLEAR_SEL_REQUEST; |
| 647 | |
| 648 | #define IPMI_CLEAR_SEL_RESPONSE_ERASURE_IN_PROGRESS 0x00 |
| 649 | #define IPMI_CLEAR_SEL_RESPONSE_ERASURE_COMPLETED 0x01 |
| 650 | |
| 651 | typedef struct { |
| 652 | UINT8 CompletionCode; |
| 653 | UINT8 ErasureProgress; |
| 654 | } IPMI_CLEAR_SEL_RESPONSE; |
| 655 | |
| 656 | // |
| 657 | // Definitions for Get SEL Time command |
| 658 | // |
| 659 | #define IPMI_STORAGE_GET_SEL_TIME 0x48 |
| 660 | |
| 661 | // |
| 662 | // Constants and Structure definitions for "Get SEL Time" command to follow here |
| 663 | // |
| 664 | typedef struct { |
| 665 | UINT8 CompletionCode; |
| 666 | UINT32 Timestamp; // Present Timestamp clock reading. LS byte first. |
| 667 | } IPMI_GET_SEL_TIME_RESPONSE; |
| 668 | |
| 669 | // |
| 670 | // Definitions for Set SEL Time command |
| 671 | // |
| 672 | #define IPMI_STORAGE_SET_SEL_TIME 0x49 |
| 673 | |
| 674 | // |
| 675 | // Constants and Structure definitions for "Set SEL Time" command to follow here |
| 676 | // |
| 677 | typedef struct { |
| 678 | UINT32 Timestamp; |
| 679 | } IPMI_SET_SEL_TIME_REQUEST; |
| 680 | |
| 681 | // |
| 682 | // Definitions for Get Auxillary Log Status command |
| 683 | // |
| 684 | #define IPMI_STORAGE_GET_AUXILLARY_LOG_STATUS 0x5A |
| 685 | |
| 686 | // |
| 687 | // Constants and Structure definitions for "Get Auxillary Log Status" command to follow here |
| 688 | // |
| 689 | |
| 690 | // |
| 691 | // Definitions for Set Auxillary Log Status command |
| 692 | // |
| 693 | #define IPMI_STORAGE_SET_AUXILLARY_LOG_STATUS 0x5B |
| 694 | |
| 695 | // |
| 696 | // Constants and Structure definitions for "Set Auxillary Log Status" command to follow here |
| 697 | // |
| 698 | |
| 699 | // |
| 700 | // Definitions for Get SEL Time UTC Offset command |
| 701 | // |
| 702 | #define IPMI_STORAGE_GET_SEL_TIME_UTC_OFFSET 0x5C |
| 703 | |
| 704 | // |
| 705 | // Constants and Structure definitions for "Get SEL Time UTC Offset" command to follow here |
| 706 | // |
| 707 | typedef struct { |
| 708 | UINT8 CompletionCode; |
| 709 | // |
| 710 | // 16-bit, 2s-complement signed integer for the offset in minutes from UTC to SEL Time. |
| 711 | // LS-byte first. (ranges from -1440 to 1440) |
| 712 | // |
| 713 | INT16 UtcOffset; |
| 714 | } IPMI_GET_SEL_TIME_UTC_OFFSET_RESPONSE; |
| 715 | |
| 716 | // |
| 717 | // Definitions for Set SEL Time UTC Offset command |
| 718 | // |
| 719 | #define IPMI_STORAGE_SET_SEL_TIME_UTC_OFFSET 0x5D |
| 720 | |
| 721 | // |
| 722 | // Constants and Structure definitions for "Set SEL Time UTC Offset" command to follow here |
| 723 | // |
| 724 | |
| 725 | #define IPMI_COMPLETE_SEL_RECORD 0xFF |
| 726 | |
| 727 | #define IPMI_SEL_SYSTEM_RECORD 0x02 |
| 728 | #define IPMI_SEL_OEM_TIME_STAMP_RECORD_START 0xC0 |
| 729 | #define IPMI_SEL_OEM_TIME_STAMP_RECORD_END 0xDF |
| 730 | #define IPMI_SEL_OEM_NO_TIME_STAMP_RECORD_START 0xE0 |
| 731 | #define IPMI_SEL_OEM_NO_TIME_STAMP_RECORD_END 0xFF |
| 732 | |
| 733 | #define IPMI_SEL_EVENT_DIR(EventDirType) (EventDirType >> 7) |
| 734 | #define IPMI_SEL_EVENT_DIR_ASSERTION_EVENT 0x00 |
| 735 | #define IPMI_SEL_EVENT_DIR_DEASSERTION_EVENT 0x01 |
| 736 | |
| 737 | #define IPMI_SEL_EVENT_TYPE(EventDirType) (EventDirType & 0x7F) |
| 738 | // |
| 739 | // Event/Reading Type Code Ranges (Chapter 42) |
| 740 | // |
| 741 | #define IPMI_SEL_EVENT_TYPE_UNSPECIFIED 0x00 |
| 742 | #define IPMI_SEL_EVENT_TYPE_THRESHOLD 0x01 |
| 743 | #define IPMI_SEL_EVENT_TYPE_GENERIC_START 0x02 |
| 744 | #define IPMI_SEL_EVENT_TYPE_GENERIC_END 0x0C |
| 745 | #define IPMI_SEL_EVENT_TYPE_SENSOR_SPECIFIC 0x6F |
| 746 | #define IPMI_SEL_EVENT_TYPE_OEM_START 0x70 |
| 747 | #define IPMI_SEL_EVENT_TYPE_OEM_END 0x7F |
| 748 | |
| 749 | #define SOFTWARE_ID_FROM_GENERATOR_ID(GeneratorId) ((GeneratorId & 0xFF) >> 1) |
| 750 | // |
| 751 | // System Software IDs definitions (Section 5.5) |
| 752 | // |
| 753 | #define IPMI_SWID_BIOS_RANGE_START 0x00 |
| 754 | #define IPMI_SWID_BIOS_RANGE_END 0x0F |
| 755 | #define IPMI_SWID_SMI_HANDLER_RANGE_START 0x10 |
| 756 | #define IPMI_SWID_SMI_HANDLER_RANGE_END 0x1F |
| 757 | #define IPMI_SWID_SMS_RANGE_START 0x20 |
| 758 | #define IPMI_SWID_SMS_RANGE_END 0x2F |
| 759 | #define IPMI_SWID_OEM_RANGE_START 0x30 |
| 760 | #define IPMI_SWID_OEM_RANGE_END 0x3F |
| 761 | #define IPMI_SWID_REMOTE_CONSOLE_RANGE_START 0x40 |
| 762 | #define IPMI_SWID_REMOTE_CONSOLE_RANGE_END 0x46 |
| 763 | #define IPMI_SWID_TERMINAL_REMOTE_CONSOLE_ID 0x47 |
| 764 | |
| 765 | #define SLAVE_ADDRESS_FROM_GENERATOR_ID(GeneratorId) ((GeneratorId & 0xFF) >> 1) |
| 766 | #define LUN_FROM_GENERATOR_ID(GeneratorId) ((GeneratorId >> 8) & 0x03) |
| 767 | #define CHANNEL_NUMBER_FROM_GENERATOR_ID(GeneratorId) ((GeneratorId >> 12) & 0x0F) |
| 768 | |
| 769 | #define IPMI_EVM_REVISION 0x04 |
| 770 | #define IPMI_BIOS_ID 0x18 |
| 771 | #define IPMI_FORMAT_REV 0x00 |
| 772 | #define IPMI_FORMAT_REV1 0x01 |
| 773 | #define IPMI_SOFTWARE_ID 0x01 |
| 774 | #define IPMI_PLATFORM_VAL_ID 0x01 |
| 775 | #define IPMI_GENERATOR_ID(i, f) ((i << 1) | (f << 1) | IPMI_SOFTWARE_ID) |
| 776 | |
| 777 | #define IPMI_SENSOR_TYPE_EVENT_CODE_DISCRETE 0x6F |
| 778 | |
| 779 | #define IPMI_OEM_SPECIFIC_DATA 0x02 |
| 780 | #define IPMI_SENSOR_SPECIFIC_DATA 0x03 |
| 781 | |
| 782 | #pragma pack() |
| 783 | #endif |