com_IPMI_AppDevice.h 12 KB

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