com_IPMI_SDRRecord.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  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. * @brief Maximum Length of the ID String
  61. **/
  62. #define MAX_ID_STR_LEN 16
  63. #define MAX_FRU_SDR_STR_SIZE 40
  64. /**
  65. * @struct SDRRecHdr_T
  66. * @brief SDR Record Header
  67. **/
  68. typedef struct
  69. {
  70. uint16_t ID;
  71. uint8_t Version;
  72. uint8_t Type;
  73. uint8_t Len;
  74. } SDRRecHdr_T;
  75. /**
  76. * @struct FullSensorRec_T
  77. * @brief Full Sensor Record
  78. **/
  79. typedef struct
  80. {
  81. /* SENSOR RECORD HEADER */
  82. SDRRecHdr_T hdr;
  83. /* RECORD KEY BYTES */
  84. uint8_t OwnerID;
  85. uint8_t OwnerLUN;
  86. uint8_t SensorNum;
  87. /* RECORD BODY BYTES */
  88. uint8_t EntityID;
  89. uint8_t EntityIns;
  90. uint8_t SensorInit;
  91. uint8_t SensorCaps;
  92. uint8_t SensorType;
  93. uint8_t EventTypeCode;
  94. uint16_t AssertionEventMask;
  95. uint16_t DeAssertionEventMask;
  96. uint16_t DiscreteReadingMask;
  97. uint8_t Units1;
  98. uint8_t Units2;
  99. uint8_t Units3;
  100. uint8_t Linearization;
  101. uint8_t M;
  102. uint8_t M_Tolerance;
  103. uint8_t B;
  104. uint8_t B_Accuracy;
  105. uint8_t Accuracy;
  106. uint8_t R_B_Exp;
  107. uint8_t Flags;
  108. uint8_t NominalReading;
  109. uint8_t NormalMax;
  110. uint8_t NormalMin;
  111. uint8_t MaxReading;
  112. uint8_t MinReading;
  113. uint8_t UpperNonRecoverable;
  114. uint8_t UpperCritical;
  115. uint8_t UpperNonCritical;
  116. uint8_t LowerNonRecoverable;
  117. uint8_t LowerCritical;
  118. uint8_t LowerNonCritical;
  119. uint8_t PositiveHysterisis;
  120. uint8_t NegativeHysterisis;
  121. uint8_t Reserved1;
  122. uint8_t Reserved2;
  123. uint8_t OEMField;
  124. uint8_t IDStrTypeLen;
  125. int8_t IDStr [MAX_ID_STR_LEN];
  126. } FullSensorRec_T;
  127. /**
  128. * @struct CompactSensorRec_T
  129. * @brief Compact Sensor Record
  130. **/
  131. typedef struct
  132. {
  133. /* SENSOR RECORD HEADER */
  134. SDRRecHdr_T hdr;
  135. /* RECORD KEY BYTES */
  136. uint8_t OwnerID;
  137. uint8_t OwnerLUN;
  138. uint8_t SensorNum;
  139. /* RECORD BODY BYTES */
  140. uint8_t EntityID;
  141. uint8_t EntityIns;
  142. uint8_t SensorInit;
  143. uint8_t SensorCaps;
  144. uint8_t SensorType;
  145. uint8_t EventTypeCode;
  146. uint16_t AssertionEventMask;
  147. uint16_t DeAssertionEventMask;
  148. uint16_t DiscreteReadingMask;
  149. uint8_t Units1;
  150. uint8_t Units2;
  151. uint8_t Units3;
  152. uint16_t RecordSharing;
  153. uint8_t PositiveHysteris;
  154. uint8_t NegativeHysterisis;
  155. uint8_t Reserved1;
  156. uint8_t Reserved2;
  157. uint8_t Reserved3;
  158. uint8_t OEMField;
  159. uint8_t IDStrTypeLen;
  160. int8_t IDStr [MAX_ID_STR_LEN];
  161. } CompactSensorRec_T;
  162. /**
  163. * @struct
  164. * @brief Common structure for both Full and Compact sensor Record.
  165. */
  166. typedef struct
  167. {
  168. /* SENSOR RECORD HEADER */
  169. SDRRecHdr_T hdr;
  170. /* RECORD KEY BYTES */
  171. uint8_t OwnerID;
  172. uint8_t OwnerLUN;
  173. uint8_t SensorNum;
  174. /* RECORD BODY BYTES */
  175. uint8_t EntityID;
  176. uint8_t EntityIns;
  177. uint8_t SensorInit;
  178. uint8_t SensorCaps;
  179. uint8_t SensorType;
  180. uint8_t EventTypeCode;
  181. uint16_t AssertionEventMask;
  182. uint16_t DeAssertionEventMask;
  183. uint16_t DiscreteReadingMask;
  184. uint8_t Units1;
  185. uint8_t Units2;
  186. uint8_t Units3;
  187. } CommonSensorRec_T;
  188. /**
  189. * @struct EvtOnlySensorRec_T
  190. * @brief Event only Sensor Record
  191. **/
  192. typedef struct
  193. {
  194. /* SENSOR RECORD HEADER */
  195. SDRRecHdr_T hdr;
  196. /* RECORD KEY BYTES */
  197. uint8_t OwnerID;
  198. uint8_t OwnerLUN;
  199. uint8_t SensorNum;
  200. /* RECORD BODY BYTES */
  201. uint8_t EntityID;
  202. uint8_t EntityIns;
  203. uint8_t SensorType;
  204. uint8_t EventTypeCode;
  205. uint16_t RecordSharing;
  206. uint8_t Reserved1;
  207. uint8_t OEMField;
  208. uint8_t IDStrTypeLen;
  209. char IDStr [MAX_ID_STR_LEN];
  210. } EvtOnlySensorRec_T;
  211. /**
  212. * @struct MgmtCtrlrConfirmRec_T
  213. * @brief Management Controller Confirmation Record
  214. **/
  215. typedef struct
  216. {
  217. /* SENSOR RECORD HEADER */
  218. SDRRecHdr_T hdr;
  219. /* RECORD KEY BYTES */
  220. uint8_t DevSlaveAddr;
  221. uint8_t DevID;
  222. uint8_t ChannelNum;
  223. /* RECORD BODY BYTES */
  224. uint8_t FirmwareRev1;
  225. uint8_t FirmwareRev2;
  226. uint8_t IPMIVer;
  227. uint8_t MftrID [3];
  228. uint8_t ProdID [2];
  229. uint8_t DevGUID [MAX_ID_STR_LEN];
  230. } MgmtCtrlrConfirmRec_T;
  231. /**
  232. * @struct MgmtCtrlrDevLocator_T
  233. * @brief Management Controller Device Locator Record
  234. **/
  235. typedef struct
  236. {
  237. /* SENSOR RECORD HEADER */
  238. SDRRecHdr_T hdr;
  239. /* RECORD KEY BYTES */
  240. uint8_t DevSlaveAddr;
  241. uint8_t ChannelNum;
  242. /* RECORD BODY BYTES */
  243. uint8_t PowerStateNotification;
  244. uint8_t DeviceCaps;
  245. uint8_t reserved [3];
  246. uint8_t EntityID;
  247. uint8_t EntityIns;
  248. uint8_t OEMField;
  249. uint8_t IDStrLen;
  250. int8_t DevIdStr [MAX_ID_STR_LEN];
  251. } MgmtCtrlrDevLocator_T;
  252. /**
  253. * @struct GnrcDevLocatorRec_T
  254. * @brief Generic Device Locator Record
  255. **/
  256. typedef struct
  257. {
  258. /* SENSOR RECORD HEADER */
  259. SDRRecHdr_T hdr;
  260. /* RECORD KEY BYTES */
  261. uint8_t DevAccessAddr;
  262. uint8_t DevSlaveAddr;
  263. uint8_t LUNBusID;
  264. /* RECORD BODY BYTES */
  265. uint8_t AddrSpan;
  266. uint8_t Reserved;
  267. uint8_t DevType;
  268. uint8_t DevTypeModifier;
  269. uint8_t EntityID;
  270. uint8_t EntityIns;
  271. uint8_t OEMField;
  272. uint8_t IDStrLen;
  273. int8_t DevIdStr [MAX_ID_STR_LEN];
  274. } GnrcDevLocatorRec_T;
  275. /**
  276. * @struct FRUcDevLocatorRec_T
  277. * @brief FRU Device Locator Record
  278. **/
  279. typedef struct
  280. {
  281. /* SENSOR RECORD HEADER */
  282. SDRRecHdr_T hdr;
  283. /* RECORD KEY BYTES */
  284. uint8_t DevAccessAddr;
  285. uint8_t FRUIDSlaveAddr;
  286. uint8_t AccessLUNBusID;
  287. uint8_t ChannelNumber;
  288. /* RECORD BODY BYTES */
  289. uint8_t Reserved;
  290. uint8_t DevType;
  291. uint8_t DevTypeModifier;
  292. uint8_t EntityID;
  293. uint8_t EntityIns;
  294. uint8_t OEMField;
  295. uint8_t IDStrLen;
  296. int8_t DevIdStr [MAX_ID_STR_LEN];
  297. } FRUDevLocatorRec_T;
  298. /**
  299. * @struct OEM_FRURec_T
  300. * @brief OEM FRU Record Info
  301. **/
  302. typedef struct
  303. {
  304. /*SENSOR RECORD HEADER*/
  305. SDRRecHdr_T hdr;
  306. /*RECORD BODY BYTES*/
  307. uint8_t Mfg_ID1;
  308. uint8_t Mfg_ID2;
  309. uint8_t Mfg_ID3;
  310. uint8_t OEM_Fru;
  311. uint8_t DeviceID;
  312. uint16_t Size;
  313. uint8_t AccessType;
  314. uint8_t EntityID;
  315. uint8_t EntityIns;
  316. uint8_t IDStrLen;
  317. int8_t FilePath[MAX_FRU_SDR_STR_SIZE];
  318. } OEM_FRURec_T;
  319. /**
  320. * @struct OEM_NMRec_T
  321. * @brief OEM NM Record Info
  322. **/
  323. typedef struct
  324. {
  325. /*SENSOR RECORD HEADER */
  326. SDRRecHdr_T hdr;
  327. /*RECORD BODY BYTES*/
  328. uint8_t Mfg_ID1;
  329. uint8_t Mfg_ID2;
  330. uint8_t Mfg_ID3;
  331. uint8_t RecordSubType;
  332. uint8_t VersionNo;
  333. uint8_t NMDevSlaveAddress;
  334. uint8_t ChannelNumber;
  335. uint8_t NMHealthEvtSensor;
  336. uint8_t NMExceptionEvtSensor;
  337. uint8_t NMOpCapSensor;
  338. uint8_t NMAlertThresExSensor;
  339. } OEM_NMRec_T;
  340. /**
  341. * @struct BMCMsgChannelInfoRec_T
  342. * @brief BMC Mesage Channel info Record
  343. **/
  344. typedef struct
  345. {
  346. /* SENSOR RECORD HEADER */
  347. SDRRecHdr_T hdr;
  348. /* RECORD BODY BYTES */
  349. uint8_t MsgChannel0Info;
  350. uint8_t MsgChannel1Info;
  351. uint8_t MsgChannel2Info;
  352. uint8_t MsgChannel3Info;
  353. uint8_t MsgChannel4Info;
  354. uint8_t MsgChannel5Info;
  355. uint8_t MsgChannel6Info;
  356. uint8_t MsgChannel7Info;
  357. uint8_t MessagingINTType;
  358. uint8_t EvtMsgBufINTType;
  359. uint8_t Reserved;
  360. } BMCMsgChannelInfoRec_T;
  361. /**
  362. * @struct SDRRec_T
  363. * @brief Complete unionized record structure with unions for
  364. * easy reference to different types
  365. **/
  366. typedef union {
  367. SDRRecHdr_T hdr;
  368. FullSensorRec_T full_sensor_rec;
  369. CompactSensorRec_T compact_sensor_rec;
  370. MgmtCtrlrConfirmRec_T mc_confim_rec;
  371. MgmtCtrlrDevLocator_T mc_dev_locator_rec;
  372. GnrcDevLocatorRec_T gen_dev_locator_rec;
  373. FRUDevLocatorRec_T fru_dev_locator_rec;
  374. BMCMsgChannelInfoRec_T bmc_msg_chnl_info_rec;
  375. } SDRRec_T;
  376. //typedef struct
  377. //{
  378. // SDRRecHdr_T hdr;
  379. // union
  380. // {
  381. // FullSensorRec_T full_sensor_rec;
  382. // CompactSensorRec_T compact_sensor_rec;
  383. // MgmtCtrlrConfirmRec_T mc_confim_rec;
  384. // MgmtCtrlrDevLocator_T mc_dev_locator_rec;
  385. // GnrcDevLocatorRec_T gen_dev_locator_rec;
  386. // FRUDevLocatorRec_T fru_dev_locator_rec;
  387. // BMCMsgChannelInfoRec_T bmc_msg_chnl_info_rec;
  388. // }
  389. // type;
  390. //} SDRRec_T;
  391. #pragma pack( )
  392. #endif /* IPMI_SDR_RECORD_H */