com_IPMI_AppDevice.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  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. * IPMI_App.h
  17. * AppDevice Commands Handler
  18. *
  19. * Author: Govind Kothandapani <govindk@ami.com>
  20. * : Rama Bisa <ramab@ami.com>
  21. * : Basavaraj Astekar <basavaraja@ami.com>
  22. * : Bakka Ravinder Reddy <bakkar@ami.com>
  23. *
  24. *****************************************************************/
  25. #ifndef IPMI_APPDEV_H
  26. #define IPMI_APPDEV_H
  27. #include <stdint.h>
  28. /*** Macro definition ***/
  29. #define CHALLENGE_STR_LEN 16
  30. #define AUTH_CODE_LEN 16
  31. #define MAX_APP_CONF_PARAM 4
  32. #define MIN_SYSINFO_OEM_CONF_PARAM 192
  33. #define MAX_SYSINFO_OEM_CONF_PARAM 255
  34. /* Added to Support IPMI v2.0/RMCP+ Integrity Algorithm Number */
  35. #define AUTH_CODE_HASH_LEN 20
  36. #define HASH_DATA_LEN 16
  37. #define MAX_USERNAME_LEN 16
  38. #define MAX_PASSWORD_LEN 20
  39. #define MAX_I2C_BUFFER_SIZE 50
  40. #define IPMI15_MAX_PASSWORD_LEN 16
  41. #define SIXTEEN_COUNT_WINDOW_LEN 16
  42. #define SEQNUM_ROLLOVER 0xFFFFFFFF
  43. #define RMCPPLUS_SEQLOWLIMIT 16
  44. #define RMCPPLUS_SEQUPLIMIT 15
  45. #define EIGHT_COUNT_WINDOW_LEN 8
  46. #define MAX_FW_VER_LENGTH 254
  47. #define MAX_SYS_NAME_LENGTH 254
  48. #define MAX_PRIM_OS_NAME_LENGTH 254
  49. #define MAX_OS_NAME_LENGTH 254
  50. #define MAX_BLOCK_SIZE 16
  51. #define SYS_INFO_SET_COMPLETE 0x00
  52. #define SYS_INFO_SET_IN_PROGRESS 0x01
  53. #define SYS_INFO_COMMIT_WRITE 0x02
  54. #define PARAM_PRESENT_REVISION 0x11
  55. #define PARAM_OLDER_REVISION 0x00
  56. #define SET_IN_PROGRESS_PARAM 0x00
  57. #define SYS_FW_VERSION_PARAM 0x01
  58. #define SYS_NAME_PARAM 0x02
  59. #define PRIM_OS_NAME_PARAM 0x03
  60. #define OS_NAME_PARAM 0x04
  61. #define MAX_PARAM_SELECTOR OS_NAME_PARAM +1 /* Last Parameter + 1 */
  62. #define GET_PARAM_REV_ONLY 0x80
  63. #pragma pack( 1 )
  64. /* SetWDTReq_T */
  65. typedef struct
  66. {
  67. uint8_t TmrUse;
  68. uint8_t TmrActions;
  69. uint8_t PreTimeOutInterval;
  70. uint8_t ExpirationFlag;
  71. uint16_t InitCountDown;
  72. } SetWDTReq_T;
  73. /* GetWDTRes_T */
  74. typedef struct
  75. {
  76. uint8_t CompletionCode;
  77. SetWDTReq_T CurrentSettings;
  78. uint16_t PresentCountDown;
  79. } GetWDTRes_T;
  80. /* GetBMCGblEnblRes_T */
  81. typedef struct
  82. {
  83. uint8_t CompletionCode;
  84. uint8_t BMCGblEnblByte;
  85. } GetBMCGblEnblRes_T;
  86. /* ClearMsgsFlagReq_T */
  87. typedef struct
  88. {
  89. uint8_t Flag;
  90. } ClearMsgsFlagReq_T;
  91. /* GetMsgFlagsRes_T */
  92. typedef struct
  93. {
  94. uint8_t CompletionCode;
  95. uint8_t MsgFlags;
  96. } GetMsgFlagsRes_T;
  97. /* EnblMsgChRcvReq_T */
  98. typedef struct
  99. {
  100. uint8_t ChannelNum;
  101. uint8_t ChannelState;
  102. } EnblMsgChRcvReq_T;
  103. /* EnblMsgChRcvRes_T */
  104. typedef struct
  105. {
  106. uint8_t CompletionCode;
  107. uint8_t ChannelNum;
  108. uint8_t ChannelState;
  109. } EnblMsgChRcvRes_T;
  110. /* GetMsgRes_T */
  111. typedef struct
  112. {
  113. uint8_t CompletionCode;
  114. uint8_t ChannelNum;
  115. } GetMsgRes_T;
  116. /* SendMsgReq_T */
  117. typedef struct
  118. {
  119. uint8_t ChNoTrackReq;
  120. } SendMsgReq_T;
  121. /* SendMsgRes_T */
  122. typedef struct
  123. {
  124. uint8_t CompletionCode;
  125. uint8_t ResData;
  126. } SendMsgRes_T;
  127. /* ReadEvtMsgBufRes_T */
  128. typedef struct
  129. {
  130. uint8_t CompletionCode;
  131. uint8_t ResData[16];
  132. } ReadEvtMsgBufRes_T;
  133. /* GetBTIfcCapRes_T */
  134. typedef struct
  135. {
  136. uint8_t CompletionCode;
  137. uint8_t NumReqSupported;
  138. uint8_t InputBufSize;
  139. uint8_t OutputBufSize;
  140. uint8_t RespTime;
  141. uint8_t Retries;
  142. } GetBTIfcCapRes_T;
  143. /* GetSysGUIDRes_T */
  144. typedef struct
  145. {
  146. uint8_t CompletionCode;
  147. uint8_t Node[6];
  148. uint16_t ClockSeq;
  149. uint16_t TimeHigh;
  150. uint16_t TimeMid;
  151. uint32_t TimeLow;
  152. } GetSysGUIDRes_T;
  153. /* GetChAuthCapReq_T */
  154. typedef struct
  155. {
  156. uint8_t ChannelNum;
  157. uint8_t PrivLevel;
  158. } GetChAuthCapReq_T;
  159. /* GetChAuthCapRes_T */
  160. typedef struct
  161. {
  162. uint8_t CompletionCode;
  163. uint8_t ChannelNum;
  164. uint8_t AuthType;
  165. uint8_t PerMsgUserAuthLoginStatus;
  166. uint8_t ExtCap;
  167. uint8_t OEMID[3];
  168. uint8_t OEMAuxData;
  169. } GetChAuthCapRes_T;
  170. /* GetSesChallengeReq_T */
  171. typedef struct
  172. {
  173. uint8_t AuthType;
  174. uint8_t UserName[16];
  175. } GetSesChallengeReq_T;
  176. /* GetSesChallengeRes_T */
  177. typedef struct
  178. {
  179. uint8_t CompletionCode;
  180. uint32_t TempSessionID;
  181. uint8_t ChallengeString[16];
  182. } GetSesChallengeRes_T;
  183. /* ActivateSesReq_T */
  184. typedef struct
  185. {
  186. uint8_t AuthType;
  187. uint8_t Privilege;
  188. uint8_t ChallengeString[CHALLENGE_STR_LEN];
  189. uint32_t OutboundSeq;
  190. } ActivateSesReq_T;
  191. /* ActivateSesRes_T */
  192. typedef struct
  193. {
  194. uint8_t CompletionCode;
  195. uint8_t AuthType;
  196. uint32_t SessionID;
  197. uint32_t InboundSeq;
  198. uint8_t Privilege;
  199. } ActivateSesRes_T;
  200. /* SetSesPrivLevelReq_T */
  201. typedef struct
  202. {
  203. uint8_t Privilege;
  204. } SetSesPrivLevelReq_T;
  205. /* SetSesPrivLevelRes_T */
  206. typedef struct
  207. {
  208. uint8_t CompletionCode;
  209. uint8_t Privilege;
  210. } SetSesPrivLevelRes_T;
  211. /* GetSesInfoReq_T */
  212. typedef struct
  213. {
  214. uint8_t SessionIndex;
  215. uint8_t SessionHandleOrID [4];
  216. } GetSesInfoReq_T;
  217. /* LANSesInfoRes_T */
  218. typedef struct
  219. {
  220. uint8_t IPAddress[4];
  221. uint8_t MACAddress[6];
  222. uint16_t PortNumber;
  223. } LANSesInfoRes_T;
  224. /* SerialSesInfoRes_T */
  225. typedef struct
  226. {
  227. uint8_t SessionActivityType;
  228. uint8_t DestinationSelector;
  229. uint8_t IPAddress[4];
  230. uint16_t PortNumber;
  231. } SerialSesInfoRes_T;
  232. /* Union SessionInfoRes_T */
  233. typedef union
  234. {
  235. LANSesInfoRes_T LANSesInfo;
  236. SerialSesInfoRes_T SerialSesInfo;
  237. } SessionInfoRes_T;
  238. /* ActiveSesInfo_T */
  239. typedef struct
  240. {
  241. uint8_t UserID;
  242. uint8_t Privilege;
  243. uint8_t ChannelNum;
  244. } ActiveSesInfo_T;
  245. /* GetSesInfoRes_T */
  246. typedef struct
  247. {
  248. uint8_t CompletionCode;
  249. uint8_t SessionHandle;
  250. uint8_t NumPossibleActiveSession;
  251. uint8_t NumActiveSession;
  252. ActiveSesInfo_T ActiveSesinfo;
  253. SessionInfoRes_T SesInfo;
  254. } GetSesInfoRes_T;
  255. /* LANIPv6SesInfoRes_T */
  256. typedef struct
  257. {
  258. uint8_t IPv6Address[16];
  259. uint8_t MACAddress[6];
  260. uint16_t PortNumber;
  261. } LANIPv6SesInfoRes_T;
  262. /* CloseSesReq_T */
  263. typedef struct
  264. {
  265. uint32_t SessionID;
  266. uint8_t SessionHandle;
  267. } CloseSesReq_T;
  268. /* GetAuthCodeReq_T */
  269. typedef struct
  270. {
  271. uint8_t AuthType;
  272. uint8_t ChannelNum;
  273. uint8_t UserID;
  274. uint8_t HashData[HASH_DATA_LEN];
  275. } GetAuthCodeReq_T;
  276. /* GetAuthCodeRes_T */
  277. typedef struct
  278. {
  279. uint8_t CompletionCode;
  280. uint8_t AuthCode[AUTH_CODE_HASH_LEN];
  281. } GetAuthCodeRes_T;
  282. /* SetChAccessReq_T */
  283. typedef struct
  284. {
  285. uint8_t ChannelNum;
  286. uint8_t ChannelAccess;
  287. uint8_t Privilege;
  288. } SetChAccessReq_T;
  289. typedef struct
  290. {
  291. uint8_t CompletionCode;
  292. } SetChAccessRes_T;
  293. /* GetChAccessReq_T */
  294. typedef struct
  295. {
  296. uint8_t ChannelNum;
  297. uint8_t AccessFlag;
  298. } GetChAccessReq_T;
  299. /* GetChAccessRes_T */
  300. typedef struct
  301. {
  302. uint8_t CompletionCode;
  303. uint8_t ChannelAccess;
  304. uint8_t Privilege;
  305. } GetChAccessRes_T;
  306. typedef struct
  307. {
  308. uint8_t ChannelNum;
  309. } GetChInfoReq_T;
  310. /* GetChInfoRes_T */
  311. typedef struct
  312. {
  313. uint8_t CompletionCode;
  314. uint8_t ChannelNum;
  315. uint8_t ChannelMedium;
  316. uint8_t ChannelProtocol;
  317. uint8_t SessionActiveSupport;
  318. uint8_t VendorID[3];
  319. uint8_t AuxiliaryInfo[2];
  320. } GetChInfoRes_T;
  321. /* SetUserAccessReq_T */
  322. typedef struct
  323. {
  324. uint8_t ChannelNoUserAccess;
  325. uint8_t UserID;
  326. uint8_t AccessLimit;
  327. uint8_t SessionLimit;
  328. } SetUserAccessReq_T;
  329. typedef struct
  330. {
  331. uint8_t CompletionCode;
  332. } SetUserAccessRes_T;
  333. /* GetUserAccessReq_T */
  334. typedef struct
  335. {
  336. uint8_t ChannelNum;
  337. uint8_t UserID;
  338. } GetUserAccessReq_T;
  339. /* GetUserAccessRes_T */
  340. typedef struct
  341. {
  342. uint8_t CompletionCode;
  343. uint8_t MaxNoUserID;
  344. uint8_t CurrentUserID;
  345. uint8_t FixedUserID;
  346. uint8_t ChannelAccess;
  347. } GetUserAccessRes_T;
  348. /* SetUserNameReq_T */
  349. typedef struct
  350. {
  351. uint8_t UserID;
  352. uint8_t UserName[MAX_USERNAME_LEN];
  353. } SetUserNameReq_T;
  354. typedef struct
  355. {
  356. uint8_t CompletionCode;
  357. } SetUserNameRes_T;
  358. /*GetUserNameReq_T*/
  359. typedef struct
  360. {
  361. uint8_t UserID;
  362. } GetUserNameReq_T;
  363. /* GetUserNameRes_T */
  364. typedef struct
  365. {
  366. uint8_t CompletionCode;
  367. uint8_t UserName[MAX_USERNAME_LEN];
  368. } GetUserNameRes_T;
  369. /* SetUserPswdReq_T */
  370. typedef struct
  371. {
  372. uint8_t UserID;
  373. uint8_t Operation;
  374. uint8_t Password[MAX_PASSWORD_LEN];
  375. } SetUserPswdReq_T;
  376. /* SetUserPswdReq_T */
  377. typedef struct
  378. {
  379. uint8_t CompletionCode;
  380. } SetUserPswdRes_T;
  381. /* MasterWriteReadReq_T */
  382. typedef struct
  383. {
  384. uint8_t BusTypeChNo;
  385. uint8_t SlaveAddress;
  386. uint8_t ReadCount;
  387. uint8_t Data[MAX_I2C_BUFFER_SIZE];
  388. } MasterWriteReadReq_T;
  389. /* MasterWriteReadRes_T */
  390. typedef struct
  391. {
  392. uint8_t CompletionCode;
  393. uint8_t Data[MAX_I2C_BUFFER_SIZE];
  394. } MasterWriteReadRes_T;
  395. typedef struct
  396. {
  397. uint8_t TypeOfEncoding ;
  398. uint8_t StringLength;
  399. uint8_t SysFWVersionName[MAX_FW_VER_LENGTH];
  400. } SysFWVersion_T;
  401. typedef struct
  402. {
  403. uint8_t TypeOfEncoding_Sys_Name;
  404. uint8_t StringLength_Sys_Name;
  405. uint8_t SystemName[MAX_SYS_NAME_LENGTH];
  406. } SysName_T;
  407. typedef struct
  408. {
  409. uint8_t TypeOfEncoding_PrimaryOSName;
  410. uint8_t StringLength_PrimaryOSName;
  411. uint8_t PrimaryOperatingSystemName[MAX_PRIM_OS_NAME_LENGTH];
  412. } PrimaryOSName_T;
  413. typedef struct
  414. {
  415. uint8_t TypeOfEncoding_OSName;
  416. uint8_t StringLength_OSName;
  417. uint8_t OSName[MAX_OS_NAME_LENGTH];
  418. } OSName_T;
  419. typedef struct
  420. {
  421. uint8_t SetSelector;
  422. uint8_t SysFWVersion[MAX_BLOCK_SIZE];
  423. } SysVerInfo_T;
  424. typedef struct
  425. {
  426. uint8_t SetSelector;
  427. uint8_t SysName[MAX_BLOCK_SIZE];
  428. } SysNameInfo_T;
  429. typedef struct {
  430. uint8_t SetSelector;
  431. uint8_t PrimaryOSName[MAX_BLOCK_SIZE];
  432. } PrimOSInfo_T;
  433. typedef struct {
  434. uint8_t SetSelector;
  435. uint8_t OperatingSystemName[MAX_BLOCK_SIZE];
  436. } OSInfo_T;
  437. typedef union {
  438. uint8_t SetInProgress;
  439. SysVerInfo_T SysVerInfo;
  440. SysNameInfo_T SysNameInfo;
  441. PrimOSInfo_T PrimOSInfo;
  442. OSInfo_T OSInfo;
  443. } SysInfoUN_T ;
  444. /* GetSystemInfoParamReq_T */
  445. typedef struct
  446. {
  447. uint8_t ParamRev;
  448. uint8_t ParamSelector;
  449. uint8_t SetSelector;
  450. uint8_t BlockSelector;
  451. } GetSystemInfoParamReq_T;
  452. /* GetSystemInfoParamRes_T */
  453. typedef struct
  454. {
  455. uint8_t CompletionCode;
  456. uint8_t ParamRevision;
  457. SysInfoUN_T SysInfo;
  458. } GetSystemInfoParamRes_T;
  459. /* GetSystemInfoParamOEMRes_T */
  460. typedef struct
  461. {
  462. uint8_t CompletionCode;
  463. uint8_t ParamRevision;
  464. /* OEM Info */
  465. } GetSystemInfoParamOEMRes_T;
  466. /* SetSystemInfoParamReq_T */
  467. typedef struct
  468. {
  469. uint8_t ParamSelector;
  470. SysInfoUN_T SysInfo;
  471. } SetSystemInfoParamReq_T;
  472. /* SetSystemInfoParamRes_T */
  473. typedef struct
  474. {
  475. uint8_t CompletionCode;
  476. } SetSystemInfoParamRes_T;
  477. /* SetSystemInfoParamOEMReq_T */
  478. typedef struct
  479. {
  480. uint8_t ParamSelector;
  481. /* OEM parameter */
  482. } SetSystemInfoParamOEMReq_T;
  483. #pragma pack( )
  484. #endif /* IPMI_APPDEV_H */