2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_2/include/mgmt/privacy.h#1 $
6 \brief This file contains the function declaration for privacy.c.
9 /*******************************************************************************
10 * Copyright (c) 2007 MediaTek Inc.
12 * All rights reserved. Copying, compilation, modification, distribution
13 * or any other use whatsoever of this material is strictly prohibited
14 * except in accordance with a Software License Agreement with
16 ********************************************************************************
19 /*******************************************************************************
22 * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND
23 * AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK
24 * SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
25 * PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY
26 * DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
27 * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
28 * PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE
29 * ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY
30 * WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK
31 * SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY
32 * WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE
33 * FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO
34 * CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
36 * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
37 * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL
38 * BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT
39 * ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
40 * BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
42 * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
43 * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT
44 * OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING
45 * THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN
46 * FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE
48 ********************************************************************************
55 * [WCXRP00000577] [MT6620 Wi-Fi][Driver][FW] Create V2.0 branch for firmware and driver
56 * create V2.0 driver release based on label "MT6620_WIFI_DRIVER_V2_0_110318_1600" from main trunk
60 * .support the Wi-Fi RSN
64 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
67 * [WPD00003840][MT6620 5931] Security migration
68 * modify some code for concurrent network.
71 * [WPD00003840][MT6620 5931] Security migration
72 * consdier the concurrent network setting.
75 * [WPD00003840][MT6620 5931] Security migration
76 * migration the security related function from firmware.
79 * [BORA00000605][WIFISYS] Phase3 Integration
80 * Refine the variable and parameter for security.
83 * [BORA00000626][MT6620] Refine the remove key flow for WHQL testing
84 * For support the WHQL test, do the remove key code refine.
86 * Dec 10 2009 mtk01088
87 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
88 * change the cmd return type
91 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
92 * adding the function declaration for auth mode and encryption status setting from build connection command
95 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
96 * adding the function declaration for wapi
99 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
100 * adding the tx done callback handle function
102 * Dec 7 2009 mtk01088
103 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
104 * adding the function declaration for mac header privacy bit setting
106 * Dec 4 2009 mtk01088
107 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
108 * adding the structure for parsing the EAPoL frame
110 * Dec 3 2009 mtk01088
111 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
112 * adjust the class error function parameter
114 * Dec 1 2009 mtk01088
115 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
116 * adding some security function declaration
118 * Nov 19 2009 mtk01088
119 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
120 * adding the ap selection structure
122 * Nov 18 2009 mtk01088
123 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
131 /*******************************************************************************
132 * C O M P I L E R F L A G S
133 ********************************************************************************
136 /*******************************************************************************
137 * E X T E R N A L R E F E R E N C E S
138 ********************************************************************************
141 /*******************************************************************************
143 ********************************************************************************
145 #define MAX_KEY_NUM 4
147 #define WEP_104_LEN 13
148 #define LEGACY_KEY_MAX_LEN 16
149 #define CCMP_KEY_LEN 16
150 #define TKIP_KEY_LEN 32
151 #define MAX_KEY_LEN 32
152 #define MIC_RX_KEY_OFFSET 16
153 #define MIC_TX_KEY_OFFSET 24
154 #define MIC_KEY_LEN 8
156 #define WEP_KEY_ID_FIELD BITS(0,29)
157 #define KEY_ID_FIELD BITS(0,7)
159 #define IS_TRANSMIT_KEY BIT(31)
160 #define IS_UNICAST_KEY BIT(30)
161 #define IS_AUTHENTICATOR BIT(28)
163 #define CIPHER_SUITE_NONE 0
164 #define CIPHER_SUITE_WEP40 1
165 #define CIPHER_SUITE_TKIP 2
166 #define CIPHER_SUITE_TKIP_WO_MIC 3
167 #define CIPHER_SUITE_CCMP 4
168 #define CIPHER_SUITE_WEP104 5
169 #define CIPHER_SUITE_BIP 6
170 #define CIPHER_SUITE_WEP128 7
171 #define CIPHER_SUITE_WPI 8
173 #define WPA_KEY_INFO_KEY_TYPE BIT(3) /* 1 = Pairwise, 0 = Group key */
174 #define WPA_KEY_INFO_MIC BIT(8)
175 #define WPA_KEY_INFO_SECURE BIT(9)
177 #define MASK_2ND_EAPOL (WPA_KEY_INFO_KEY_TYPE | WPA_KEY_INFO_MIC)
180 /*******************************************************************************
182 ********************************************************************************
185 typedef struct _IEEE_802_1X_HDR {
189 /* followed by length octets of data */
190 } IEEE_802_1X_HDR, *P_IEEE_802_1X_HDR;
192 typedef struct _EAPOL_KEY {
194 /* Note: key_info, key_length, and key_data_length are unaligned */
195 UINT_8 aucKeyInfo[2]; /* big endian */
196 UINT_8 aucKeyLength[2]; /* big endian */
197 UINT_8 aucReplayCounter[8];
198 UINT_8 aucKeyNonce[16];
201 UINT_8 aucKeyId[8]; /* Reserved in IEEE 802.11i/RSN */
202 UINT_8 aucKeyMic[16];
203 UINT_8 aucKeyDataLength[2]; /* big endian */
204 /* followed by key_data_length bytes of key_data */
205 } EAPOL_KEY, *P_EAPOL_KEY;
207 /* WPA2 PMKID candicate structure */
208 typedef struct _PMKID_CANDICATE_T {
209 UINT_8 aucBssid[MAC_ADDR_LEN];
210 UINT_32 u4PreAuthFlags;
211 } PMKID_CANDICATE_T, *P_PMKID_CANDICATE_T;
214 /* WPA2 PMKID cache structure */
215 typedef struct _PMKID_ENTRY_T {
216 PARAM_BSSID_INFO_T rBssidInfo;
217 BOOLEAN fgPmkidExist;
218 } PMKID_ENTRY_T, *P_PMKID_ENTRY_T;
221 /*******************************************************************************
222 * P U B L I C D A T A
223 ********************************************************************************
226 /*******************************************************************************
227 * P R I V A T E D A T A
228 ********************************************************************************
231 /*******************************************************************************
233 ********************************************************************************
236 /*******************************************************************************
237 * F U N C T I O N D E C L A R A T I O N S
238 ********************************************************************************
243 IN P_ADAPTER_T prAdapter,
244 IN UINT_8 ucNetTypeIdx
249 IN P_ADAPTER_T prAdapter,
250 IN P_STA_RECORD_T prSta,
256 IN P_ADAPTER_T prAdapter,
257 IN P_SW_RFB_T prSwRfb,
258 IN P_STA_RECORD_T prStaRec
262 secTxPortControlCheck(
263 IN P_ADAPTER_T prAdapter,
264 IN P_MSDU_INFO_T prMsduInfo,
265 IN P_STA_RECORD_T prStaRec
269 secRxPortControlCheck(
270 IN P_ADAPTER_T prAdapter,
271 IN P_SW_RFB_T prSWRfb
276 IN P_ADAPTER_T prAdapter,
277 IN UINT_32 u4CipherSuitesFlags
282 IN P_ADAPTER_T prAdapter,
283 IN P_MSDU_INFO_T prMsduInfo,
284 IN P_STA_RECORD_T prStaRec,
285 IN PUINT_8 pucPayload,
286 IN UINT_16 u2PayloadLen
290 secHandleTxDoneCallback(
291 IN P_ADAPTER_T prAdapter,
292 IN P_MSDU_INFO_T pMsduInfo,
293 IN P_STA_RECORD_T prStaRec,
294 IN WLAN_STATUS rStatus
298 secIsProtectedFrame (
299 IN P_ADAPTER_T prAdapter,
300 IN P_MSDU_INFO_T prMsdu,
301 IN P_STA_RECORD_T prStaRec
306 IN P_ADAPTER_T prAdapter
310 secRsnKeyHandshakeEnabled(
311 IN P_ADAPTER_T prAdapter
316 IN P_ADAPTER_T prAdapter,
317 IN P_STA_RECORD_T prSta
322 IN P_ADAPTER_T prAdapter
326 /*******************************************************************************
328 ********************************************************************************
331 #endif /* _PRIVACY_H */