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