2 ** $Id: //Department/DaVinci/BRANCHES/MT662X_593X_WIFI_DRIVER_V2_3/include/mgmt/sec_fsm.h#1 $
6 \brief Declaration of functions and finite state machine for SECURITY Module.
8 Function declaration for privacy.c and SEC_STATE for SECURITY FSM.
11 /*******************************************************************************
12 * Copyright (c) 2007 MediaTek Inc.
14 * All rights reserved. Copying, compilation, modification, distribution
15 * or any other use whatsoever of this material is strictly prohibited
16 * except in accordance with a Software License Agreement with
18 ********************************************************************************
21 /*******************************************************************************
24 * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND
25 * AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK
26 * SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
27 * PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY
28 * DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
29 * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
30 * PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE
31 * ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY
32 * WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK
33 * SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY
34 * WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE
35 * FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO
36 * CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
38 * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
39 * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL
40 * BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT
41 * ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
42 * BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
44 * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
45 * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT
46 * OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING
47 * THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN
48 * FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE
50 ********************************************************************************
57 * [WCXRP00000072] [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue
58 * [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue.
60 * 09 21 2010 kevin.huang
61 * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
62 * Eliminate Linux Compile Warning
64 * 09 03 2010 kevin.huang
66 * Refine #include sequence and solve recursive/nested #include issue
70 * adding the eapol callback setting.
74 * adding the tx pkt call back handle for countermeasure.
78 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
81 * [WPD00003840][MT6620 5931] Security migration
82 * modify some code for concurrent network.
85 * [WPD00003840][MT6620 5931] Security migration
86 * consdier the concurrent network setting.
89 * [BORA00000605][WIFISYS] Phase3 Integration
90 * Code refine, and remove non-used code.
93 * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize
94 * Fixed the pre-authentication timer not correctly init issue, and modify the security related callback function prototype.
97 * [BORA00000605][WIFISYS] Phase3 Integration
98 * Refine the variable and parameter for security.
100 * 12 18 2009 cm.chang
101 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
104 * Dec 7 2009 mtk01088
105 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
106 * fixed the deauth Tx done callback parameter
108 * Dec 4 2009 mtk01088
109 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
110 * adding the reference function declaration
112 * Dec 3 2009 mtk01088
113 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
114 * delete non-used code
116 * Dec 1 2009 mtk01088
117 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
118 * adjust the function prototype
120 * Nov 23 2009 mtk01088
121 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
122 * adjust the function declaration
124 * Nov 19 2009 mtk01088
125 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
126 * adding the security variable
128 * Nov 18 2009 mtk01088
129 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
131 ** \main\maintrunk.MT5921\14 2009-04-06 15:35:47 GMT mtk01088
132 ** add the variable to set the disable AP selection for privacy check, for wps open networking.
133 ** \main\maintrunk.MT5921\13 2008-11-19 11:46:01 GMT mtk01088
134 ** rename some variable with pre-fix to avoid the misunderstanding
135 ** \main\maintrunk.MT5921\12 2008-08-28 20:37:11 GMT mtk01088
136 ** remove non-used code
138 ** \main\maintrunk.MT5921\11 2008-03-18 09:51:52 GMT mtk01088
139 ** Add function declaration for timer to indicate pmkid candidate
140 ** \main\maintrunk.MT5921\10 2008-02-29 15:12:08 GMT mtk01088
141 ** add variable for sw port control
142 ** \main\maintrunk.MT5921\9 2008-02-29 12:37:30 GMT mtk01088
143 ** rename the security related function declaration
144 ** \main\maintrunk.MT5921\8 2007-12-27 13:59:08 GMT mtk01088
145 ** adjust the wlan table and sec fsm init timing
146 ** \main\maintrunk.MT5921\7 2007-11-20 10:39:49 GMT mtk01088
147 ** add function timer for wait EAPoL Error timeout
148 ** \main\maintrunk.MT5921\6 2007-11-06 20:39:08 GMT mtk01088
149 ** rename the counter measure timer
150 ** \main\maintrunk.MT5921\5 2007-11-06 20:14:31 GMT mtk01088
151 ** add a abort function
152 ** Revision 1.5 2007/07/16 02:33:42 MTK01088
153 ** change the ENUM declaration structure prefix from r to e
155 ** Revision 1.4 2007/07/09 06:23:10 MTK01088
158 ** Revision 1.3 2007/07/04 10:09:04 MTK01088
159 ** adjust the state for security fsm
160 ** change function name
162 ** Revision 1.2 2007/07/03 08:13:22 MTK01088
163 ** change the sec fsm state
164 ** add the event for sec fsm
166 ** Revision 1.1 2007/06/27 06:20:35 MTK01088
167 ** add the sec fsm header file
174 /*******************************************************************************
175 * C O M P I L E R F L A G S
176 ********************************************************************************
179 /*******************************************************************************
180 * E X T E R N A L R E F E R E N C E S
181 ********************************************************************************
184 /*******************************************************************************
186 ********************************************************************************
189 /* TKIP CounterMeasure interval for Rejoin to Network. */
190 #define COUNTER_MEASURE_TIMEOUT_INTERVAL_SEC 60
192 /* Timeout to wait the EAPoL Error Report frame Send out. */
193 #define EAPOL_REPORT_SEND_TIMEOUT_INTERVAL_SEC 1
195 /*******************************************************************************
197 ********************************************************************************
200 typedef UINT_32 SEC_STATUS, *P_SEC_STATUS;
203 /* WPA2 PMKID candicate structure */
204 typedef struct _PMKID_CANDICATE_T {
205 UINT_8 aucBssid[MAC_ADDR_LEN]; /* MAC address */
206 UINT_32 u4PreAuthFlags;
207 } PMKID_CANDICATE_T, *P_PMKID_CANDICATE_T;
210 typedef SEC_STATUS (*PFN_SEC_FSM_STATE_HANDLER)(VOID);
212 /*******************************************************************************
213 * P U B L I C D A T A
214 ********************************************************************************
217 /*******************************************************************************
218 * P R I V A T E D A T A
219 ********************************************************************************
222 /*******************************************************************************
224 ********************************************************************************
226 #define SEC_STATE_TRANSITION_FLAG fgIsTransition
227 #define SEC_NEXT_STATE_VAR eNextState
229 #define SEC_STATE_TRANSITION(prAdapter, prSta, eFromState, eToState) \
230 { secFsmTrans_ ## eFromState ## _to_ ## eToState(prAdapter, prSta); \
231 SEC_NEXT_STATE_VAR = SEC_STATE_ ## eToState; \
232 SEC_STATE_TRANSITION_FLAG = (BOOLEAN)TRUE; \
235 /*******************************************************************************
236 * F U N C T I O N D E C L A R A T I O N S
237 ********************************************************************************
240 /*--------------------------------------------------------------*/
241 /* Routines to handle the sec check */
242 /*--------------------------------------------------------------*/
243 /***** Routines in sec_fsm.c *****/
246 IN P_ADAPTER_T prAdapter,
247 IN P_STA_RECORD_T prSta
252 IN P_ADAPTER_T prAdapter,
253 IN P_STA_RECORD_T prSta
258 IN P_ADAPTER_T prAdapter,
259 IN P_STA_RECORD_T prSta
264 IN P_ADAPTER_T prAdapter,
265 IN P_STA_RECORD_T prSta
269 secFsmEventPTKInstalled(
270 IN P_ADAPTER_T prAdapter,
271 IN P_STA_RECORD_T prSta
275 secFsmEvent2ndEapolTx(
276 IN P_ADAPTER_T prAdapter,
277 IN P_STA_RECORD_T prSta
281 secFsmEvent4ndEapolTxDone(
282 IN P_ADAPTER_T prAdapter,
283 IN P_STA_RECORD_T prSta
287 secFsmEventEapolTxDone (
288 IN P_ADAPTER_T prAdapter,
289 IN P_STA_RECORD_T prStaRec,
290 IN ENUM_TX_RESULT_CODE_T rTxDoneStatus
294 secFsmEventEapolTxTimeout (
295 IN P_ADAPTER_T prAdapter,
300 secFsmEventDeauthTxDone(
301 IN P_ADAPTER_T prAdapter,
302 IN P_MSDU_INFO_T prMsduInfo,
303 IN ENUM_TX_RESULT_CODE_T rTxDoneStatus
307 secFsmEventStartCounterMeasure(
308 IN P_ADAPTER_T prAdapter,
309 IN P_STA_RECORD_T prSta
313 secFsmEventEndOfCounterMeasure(
314 IN P_ADAPTER_T prAdapter,
318 /*******************************************************************************
320 ********************************************************************************
322 #endif /* _SEC_FSM_H */