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