1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
|
/*
** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rsn.h#1
*/
/*! \file rsn.h
\brief The wpa/rsn related define, macro and structure are described here.
*/
/*
** Log: rsn.h
*
* 10 12 2011 wh.su
* [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP
* adding the 802.11w related function and define .
*
* 06 22 2011 wh.su
* [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
* Move the WAPI/RSN IE to mac.h and SW structure not align to byte,
* Notice needed update P2P.ko.
*
* 03 17 2011 chinglan.wang
* [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature
* .
*
* 02 09 2011 wh.su
* [WCXRP00000432] [MT6620 Wi-Fi][Driver] Add STA privacy check at hotspot mode
* adding the code for check STA privacy bit at AP mode, .
*
* 11 05 2010 wh.su
* [WCXRP00000165] [MT6620 Wi-Fi] [Pre-authentication] Assoc req rsn ie use wrong pmkid value
* fixed the.pmkid value mismatch issue
*
* 10 04 2010 wh.su
* [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P
* add a kal function for set cipher.
*
* 09 01 2010 wh.su
* NULL
* adding the wapi support for integration test.
*
* 08 30 2010 wh.su
* NULL
* remove non-used code.
*
* 08 19 2010 wh.su
* NULL
* adding the tx pkt call back handle for countermeasure.
*
* 07 08 2010 cp.wu
*
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
*
* 06 18 2010 wh.su
* [WPD00003840][MT6620 5931] Security migration
* migration from MT6620 firmware.
*
* 03 03 2010 wh.su
* [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize
* Fixed the pre-authentication timer not correctly init issue, and modify
* the security related callback function prototype.
*
* 01 27 2010 wh.su
* [BORA00000476][Wi-Fi][firmware] Add the security module initialize code
* add and fixed some security function.
*
* Dec 4 2009 mtk01088
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
* adjust the function prototype for generate wap/rsn ie
*
* Dec 3 2009 mtk01088
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
* adjust the function input parameter
*
* Dec 1 2009 mtk01088
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
* adding some event function declaration
*
* Nov 26 2009 mtk01088
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
* move the internal data structure for pmkid to rsn.h
*
* Nov 23 2009 mtk01088
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
* adding the port control and class error function
*
* Nov 19 2009 mtk01088
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
* adding the pmkid candidate
*
* Nov 18 2009 mtk01088
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
*
**
*/
#ifndef _RSN_H
#define _RSN_H
/*******************************************************************************
* C O M P I L E R F L A G S
********************************************************************************
*/
/*******************************************************************************
* E X T E R N A L R E F E R E N C E S
********************************************************************************
*/
/*******************************************************************************
* C O N S T A N T S
********************************************************************************
*/
/* ----- Definitions for Cipher Suite Selectors ----- */
#define RSN_CIPHER_SUITE_USE_GROUP_KEY 0x00AC0F00
#define RSN_CIPHER_SUITE_WEP40 0x01AC0F00
#define RSN_CIPHER_SUITE_TKIP 0x02AC0F00
#define RSN_CIPHER_SUITE_CCMP 0x04AC0F00
#define RSN_CIPHER_SUITE_WEP104 0x05AC0F00
#if CFG_SUPPORT_802_11W
#define RSN_CIPHER_SUITE_AES_128_CMAC 0x06AC0F00
#endif
#define WPA_CIPHER_SUITE_NONE 0x00F25000
#define WPA_CIPHER_SUITE_WEP40 0x01F25000
#define WPA_CIPHER_SUITE_TKIP 0x02F25000
#define WPA_CIPHER_SUITE_CCMP 0x04F25000
#define WPA_CIPHER_SUITE_WEP104 0x05F25000
/* ----- Definitions for Authentication and Key Management Suite Selectors ----- */
#define RSN_AKM_SUITE_NONE 0x00AC0F00
#define RSN_AKM_SUITE_802_1X 0x01AC0F00
#define RSN_AKM_SUITE_PSK 0x02AC0F00
#if CFG_SUPPORT_802_11W
#define RSN_AKM_SUITE_802_1X_SHA256 0x05AC0F00
#define RSN_AKM_SUITE_PSK_SHA256 0x06AC0F00
#endif
#define WPA_AKM_SUITE_NONE 0x00F25000
#define WPA_AKM_SUITE_802_1X 0x01F25000
#define WPA_AKM_SUITE_PSK 0x02F25000
#define ELEM_ID_RSN_LEN_FIXED 20 /* The RSN IE len for associate request */
#define ELEM_ID_WPA_LEN_FIXED 22 /* The RSN IE len for associate request */
#define MASK_RSNIE_CAP_PREAUTH BIT(0)
#define GET_SELECTOR_TYPE(x) ((UINT_8)(((x) >> 24) & 0x000000FF))
#define SET_SELECTOR_TYPE(x, y) {x = (((x) & 0x00FFFFFF) | (((UINT_32)(y) << 24) & 0xFF000000))}
#define AUTH_CIPHER_CCMP 0x00000008
/* Cihpher suite flags */
#define CIPHER_FLAG_NONE 0x00000000
#define CIPHER_FLAG_WEP40 0x00000001 /* BIT 1 */
#define CIPHER_FLAG_TKIP 0x00000002 /* BIT 2 */
#define CIPHER_FLAG_CCMP 0x00000008 /* BIT 4 */
#define CIPHER_FLAG_WEP104 0x00000010 /* BIT 5 */
#define CIPHER_FLAG_WEP128 0x00000020 /* BIT 6 */
#define WAIT_TIME_IND_PMKID_CANDICATE_SEC 6 /* seconds */
#define TKIP_COUNTERMEASURE_SEC 60 /* seconds */
#if CFG_SUPPORT_802_11W
#define RSN_AUTH_MFP_DISABLED 0 /* MFP disabled */
#define RSN_AUTH_MFP_OPTIONAL 1 /* MFP optional */
#define RSN_AUTH_MFP_REQUIRED 2 /* MFP required */
#endif
/*******************************************************************************
* D A T A T Y P E S
********************************************************************************
*/
/* Flags for PMKID Candidate list structure */
#define EVENT_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01
#define CONTROL_FLAG_UC_MGMT_NO_ENC BIT(5)
/*******************************************************************************
* P U B L I C D A T A
********************************************************************************
*/
/*******************************************************************************
* P R I V A T E D A T A
********************************************************************************
*/
/*******************************************************************************
* M A C R O S
********************************************************************************
*/
#define RSN_IE(fp) ((P_RSN_INFO_ELEM_T) fp)
#define WPA_IE(fp) ((P_WPA_INFO_ELEM_T) fp)
/*******************************************************************************
* F U N C T I O N D E C L A R A T I O N S
********************************************************************************
*/
BOOLEAN rsnParseRsnIE(IN P_ADAPTER_T prAdapter, IN P_RSN_INFO_ELEM_T prInfoElem, OUT P_RSN_INFO_T prRsnInfo);
BOOLEAN rsnParseWpaIE(IN P_ADAPTER_T prAdapter, IN P_WPA_INFO_ELEM_T prInfoElem, OUT P_RSN_INFO_T prWpaInfo);
BOOLEAN rsnSearchSupportedCipher(IN P_ADAPTER_T prAdapter, IN UINT_32 u4Cipher, OUT PUINT_32 pu4Index);
BOOLEAN rsnSearchAKMSuite(IN P_ADAPTER_T prAdapter, IN UINT_32 u4AkmSuite, OUT PUINT_32 pu4Index);
BOOLEAN rsnPerformPolicySelection(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBss);
VOID rsnGenerateWpaNoneIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
VOID rsnGenerateWPAIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
VOID rsnGenerateRSNIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
BOOLEAN
rsnParseCheckForWFAInfoElem(IN P_ADAPTER_T prAdapter,
IN PUINT_8 pucBuf, OUT PUINT_8 pucOuiType, OUT PUINT_16 pu2SubTypeVersion);
BOOLEAN rsnIsSuitableBSS(IN P_ADAPTER_T prAdapter, IN P_RSN_INFO_T prBssRsnInfo);
#if CFG_SUPPORT_AAA
void rsnParserCheckForRSNCCMPPSK(P_ADAPTER_T prAdapter, P_RSN_INFO_ELEM_T prIe, PUINT_16 pu2StatusCode);
#endif
VOID rsnTkipHandleMICFailure(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta, IN BOOLEAN fgErrorKeyType);
VOID rsnSelectPmkidCandidateList(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
VOID rsnUpdatePmkidCandidateList(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
BOOLEAN rsnSearchPmkidEntry(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucBssid, OUT PUINT_32 pu4EntryIndex);
BOOLEAN rsnCheckPmkidCandicate(IN P_ADAPTER_T prAdapter);
VOID rsnCheckPmkidCache(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBss);
VOID rsnGeneratePmkidIndication(IN P_ADAPTER_T prAdapter);
VOID rsnIndicatePmkidCand(IN P_ADAPTER_T prAdapter, IN ULONG ulParm);
#if CFG_SUPPORT_WPS2
VOID rsnGenerateWSCIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
#endif
#if CFG_SUPPORT_802_11W
UINT_32 rsnCheckBipKeyInstalled(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
UINT_8 rsnCheckSaQueryTimeout(IN P_ADAPTER_T prAdapter);
void rsnStartSaQueryTimer(IN P_ADAPTER_T prAdapter);
void rsnStartSaQuery(IN P_ADAPTER_T prAdapter);
void rsnStopSaQuery(IN P_ADAPTER_T prAdapter);
void rsnSaQueryRequest(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
void rsnSaQueryAction(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
BOOLEAN rsnCheckRxMgmt(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, IN UINT_8 ucSubtype);
#endif
BOOLEAN rsnCheckSecurityModeChanged(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo, P_BSS_DESC_T prBssDesc);
/*******************************************************************************
* F U N C T I O N S
********************************************************************************
*/
#endif /* _RSN_H */
|