hem_mbox.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. /*
  2. ** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/hem_mbox.h#2
  3. */
  4. /*! \file hem_mbox.h
  5. \brief
  6. */
  7. /*
  8. ** Log: hem_mbox.h
  9. **
  10. ** 07 26 2012 yuche.tsai
  11. ** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot
  12. ** Update driver code of ALPS.JB for hot-spot.
  13. **
  14. ** 07 19 2012 yuche.tsai
  15. ** NULL
  16. ** Code update for JB.
  17. *
  18. * 03 02 2012 terry.wu
  19. * NULL
  20. * Sync CFG80211 modification from branch 2,2.
  21. *
  22. * 07 18 2011 cp.wu
  23. * [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for
  24. * more than one SSID in a single scanning request
  25. * add framework in driver domain for supporting new SCAN_REQ_V2 for more than 1 SSID
  26. * support as well as uProbeDelay in NDIS 6.x driver model
  27. *
  28. * 06 07 2011 yuche.tsai
  29. * [WCXRP00000696] [Volunteer Patch][MT6620][Driver] Infinite loop issue when RX invitation response.
  30. * cnm_timer[WCXRP00000763] [Volunteer Patch][MT6620][Driver] RX Service Discovery Frame under AP mode Issue
  31. * Add invitation support.
  32. *
  33. * 06 02 2011 cp.wu
  34. * [WCXRP00000681] [MT5931][Firmware] HIF code size reduction
  35. * eliminate unused parameters for SAA-FSM
  36. *
  37. * 01 26 2011 cm.chang
  38. * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument
  39. * Allocate system RAM if fixed message or mgmt buffer is not available
  40. *
  41. * 11 08 2010 cm.chang
  42. * [WCXRP00000169] [MT6620 Wi-Fi][Driver][FW] Remove unused CNM recover message ID
  43. * Remove CNM channel reover message ID
  44. *
  45. * 09 16 2010 cm.chang
  46. * NULL
  47. * Remove unused message ID
  48. *
  49. * 09 03 2010 kevin.huang
  50. * NULL
  51. * Refine #include sequence and solve recursive/nested #include issue
  52. *
  53. * 08 30 2010 cp.wu
  54. * NULL
  55. * eliminate klockwork errors
  56. *
  57. * 08 25 2010 george.huang
  58. * NULL
  59. * update OID/ registry control path for PM related settings
  60. *
  61. * 08 23 2010 chinghwa.yu
  62. * NULL
  63. * Update for BOW.
  64. *
  65. * 08 16 2010 cp.wu
  66. * NULL
  67. * add interface for RLM to trigger OBSS-SCAN.
  68. *
  69. * 08 11 2010 yuche.tsai
  70. * NULL
  71. * Add some message ID for P2P FSM under provisioning phase.
  72. *
  73. * 08 11 2010 yuche.tsai
  74. * NULL
  75. * Add Message Event ID for P2P Module.
  76. *
  77. * 08 05 2010 yuche.tsai
  78. * NULL
  79. * Check-in P2P Device Discovery Feature.
  80. *
  81. * 08 04 2010 cp.wu
  82. * NULL
  83. * remove unused mailbox message definitions.
  84. *
  85. * 08 02 2010 yuche.tsai
  86. * NULL
  87. * P2P Group Negotiation Code Check in.
  88. *
  89. * 07 19 2010 cp.wu
  90. *
  91. * [WPD00003833] [MT6620 and MT5931] Driver migration.
  92. * message table should not be commented out by compilation option without modifying header file
  93. *
  94. * 07 08 2010 cp.wu
  95. *
  96. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  97. *
  98. * 07 08 2010 cm.chang
  99. * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
  100. * Rename MID_MNY_CNM_CH_RELEASE to MID_MNY_CNM_CH_ABORT
  101. *
  102. * 07 01 2010 cp.wu
  103. * [WPD00003833][MT6620 and MT5931] Driver migration
  104. * AIS-FSM integration with CNM channel request messages
  105. *
  106. * 07 01 2010 cp.wu
  107. * [WPD00003833][MT6620 and MT5931] Driver migration
  108. * implementation of DRV-SCN and related mailbox message handling.
  109. *
  110. * 07 01 2010 cm.chang
  111. * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
  112. * Modify CNM message handler for new flow
  113. *
  114. * 06 18 2010 cm.chang
  115. * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
  116. * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf
  117. *
  118. * 06 14 2010 cp.wu
  119. * [WPD00003833][MT6620 and MT5931] Driver migration
  120. * restore utility function invoking via hem_mbox to direct calls
  121. *
  122. * 06 11 2010 cp.wu
  123. * [WPD00003833][MT6620 and MT5931] Driver migration
  124. * auth.c is migrated.
  125. *
  126. * 06 10 2010 cp.wu
  127. * [WPD00003833][MT6620 and MT5931] Driver migration
  128. * add buildable & linkable ais_fsm.c
  129. *
  130. * related reference are still waiting to be resolved
  131. *
  132. * 06 09 2010 cp.wu
  133. * [WPD00003833][MT6620 and MT5931] Driver migration
  134. * add definitions for module migration.
  135. *
  136. * 06 08 2010 cp.wu
  137. * [WPD00003833][MT6620 and MT5931] Driver migration
  138. * hem_mbox is migrated.
  139. *
  140. * 06 07 2010 cp.wu
  141. * [WPD00003833][MT6620 and MT5931] Driver migration
  142. * merge cnm_scan.h and hem_mbox.h
  143. *
  144. * 05 12 2010 kevin.huang
  145. * [BORA00000794][WIFISYS][New Feature]Power Management Support
  146. * Add Power Management - Legacy PS-POLL support.
  147. *
  148. * 04 29 2010 tehuang.liu
  149. * [BORA00000605][WIFISYS] Phase3 Integration
  150. * Removed MID_RXM_MQM_QOS_ACTION_FRAME
  151. *
  152. * 04 29 2010 tehuang.liu
  153. * [BORA00000605][WIFISYS] Phase3 Integration
  154. * Removed MID_RXM_MQM_BA_ACTION_FRAME
  155. *
  156. * 03 30 2010 cm.chang
  157. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  158. * Support 2.4G OBSS scan
  159. *
  160. * 03 16 2010 kevin.huang
  161. * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
  162. * Add AdHoc Mode
  163. *
  164. * 03 10 2010 kevin.huang
  165. * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
  166. *
  167. * * * * * Add Channel Manager for arbitration of JOIN and SCAN Req
  168. *
  169. * 03 05 2010 cm.chang
  170. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  171. * Develop partial DPD code
  172. *
  173. * 02 11 2010 tehuang.liu
  174. * [BORA00000569][WIFISYS] Phase 2 Integration Test
  175. * Added MID_RXM_MQM_QOS_ACTION_FRAME for RXM to indicate QoS Action frames to MQM
  176. *
  177. * 01 11 2010 kevin.huang
  178. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  179. * Add Deauth and Disassoc Handler
  180. *
  181. * Dec 7 2009 mtk01461
  182. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  183. * Rename the parameter of mboxDummy()
  184. *
  185. * Dec 2 2009 MTK02468
  186. * [BORA00000337] To check in codes for FPGA emulation
  187. * Added MID_RXM_MQM_BA_ACTION_FRAME
  188. *
  189. * Nov 24 2009 mtk01461
  190. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  191. * Remove Dummy MSG ID
  192. *
  193. * Nov 23 2009 mtk01461
  194. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  195. * Add JOIN REQ related MSG ID
  196. *
  197. * Nov 16 2009 mtk01461
  198. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  199. * Add AIS ABORT MSG ID
  200. *
  201. * Nov 5 2009 mtk01461
  202. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  203. * Add SCN MSG IDs
  204. *
  205. * Oct 28 2009 mtk01104
  206. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  207. *
  208. */
  209. #ifndef _HEM_MBOX_H
  210. #define _HEM_MBOX_H
  211. /*******************************************************************************
  212. * C O M P I L E R F L A G S
  213. ********************************************************************************
  214. */
  215. /*******************************************************************************
  216. * E X T E R N A L R E F E R E N C E S
  217. ********************************************************************************
  218. */
  219. /*******************************************************************************
  220. * C O N S T A N T S
  221. ********************************************************************************
  222. */
  223. /*******************************************************************************
  224. * D A T A T Y P E S
  225. ********************************************************************************
  226. */
  227. /* Message IDs */
  228. typedef enum _ENUM_MSG_ID_T {
  229. MID_MNY_CNM_CH_REQ, /* MANY notify CNM to obtain channel privilege */
  230. MID_MNY_CNM_CH_ABORT, /* MANY notify CNM to abort/release channel privilege */
  231. MID_CNM_AIS_CH_GRANT, /* CNM notify AIS for indicating channel granted */
  232. MID_CNM_P2P_CH_GRANT, /* CNM notify P2P for indicating channel granted */
  233. MID_CNM_BOW_CH_GRANT, /* CNM notify BOW for indicating channel granted */
  234. /*--------------------------------------------------*/
  235. /* SCN Module Mailbox Messages */
  236. /*--------------------------------------------------*/
  237. MID_AIS_SCN_SCAN_REQ, /* AIS notify SCN for starting scan */
  238. MID_AIS_SCN_SCAN_REQ_V2, /* AIS notify SCN for starting scan with multiple SSID support */
  239. MID_AIS_SCN_SCAN_CANCEL, /* AIS notify SCN for cancelling scan */
  240. MID_P2P_SCN_SCAN_REQ, /* P2P notify SCN for starting scan */
  241. MID_P2P_SCN_SCAN_REQ_V2, /* P2P notify SCN for starting scan with multiple SSID support */
  242. MID_P2P_SCN_SCAN_CANCEL, /* P2P notify SCN for cancelling scan */
  243. MID_BOW_SCN_SCAN_REQ, /* BOW notify SCN for starting scan */
  244. MID_BOW_SCN_SCAN_REQ_V2, /* BOW notify SCN for starting scan with multiple SSID support */
  245. MID_BOW_SCN_SCAN_CANCEL, /* BOW notify SCN for cancelling scan */
  246. MID_RLM_SCN_SCAN_REQ, /* RLM notify SCN for starting scan (OBSS-SCAN) */
  247. MID_RLM_SCN_SCAN_REQ_V2, /* RLM notify SCN for starting scan (OBSS-SCAN) with multiple SSID support */
  248. MID_RLM_SCN_SCAN_CANCEL, /* RLM notify SCN for cancelling scan (OBSS-SCAN) */
  249. MID_SCN_AIS_SCAN_DONE, /* SCN notify AIS for scan completion */
  250. MID_SCN_P2P_SCAN_DONE, /* SCN notify P2P for scan completion */
  251. MID_SCN_BOW_SCAN_DONE, /* SCN notify BOW for scan completion */
  252. MID_SCN_RLM_SCAN_DONE, /* SCN notify RLM for scan completion (OBSS-SCAN) */
  253. /*--------------------------------------------------*/
  254. /* AIS Module Mailbox Messages */
  255. /*--------------------------------------------------*/
  256. MID_OID_AIS_FSM_JOIN_REQ, /* OID/IOCTL notify AIS for join */
  257. MID_OID_AIS_FSM_ABORT, /* OID/IOCTL notify AIS for abort */
  258. MID_AIS_SAA_FSM_START, /* AIS notify SAA for Starting authentication/association fsm */
  259. MID_AIS_SAA_FSM_ABORT, /* AIS notify SAA for Aborting authentication/association fsm */
  260. MID_SAA_AIS_JOIN_COMPLETE, /* SAA notify AIS for indicating join complete */
  261. #if CFG_ENABLE_BT_OVER_WIFI
  262. /*--------------------------------------------------*/
  263. /* BOW Module Mailbox Messages */
  264. /*--------------------------------------------------*/
  265. MID_BOW_SAA_FSM_START, /* BOW notify SAA for Starting authentication/association fsm */
  266. MID_BOW_SAA_FSM_ABORT, /* BOW notify SAA for Aborting authentication/association fsm */
  267. MID_SAA_BOW_JOIN_COMPLETE, /* SAA notify BOW for indicating join complete */
  268. #endif
  269. #if CFG_ENABLE_WIFI_DIRECT
  270. /*--------------------------------------------------*/
  271. /* P2P Module Mailbox Messages */
  272. /*--------------------------------------------------*/
  273. MID_P2P_SAA_FSM_START, /* P2P notify SAA for Starting authentication/association fsm */
  274. MID_P2P_SAA_FSM_ABORT, /* P2P notify SAA for Aborting authentication/association fsm */
  275. MID_SAA_P2P_JOIN_COMPLETE, /* SAA notify P2P for indicating join complete */
  276. MID_MNY_P2P_FUN_SWITCH, /* Enable P2P FSM. */
  277. MID_MNY_P2P_DEVICE_DISCOVERY, /* Start device discovery. */
  278. MID_MNY_P2P_CONNECTION_REQ, /* Connection request. */
  279. MID_MNY_P2P_CONNECTION_ABORT, /* Abort connection request, P2P FSM return to IDLE. */
  280. MID_MNY_P2P_BEACON_UPDATE,
  281. MID_MNY_P2P_STOP_AP,
  282. MID_MNY_P2P_CHNL_REQ,
  283. MID_MNY_P2P_CHNL_ABORT,
  284. MID_MNY_P2P_MGMT_TX,
  285. MID_MNY_P2P_GROUP_DISSOLVE,
  286. MID_MNY_P2P_MGMT_FRAME_REGISTER,
  287. MID_MNY_P2P_NET_DEV_REGISTER,
  288. MID_MNY_P2P_START_AP,
  289. MID_MNY_P2P_MGMT_FRAME_UPDATE,
  290. #if CFG_SUPPORT_WFD
  291. MID_MNY_P2P_WFD_CFG_UPDATE,
  292. #endif
  293. #endif
  294. #if CFG_SUPPORT_ADHOC
  295. MID_SCN_AIS_FOUND_IBSS, /* SCN notify AIS that an IBSS Peer has been found and can merge into */
  296. #endif /* CFG_SUPPORT_ADHOC */
  297. MID_SAA_AIS_FSM_ABORT, /* SAA notify AIS for indicating deauthentication/disassociation */
  298. /*--------------------------------------------------*/
  299. /* AIS MGMT-TX Support */
  300. /*--------------------------------------------------*/
  301. MID_MNY_AIS_REMAIN_ON_CHANNEL,
  302. MID_MNY_AIS_CANCEL_REMAIN_ON_CHANNEL,
  303. MID_MNY_AIS_MGMT_TX,
  304. MID_TOTAL_NUM
  305. } ENUM_MSG_ID_T, *P_ENUM_MSG_ID_T;
  306. /* Message header of inter-components */
  307. struct _MSG_HDR_T {
  308. LINK_ENTRY_T rLinkEntry;
  309. ENUM_MSG_ID_T eMsgId;
  310. };
  311. typedef VOID(*PFN_MSG_HNDL_FUNC) (P_ADAPTER_T, P_MSG_HDR_T);
  312. typedef struct _MSG_HNDL_ENTRY {
  313. ENUM_MSG_ID_T eMsgId;
  314. PFN_MSG_HNDL_FUNC pfMsgHndl;
  315. } MSG_HNDL_ENTRY_T, *P_MSG_HNDL_ENTRY_T;
  316. typedef enum _EUNM_MSG_SEND_METHOD_T {
  317. MSG_SEND_METHOD_BUF = 0, /* Message is put in the queue and will be
  318. executed when mailbox is checked. */
  319. MSG_SEND_METHOD_UNBUF /* The handler function is called immediately
  320. in the same context of the sender */
  321. } EUNM_MSG_SEND_METHOD_T, *P_EUNM_MSG_SEND_METHOD_T;
  322. typedef enum _ENUM_MBOX_ID_T {
  323. MBOX_ID_0 = 0,
  324. MBOX_ID_TOTAL_NUM
  325. } ENUM_MBOX_ID_T, *P_ENUM_MBOX_ID_T;
  326. /* Define Mailbox structure */
  327. typedef struct _MBOX_T {
  328. LINK_T rLinkHead;
  329. } MBOX_T, *P_MBOX_T;
  330. typedef struct _MSG_SAA_FSM_START_T {
  331. MSG_HDR_T rMsgHdr; /* Must be the first member */
  332. UINT_8 ucSeqNum;
  333. P_STA_RECORD_T prStaRec;
  334. } MSG_SAA_FSM_START_T, *P_MSG_SAA_FSM_START_T;
  335. typedef struct _MSG_SAA_FSM_COMP_T {
  336. MSG_HDR_T rMsgHdr; /* Must be the first member */
  337. UINT_8 ucSeqNum;
  338. WLAN_STATUS rJoinStatus;
  339. P_STA_RECORD_T prStaRec;
  340. P_SW_RFB_T prSwRfb;
  341. } MSG_SAA_FSM_COMP_T, *P_MSG_SAA_FSM_COMP_T;
  342. typedef struct _MSG_SAA_FSM_ABORT_T {
  343. MSG_HDR_T rMsgHdr; /* Must be the first member */
  344. UINT_8 ucSeqNum;
  345. P_STA_RECORD_T prStaRec;
  346. } MSG_SAA_FSM_ABORT_T, *P_MSG_SAA_FSM_ABORT_T;
  347. typedef struct _MSG_CONNECTION_ABORT_T {
  348. MSG_HDR_T rMsgHdr; /* Must be the first member */
  349. UINT_8 ucNetTypeIndex;
  350. } MSG_CONNECTION_ABORT_T, *P_MSG_CONNECTION_ABORT_T;
  351. typedef struct _MSG_REMAIN_ON_CHANNEL_T {
  352. MSG_HDR_T rMsgHdr; /* Must be the first member */
  353. ENUM_BAND_T eBand;
  354. ENUM_CHNL_EXT_T eSco;
  355. UINT_8 ucChannelNum;
  356. UINT_32 u4DurationMs;
  357. UINT_64 u8Cookie;
  358. } MSG_REMAIN_ON_CHANNEL_T, *P_MSG_REMAIN_ON_CHANNEL_T;
  359. typedef struct _MSG_CANCEL_REMAIN_ON_CHANNEL_T {
  360. MSG_HDR_T rMsgHdr; /* Must be the first member */
  361. UINT_64 u8Cookie;
  362. } MSG_CANCEL_REMAIN_ON_CHANNEL_T, *P_MSG_CANCEL_REMAIN_ON_CHANNEL_T;
  363. typedef struct _MSG_MGMT_TX_REQUEST_T {
  364. MSG_HDR_T rMsgHdr;
  365. P_MSDU_INFO_T prMgmtMsduInfo;
  366. UINT_64 u8Cookie; /* For indication. */
  367. BOOLEAN fgNoneCckRate;
  368. BOOLEAN fgIsWaitRsp;
  369. } MSG_MGMT_TX_REQUEST_T, *P_MSG_MGMT_TX_REQUEST_T;
  370. /* specific message data types */
  371. typedef MSG_SAA_FSM_START_T MSG_JOIN_REQ_T, *P_MSG_JOIN_REQ_T;
  372. typedef MSG_SAA_FSM_COMP_T MSG_JOIN_COMP_T, *P_MSG_JOIN_COMP_T;
  373. typedef MSG_SAA_FSM_ABORT_T MSG_JOIN_ABORT_T, *P_MSG_JOIN_ABORT_T;
  374. /*******************************************************************************
  375. * P U B L I C D A T A
  376. ********************************************************************************
  377. */
  378. /*******************************************************************************
  379. * P R I V A T E D A T A
  380. ********************************************************************************
  381. */
  382. /*******************************************************************************
  383. * M A C R O S
  384. ********************************************************************************
  385. */
  386. /*******************************************************************************
  387. * F U N C T I O N D E C L A R A T I O N S
  388. ********************************************************************************
  389. */
  390. VOID mboxSetup(IN P_ADAPTER_T prAdapter, IN ENUM_MBOX_ID_T eMboxId);
  391. VOID
  392. mboxSendMsg(IN P_ADAPTER_T prAdapter,
  393. IN ENUM_MBOX_ID_T eMboxId, IN P_MSG_HDR_T prMsg, IN EUNM_MSG_SEND_METHOD_T eMethod);
  394. VOID mboxRcvAllMsg(IN P_ADAPTER_T prAdapter, IN ENUM_MBOX_ID_T eMboxId);
  395. VOID mboxInitialize(IN P_ADAPTER_T prAdapter);
  396. VOID mboxDestroy(IN P_ADAPTER_T prAdapter);
  397. VOID mboxDummy(IN P_ADAPTER_T prAdapter, P_MSG_HDR_T prMsgHdr);
  398. /*******************************************************************************
  399. * F U N C T I O N S
  400. ********************************************************************************
  401. */
  402. #endif /* _HEM_MBOX_H */