hem_mbox.h 16 KB

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