123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452 |
- /*****************************************************************
- *****************************************************************
- *** **
- *** (C)Copyright 2005-2006, American Megatrends Inc. **
- *** **
- *** All Rights Reserved. **
- *** **
- *** 6145-F, Northbelt Parkway, Norcross, **
- *** **
- *** Georgia - 30071, USA. Phone-(770)-246-8600. **
- *** **
- *****************************************************************
- *****************************************************************
- *****************************************************************
- ******************************************************************
- *
- * SDRRecord.h
- * SDR record structures.
- *
- * Author: Govind Kothandapani <govindk@ami.com>
- *
- ******************************************************************/
- #ifndef IPMI_SDR_RECORD_H
- #define IPMI_SDR_RECORD_H
- #ifndef uint8_t
- #define uint8_t unsigned char
- #endif
- #ifndef uint16_t
- #define uint16_t unsigned short
- #endif
- #ifndef uint32_t
- #define uint32_t unsigned long
- #endif
- #ifndef int8_t
- #define int8_t signed char
- #endif
- #ifndef int16_t
- #define int16_t signed short
- #endif
- #ifndef int32_t
- #define int32_t signed long
- #endif
- #pragma pack( 1 )
- /**
- * @brief SDR Type
- **/
- #define FULL_SDR_REC 0x01
- #define COMPACT_SDR_REC 0x02
- #define EVENT_ONLY_SDR_REC 0x03
- #define ENTITY_ASSOCIATION_SDR_REC 0x08
- #define DEV_REL_ENTITY_ASSOCIATION_SDR_REC 0x09
- #define GENERIC_DEVICE_LOCATOR_SDR_REC 0x10
- #define FRU_DEVICE_LOCATOR_SDR_REC 0x11
- #define MGMT_CTRL_DEV_LOCATOR_SDR_REC 0x12
- #define MGMT_CTRL_CONFIRMATION_SDR_REC 0x13
- #define BMC_MSG_CHANNEL_INFO_REC 0x14
- #define OEM_SDRFRU_REC 0xD0
- #define OEM_SDRNM_REC 0xC0
- /**
- * @brief Maximum Length of the ID String
- **/
- #define MAX_ID_STR_LEN 16
- #define MAX_FRU_SDR_STR_SIZE 40
- /**
- * @struct SDRRecHdr_T
- * @brief SDR Record Header
- **/
- typedef struct
- {
- uint16_t ID;
- uint8_t Version;
- uint8_t Type;
- uint8_t Len;
- } SDRRecHdr_T;
- /**
- * @struct FullSensorRec_T
- * @brief Full Sensor Record
- **/
- typedef struct
- {
- /* SENSOR RECORD HEADER */
- SDRRecHdr_T hdr;
- /* RECORD KEY BYTES */
- uint8_t OwnerID;
- uint8_t OwnerLUN;
- uint8_t SensorNum;
- /* RECORD BODY BYTES */
- uint8_t EntityID;
- uint8_t EntityIns;
- uint8_t SensorInit;
- uint8_t SensorCaps;
- uint8_t SensorType;
- uint8_t EventTypeCode;
- uint16_t AssertionEventMask;
- uint16_t DeAssertionEventMask;
- uint16_t DiscreteReadingMask;
- uint8_t Units1;
- uint8_t Units2;
- uint8_t Units3;
- uint8_t Linearization;
- uint8_t M;
- uint8_t M_Tolerance;
- uint8_t B;
- uint8_t B_Accuracy;
- uint8_t Accuracy;
- uint8_t R_B_Exp;
- uint8_t Flags;
- uint8_t NominalReading;
- uint8_t NormalMax;
- uint8_t NormalMin;
- uint8_t MaxReading;
- uint8_t MinReading;
- uint8_t UpperNonRecoverable;
- uint8_t UpperCritical;
- uint8_t UpperNonCritical;
- uint8_t LowerNonRecoverable;
- uint8_t LowerCritical;
- uint8_t LowerNonCritical;
- uint8_t PositiveHysterisis;
- uint8_t NegativeHysterisis;
- uint8_t Reserved1;
- uint8_t Reserved2;
- uint8_t OEMField;
- uint8_t IDStrTypeLen;
- int8_t IDStr [MAX_ID_STR_LEN];
- } FullSensorRec_T;
- /**
- * @struct CompactSensorRec_T
- * @brief Compact Sensor Record
- **/
- typedef struct
- {
- /* SENSOR RECORD HEADER */
- SDRRecHdr_T hdr;
- /* RECORD KEY BYTES */
- uint8_t OwnerID;
- uint8_t OwnerLUN;
- uint8_t SensorNum;
- /* RECORD BODY BYTES */
- uint8_t EntityID;
- uint8_t EntityIns;
- uint8_t SensorInit;
- uint8_t SensorCaps;
- uint8_t SensorType;
- uint8_t EventTypeCode;
- uint16_t AssertionEventMask;
- uint16_t DeAssertionEventMask;
- uint16_t DiscreteReadingMask;
- uint8_t Units1;
- uint8_t Units2;
- uint8_t Units3;
- uint16_t RecordSharing;
- uint8_t PositiveHysteris;
- uint8_t NegativeHysterisis;
- uint8_t Reserved1;
- uint8_t Reserved2;
- uint8_t Reserved3;
- uint8_t OEMField;
- uint8_t IDStrTypeLen;
- int8_t IDStr [MAX_ID_STR_LEN];
- } CompactSensorRec_T;
- /**
- * @struct
- * @brief Common structure for both Full and Compact sensor Record.
- */
- typedef struct
- {
- /* SENSOR RECORD HEADER */
- SDRRecHdr_T hdr;
- /* RECORD KEY BYTES */
- uint8_t OwnerID;
- uint8_t OwnerLUN;
- uint8_t SensorNum;
- /* RECORD BODY BYTES */
- uint8_t EntityID;
- uint8_t EntityIns;
- uint8_t SensorInit;
- uint8_t SensorCaps;
- uint8_t SensorType;
- uint8_t EventTypeCode;
- uint16_t AssertionEventMask;
- uint16_t DeAssertionEventMask;
- uint16_t DiscreteReadingMask;
- uint8_t Units1;
- uint8_t Units2;
- uint8_t Units3;
- } CommonSensorRec_T;
- /**
- * @struct EvtOnlySensorRec_T
- * @brief Event only Sensor Record
- **/
- typedef struct
- {
- /* SENSOR RECORD HEADER */
- SDRRecHdr_T hdr;
- /* RECORD KEY BYTES */
- uint8_t OwnerID;
- uint8_t OwnerLUN;
- uint8_t SensorNum;
- /* RECORD BODY BYTES */
- uint8_t EntityID;
- uint8_t EntityIns;
- uint8_t SensorType;
- uint8_t EventTypeCode;
- uint16_t RecordSharing;
- uint8_t Reserved1;
- uint8_t OEMField;
- uint8_t IDStrTypeLen;
- char IDStr [MAX_ID_STR_LEN];
- } EvtOnlySensorRec_T;
- /**
- * @struct MgmtCtrlrConfirmRec_T
- * @brief Management Controller Confirmation Record
- **/
- typedef struct
- {
- /* SENSOR RECORD HEADER */
- SDRRecHdr_T hdr;
- /* RECORD KEY BYTES */
- uint8_t DevSlaveAddr;
- uint8_t DevID;
- uint8_t ChannelNum;
- /* RECORD BODY BYTES */
- uint8_t FirmwareRev1;
- uint8_t FirmwareRev2;
- uint8_t IPMIVer;
- uint8_t MftrID [3];
- uint8_t ProdID [2];
- uint8_t DevGUID [MAX_ID_STR_LEN];
- } MgmtCtrlrConfirmRec_T;
- /**
- * @struct MgmtCtrlrDevLocator_T
- * @brief Management Controller Device Locator Record
- **/
- typedef struct
- {
- /* SENSOR RECORD HEADER */
- SDRRecHdr_T hdr;
- /* RECORD KEY BYTES */
- uint8_t DevSlaveAddr;
- uint8_t ChannelNum;
- /* RECORD BODY BYTES */
- uint8_t PowerStateNotification;
- uint8_t DeviceCaps;
- uint8_t reserved [3];
- uint8_t EntityID;
- uint8_t EntityIns;
- uint8_t OEMField;
- uint8_t IDStrLen;
- int8_t DevIdStr [MAX_ID_STR_LEN];
- } MgmtCtrlrDevLocator_T;
- /**
- * @struct GnrcDevLocatorRec_T
- * @brief Generic Device Locator Record
- **/
- typedef struct
- {
- /* SENSOR RECORD HEADER */
- SDRRecHdr_T hdr;
- /* RECORD KEY BYTES */
- uint8_t DevAccessAddr;
- uint8_t DevSlaveAddr;
- uint8_t LUNBusID;
- /* RECORD BODY BYTES */
- uint8_t AddrSpan;
- uint8_t Reserved;
- uint8_t DevType;
- uint8_t DevTypeModifier;
- uint8_t EntityID;
- uint8_t EntityIns;
- uint8_t OEMField;
- uint8_t IDStrLen;
- int8_t DevIdStr [MAX_ID_STR_LEN];
- } GnrcDevLocatorRec_T;
- /**
- * @struct FRUcDevLocatorRec_T
- * @brief FRU Device Locator Record
- **/
- typedef struct
- {
- /* SENSOR RECORD HEADER */
- SDRRecHdr_T hdr;
- /* RECORD KEY BYTES */
- uint8_t DevAccessAddr;
- uint8_t FRUIDSlaveAddr;
- uint8_t AccessLUNBusID;
- uint8_t ChannelNumber;
- /* RECORD BODY BYTES */
- uint8_t Reserved;
- uint8_t DevType;
- uint8_t DevTypeModifier;
- uint8_t EntityID;
- uint8_t EntityIns;
- uint8_t OEMField;
- uint8_t IDStrLen;
- int8_t DevIdStr [MAX_ID_STR_LEN];
- } FRUDevLocatorRec_T;
- /**
- * @struct OEM_FRURec_T
- * @brief OEM FRU Record Info
- **/
- typedef struct
- {
- /*SENSOR RECORD HEADER*/
- SDRRecHdr_T hdr;
- /*RECORD BODY BYTES*/
- uint8_t Mfg_ID1;
- uint8_t Mfg_ID2;
- uint8_t Mfg_ID3;
- uint8_t OEM_Fru;
- uint8_t DeviceID;
- uint16_t Size;
- uint8_t AccessType;
- uint8_t EntityID;
- uint8_t EntityIns;
- uint8_t IDStrLen;
- int8_t FilePath[MAX_FRU_SDR_STR_SIZE];
- } OEM_FRURec_T;
- /**
- * @struct OEM_NMRec_T
- * @brief OEM NM Record Info
- **/
- typedef struct
- {
- /*SENSOR RECORD HEADER */
- SDRRecHdr_T hdr;
- /*RECORD BODY BYTES*/
- uint8_t Mfg_ID1;
- uint8_t Mfg_ID2;
- uint8_t Mfg_ID3;
- uint8_t RecordSubType;
- uint8_t VersionNo;
- uint8_t NMDevSlaveAddress;
- uint8_t ChannelNumber;
- uint8_t NMHealthEvtSensor;
- uint8_t NMExceptionEvtSensor;
- uint8_t NMOpCapSensor;
- uint8_t NMAlertThresExSensor;
- } OEM_NMRec_T;
- /**
- * @struct BMCMsgChannelInfoRec_T
- * @brief BMC Mesage Channel info Record
- **/
- typedef struct
- {
- /* SENSOR RECORD HEADER */
- SDRRecHdr_T hdr;
- /* RECORD BODY BYTES */
- uint8_t MsgChannel0Info;
- uint8_t MsgChannel1Info;
- uint8_t MsgChannel2Info;
- uint8_t MsgChannel3Info;
- uint8_t MsgChannel4Info;
- uint8_t MsgChannel5Info;
- uint8_t MsgChannel6Info;
- uint8_t MsgChannel7Info;
- uint8_t MessagingINTType;
- uint8_t EvtMsgBufINTType;
- uint8_t Reserved;
- } BMCMsgChannelInfoRec_T;
- /**
- * @struct SDRRec_T
- * @brief Complete unionized record structure with unions for
- * easy reference to different types
- **/
- typedef union {
- SDRRecHdr_T hdr;
- FullSensorRec_T full_sensor_rec;
- CompactSensorRec_T compact_sensor_rec;
- MgmtCtrlrConfirmRec_T mc_confim_rec;
- MgmtCtrlrDevLocator_T mc_dev_locator_rec;
- GnrcDevLocatorRec_T gen_dev_locator_rec;
- FRUDevLocatorRec_T fru_dev_locator_rec;
- BMCMsgChannelInfoRec_T bmc_msg_chnl_info_rec;
- } SDRRec_T;
- //typedef struct
- //{
- // SDRRecHdr_T hdr;
- // union
- // {
- // FullSensorRec_T full_sensor_rec;
- // CompactSensorRec_T compact_sensor_rec;
- // MgmtCtrlrConfirmRec_T mc_confim_rec;
- // MgmtCtrlrDevLocator_T mc_dev_locator_rec;
- // GnrcDevLocatorRec_T gen_dev_locator_rec;
- // FRUDevLocatorRec_T fru_dev_locator_rec;
- // BMCMsgChannelInfoRec_T bmc_msg_chnl_info_rec;
- // }
- // type;
- //} SDRRec_T;
- #pragma pack( )
- #endif /* IPMI_SDR_RECORD_H */
|