17#ifndef _IPMI_NET_FN_STORAGE_H_
18#define _IPMI_NET_FN_STORAGE_H_
24#define IPMI_NETFN_STORAGE 0x0A
37#define IPMI_STORAGE_GET_FRU_INVENTORY_AREAINFO 0x10
48 UINT16 InventoryAreaSize;
55#define IPMI_STORAGE_READ_FRU_DATA 0x11
72 UINT16 InventoryOffset;
85#define IPMI_STORAGE_WRITE_FRU_DATA 0x12
97 UINT16 InventoryOffset;
102 UINT8 CompletionCode;
113#define IPMI_STORAGE_GET_SDR_REPOSITORY_INFO 0x20
120 UINT8 SdrRepAllocInfoCmd : 1;
121 UINT8 SdrRepReserveCmd : 1;
122 UINT8 PartialAddSdrCmd : 1;
123 UINT8 DeleteSdrRepCmd : 1;
125 UINT8 SdrRepUpdateOp : 2;
132 UINT8 CompletionCode;
136 UINT32 RecentAdditionTimeStamp;
137 UINT32 RecentEraseTimeStamp;
144#define IPMI_STORAGE_GET_SDR_REPOSITORY_ALLOCATION_INFO 0x21
153#define IPMI_STORAGE_RESERVE_SDR_REPOSITORY 0x22
159 UINT8 CompletionCode;
160 UINT8 ReservationId[2];
166#define IPMI_STORAGE_GET_SDR 0x23
173 UINT8 EventScanningEnabled : 1;
174 UINT8 EventScanningDisabled : 1;
175 UINT8 InitSensorType : 1;
176 UINT8 InitHysteresis : 1;
177 UINT8 InitThresholds : 1;
179 UINT8 InitScanning : 1;
180 UINT8 SettableSensor : 1;
187 UINT8 EventMessageControl : 2;
188 UINT8 ThresholdAccessSupport : 2;
189 UINT8 HysteresisSupport : 2;
190 UINT8 ReArmSupport : 1;
191 UINT8 IgnoreSensor : 1;
198 UINT8 Linearization : 7;
214 UINT8 AccuracyLow : 6;
223 UINT8 AccuracyExp : 2;
224 UINT8 AccuracyHi : 4;
239 UINT8 NominalReadingSpscified : 1;
240 UINT8 NominalMaxSpscified : 1;
241 UINT8 NominalMinSpscified : 1;
256 UINT8 EntityInstance;
272 UINT8 NominalReading;
274 UINT8 UpperNonRecoverThreshold;
275 UINT8 UpperCriticalThreshold;
276 UINT8 UpperNonCriticalThreshold;
277 UINT8 LowerNonRecoverThreshold;
278 UINT8 LowerCriticalThreshold;
279 UINT8 LowerNonCriticalThreshold;
281 UINT8 IdStringLength;
282 UINT8 AsciiIdString[16];
294 UINT8 EntityInstance;
302 UINT8 IdStringLength;
303 UINT8 AsciiIdString[16];
309 UINT8 ControllerSlaveAddress : 7;
314 UINT8 LogicalFruDevice : 1;
316 UINT8 ChannelNumber : 4;
325 UINT8 StringType : 3;
338 UINT8 DeviceTypeModifier;
340 UINT8 FruEntityInstance;
351 UINT8 ManufacturerId[3];
352 UINT8 StringChars[20];
371 UINT16 ReservationId;
378 UINT8 CompletionCode;
386#define IPMI_STORAGE_ADD_SDR 0x24
395#define IPMI_STORAGE_PARTIAL_ADD_SDR 0x25
404#define IPMI_STORAGE_DELETE_SDR 0x26
413#define IPMI_STORAGE_CLEAR_SDR 0x27
422#define IPMI_STORAGE_GET_SDR_REPOSITORY_TIME 0x28
431#define IPMI_STORAGE_SET_SDR_REPOSITORY_TIME 0x29
440#define IPMI_STORAGE_ENTER_SDR_UPDATE_MODE 0x2A
449#define IPMI_STORAGE_EXIT_SDR_UPDATE_MODE 0x2B
458#define IPMI_STORAGE_RUN_INIT_AGENT 0x2C
471#define IPMI_STORAGE_GET_SEL_INFO 0x40
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
483 UINT8 CompletionCode;
487 UINT32 RecentAddTimeStamp;
488 UINT32 RecentEraseTimeStamp;
489 UINT8 OperationSupport;
495#define IPMI_STORAGE_GET_SEL_ALLOCATION_INFO 0x41
504#define IPMI_STORAGE_RESERVE_SEL 0x42
510 UINT8 CompletionCode;
511 UINT8 ReservationId[2];
517#define IPMI_STORAGE_GET_SEL_ENTRY 0x43
544 UINT8 ManufacturerId[3];
551 UINT8 OEMDefined[13];
562 UINT8 CompletionCode;
563 UINT16 NextSelRecordId;
570#define IPMI_STORAGE_ADD_SEL_ENTRY 0x44
580 UINT8 CompletionCode;
587#define IPMI_STORAGE_PARTIAL_ADD_SEL_ENTRY 0x45
593 UINT16 ReservationId;
595 UINT8 OffsetIntoRecord;
601 UINT8 CompletionCode;
608#define IPMI_STORAGE_DELETE_SEL_ENTRY 0x46
615 UINT8 RecordToDelete[2];
618#define IPMI_DELETE_SEL_ENTRY_RESPONSE_TYPE_UNSUPPORTED 0x80
619#define IPMI_DELETE_SEL_ENTRY_RESPONSE_ERASE_IN_PROGRESS 0x81
622 UINT8 CompletionCode;
629#define IPMI_STORAGE_CLEAR_SEL 0x47
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
648#define IPMI_CLEAR_SEL_RESPONSE_ERASURE_IN_PROGRESS 0x00
649#define IPMI_CLEAR_SEL_RESPONSE_ERASURE_COMPLETED 0x01
652 UINT8 CompletionCode;
653 UINT8 ErasureProgress;
659#define IPMI_STORAGE_GET_SEL_TIME 0x48
665 UINT8 CompletionCode;
672#define IPMI_STORAGE_SET_SEL_TIME 0x49
684#define IPMI_STORAGE_GET_AUXILLARY_LOG_STATUS 0x5A
693#define IPMI_STORAGE_SET_AUXILLARY_LOG_STATUS 0x5B
702#define IPMI_STORAGE_GET_SEL_TIME_UTC_OFFSET 0x5C
708 UINT8 CompletionCode;
719#define IPMI_STORAGE_SET_SEL_TIME_UTC_OFFSET 0x5D
725#define IPMI_COMPLETE_SEL_RECORD 0xFF
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
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
737#define IPMI_SEL_EVENT_TYPE(EventDirType) (EventDirType & 0x7F)
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
749#define SOFTWARE_ID_FROM_GENERATOR_ID(GeneratorId) ((GeneratorId & 0xFF) >> 1)
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
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)
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)
777#define IPMI_SENSOR_TYPE_EVENT_CODE_DISCRETE 0x6F
779#define IPMI_OEM_SPECIFIC_DATA 0x02
780#define IPMI_SENSOR_SPECIFIC_DATA 0x03
EFI_STATUS EFIAPI Erase(IN CONST EFI_SPI_NOR_FLASH_PROTOCOL *This, IN UINT32 FlashAddress, IN UINT32 BlockCount)