add rk3288 pinctrl dts code
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / combo_mt66xx / mt6628 / 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     MID_TOTAL_NUM
315 } ENUM_MSG_ID_T, *P_ENUM_MSG_ID_T;
316
317 /* Message header of inter-components */
318 struct _MSG_HDR_T {
319     LINK_ENTRY_T    rLinkEntry;
320     ENUM_MSG_ID_T   eMsgId;
321 };
322
323 typedef VOID (*PFN_MSG_HNDL_FUNC)(P_ADAPTER_T, P_MSG_HDR_T);
324
325 typedef struct _MSG_HNDL_ENTRY {
326     ENUM_MSG_ID_T       eMsgId;
327     PFN_MSG_HNDL_FUNC   pfMsgHndl;
328 } MSG_HNDL_ENTRY_T, *P_MSG_HNDL_ENTRY_T;
329
330 typedef enum _EUNM_MSG_SEND_METHOD_T {
331     MSG_SEND_METHOD_BUF = 0,    /* Message is put in the queue and will be
332                                    executed when mailbox is checked. */
333     MSG_SEND_METHOD_UNBUF       /* The handler function is called immediately
334                                    in the same context of the sender */
335 } EUNM_MSG_SEND_METHOD_T, *P_EUNM_MSG_SEND_METHOD_T;
336
337
338 typedef enum _ENUM_MBOX_ID_T {
339     MBOX_ID_0 = 0,
340     MBOX_ID_TOTAL_NUM
341 } ENUM_MBOX_ID_T, *P_ENUM_MBOX_ID_T;
342
343 /* Define Mailbox structure */
344 typedef struct _MBOX_T {
345     LINK_T          rLinkHead;
346 } MBOX_T, *P_MBOX_T;
347
348 typedef struct _MSG_SAA_FSM_START_T {
349     MSG_HDR_T       rMsgHdr;    /* Must be the first member */
350     UINT_8          ucSeqNum;
351     P_STA_RECORD_T  prStaRec;
352 } MSG_SAA_FSM_START_T, *P_MSG_SAA_FSM_START_T;
353
354 typedef struct _MSG_SAA_FSM_COMP_T {
355     MSG_HDR_T       rMsgHdr;        /* Must be the first member */
356     UINT_8          ucSeqNum;
357     WLAN_STATUS     rJoinStatus;
358     P_STA_RECORD_T  prStaRec;
359     P_SW_RFB_T      prSwRfb;
360 } MSG_SAA_FSM_COMP_T, *P_MSG_SAA_FSM_COMP_T;
361
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
368 typedef struct _MSG_CONNECTION_ABORT_T {
369     MSG_HDR_T       rMsgHdr;    /* Must be the first member */
370     UINT_8          ucNetTypeIndex;
371 } MSG_CONNECTION_ABORT_T, *P_MSG_CONNECTION_ABORT_T;
372
373
374
375 /* specific message data types */
376 typedef MSG_SAA_FSM_START_T MSG_JOIN_REQ_T, *P_MSG_JOIN_REQ_T;
377 typedef MSG_SAA_FSM_COMP_T MSG_JOIN_COMP_T, *P_MSG_JOIN_COMP_T;
378 typedef MSG_SAA_FSM_ABORT_T MSG_JOIN_ABORT_T, *P_MSG_JOIN_ABORT_T;
379
380
381 /*******************************************************************************
382 *                            P U B L I C   D A T A
383 ********************************************************************************
384 */
385
386 /*******************************************************************************
387 *                           P R I V A T E   D A T A
388 ********************************************************************************
389 */
390
391 /*******************************************************************************
392 *                                 M A C R O S
393 ********************************************************************************
394 */
395
396 /*******************************************************************************
397 *                  F U N C T I O N   D E C L A R A T I O N S
398 ********************************************************************************
399 */
400 VOID
401 mboxSetup (
402     IN P_ADAPTER_T  prAdapter,
403     IN ENUM_MBOX_ID_T  eMboxId
404     );
405
406
407 VOID
408 mboxSendMsg (
409     IN P_ADAPTER_T prAdapter,
410     IN ENUM_MBOX_ID_T eMboxId,
411     IN P_MSG_HDR_T prMsg,
412     IN EUNM_MSG_SEND_METHOD_T eMethod
413     );
414
415 VOID
416 mboxRcvAllMsg (
417     IN P_ADAPTER_T prAdapter,
418     IN ENUM_MBOX_ID_T eMboxId
419     );
420
421 VOID
422 mboxInitialize (
423     IN P_ADAPTER_T prAdapter
424     );
425
426 VOID
427 mboxDestroy (
428     IN P_ADAPTER_T prAdapter
429     );
430
431 VOID
432 mboxDummy (
433     IN P_ADAPTER_T prAdapter,
434     P_MSG_HDR_T prMsgHdr
435     );
436
437 /*******************************************************************************
438 *                              F U N C T I O N S
439 ********************************************************************************
440 */
441
442 #endif /* _HEM_MBOX_H */
443
444