2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/privacy.h#1 $
6 \brief This file contains the function declaration for privacy.c.
16 * .support the Wi-Fi RSN
20 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
23 * [WPD00003840][MT6620 5931] Security migration
24 * modify some code for concurrent network.
27 * [WPD00003840][MT6620 5931] Security migration
28 * consdier the concurrent network setting.
31 * [WPD00003840][MT6620 5931] Security migration
32 * migration the security related function from firmware.
35 * [BORA00000605][WIFISYS] Phase3 Integration
36 * Refine the variable and parameter for security.
39 * [BORA00000626][MT6620] Refine the remove key flow for WHQL testing
40 * For support the WHQL test, do the remove key code refine.
42 * Dec 10 2009 mtk01088
43 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
44 * change the cmd return type
47 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
48 * adding the function declaration for auth mode and encryption status setting from build connection command
51 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
52 * adding the function declaration for wapi
55 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
56 * adding the tx done callback handle function
59 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
60 * adding the function declaration for mac header privacy bit setting
63 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
64 * adding the structure for parsing the EAPoL frame
67 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
68 * adjust the class error function parameter
71 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
72 * adding some security function declaration
74 * Nov 19 2009 mtk01088
75 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
76 * adding the ap selection structure
78 * Nov 18 2009 mtk01088
79 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
87 /*******************************************************************************
88 * C O M P I L E R F L A G S
89 ********************************************************************************
92 /*******************************************************************************
93 * E X T E R N A L R E F E R E N C E S
94 ********************************************************************************
97 /*******************************************************************************
99 ********************************************************************************
101 #define MAX_KEY_NUM 4
103 #define WEP_104_LEN 13
104 #define LEGACY_KEY_MAX_LEN 16
105 #define CCMP_KEY_LEN 16
106 #define TKIP_KEY_LEN 32
107 #define MAX_KEY_LEN 32
108 #define MIC_RX_KEY_OFFSET 16
109 #define MIC_TX_KEY_OFFSET 24
110 #define MIC_KEY_LEN 8
112 #define WEP_KEY_ID_FIELD BITS(0, 29)
113 #define KEY_ID_FIELD BITS(0, 7)
115 #define IS_TRANSMIT_KEY BIT(31)
116 #define IS_UNICAST_KEY BIT(30)
117 #define IS_AUTHENTICATOR BIT(28)
119 #define CIPHER_SUITE_NONE 0
120 #define CIPHER_SUITE_WEP40 1
121 #define CIPHER_SUITE_TKIP 2
122 #define CIPHER_SUITE_TKIP_WO_MIC 3
123 #define CIPHER_SUITE_CCMP 4
124 #define CIPHER_SUITE_WEP104 5
125 #define CIPHER_SUITE_BIP 6
126 #define CIPHER_SUITE_WEP128 7
127 #define CIPHER_SUITE_WPI 8
129 #define WPA_KEY_INFO_KEY_TYPE BIT(3) /* 1 = Pairwise, 0 = Group key */
130 #define WPA_KEY_INFO_MIC BIT(8)
131 #define WPA_KEY_INFO_SECURE BIT(9)
133 #define MASK_2ND_EAPOL (WPA_KEY_INFO_KEY_TYPE | WPA_KEY_INFO_MIC)
136 /*******************************************************************************
138 ********************************************************************************
141 typedef struct _IEEE_802_1X_HDR
{
145 /* followed by length octets of data */
146 } IEEE_802_1X_HDR
, *P_IEEE_802_1X_HDR
;
148 typedef struct _EAPOL_KEY
{
150 /* Note: key_info, key_length, and key_data_length are unaligned */
151 UINT_8 aucKeyInfo
[2]; /* big endian */
152 UINT_8 aucKeyLength
[2]; /* big endian */
153 UINT_8 aucReplayCounter
[8];
154 UINT_8 aucKeyNonce
[16];
157 UINT_8 aucKeyId
[8]; /* Reserved in IEEE 802.11i/RSN */
158 UINT_8 aucKeyMic
[16];
159 UINT_8 aucKeyDataLength
[2]; /* big endian */
160 /* followed by key_data_length bytes of key_data */
161 } EAPOL_KEY
, *P_EAPOL_KEY
;
163 /* WPA2 PMKID candicate structure */
164 typedef struct _PMKID_CANDICATE_T
{
165 UINT_8 aucBssid
[MAC_ADDR_LEN
];
166 UINT_32 u4PreAuthFlags
;
167 } PMKID_CANDICATE_T
, *P_PMKID_CANDICATE_T
;
170 /* WPA2 PMKID cache structure */
171 typedef struct _PMKID_ENTRY_T
{
172 PARAM_BSSID_INFO_T rBssidInfo
;
173 BOOLEAN fgPmkidExist
;
174 } PMKID_ENTRY_T
, *P_PMKID_ENTRY_T
;
177 /*******************************************************************************
178 * P U B L I C D A T A
179 ********************************************************************************
182 /*******************************************************************************
183 * P R I V A T E D A T A
184 ********************************************************************************
187 /*******************************************************************************
189 ********************************************************************************
192 /*******************************************************************************
193 * F U N C T I O N D E C L A R A T I O N S
194 ********************************************************************************
197 VOID
secInit(IN P_ADAPTER_T prAdapter
, IN UINT_8 ucNetTypeIdx
);
199 VOID
secSetPortBlocked(IN P_ADAPTER_T prAdapter
, IN P_STA_RECORD_T prSta
, IN BOOLEAN fgPort
);
202 secCheckClassError(IN P_ADAPTER_T prAdapter
, IN P_SW_RFB_T prSwRfb
, IN P_STA_RECORD_T prStaRec
);
205 secTxPortControlCheck(IN P_ADAPTER_T prAdapter
,
206 IN P_MSDU_INFO_T prMsduInfo
, IN P_STA_RECORD_T prStaRec
);
208 BOOLEAN
secRxPortControlCheck(IN P_ADAPTER_T prAdapter
, IN P_SW_RFB_T prSWRfb
);
210 VOID
secSetCipherSuite(IN P_ADAPTER_T prAdapter
, IN UINT_32 u4CipherSuitesFlags
);
213 secProcessEAPOL(IN P_ADAPTER_T prAdapter
,
214 IN P_MSDU_INFO_T prMsduInfo
,
215 IN P_STA_RECORD_T prStaRec
, IN PUINT_8 pucPayload
, IN UINT_16 u2PayloadLen
);
218 secHandleTxDoneCallback(IN P_ADAPTER_T prAdapter
,
219 IN P_MSDU_INFO_T pMsduInfo
,
220 IN P_STA_RECORD_T prStaRec
, IN WLAN_STATUS rStatus
);
223 secIsProtectedFrame(IN P_ADAPTER_T prAdapter
, IN P_MSDU_INFO_T prMsdu
, IN P_STA_RECORD_T prStaRec
);
225 VOID
secClearPmkid(IN P_ADAPTER_T prAdapter
);
227 BOOLEAN
secRsnKeyHandshakeEnabled(IN P_ADAPTER_T prAdapter
);
229 BOOLEAN
secTransmitKeyExist(IN P_ADAPTER_T prAdapter
, IN P_STA_RECORD_T prSta
);
231 BOOLEAN
secEnabledInAis(IN P_ADAPTER_T prAdapter
);
234 /*******************************************************************************
236 ********************************************************************************
239 #endif /* _PRIVACY_H */