com_IPMI_SDRRecord.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. /*****************************************************************
  2. *****************************************************************
  3. *** **
  4. *** (C)Copyright 2005-2006, American Megatrends Inc. **
  5. *** **
  6. *** All Rights Reserved. **
  7. *** **
  8. *** 6145-F, Northbelt Parkway, Norcross, **
  9. *** **
  10. *** Georgia - 30071, USA. Phone-(770)-246-8600. **
  11. *** **
  12. *****************************************************************
  13. *****************************************************************
  14. *****************************************************************
  15. ******************************************************************
  16. *
  17. * SDRRecord.h
  18. * SDR record structures.
  19. *
  20. * Author: Govind Kothandapani <govindk@ami.com>
  21. *
  22. ******************************************************************/
  23. #ifndef IPMI_SDR_RECORD_H
  24. #define IPMI_SDR_RECORD_H
  25. #ifndef uint8_t
  26. #define uint8_t unsigned char
  27. #endif
  28. #ifndef uint16_t
  29. #define uint16_t unsigned short
  30. #endif
  31. #ifndef uint32_t
  32. #define uint32_t unsigned long
  33. #endif
  34. #ifndef int8_t
  35. #define int8_t signed char
  36. #endif
  37. #ifndef int16_t
  38. #define int16_t signed short
  39. #endif
  40. #ifndef int32_t
  41. #define int32_t signed long
  42. #endif
  43. #pragma pack( 1 )
  44. /**
  45. * @brief SDR Type
  46. **/
  47. #define FULL_SDR_REC 0x01
  48. #define COMPACT_SDR_REC 0x02
  49. #define EVENT_ONLY_SDR_REC 0x03
  50. #define ENTITY_ASSOCIATION_SDR_REC 0x08
  51. #define DEV_REL_ENTITY_ASSOCIATION_SDR_REC 0x09
  52. #define GENERIC_DEVICE_LOCATOR_SDR_REC 0x10
  53. #define FRU_DEVICE_LOCATOR_SDR_REC 0x11
  54. #define MGMT_CTRL_DEV_LOCATOR_SDR_REC 0x12
  55. #define MGMT_CTRL_CONFIRMATION_SDR_REC 0x13
  56. #define BMC_MSG_CHANNEL_INFO_REC 0x14
  57. #define OEM_SDRFRU_REC 0xD0
  58. #define OEM_SDRNM_REC 0xC0
  59. /**
  60. * @struct SDRRecHdr_T
  61. * @brief SDR Record Header
  62. **/
  63. typedef struct
  64. {
  65. uint16_t ID;
  66. uint8_t Version;
  67. uint8_t Type;
  68. uint8_t Len;
  69. } SDRRecHdr_T;
  70. /**
  71. * @struct FullSensorRec_T
  72. * @brief Full Sensor Record
  73. **/
  74. typedef struct
  75. {
  76. /* SENSOR RECORD HEADER */
  77. SDRRecHdr_T hdr;
  78. /* RECORD KEY BYTES */
  79. uint8_t OwnerID;
  80. uint8_t OwnerLUN;
  81. uint8_t SensorNum;
  82. /* RECORD BODY BYTES */
  83. uint8_t EntityID;
  84. uint8_t EntityIns;
  85. uint8_t SensorInit;
  86. uint8_t SensorCaps;
  87. uint8_t SensorType;
  88. uint8_t EventTypeCode;
  89. uint16_t AssertionEventMask;
  90. uint16_t DeAssertionEventMask;
  91. uint16_t DiscreteReadingMask;
  92. uint8_t Units1;
  93. uint8_t Units2;
  94. uint8_t Units3;
  95. uint8_t Linearization;
  96. uint8_t M;
  97. uint8_t M_Tolerance;
  98. uint8_t B;
  99. uint8_t B_Accuracy;
  100. uint8_t Accuracy;
  101. uint8_t R_B_Exp;
  102. uint8_t Flags;
  103. uint8_t NominalReading;
  104. uint8_t NormalMax;
  105. uint8_t NormalMin;
  106. uint8_t MaxReading;
  107. uint8_t MinReading;
  108. uint8_t UpperNonRecoverable;
  109. uint8_t UpperCritical;
  110. uint8_t UpperNonCritical;
  111. uint8_t LowerNonRecoverable;
  112. uint8_t LowerCritical;
  113. uint8_t LowerNonCritical;
  114. uint8_t PositiveHysterisis;
  115. uint8_t NegativeHysterisis;
  116. uint8_t Reserved1;
  117. uint8_t Reserved2;
  118. uint8_t OEMField;
  119. uint8_t IDStrTypeLen;
  120. int8_t IDStr [MAX_ID_STR_LEN];
  121. } FullSensorRec_T;
  122. /**
  123. * @struct CompactSensorRec_T
  124. * @brief Compact Sensor Record
  125. **/
  126. typedef struct
  127. {
  128. /* SENSOR RECORD HEADER */
  129. SDRRecHdr_T hdr;
  130. /* RECORD KEY BYTES */
  131. uint8_t OwnerID;
  132. uint8_t OwnerLUN;
  133. uint8_t SensorNum;
  134. /* RECORD BODY BYTES */
  135. uint8_t EntityID;
  136. uint8_t EntityIns;
  137. uint8_t SensorInit;
  138. uint8_t SensorCaps;
  139. uint8_t SensorType;
  140. uint8_t EventTypeCode;
  141. uint16_t AssertionEventMask;
  142. uint16_t DeAssertionEventMask;
  143. uint16_t DiscreteReadingMask;
  144. uint8_t Units1;
  145. uint8_t Units2;
  146. uint8_t Units3;
  147. uint16_t RecordSharing;
  148. uint8_t PositiveHysteris;
  149. uint8_t NegativeHysterisis;
  150. uint8_t Reserved1;
  151. uint8_t Reserved2;
  152. uint8_t Reserved3;
  153. uint8_t OEMField;
  154. uint8_t IDStrTypeLen;
  155. int8_t IDStr [MAX_ID_STR_LEN];
  156. } CompactSensorRec_T;
  157. /**
  158. * @struct
  159. * @brief Common structure for both Full and Compact sensor Record.
  160. */
  161. typedef struct
  162. {
  163. /* SENSOR RECORD HEADER */
  164. SDRRecHdr_T hdr;
  165. /* RECORD KEY BYTES */
  166. uint8_t OwnerID;
  167. uint8_t OwnerLUN;
  168. uint8_t SensorNum;
  169. /* RECORD BODY BYTES */
  170. uint8_t EntityID;
  171. uint8_t EntityIns;
  172. uint8_t SensorInit;
  173. uint8_t SensorCaps;
  174. uint8_t SensorType;
  175. uint8_t EventTypeCode;
  176. uint16_t AssertionEventMask;
  177. uint16_t DeAssertionEventMask;
  178. uint16_t DiscreteReadingMask;
  179. uint8_t Units1;
  180. uint8_t Units2;
  181. uint8_t Units3;
  182. } CommonSensorRec_T;
  183. /**
  184. * @struct EvtOnlySensorRec_T
  185. * @brief Event only Sensor Record
  186. **/
  187. typedef struct
  188. {
  189. /* SENSOR RECORD HEADER */
  190. SDRRecHdr_T hdr;
  191. /* RECORD KEY BYTES */
  192. uint8_t OwnerID;
  193. uint8_t OwnerLUN;
  194. uint8_t SensorNum;
  195. /* RECORD BODY BYTES */
  196. uint8_t EntityID;
  197. uint8_t EntityIns;
  198. uint8_t SensorType;
  199. uint8_t EventTypeCode;
  200. uint16_t RecordSharing;
  201. uint8_t Reserved1;
  202. uint8_t OEMField;
  203. uint8_t IDStrTypeLen;
  204. char IDStr [MAX_ID_STR_LEN];
  205. } EvtOnlySensorRec_T;
  206. /**
  207. * @struct MgmtCtrlrConfirmRec_T
  208. * @brief Management Controller Confirmation Record
  209. **/
  210. typedef struct
  211. {
  212. /* SENSOR RECORD HEADER */
  213. SDRRecHdr_T hdr;
  214. /* RECORD KEY BYTES */
  215. uint8_t DevSlaveAddr;
  216. uint8_t DevID;
  217. uint8_t ChannelNum;
  218. /* RECORD BODY BYTES */
  219. uint8_t FirmwareRev1;
  220. uint8_t FirmwareRev2;
  221. uint8_t IPMIVer;
  222. uint8_t MftrID [3];
  223. uint8_t ProdID [2];
  224. uint8_t DevGUID [MAX_ID_STR_LEN];
  225. } MgmtCtrlrConfirmRec_T;
  226. /**
  227. * @struct MgmtCtrlrDevLocator_T
  228. * @brief Management Controller Device Locator Record
  229. **/
  230. typedef struct
  231. {
  232. /* SENSOR RECORD HEADER */
  233. SDRRecHdr_T hdr;
  234. /* RECORD KEY BYTES */
  235. uint8_t DevSlaveAddr;
  236. uint8_t ChannelNum;
  237. /* RECORD BODY BYTES */
  238. uint8_t PowerStateNotification;
  239. uint8_t DeviceCaps;
  240. uint8_t reserved [3];
  241. uint8_t EntityID;
  242. uint8_t EntityIns;
  243. uint8_t OEMField;
  244. uint8_t IDStrLen;
  245. int8_t DevIdStr [MAX_ID_STR_LEN];
  246. } MgmtCtrlrDevLocator_T;
  247. /**
  248. * @struct GnrcDevLocatorRec_T
  249. * @brief Generic Device Locator Record
  250. **/
  251. typedef struct
  252. {
  253. /* SENSOR RECORD HEADER */
  254. SDRRecHdr_T hdr;
  255. /* RECORD KEY BYTES */
  256. uint8_t DevAccessAddr;
  257. uint8_t DevSlaveAddr;
  258. uint8_t LUNBusID;
  259. /* RECORD BODY BYTES */
  260. uint8_t AddrSpan;
  261. uint8_t Reserved;
  262. uint8_t DevType;
  263. uint8_t DevTypeModifier;
  264. uint8_t EntityID;
  265. uint8_t EntityIns;
  266. uint8_t OEMField;
  267. uint8_t IDStrLen;
  268. int8_t DevIdStr [MAX_ID_STR_LEN];
  269. } GnrcDevLocatorRec_T;
  270. /**
  271. * @struct FRUcDevLocatorRec_T
  272. * @brief FRU Device Locator Record
  273. **/
  274. typedef struct
  275. {
  276. /* SENSOR RECORD HEADER */
  277. SDRRecHdr_T hdr;
  278. /* RECORD KEY BYTES */
  279. uint8_t DevAccessAddr;
  280. uint8_t FRUIDSlaveAddr;
  281. uint8_t AccessLUNBusID;
  282. uint8_t ChannelNumber;
  283. /* RECORD BODY BYTES */
  284. uint8_t Reserved;
  285. uint8_t DevType;
  286. uint8_t DevTypeModifier;
  287. uint8_t EntityID;
  288. uint8_t EntityIns;
  289. uint8_t OEMField;
  290. uint8_t IDStrLen;
  291. int8_t DevIdStr [MAX_ID_STR_LEN];
  292. } FRUDevLocatorRec_T;
  293. /**
  294. * @struct OEM_FRURec_T
  295. * @brief OEM FRU Record Info
  296. **/
  297. typedef struct
  298. {
  299. /*SENSOR RECORD HEADER*/
  300. SDRRecHdr_T hdr;
  301. /*RECORD BODY BYTES*/
  302. uint8_t Mfg_ID1;
  303. uint8_t Mfg_ID2;
  304. uint8_t Mfg_ID3;
  305. uint8_t OEM_Fru;
  306. uint8_t DeviceID;
  307. uint16_t Size;
  308. uint8_t AccessType;
  309. uint8_t EntityID;
  310. uint8_t EntityIns;
  311. uint8_t IDStrLen;
  312. int8_t FilePath[MAX_FRU_SDR_STR_SIZE];
  313. } OEM_FRURec_T;
  314. /**
  315. * @struct OEM_NMRec_T
  316. * @brief OEM NM Record Info
  317. **/
  318. typedef struct
  319. {
  320. /*SENSOR RECORD HEADER */
  321. SDRRecHdr_T hdr;
  322. /*RECORD BODY BYTES*/
  323. uint8_t Mfg_ID1;
  324. uint8_t Mfg_ID2;
  325. uint8_t Mfg_ID3;
  326. uint8_t RecordSubType;
  327. uint8_t VersionNo;
  328. uint8_t NMDevSlaveAddress;
  329. uint8_t ChannelNumber;
  330. uint8_t NMHealthEvtSensor;
  331. uint8_t NMExceptionEvtSensor;
  332. uint8_t NMOpCapSensor;
  333. uint8_t NMAlertThresExSensor;
  334. } OEM_NMRec_T;
  335. /**
  336. * @struct BMCMsgChannelInfoRec_T
  337. * @brief BMC Mesage Channel info Record
  338. **/
  339. typedef struct
  340. {
  341. /* SENSOR RECORD HEADER */
  342. SDRRecHdr_T hdr;
  343. /* RECORD BODY BYTES */
  344. uint8_t MsgChannel0Info;
  345. uint8_t MsgChannel1Info;
  346. uint8_t MsgChannel2Info;
  347. uint8_t MsgChannel3Info;
  348. uint8_t MsgChannel4Info;
  349. uint8_t MsgChannel5Info;
  350. uint8_t MsgChannel6Info;
  351. uint8_t MsgChannel7Info;
  352. uint8_t MessagingINTType;
  353. uint8_t EvtMsgBufINTType;
  354. uint8_t Reserved;
  355. } BMCMsgChannelInfoRec_T;
  356. /**
  357. * @struct SDRRec_T
  358. * @brief Complete unionized record structure with unions for
  359. * easy reference to different types
  360. **/
  361. typedef union {
  362. SDRRecHdr_T hdr;
  363. FullSensorRec_T full_sensor_rec;
  364. CompactSensorRec_T compact_sensor_rec;
  365. MgmtCtrlrConfirmRec_T mc_confim_rec;
  366. MgmtCtrlrDevLocator_T mc_dev_locator_rec;
  367. GnrcDevLocatorRec_T gen_dev_locator_rec;
  368. FRUDevLocatorRec_T fru_dev_locator_rec;
  369. BMCMsgChannelInfoRec_T bmc_msg_chnl_info_rec;
  370. } SDRRec_T;
  371. //typedef struct
  372. //{
  373. // SDRRecHdr_T hdr;
  374. // union
  375. // {
  376. // FullSensorRec_T full_sensor_rec;
  377. // CompactSensorRec_T compact_sensor_rec;
  378. // MgmtCtrlrConfirmRec_T mc_confim_rec;
  379. // MgmtCtrlrDevLocator_T mc_dev_locator_rec;
  380. // GnrcDevLocatorRec_T gen_dev_locator_rec;
  381. // FRUDevLocatorRec_T fru_dev_locator_rec;
  382. // BMCMsgChannelInfoRec_T bmc_msg_chnl_info_rec;
  383. // }
  384. // type;
  385. //} SDRRec_T;
  386. #pragma pack( )
  387. #endif /* IPMI_SDR_RECORD_H */