com_IPMI_AppDevice.h 12 KB

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