com_IPMI_SDRRecord.h 12 KB

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