#ifndef DRV_MCH_H #define DRV_MCH_H #include #include #include #define MAX_FRU 255 #define MAX_MGMT 5 // management controller device #define MAX_FRU_MGMT MAX_FRU + MAX_MGMT #define MAX_MCH 255 #define MAX_SENS_INST 32 /* Max instances of one sensor type on one FRU or Management Controller entity */ extern uint32_t mchStat[MAX_MCH]; /* Vadatech typically sends 2 replies; NAT sends 1 */ #define RPLY_TIMEOUT_VT 0.50 #define RPLY_TIMEOUT_NAT 0.25 #define RPLY_TIMEOUT_SENDMSG_RPLY 0.50 #define RPLY_TIMEOUT_DEFAULT 0.25 /* Mask of MCH status * INIT uses 2 lowest bits: * must AND stat with MCH_MASK_INIT and * then test for value, for example: * if ( (mchStat & MCH_MASK_INIT) == MCH_MASK_INIT_DONE ) * Similarly for DBG */ #define MCH_MASK_INIT (0x3) #define MCH_MASK_INIT_NOT_DONE 0 #define MCH_MASK_INIT_IN_PROGRESS 1 #define MCH_MASK_INIT_DONE 2 #define MCH_MASK_INIT_FAILED 3 #define MCH_MASK_ONLN (1<<2) /* 1 = MCH responds to pings */ #define MCH_MASK_CNFG_CHK (1<<3) /* 1 = time to check config up-to-date */ #define MCH_MASK_DBG (0x30) #define MCH_INIT_DONE(x) ((x & MCH_MASK_INIT) == MCH_MASK_INIT_DONE) #define MCH_INIT_NOT_DONE(x) ((x & MCH_MASK_INIT) == MCH_MASK_INIT_NOT_DONE) #define MCH_ONLN(x) ((x & MCH_MASK_ONLN) >> 2) #define MCH_CNFG_CHK(x) ((x & MCH_MASK_CNFG_CHK) >> 3) #define MCH_DBG(x) ((x & MCH_MASK_DBG) >> 4) #define MCH_DBG_SET(x) (x<<4) /* Select debug bits in mask */ #define MCH_DBG_OFF 0 #define MCH_DBG_LOW 1 #define MCH_DBG_MED 2 #define MCH_DBG_HIGH 3 #ifdef __cplusplus extern "C" { #endif /* Handle for each Management Controller Device */ typedef struct MgmtRec_ { uint8_t instance; /* Instance of management controller set in drvMch.c - needed? */ SdrMgmtRec sdr; } MgmtRec, *Mgmt; /* Handle for each FRU */ typedef struct FruRec_ { uint8_t type; /* FRU type */ uint8_t instance; /* Instance of this FRU type, set in drvMch.c - still in use? */ uint8_t size[2]; /* FRU Inventory Area size, LS byte stored first */ uint8_t access; /* Access FRU data by words or bytes */ uint8_t readOffset[2]; uint16_t read; /* Read number */ FruChassisRec chassis; FruBoardRec board; FruProdRec prod; SdrFruRec sdr; char parm[10]; /* Describes FRU type, used to load EPICS records */ uint8_t pwrDyn; /* 1 if FRU supports dynamic reconfiguration of power, otherwise 0 */ uint8_t pwrDly; /* Delay to stable power */ /* Following used only by cooling unit FRUs */ uint8_t fanMin; /* Fan minimum level */ uint8_t fanMax; /* Fan maximum level */ uint8_t fanNom; /* Fan nominal level */ uint8_t fanProp; /* [7] 1 if fan try supports automatic fan speed adjustment */ } FruRec, *Fru; /* Handle for each SDR */ typedef struct SensorRec_ { SdrFullRec sdr; /* Full Sensor SDR */ uint8_t val; /* Most recent sensor reading */ int fruId; /* FRU ID for associated FRU, same as index into FRU array ( -1 if no associated FRU ) */ int mgmtIndex; /* Index into MGMT array for associated Management Controller ( -1 if no associated MGMT ) */ uint8_t instance; /* Instance of this sensor type on this entity (usually a FRU) */ int unavail; /* 1 if sensor reading returns 'Requested Sensor, data, or record not present' */ char parm[10]; /* Describes signal type, used by device support */ size_t readMsgLength;/* Get Sensor Reading message response length */ int cnfg; /* 0 if needs record fields need to be updated */ uint8_t tmask; /* Mask of which thresholds are readable */ uint8_t tlnc; /* Threshold lower non-critical */ uint8_t tlc; /* Threshold lower critical */ uint8_t tlnr; /* Threshold lower non-recoverable */ uint8_t tunc; /* Threshold upper non-critical */ uint8_t tuc; /* Threshold upper critical */ uint8_t tunr; /* Threshold upper non-recoverable */ } SensorRec, *Sensor; /* Struct for MCH session information */ typedef struct MchSessRec_ { char name[MAX_NAME_LENGTH]; /* MCH port name used by asyn */ int instance; /* MCH instance number; assigned at init */ epicsThreadId pingThreadId; /* Thread ID for task that periodically pings MCH */ double timeout; /* Asyn read timeout */ int session; /* Enable session with MCH */ int err; /* Count of sequential message errors */ int type; /* MCH vendor, Vadatech, NAT, etc. - need to clean this up, perhaps merge with vendor and/or add 'features' */ } MchSessRec, *MchSess; /* Struct for MCH system information */ typedef struct MchSysRec_ { char name[MAX_NAME_LENGTH]; /* MCH port name used by asyn */ SdrRepRec sdrRep; FruRec *fru; /* Array of FRUs (size of MAX_FRU) */ int sensLkup[MAX_FRU_MGMT][MAX_SENSOR_TYPE][MAX_SENS_INST]; /* Index into sens struct array, used by devsup, -1 if not used */ /*sens count used to be 8-bit !! */ uint32_t sensCount; /* Sensor count, data type must be larger than MAX_FRU_MGMT*MAX_SENSOR_TYPE*MAX_SENS_INST */ SensorRec *sens; /* Array of sensors (size of sensCount) */ uint8_t mgmtCount; /* Management controller device count */ MgmtRec *mgmt; /* Array of management controller devices (size of mgmtCount) */ } MchSysRec, *MchSys; /* Struct for MCH system information */ typedef struct MchDataRec_ { IpmiSess ipmiSess; /* IPMI session information; defined in ipmiDef.h */ MchSess mchSess; /* Additional MCH session info */ MchSys mchSys; /* MCH system info */ } MchDataRec, *MchData; /*extern MchSys mchSysData[MAX_MCH];*/ int mchCnfgChk(MchData mchData); void mchStatSet(int inst, uint32_t clear, uint32_t set); int mchNewSession(MchSess mchSess, IpmiSess ipmiSess); int mchGetSensorReadingStat(MchData mchData, Sensor sens, uint8_t *response, uint8_t number, uint8_t lun, size_t *sensReadMsgLength); /* Response message payload (aka IMSG2) lengths (0s for those that can vary) */ #define IPMI_RPLY_IMSG2_CLOSE_SESSION_LENGTH 1 #define IPMI_RPLY_IMSG2_SENSOR_READ_MAX_LENGTH 5 /* length varies */ #define IPMI_RPLY_IMSG2_GET_SENSOR_THRESH_LENGTH 8 /* need to determine this; using NAT length for now*/ #define IPMI_RPLY_IMSG2_GET_CHAS_STATUS_LENGTH 4 /* does NOT include optional byte */ #define IPMI_RPLY_IMSG2_CHAS_CTRL_LENGTH 1 #define IPMI_RPLY_IMSG2_GET_FRU_INFO_LENGTH 4 /* get fru message length is this + remaining data bytes */ #define IPMI_RPLY_IMSG2_READ_FRU_DATA_BASE_LENGTH 2 #define IPMI_RPLY_IMSG2_WRITE_FRU_DATA_LENGTH 2 #define IPMI_RPLY_IMSG2_GET_SDRREP_INFO_LENGTH 15 #define IPMI_RPLY_IMSG2_RESERVE_SDRREP_LENGTH 3 #define IPMI_RPLY_IMSG2_GET_SDR_BASE_LENGTH 3 /* get sdr message length is this + remaining data bytes */ #define IPMI_RPLY_IMSG2_GET_SDR_LENGTH 0 /* varies */ #define IPMI_RPLY_IMSG2_GET_DEV_SDR_INFO_LENGTH 7 #define IPMI_RPLY_IMSG2_GET_DEV_SDR_LENGTH 0 /* varies; base length is 3 */ #define IPMI_RPLY_IMSG2_COLD_RESET_LENGTH 1 /* MicroTCA-specific commands */ #define IPMI_RPLY_IMSG2_SET_FRU_POLICY_LENGTH 0 /*TBD*/ #define IPMI_RPLY_IMSG2_GET_FRU_POLICY_LENGTH 0 /*TBD*/ #define IPMI_RPLY_IMSG2_SET_FRU_ACT_LENGTH 0 /*TBD*/ //#define IPMI_RPLY_IMSG2_GET_DEVICE_ID_LENGTH 0 /*TBD*/ /* includes optional bytes */ #define IPMI_RPLY_IMSG2_GET_FAN_PROP_LENGTH 0 /*TBD*/ #define IPMI_RPLY_IMSG2_GET_FAN_LEVEL_LENGTH 0 /*TBD*/ #define IPMI_RPLY_IMSG2_SET_FAN_LEVEL_LENGTH 0 /*TBD*/ /* Response message lengths using Vadatech MCH (0s for those that can vary) */ #define IPMI_RPLY_CLOSE_SESSION_LENGTH_VT 22 #define IPMI_RPLY_SENSOR_READ_MAX_LENGTH_VT 48 /* length varies */ #define IPMI_RPLY_GET_SENSOR_THRESH_LENGTH_VT 51 /* need to determine this; using NAT length for now*/ #define IPMI_RPLY_GET_CHAS_STATUS_LENGTH_VT 47 /* does NOT include optional byte */ #define IPMI_RPLY_CHAS_CTRL_LENGTH_VT 44 #define IPMI_RPLY_GET_FRU_INFO_LENGTH_VT 47 #define IPMI_RPLY_READ_FRU_DATA_BASE_LENGTH_VT 45 #define IPMI_RPLY_WRITE_FRU_DATA_LENGTH_VT 45 #define IPMI_RPLY_GET_SDRREP_INFO_LENGTH_VT 58 #define IPMI_RPLY_RESERVE_SDRREP_LENGTH_VT 46 #define IPMI_RPLY_GET_SDR_BASE_LENGTH_VT 50 /* get sdr message length is this + remaining data bytes */ #define IPMI_RPLY_GET_SDR_LENGTH_VT 0 /* varies */ #define IPMI_RPLY_GET_DEV_SDR_INFO_LENGTH_VT 50 #define IPMI_RPLY_GET_DEV_SDR_LENGTH_VT 0 /* varies */ #define IPMI_RPLY_COLD_RESET_LENGTH_VT 44 #define IPMI_RPLY_SET_FRU_POLICY_LENGTH_VT 44 #define IPMI_RPLY_GET_FRU_POLICY_LENGTH_VT 45 #define IPMI_RPLY_SET_FRU_ACT_LENGTH_VT 45 #define IPMI_RPLY_GET_DEVICE_ID_LENGTH_VT 59 /* includes optional bytes */ #define IPMI_RPLY_GET_FAN_PROP_LENGTH_VT 49 #define IPMI_RPLY_GET_FAN_LEVEL_LENGTH_VT 48 #define IPMI_RPLY_SET_FAN_LEVEL_LENGTH_VT 45 /* Response message lengths using NAT MCH (0s for those we haven't figured out yet) */ #define IPMI_RPLY_CLOSE_SESSION_LENGTH_NAT 22 /* UPDATE THIS */ #define IPMI_RPLY_SENSOR_READ_MAX_LENGTH_NAT 34 /* length varies */ #define IPMI_RPLY_GET_SENSOR_THRESH_LENGTH_NAT 51 #define IPMI_RPLY_GET_CHAS_STATUS_LENGTH_NAT 47 /* does NOT include optional byte */ #define IPMI_RPLY_CHAS_CTRL_LENGTH_NAT 44 #define IPMI_RPLY_GET_FRU_INFO_LENGTH_NAT 32 #define IPMI_RPLY_READ_FRU_DATA_BASE_LENGTH_NAT 30 #define IPMI_RPLY_WRITE_FRU_DATA_LENGTH_NAT 45 #define IPMI_RPLY_GET_SDRREP_INFO_LENGTH_NAT 43 #define IPMI_RPLY_RESERVE_SDRREP_LENGTH_NAT 31 #define IPMI_RPLY_GET_SDR_BASE_LENGTH_NAT 35 /* get sdr message length is this + remaining data bytes */ #define IPMI_RPLY_GET_SDR_LENGTH_NAT 0 /* varies */ #define IPMI_RPLY_GET_DEV_SDR_INFO_LENGTH_NAT 50 #define IPMI_RPLY_GET_DEV_SDR_LENGTH_NAT 0 /* varies */ #define IPMI_RPLY_COLD_RESET_LENGTH_NAT 44 #define IPMI_RPLY_SET_FRU_POLICY_LENGTH_NAT 29 #define IPMI_RPLY_GET_FRU_POLICY_LENGTH_NAT 39 #define IPMI_RPLY_SET_FRU_ACT_LENGTH_NAT 45 #define IPMI_RPLY_GET_DEVICE_ID_LENGTH_NAT 44 /* includes optional bytes */ #define IPMI_RPLY_GET_FAN_PROP_LENGTH_NAT 43 #define IPMI_RPLY_GET_FAN_LEVEL_LENGTH_NAT 42 #define IPMI_RPLY_SET_FAN_LEVEL_LENGTH_NAT 41 #define IPMI_RPLY_OFFSET_NAT -15 #define IPMI_RPLY_2ND_BRIDGED_OFFSET_NAT 14 /* Response message data; offsets from beginning of message; * These defaults work for single-bridged replies from Vadatech MCH. * Non-bridged or NAT replies require different offsets */ /* new offsets need to be tested with utca */ #define IPMI_RPLY_AUTH_CAP_CHAN_OFFSET_OLD 2 /* Get Authentication Capabilities response - channel number */ #define IPMI_RPLY_AUTH_CAP_AUTH_OFFSET_OLD 23 /* Get Authentication Capabilities response - authentication type support */ #define IPMI_RPLY_IMSG2_AUTH_CAP_CHAN_OFFSET 1 /* Get Authentication Capabilities response - channel number */ #define IPMI_RPLY_IMSG2_AUTH_CAP_AUTH_OFFSET 2 /* Get Authentication Capabilities response - authentication type support */ #define IPMI_RPLY_AUTH_CAP_CHAN_OFFSET 21 /* Get Authentication Capabilities response - channel number */ #define IPMI_RPLY_AUTH_CAP_AUTH_OFFSET 22 /* Get Authentication Capabilities response - authentication type support */ #define IPMI_RPLY_TEMP_ID_OFFSET 21 /* Temporary session ID */ #define IPMI_RPLY_IMSG2_GET_SESS_TEMP_ID_OFFSET 1 /* Temporary session ID */ #define IPMI_RPLY_TEMP_ID_LENGTH 4 #define IPMI_RPLY_STR_OFFSET 25 /* Challenge string */ #define IPMI_RPLY_IMSG2_GET_SESS_STR_OFFSET 5 /* Challenge string */ #define IPMI_RPLY_STR_LENGTH 16 #define IPMI_RPLY_AUTH_TYPE_OFFSET 21 /* Authentication type */ #define IPMI_RPLY_IMSG2_ACT_SESSAUTH_TYPE_OFFSET 1 /* Authentication type */ #define IPMI_RPLY_AUTH_TYPE_LENGTH 1 #define IPMI_RPLY_ID_OFFSET 22 /* Session ID for remainder of session */ #define IPMI_RPLY_IMSG2_ACT_SESS_ID_OFFSET 2 /* Session ID for remainder of session */ #define IPMI_RPLY_ID_LENGTH 4 #define IPMI_RPLY_INIT_SEND_SEQ_OFFSET 26 /* Start sequence number for messages to MCH */ #define IPMI_RPLY_IMSG2_ACT_SESS_INIT_SEND_SEQ_OFFSET 6 /* Start sequence number for messages to MCH */ #define IPMI_RPLY_INIT_SEND_SEQ_LENGTH 4 #define IPMI_RPLY_MAX_PRIV_OFFSET 30 /* Maximum privilege level allowed for session */ #define IPMI_RPLY_IMSG2_ACT_SESS_MAX_PRIV_OFFSET 10 /* Maximum privilege level allowed for session */ #define IPMI_RPLY_MAX_PRIV_LENGTH 1 #define IPMI_RPLY_SEQ_OFFSET 5 /* From-MCH sequence number (in reply to non-bridged message) */ #define IPMI_RPLY_HDR_SESS_SEQ_OFFSET 1 /* From-MCH session sequence number (in reply to non-bridged message) */ #define IPMI_RPLY_SEQ_LENGTH 4 #define IPMI_RPLY_SEQLUN_OFFSET 18 /* MS 6 bits: IPMI sequence, LS 2 bits: LUN */ #define IPMI_RPLY_IMSG1_SEQLUN_OFFSET 4 /* MS 6 bits: IPMI sequence, LS 2 bits: LUN */ #define IPMI_RPLY_COMPLETION_CODE_OFFSET_OLD 42 #define IPMI_RPLY_IPMI_VERS_OFFSET_OLD 47 /* Returned from Get Device ID Command */ #define IPMI_RPLY_MANUF_ID_OFFSET_OLD 49 /* Returned from Get Device ID Command */ #define IPMI_RPLY_MANUF_ID_LENGTH 3 #define IPMI_RPLY_SENSOR_READING_OFFSET_OLD 43 /* Sensor reading (1 byte) */ #define IPMI_RPLY_SENSOR_ENABLE_BITS_OFFSET_OLD 44 /* Sensor enable bits: event msgs; scanning; reading/state */ #define IPMI_RPLY_HS_SENSOR_READING_OFFSET_OLD 45 /* Hot swap sensor reading (1 byte) */ #define IPMI_RPLY_FRU_AREA_SIZE_LSB_OFFSET_OLD 43 /* FRU inventory area size in bytes, LSB */ #define IPMI_RPLY_FRU_AREA_SIZE_MSB_OFFSET_OLD 44 /* FRU inventory area size in bytes, MSB */ #define IPMI_RPLY_FRU_AREA_ACCESS_OFFSET_OLD 45 /* Bit 0 indicates if device is accessed by bytes (0) or words (1) */ #define IPMI_RPLY_FRU_DATA_READ_OFFSET_OLD 44 /* FRU data */ #define IPMI_RPLY_SDRREP_VER_OFFSET_OLD 43 /* SDR Repository Info */ #define IPMI_RPLY_SDRREP_CNT_LSB_OFFSET_OLD 44 /* Number of records in repository, LSB */ #define IPMI_RPLY_SDRREP_CNT_MSB_OFFSET_OLD 45 /* Number of records in repository, MSB */ #define IPMI_RPLY_SDRREP_ADD_TS_OFFSET_OLD 48 /* Timestamp of most recent addition, LSB first */ #define IPMI_RPLY_SDRREP_DEL_TS_OFFSET_OLD 52 /* Timestamp of most recent deletion, LSB first */ #define IPMI_RPLY_DEV_SDR_CNT_OFFSET_OLD 43 /* Number of SDRs for device */ #define IPMI_RPLY_DEV_SDR_FLAGS_OFFSET_OLD 44 /* Number of SDRs for device */ #define IPMI_RPLY_GET_SDR_NEXT_ID_LSB_OFFSET_OLD 43 /* ID of next sensor in repository, LSB */ #define IPMI_RPLY_GET_SDR_NEXT_ID_MSB_OFFSET_OLD 44 /* ID of next sensor in repository, MSB */ #define IPMI_RPLY_GET_SDR_DATA_OFFSET_OLD 45 /* ID of next sensor in repository, MSB */ /* need to update this */ #define IPMI_RPLY_GET_FRU_POLICY_PROP_OFFSET 44 /* FRU activation policy properties */ #define IPMI_RPLY_COMPLETION_CODE_UNBRIDGED_OFFSET 20 #define IPMI_RPLY_COMPLETION_CODE_OFFSET 20 /* Offsets into payload message * (0-leading as these are used as index arrays, * 0th element always completion code) */ #define IPMI_RPLY_IMSG2_GET_DEVICE_ID_MANUF_ID_OFFSET 7 /* Returned from Get Device ID Command */ #define IPMI_RPLY_MANUF_ID_OFFSET 10 /* Returned from Get Device ID Command */ #define IPMI_RPLY_IPMI_VERS_OFFSET 8 /* Returned from Get Device ID Command */ #define IPMI_RPLY_IMSG2_GET_DEVICE_ID_IPMI_VERS_OFFSET 5 /* Returned from Get Device ID Command */ #define IPMI_RPLY_SDRREP_VER_OFFSET 1 /* SDR Repository Info */ #define IPMI_RPLY_IMSG2_SDRREP_VER_OFFSET 1 /* SDR Repository Info */ #define IPMI_RPLY_SDRREP_CNT_LSB_OFFSET 2 /* Number of records in repository, LSB */ #define IPMI_RPLY_SDRREP_CNT_MSB_OFFSET 3 /* Number of records in repository, MSB */ #define IPMI_RPLY_IMSG2_SDRREP_CNT_LSB_OFFSET 2 /* Number of records in repository, LSB */ #define IPMI_RPLY_IMSG2_SDRREP_CNT_MSB_OFFSET 3 /* Number of records in repository, MSB */ #define IPMI_RPLY_SDRREP_ADD_TS_OFFSET 6 /* Timestamp of most recent addition, LSB first */ #define IPMI_RPLY_SDRREP_DEL_TS_OFFSET 10 /* Timestamp of most recent deletion, LSB first */ #define IPMI_RPLY_IMSG2_SDRREP_ADD_TS_OFFSET 6 /* Timestamp of most recent addition, LSB first */ #define IPMI_RPLY_IMSG2_SDRREP_DEL_TS_OFFSET 10 /* Timestamp of most recent deletion, LSB first */ #define IPMI_RPLY_DEV_SDR_CNT_OFFSET 1 /* Number of SDRs for device */ #define IPMI_RPLY_DEV_SDR_FLAGS_OFFSET 2 /* Number of SDRs for device */ #define IPMI_RPLY_IMSG2_DEV_SDR_INFO_CNT_OFFSET 1 /* Number of SDRs for device */ #define IPMI_RPLY_IMSG2_DEV_SDR_INFO_FLAGS_OFFSET 2 /* Number of SDRs for device */ #define IPMI_RPLY_GET_SDR_NEXT_ID_LSB_OFFSET 1 /* ID of next sensor in repository, LSB */ #define IPMI_RPLY_GET_SDR_NEXT_ID_MSB_OFFSET 2 /* ID of next sensor in repository, MSB */ #define IPMI_RPLY_IMSG2_GET_SDR_NEXT_ID_LSB_OFFSET 1 /* ID of next sensor in repository, LSB */ #define IPMI_RPLY_IMSG2_GET_SDR_NEXT_ID_MSB_OFFSET 2 /* ID of next sensor in repository, MSB */ #define IPMI_RPLY_GET_SDR_DATA_OFFSET 3 /* Requested SDR data */ #define IPMI_RPLY_GET_SDR_RES_LSB_OFFSET 1 /* Reservation ID returned by Reserve SDR Rep */ #define IPMI_RPLY_GET_SDR_RES_MSB_OFFSET 2 /* Reservation ID returned by Reserve SDR Rep */ #define IPMI_RPLY_IMSG2_GET_SDR_DATA_OFFSET 3 /* Requested SDR data */ #define IPMI_RPLY_IMSG2_GET_SDR_RES_LSB_OFFSET 1 /* Reservation ID returned by Reserve SDR Rep */ #define IPMI_RPLY_IMSG2_GET_SDR_RES_MSB_OFFSET 2 /* Reservation ID returned by Reserve SDR Rep */ #define IPMI_RPLY_FRU_AREA_SIZE_LSB_OFFSET 1 /* FRU inventory area size in bytes, LSB */ #define IPMI_RPLY_FRU_AREA_SIZE_MSB_OFFSET 2 /* FRU inventory area size in bytes, MSB */ #define IPMI_RPLY_FRU_AREA_ACCESS_OFFSET 3 /* Bit 0 indicates if device is accessed by bytes (0) or words (1) */ #define IPMI_RPLY_FRU_DATA_READ_OFFSET 2 /* FRU data */ #define IPMI_RPLY_IMSG2_FRU_AREA_SIZE_LSB_OFFSET 1 /* FRU inventory area size in bytes, LSB */ #define IPMI_RPLY_IMSG2_FRU_AREA_SIZE_MSB_OFFSET 2 /* FRU inventory area size in bytes, MSB */ #define IPMI_RPLY_IMSG2_FRU_AREA_ACCESS_OFFSET 3 /* Bit 0 indicates if device is accessed by bytes (0) or words (1) */ #define IPMI_RPLY_IMSG2_FRU_DATA_READ_OFFSET 2 /* FRU data */ #define IPMI_RPLY_SENSOR_READING_OFFSET 1 /* Sensor reading (1 byte) */ #define IPMI_RPLY_DISCRETE_SENSOR_READING_OFFSET 3 /* Discrete multi-state sensor value in threshold/assertions byte */ #define IPMI_RPLY_SENSOR_ENABLE_BITS_OFFSET 2 /* Sensor enable bits: event msgs; scanning; reading/state */ #define IPMI_RPLY_SENSOR_THRESH_MASK_OFFSET 1 /* Mask of readable thresholds */ #define IPMI_RPLY_SENSOR_THRESH_LNC_OFFSET 2 /* Lower non-critical threshold */ #define IPMI_RPLY_SENSOR_THRESH_LC_OFFSET 3 /* Lower critical threshold */ #define IPMI_RPLY_SENSOR_THRESH_LNR_OFFSET 4 /* Lower non-recoverable threshold */ #define IPMI_RPLY_SENSOR_THRESH_UNC_OFFSET 5 /* Upper non-critical threshold */ #define IPMI_RPLY_SENSOR_THRESH_UC_OFFSET 6 /* Upper critical threshold */ #define IPMI_RPLY_SENSOR_THRESH_UNR_OFFSET 7 /* Upper non-recoverable threshold */ #define IPMI_RPLY_IMSG2_SENSOR_READING_OFFSET 1 /* Sensor reading (1 byte) */ #define IPMI_RPLY_IMSG2_DISCRETE_SENSOR_READING_OFFSET 3 /* Discrete multi-state sensor value in threshold/assertions byte */ #define IPMI_RPLY_IMSG2_SENSOR_ENABLE_BITS_OFFSET 2 /* Sensor enable bits: event msgs; scanning; reading/state */ #define IPMI_RPLY_IMSG2_SENSOR_THRESH_MASK_OFFSET 1 /* Mask of readable thresholds */ #define IPMI_RPLY_IMSG2_SENSOR_THRESH_LNC_OFFSET 2 /* Lower non-critical threshold */ #define IPMI_RPLY_IMSG2_SENSOR_THRESH_LC_OFFSET 3 /* Lower critical threshold */ #define IPMI_RPLY_IMSG2_SENSOR_THRESH_LNR_OFFSET 4 /* Lower non-recoverable threshold */ #define IPMI_RPLY_IMSG2_SENSOR_THRESH_UNC_OFFSET 5 /* Upper non-critical threshold */ #define IPMI_RPLY_IMSG2_SENSOR_THRESH_UC_OFFSET 6 /* Upper critical threshold */ #define IPMI_RPLY_IMSG2_SENSOR_THRESH_UNR_OFFSET 7 /* Upper non-recoverable threshold */ /* Read offset: bridged request, reply is in 1 message packet (NAT) */ #define IPMI_RPLY_BRIDGED_1REPLY_OFFSET 7 /* Read offset: bridged request, reply is in 2 message packet2 (VT) */ #define IPMI_RPLY_BRIDGED_2REPLY_OFFSET 22 /* Read offset: double bridged request, reply is in 1 message packet (NAT), not sure about this one */ #define IPMI_RPLY_2BRIDGED_1REPLY_OFFSET 0 #define FOOTER_LENGTH 1 /* checksum */ #define IPMI_RPLY_IMSG2_GET_DEVICE_ID_LENGTH 12 #define IPMI_RPLY_IMSG2_GET_SDRREP_INFO_LENGTH 15 #define IPMI_RPLY_IMSG2_RESERVE_SDRREP_LENGTH 3 #define IPMI_RPLY_IMSG2_GET_DEV_SDR_INFO_LENGTH 7 #define IPMI_RPLY_IMSG2_GET_DEV_SDR_LENGTH_HDR 3 #define SDR_MAX_READ_SIZE 22 /*not all systems can deliver full SDR in one message, ipmitool uses 22 for VT (and maybe others */ #define IPMI_RPLY_CLOSE_SESSION_LENGTH_VT 22 #define IPMI_RPLY_IMSG2_SENSOR_READ_MAX_LENGTH 5 /* max, length varies */ #define IPMI_RPLY_IMSG2_GET_SENSOR_THRESH_LENGTH 8 #define IPMI_RPLY_IMSG2_GET_CHAS_STATUS_LENGTH_VT 47 /* does NOT include optional byte */ #define IPMI_RPLY_IMSG2_CHAS_CTRL_LENGTH 1 #define IPMI_RPLY_IMSG2_GET_FRU_INV_INFO_LENGTH 4 #define IPMI_RPLY_IMSG2_READ_FRU_DATA_LENGTH_HDR 2 #define IPMI_RPLY_IMSG2_WRITE_FRU_DATA_LENGTH 2 #define IPMI_RPLY_IMSG2_GET_SDR_LENGTH_HDR 3 /* get sdr message length is this + remaining data bytes */ //#define IPMI_RPLY_GET_SDR_LENGTH 0 /* varies */ #define IPMI_RPLY_IMSG2_COLD_RESET_LENGTH 1 #define IPMI_RPLY_IMSG2_CHAS_CTRL_LENGTH 1 #define SENSOR_TYPE_HOTSWAP 0xF0 /* Contains M-state */ #define SENSOR_TYPE_HOTSWAP_NAT 0xF2 /* IPMI device types */ #define MCH_TYPE_MAX 10 /* Number possible MCH types; increase as needed */ #define MCH_TYPE_UNKNOWN 0 #define MCH_TYPE_VT 1 #define MCH_TYPE_NAT 2 #define MCH_TYPE_DELL 3 #define MCH_TYPE_SUPERMICRO 4 #define MCH_IS_VT(x) (x == MCH_TYPE_VT) #define MCH_IS_NAT(x) (x == MCH_TYPE_NAT) #define MCH_IS_DELL(x) (x == MCH_TYPE_DELL) #define MCH_IS_SUPERMICRO(x) (x == MCH_TYPE_SUPERMICRO) #define MCH_IS_MICROTCA(x) ((x==MCH_TYPE_NAT)||(x==MCH_TYPE_VT)) #define MCH_DESC_MAX_LENGTH 40 extern char mchDescString[MCH_TYPE_MAX][MCH_DESC_MAX_LENGTH]; /* Defined in drvMch.c */ /* Manufacturer ID */ #define MCH_MANUF_ID_VT 0x5D32 #define MCH_MANUF_ID_NAT 0x6C78 #define MCH_MANUF_ID_DELL 0x02A2 #define MCH_MANUF_ID_SUPERMICRO 0x2A7C /* Product ID */ #define MCH_PROD_ID_DELL 0x0100 /* Vadatech */ #define VT_ENTITY_ID_MCH 0xC2 #define VT_ENTITY_ID_AMC 0xC1 #define VT_ENTITY_ID_CU 0x1E #define VT_ENTITY_ID_PM 0x0A #define VT_ENTITY_ID_RTM 0xC0 /* asked Vivek to verify */ #ifdef __cplusplus }; #endif #endif