1e7630c7c7ee58d0ebb6390cedf75b04b237cac8
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / mt5931 / include / mgmt / aa_fsm.h
1 /*
2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/aa_fsm.h#1 $
3 */
4
5 /*! \file   aa_fsm.h
6     \brief  Declaration of functions and finite state machine for SAA/AAA Module.
7
8     Declaration of functions and finite state machine for SAA/AAA Module.
9 */
10
11
12
13 /*
14 ** $Log: aa_fsm.h $
15  *
16  * 10 13 2011 cp.wu
17  * [MT6620 Wi-Fi][Driver] Reduce join failure count limit to 2 for faster re-join for other BSS 
18  * 1. short join failure count limit to 2
19  * 2. treat join timeout as kind of join failure as well
20  *
21  * 07 08 2010 cp.wu
22  * 
23  * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
24  *
25  * 06 21 2010 cp.wu
26  * [WPD00003833][MT6620 and MT5931] Driver migration 
27  * refine TX-DONE callback.
28  *
29  * 06 11 2010 cp.wu
30  * [WPD00003833][MT6620 and MT5931] Driver migration 
31  * 1) migrate assoc.c.
32  * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
33  * 3) add configuration options for CNM_MEM and RSN modules
34  * 4) add data path for management frames
35  * 5) eliminate rPacketInfo of MSDU_INFO_T
36  *
37  * 06 10 2010 cp.wu
38  * [WPD00003833][MT6620 and MT5931] Driver migration 
39  * add buildable & linkable ais_fsm.c
40  * 
41  * related reference are still waiting to be resolved
42  *
43  * 06 07 2010 cp.wu
44  * [WPD00003833][MT6620 and MT5931] Driver migration 
45  * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
46  *
47  * 03 10 2010 kevin.huang
48  * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support 
49  * 
50  * Add Channel Manager for arbitration of JOIN and SCAN Req
51  *
52  * 02 04 2010 kevin.huang
53  * [BORA00000603][WIFISYS] [New Feature] AAA Module Support 
54  * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
55  *
56  * 01 11 2010 kevin.huang
57  * [BORA00000018]Integrate WIFI part into BORA for the 1st time 
58  * Add Deauth and Disassoc Handler
59  *
60  * Nov 24 2009 mtk01461
61  * [BORA00000018] Integrate WIFI part into BORA for the 1st time
62  * Revise MGMT Handler with Retain Status
63  *
64  * Nov 23 2009 mtk01461
65  * [BORA00000018] Integrate WIFI part into BORA for the 1st time
66  * 
67 */
68
69
70 #ifndef _AA_FSM_H
71 #define _AA_FSM_H
72
73 /*******************************************************************************
74 *                         C O M P I L E R   F L A G S
75 ********************************************************************************
76 */
77
78 /*******************************************************************************
79 *                    E X T E R N A L   R E F E R E N C E S
80 ********************************************************************************
81 */
82
83 /*******************************************************************************
84 *                              C O N S T A N T S
85 ********************************************************************************
86 */
87 /* Retry interval for retransmiting authentication-request MMPDU. */
88 #define TX_AUTHENTICATION_RETRY_TIMEOUT_TU          100 // TU.
89
90 /* Retry interval for retransmiting association-request MMPDU. */
91 #define TX_ASSOCIATION_RETRY_TIMEOUT_TU             100 // TU.
92
93 /* Wait for a response to a transmitted authentication-request MMPDU. */
94 #define DOT11_AUTHENTICATION_RESPONSE_TIMEOUT_TU    512 // TU.
95
96 /* Wait for a response to a transmitted association-request MMPDU. */
97 #define DOT11_ASSOCIATION_RESPONSE_TIMEOUT_TU       512 // TU.
98
99 /* The maximum time to wait for JOIN process complete. */
100 #define JOIN_FAILURE_TIMEOUT_BEACON_INTERVAL        20 // Beacon Interval, 20 * 100TU = 2 sec.
101
102 /* Retry interval for next JOIN request. */
103 #define JOIN_RETRY_INTERVAL_SEC                     10 // Seconds
104
105 /* Maximum Retry Count for accept a JOIN request. */
106 #define JOIN_MAX_RETRY_FAILURE_COUNT                2 // Times
107
108 /*******************************************************************************
109 *                             D A T A   T Y P E S
110 ********************************************************************************
111 */
112 typedef enum _ENUM_AA_STATE_T {
113     AA_STATE_IDLE = 0,
114     SAA_STATE_SEND_AUTH1,
115     SAA_STATE_WAIT_AUTH2,
116     SAA_STATE_SEND_AUTH3,
117     SAA_STATE_WAIT_AUTH4,
118     SAA_STATE_SEND_ASSOC1,
119     SAA_STATE_WAIT_ASSOC2,
120     AAA_STATE_SEND_AUTH2,
121     AAA_STATE_SEND_AUTH4, // We may not use, because P2P GO didn't support WEP and 11r
122     AAA_STATE_SEND_ASSOC2,
123     AA_STATE_RESOURCE, // A state for debugging the case of out of msg buffer. 
124     AA_STATE_NUM
125 } ENUM_AA_STATE_T;
126
127 /*******************************************************************************
128 *                            P U B L I C   D A T A
129 ********************************************************************************
130 */
131
132 /*******************************************************************************
133 *                           P R I V A T E   D A T A
134 ********************************************************************************
135 */
136
137 /*******************************************************************************
138 *                                 M A C R O S
139 ********************************************************************************
140 */
141
142 /*******************************************************************************
143 *                  F U N C T I O N   D E C L A R A T I O N S
144 ********************************************************************************
145 */
146 /*----------------------------------------------------------------------------*/
147 /* Routines in saa_fsm.c                                                      */
148 /*----------------------------------------------------------------------------*/
149 VOID
150 saaFsmSteps (
151     IN P_ADAPTER_T prAdapter,
152     IN P_STA_RECORD_T prStaRec,
153     IN ENUM_AA_STATE_T eNextState,
154     IN P_SW_RFB_T prRetainedSwRfb
155     );
156
157 WLAN_STATUS
158 saaFsmSendEventJoinComplete (
159     IN P_ADAPTER_T prAdapter,
160     WLAN_STATUS rJoinStatus,
161     P_STA_RECORD_T prStaRec,
162     P_SW_RFB_T prSwRfb
163     );
164
165 VOID
166 saaFsmRunEventStart (
167     IN P_ADAPTER_T prAdapter,
168     IN P_MSG_HDR_T prMsgHdr
169     );
170     
171 WLAN_STATUS
172 saaFsmRunEventTxDone (
173     IN P_ADAPTER_T              prAdapter,
174     IN P_MSDU_INFO_T            prMsduInfo,
175     IN ENUM_TX_RESULT_CODE_T    rTxDoneStatus
176     );
177
178 VOID
179 saaFsmRunEventTxReqTimeOut (
180     IN P_ADAPTER_T prAdapter,
181     IN P_STA_RECORD_T prStaRec
182     );
183
184 VOID
185 saaFsmRunEventRxRespTimeOut (
186     IN P_ADAPTER_T prAdapter,
187     IN P_STA_RECORD_T prStaRec
188     );
189
190 VOID
191 saaFsmRunEventRxAuth (
192     IN P_ADAPTER_T prAdapter,
193     IN P_SW_RFB_T prSwRfb
194     );
195
196 WLAN_STATUS
197 saaFsmRunEventRxAssoc (
198     IN P_ADAPTER_T prAdapter,
199     IN P_SW_RFB_T prSwRfb
200     );
201
202 WLAN_STATUS
203 saaFsmRunEventRxDeauth (
204     IN P_ADAPTER_T prAdapter,
205     IN P_SW_RFB_T prSwRfb
206     );
207
208 WLAN_STATUS
209 saaFsmRunEventRxDisassoc (
210     IN P_ADAPTER_T prAdapter,
211     IN P_SW_RFB_T prSwRfb
212     );
213     
214 VOID
215 saaFsmRunEventAbort (
216     IN P_ADAPTER_T prAdapter,
217     IN P_MSG_HDR_T prMsgHdr
218     );
219
220 /*----------------------------------------------------------------------------*/
221 /* Routines in aaa_fsm.c                                                      */
222 /*----------------------------------------------------------------------------*/
223 VOID
224 aaaFsmRunEventRxAuth (
225     IN P_ADAPTER_T prAdapter,
226     IN P_SW_RFB_T prSwRfb
227     );
228
229 WLAN_STATUS
230 aaaFsmRunEventRxAssoc (
231     IN P_ADAPTER_T prAdapter,
232     IN P_SW_RFB_T prSwRfb
233     );
234
235 WLAN_STATUS
236 aaaFsmRunEventTxDone (
237     IN P_ADAPTER_T              prAdapter,
238     IN P_MSDU_INFO_T            prMsduInfo,
239     IN ENUM_TX_RESULT_CODE_T    rTxDoneStatus
240     );
241   
242 /*******************************************************************************
243 *                              F U N C T I O N S
244 ********************************************************************************
245 */
246
247 #endif /* _AA_FSM_H */
248
249
250
251