2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rsn.h#1 $
6 \brief The wpa/rsn related define, macro and structure are described here.
15 * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP
16 * adding the 802.11w related function and define .
19 * [WCXRP00000806] [MT6620 Wi-Fi][Driver] Move the WPA/RSN IE and WAPI IE structure to mac.h and let the sw structure not align at byte
20 * Move the WAPI/RSN IE to mac.h and SW structure not align to byte,
21 * Notice needed update P2P.ko.
23 * 03 17 2011 chinglan.wang
24 * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature
28 * [WCXRP00000432] [MT6620 Wi-Fi][Driver] Add STA privacy check at hotspot mode
29 * adding the code for check STA privacy bit at AP mode, .
32 * [WCXRP00000165] [MT6620 Wi-Fi] [Pre-authentication] Assoc req rsn ie use wrong pmkid value
33 * fixed the.pmkid value mismatch issue
36 * [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P
37 * add a kal function for set cipher.
41 * adding the wapi support for integration test.
45 * remove non-used code.
49 * adding the tx pkt call back handle for countermeasure.
53 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
56 * [WPD00003840][MT6620 5931] Security migration
57 * migration from MT6620 firmware.
60 * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize
61 * Fixed the pre-authentication timer not correctly init issue, and modify the security related callback function prototype.
64 * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code
65 * add and fixed some security function.
68 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
69 * adjust the function prototype for generate wap/rsn ie
72 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
73 * adjust the function input parameter
76 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
77 * adding some event function declaration
79 * Nov 26 2009 mtk01088
80 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
81 * move the internal data structure for pmkid to rsn.h
83 * Nov 23 2009 mtk01088
84 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
85 * adding the port control and class error function
87 * Nov 19 2009 mtk01088
88 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
89 * adding the pmkid candidate
91 * Nov 18 2009 mtk01088
92 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
100 /*******************************************************************************
101 * C O M P I L E R F L A G S
102 ********************************************************************************
105 /*******************************************************************************
106 * E X T E R N A L R E F E R E N C E S
107 ********************************************************************************
110 /*******************************************************************************
112 ********************************************************************************
114 /* ----- Definitions for Cipher Suite Selectors ----- */
115 #define RSN_CIPHER_SUITE_USE_GROUP_KEY 0x00AC0F00
116 #define RSN_CIPHER_SUITE_WEP40 0x01AC0F00
117 #define RSN_CIPHER_SUITE_TKIP 0x02AC0F00
118 #define RSN_CIPHER_SUITE_CCMP 0x04AC0F00
119 #define RSN_CIPHER_SUITE_WEP104 0x05AC0F00
120 #if CFG_SUPPORT_802_11W
121 #define RSN_CIPHER_SUITE_AES_128_CMAC 0x06AC0F00
124 #define WPA_CIPHER_SUITE_NONE 0x00F25000
125 #define WPA_CIPHER_SUITE_WEP40 0x01F25000
126 #define WPA_CIPHER_SUITE_TKIP 0x02F25000
127 #define WPA_CIPHER_SUITE_CCMP 0x04F25000
128 #define WPA_CIPHER_SUITE_WEP104 0x05F25000
130 /* ----- Definitions for Authentication and Key Management Suite Selectors ----- */
131 #define RSN_AKM_SUITE_NONE 0x00AC0F00
132 #define RSN_AKM_SUITE_802_1X 0x01AC0F00
133 #define RSN_AKM_SUITE_PSK 0x02AC0F00
134 #if CFG_SUPPORT_802_11W
135 #define RSN_AKM_SUITE_802_1X_SHA256 0x05AC0F00
136 #define RSN_AKM_SUITE_PSK_SHA256 0x06AC0F00
139 #define WPA_AKM_SUITE_NONE 0x00F25000
140 #define WPA_AKM_SUITE_802_1X 0x01F25000
141 #define WPA_AKM_SUITE_PSK 0x02F25000
143 #define ELEM_ID_RSN_LEN_FIXED 20 /* The RSN IE len for associate request */
145 #define ELEM_ID_WPA_LEN_FIXED 22 /* The RSN IE len for associate request */
147 #define MASK_RSNIE_CAP_PREAUTH BIT(0)
149 #define GET_SELECTOR_TYPE(x) ((UINT_8)(((x) >> 24) & 0x000000FF))
150 #define SET_SELECTOR_TYPE(x, y) x = (((x) & 0x00FFFFFF) | (((UINT_32)(y) << 24) & 0xFF000000))
152 #define AUTH_CIPHER_CCMP 0x00000008
154 /* Cihpher suite flags */
155 #define CIPHER_FLAG_NONE 0x00000000
156 #define CIPHER_FLAG_WEP40 0x00000001 /* BIT 1 */
157 #define CIPHER_FLAG_TKIP 0x00000002 /* BIT 2 */
158 #define CIPHER_FLAG_CCMP 0x00000008 /* BIT 4 */
159 #define CIPHER_FLAG_WEP104 0x00000010 /* BIT 5 */
160 #define CIPHER_FLAG_WEP128 0x00000020 /* BIT 6 */
162 #define WAIT_TIME_IND_PMKID_CANDICATE_SEC 6 /* seconds */
163 #define TKIP_COUNTERMEASURE_SEC 60 /* seconds */
165 #if CFG_SUPPORT_802_11W
166 #define RSN_AUTH_MFP_DISABLED 0 /* MFP disabled */
167 #define RSN_AUTH_MFP_OPTIONAL 1 /* MFP optional */
168 #define RSN_AUTH_MFP_REQUIRED 2 /* MFP required */
171 /*******************************************************************************
173 ********************************************************************************
176 /* Flags for PMKID Candidate list structure */
177 #define EVENT_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01
180 #define CONTROL_FLAG_UC_MGMT_NO_ENC BIT(5)
182 /*******************************************************************************
183 * P U B L I C D A T A
184 ********************************************************************************
187 /*******************************************************************************
188 * P R I V A T E D A T A
189 ********************************************************************************
192 /*******************************************************************************
194 ********************************************************************************
196 #define RSN_IE(fp) ((P_RSN_INFO_ELEM_T) fp)
197 #define WPA_IE(fp) ((P_WPA_INFO_ELEM_T) fp)
200 /*******************************************************************************
201 * F U N C T I O N D E C L A R A T I O N S
202 ********************************************************************************
206 IN P_ADAPTER_T prAdapter,
207 IN P_RSN_INFO_ELEM_T prInfoElem,
208 OUT P_RSN_INFO_T prRsnInfo
213 IN P_ADAPTER_T prAdapter,
214 IN P_WPA_INFO_ELEM_T prInfoElem,
215 OUT P_RSN_INFO_T prWpaInfo
219 rsnSearchSupportedCipher(
220 IN P_ADAPTER_T prAdapter,
222 OUT PUINT_32 pu4Index
227 IN P_ADAPTER_T prAdapter,
228 IN UINT_32 u4AkmSuite,
229 OUT PUINT_32 pu4Index
233 rsnPerformPolicySelection(
234 IN P_ADAPTER_T prAdapter,
235 IN P_BSS_DESC_T prBss
239 rsnGenerateWpaNoneIE(
240 IN P_ADAPTER_T prAdapter,
241 IN P_MSDU_INFO_T prMsduInfo
246 IN P_ADAPTER_T prAdapter,
247 IN P_MSDU_INFO_T prMsduInfo
252 IN P_ADAPTER_T prAdapter,
253 IN P_MSDU_INFO_T prMsduInfo
257 rsnParseCheckForWFAInfoElem(
258 IN P_ADAPTER_T prAdapter,
260 OUT PUINT_8 pucOuiType,
261 OUT PUINT_16 pu2SubTypeVersion
266 IN P_ADAPTER_T prAdapter,
267 IN P_RSN_INFO_T prBssRsnInfo
272 rsnParserCheckForRSNCCMPPSK (
273 P_ADAPTER_T prAdapter,
274 P_RSN_INFO_ELEM_T prIe,
275 PUINT_16 pu2StatusCode
280 rsnTkipHandleMICFailure(
281 IN P_ADAPTER_T prAdapter,
282 IN P_STA_RECORD_T prSta,
283 IN BOOLEAN fgErrorKeyType
287 rsnSelectPmkidCandidateList(
288 IN P_ADAPTER_T prAdapter,
289 IN P_BSS_DESC_T prBssDesc
293 rsnUpdatePmkidCandidateList(
294 IN P_ADAPTER_T prAdapter,
295 IN P_BSS_DESC_T prBssDesc
300 IN P_ADAPTER_T prAdapter,
302 OUT PUINT_32 pu4EntryIndex
306 rsnCheckPmkidCandicate(
307 IN P_ADAPTER_T prAdapter
312 IN P_ADAPTER_T prAdapter,
313 IN P_BSS_DESC_T prBss
317 rsnGeneratePmkidIndication(
318 IN P_ADAPTER_T prAdapter
322 rsnIndicatePmkidCand(
323 IN P_ADAPTER_T prAdapter,
329 IN P_ADAPTER_T prAdapter,
330 IN P_MSDU_INFO_T prMsduInfo
334 #if CFG_SUPPORT_802_11W
336 rsnCheckBipKeyInstalled(
337 IN P_ADAPTER_T prAdapter,
338 IN P_STA_RECORD_T prStaRec
342 rsnCheckSaQueryTimeout(
343 IN P_ADAPTER_T prAdapter
347 rsnStartSaQueryTimer(
348 IN P_ADAPTER_T prAdapter
353 IN P_ADAPTER_T prAdapter
358 IN P_ADAPTER_T prAdapter
363 IN P_ADAPTER_T prAdapter,
364 IN P_SW_RFB_T prSwRfb
369 IN P_ADAPTER_T prAdapter,
370 IN P_SW_RFB_T prSwRfb
375 IN P_ADAPTER_T prAdapter,
376 IN P_SW_RFB_T prSwRfb,
380 /*******************************************************************************
382 ********************************************************************************