com_IPMI_AppDevice.h 12 KB

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