2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/include/gl_wext.h#1 $
6 \brief This file is for Portable Driver linux wireless extension support.
14 ** 09 17 2012 cm.chang
15 ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
16 ** Duplicate source from MT6620 v2.3 driver branch
17 ** (Davinci label: MT6620_WIFI_Driver_V2_3_120913_1942_As_MT6630_Base)
20 * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP
21 * adding the 802.11w related function and define .
23 * 09 20 2011 chinglan.wang
24 * [WCXRP00000989] [WiFi Direct] [Driver] Add a new io control API to start the formation for the sigma test.
27 * 09 20 2011 chinglan.wang
28 * [WCXRP00000989] [WiFi Direct] [Driver] Add a new io control API to start the formation for the sigma test.
31 * 01 11 2011 chinglan.wang
33 * Modify to reslove the CR :[ALPS00028994] Use WEP security to connect Marvell 11N AP. Connection establish successfully.
34 * Use the WPS function to connect AP, the privacy bit always is set to 1. .
38 * [WCXRP00000067][MT6620 Wi-Fi][Driver] Support the android+ WAPI function.
42 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
44 * 06 06 2010 kevin.huang
45 * [WPD00003832][MT6620 5931] Create driver base
46 * [MT6620 5931] Create driver base
49 * [WPD00003816][MT6620 Wi-Fi] Adding the security support
50 * modify the wapi related code for new driver's design.
52 * 03 24 2010 jeffrey.chang
53 * [WPD00003826]Initial import for Linux port
54 * initial import for Linux port
55 ** \main\maintrunk.MT5921\12 2009-10-20 17:38:33 GMT mtk01090
56 ** Refine driver unloading and clean up procedure. Block requests, stop main thread and clean up queued requests, and then stop hw.
57 ** \main\maintrunk.MT5921\11 2009-09-28 20:19:28 GMT mtk01090
58 ** Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel.
59 ** \main\maintrunk.MT5921\10 2009-09-03 12:12:35 GMT mtk01088
60 ** adding the function declaration
61 ** \main\maintrunk.MT5921\9 2009-08-18 22:57:17 GMT mtk01090
62 ** Add Linux SDIO (with mmc core) support.
63 ** Add Linux 2.6.21, 2.6.25, 2.6.26.
64 ** Fix compile warning in Linux.
65 ** \main\maintrunk.MT5921\8 2008-08-29 16:59:07 GMT mtk01088
66 ** fixed compiling error
67 ** \main\maintrunk.MT5921\7 2008-08-29 14:13:28 GMT mtk01088
68 ** adjust the header file for code refine
69 ** \main\maintrunk.MT5921\6 2008-03-28 10:40:31 GMT mtk01461
70 ** Add set desired rate in Linux STD IOCTL
71 ** \main\maintrunk.MT5921\5 2008-03-11 14:51:08 GMT mtk01461
72 ** Refine private IOCTL functions
73 ** \main\maintrunk.MT5921\4 2008-02-12 23:45:45 GMT mtk01461
74 ** Add Set Frequency & Channel oid support for Linux
75 ** \main\maintrunk.MT5921\3 2007-11-06 19:36:19 GMT mtk01088
76 ** add the WPS related code
83 /*******************************************************************************
84 * C O M P I L E R F L A G S
85 ********************************************************************************
88 /*******************************************************************************
89 * E X T E R N A L R E F E R E N C E S
90 ********************************************************************************
93 extern UINT_8 keyStructBuf
[1024]; /* add/remove key shared buffer */
95 extern UINT_8 keyStructBuf
[100]; /* add/remove key shared buffer */
98 /* for IE Searching */
100 wextSrchDesiredWPAIE(IN PUINT_8 pucIEStart
,
101 IN INT_32 i4TotalIeLen
,
102 IN UINT_8 ucDesiredElemId
, OUT PUINT_8
* ppucDesiredIE
);
106 wextSrchDesiredWPSIE(IN PUINT_8 pucIEStart
,
107 IN INT_32 i4TotalIeLen
,
108 IN UINT_8 ucDesiredElemId
, OUT PUINT_8
* ppucDesiredIE
);
111 /*******************************************************************************
113 ********************************************************************************
116 #define RATE_5_5M 11 /* 5.5M */
118 /*******************************************************************************
120 ********************************************************************************
122 typedef struct _PARAM_FIXED_IEs
{
123 UINT_8 aucTimestamp
[8];
124 UINT_16 u2BeaconInterval
;
125 UINT_16 u2Capabilities
;
128 typedef struct _PARAM_VARIABLE_IE_T
{
132 } PARAM_VARIABLE_IE_T
, *P_PARAM_VARIABLE_IE_T
;
135 #if WIRELESS_EXT < 18
137 #define SIOCSIWMLME 0x8B16 /* request MLME operation; uses struct iw_mlme */
138 /* MLME requests (SIOCSIWMLME / struct iw_mlme) */
139 #define IW_MLME_DEAUTH 0
140 #define IW_MLME_DISASSOC 1
142 /*! \brief SIOCSIWMLME data */
144 __u16 cmd
; /*!< IW_MLME_* */
146 struct sockaddr addr
;
149 #define SIOCSIWAUTH 0x8B32 /* set authentication mode params */
150 #define SIOCGIWAUTH 0x8B33 /* get authentication mode params */
151 /* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
152 #define IW_AUTH_INDEX 0x0FFF
153 #define IW_AUTH_FLAGS 0xF000
154 /* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095)
155 * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the
156 * parameter that is being set/get to; value will be read/written to
157 * struct iw_param value field) */
158 #define IW_AUTH_WPA_VERSION 0
159 #define IW_AUTH_CIPHER_PAIRWISE 1
160 #define IW_AUTH_CIPHER_GROUP 2
161 #define IW_AUTH_KEY_MGMT 3
162 #define IW_AUTH_TKIP_COUNTERMEASURES 4
163 #define IW_AUTH_DROP_UNENCRYPTED 5
164 #define IW_AUTH_80211_AUTH_ALG 6
165 #define IW_AUTH_WPA_ENABLED 7
166 #define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
167 #define IW_AUTH_ROAMING_CONTROL 9
168 #define IW_AUTH_PRIVACY_INVOKED 10
169 #if CFG_SUPPORT_802_11W
170 #define IW_AUTH_MFP 12
172 #define IW_AUTH_MFP_DISABLED 0 /* MFP disabled */
173 #define IW_AUTH_MFP_OPTIONAL 1 /* MFP optional */
174 #define IW_AUTH_MFP_REQUIRED 2 /* MFP required */
177 /* IW_AUTH_WPA_VERSION values (bit field) */
178 #define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
179 #define IW_AUTH_WPA_VERSION_WPA 0x00000002
180 #define IW_AUTH_WPA_VERSION_WPA2 0x00000004
182 /* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */
183 #define IW_AUTH_CIPHER_NONE 0x00000001
184 #define IW_AUTH_CIPHER_WEP40 0x00000002
185 #define IW_AUTH_CIPHER_TKIP 0x00000004
186 #define IW_AUTH_CIPHER_CCMP 0x00000008
187 #define IW_AUTH_CIPHER_WEP104 0x00000010
189 /* IW_AUTH_KEY_MGMT values (bit field) */
190 #define IW_AUTH_KEY_MGMT_802_1X 1
191 #define IW_AUTH_KEY_MGMT_PSK 2
192 #define IW_AUTH_KEY_MGMT_WPA_NONE 4
194 /* IW_AUTH_80211_AUTH_ALG values (bit field) */
195 #define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001
196 #define IW_AUTH_ALG_SHARED_KEY 0x00000002
197 #define IW_AUTH_ALG_LEAP 0x00000004
199 /* IW_AUTH_ROAMING_CONTROL values */
200 #define IW_AUTH_ROAMING_ENABLE 0 /* driver/firmware based roaming */
201 #define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming
204 #define SIOCSIWENCODEEXT 0x8B34 /* set encoding token & mode */
205 #define SIOCGIWENCODEEXT 0x8B35 /* get encoding token & mode */
206 /* SIOCSIWENCODEEXT definitions */
207 #define IW_ENCODE_SEQ_MAX_SIZE 8
208 /* struct iw_encode_ext ->alg */
209 #define IW_ENCODE_ALG_NONE 0
210 #define IW_ENCODE_ALG_WEP 1
211 #define IW_ENCODE_ALG_TKIP 2
212 #define IW_ENCODE_ALG_CCMP 3
213 #if CFG_SUPPORT_802_11W
214 #define IW_ENCODE_ALG_AES_CMAC 5
217 /* struct iw_encode_ext ->ext_flags */
218 #define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
219 #define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
220 #define IW_ENCODE_EXT_GROUP_KEY 0x00000004
221 #define IW_ENCODE_EXT_SET_TX_KEY 0x00000008
223 struct iw_encode_ext
{
224 __u32 ext_flags
; /*!< IW_ENCODE_EXT_* */
225 __u8 tx_seq
[IW_ENCODE_SEQ_MAX_SIZE
]; /*!< LSB first */
226 __u8 rx_seq
[IW_ENCODE_SEQ_MAX_SIZE
]; /*!< LSB first */
227 struct sockaddr addr
; /*!< ff:ff:ff:ff:ff:ff for broadcast/multicast
228 * (group) keys or unicast address for
230 __u16 alg
; /*!< IW_ENCODE_ALG_* */
235 #define SIOCSIWPMKSA 0x8B36 /* PMKSA cache operation */
236 #define IW_PMKSA_ADD 1
237 #define IW_PMKSA_REMOVE 2
238 #define IW_PMKSA_FLUSH 3
240 #define IW_PMKID_LEN 16
243 __u32 cmd
; /*!< IW_PMKSA_* */
244 struct sockaddr bssid
;
245 __u8 pmkid
[IW_PMKID_LEN
];
248 #define IWEVGENIE 0x8C05 /* Generic IE (WPA, RSN, WMM, ..)
249 * (scan results); This includes id and
250 * length fields. One IWEVGENIE may
251 * contain more than one IE. Scan
252 * results may contain one or more
253 * IWEVGENIE events. */
254 #define IWEVMICHAELMICFAILURE 0x8C06 /* Michael MIC failure
255 * (struct iw_michaelmicfailure)
257 #define IWEVASSOCREQIE 0x8C07 /* IEs used in (Re)Association Request.
258 * The data includes id and length
259 * fields and may contain more than one
260 * IE. This event is required in
261 * Managed mode if the driver
262 * generates its own WPA/RSN IE. This
263 * should be sent just before
264 * IWEVREGISTERED event for the
266 #define IWEVASSOCRESPIE 0x8C08 /* IEs used in (Re)Association
267 * Response. The data includes id and
268 * length fields and may contain more
269 * than one IE. This may be sent
270 * between IWEVASSOCREQIE and
271 * IWEVREGISTERED events for the
273 #define IWEVPMKIDCAND 0x8C09 /* PMKID candidate for RSN
275 * (struct iw_pmkid_cand) */
277 #endif /* WIRELESS_EXT < 18 */
279 #if WIRELESS_EXT < 17
280 /* Statistics flags (bitmask in updated) */
281 #define IW_QUAL_QUAL_UPDATED 0x1 /* Value was updated since last read */
282 #define IW_QUAL_LEVEL_UPDATED 0x2
283 #define IW_QUAL_NOISE_UPDATED 0x4
284 #define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */
285 #define IW_QUAL_LEVEL_INVALID 0x20
286 #define IW_QUAL_NOISE_INVALID 0x40
290 IEEE80211_FILTER_TYPE_BEACON
= 1 << 0,
291 IEEE80211_FILTER_TYPE_PROBE_REQ
= 1 << 1,
292 IEEE80211_FILTER_TYPE_PROBE_RESP
= 1 << 2,
293 IEEE80211_FILTER_TYPE_ASSOC_REQ
= 1 << 3,
294 IEEE80211_FILTER_TYPE_ASSOC_RESP
= 1 << 4,
295 IEEE80211_FILTER_TYPE_AUTH
= 1 << 5,
296 IEEE80211_FILTER_TYPE_DEAUTH
= 1 << 6,
297 IEEE80211_FILTER_TYPE_DISASSOC
= 1 << 7,
298 IEEE80211_FILTER_TYPE_ALL
= 0xFF /* used to check the valid filter bits */
302 #define IW_AUTH_WAPI_ENABLED 0x20
303 #define IW_ENCODE_ALG_SMS4 0x20
306 #if CFG_SUPPORT_WAPI /* Android+ */
307 #define IW_AUTH_KEY_MGMT_WAPI_PSK 3
308 #define IW_AUTH_KEY_MGMT_WAPI_CERT 4
310 #define IW_AUTH_KEY_MGMT_WPS 5
312 #if CFG_SUPPORT_802_11W
313 #define IW_AUTH_KEY_MGMT_802_1X_SHA256 7
314 #define IW_AUTH_KEY_MGMT_PSK_SHA256 8
318 /*******************************************************************************
319 * P U B L I C D A T A
320 ********************************************************************************
322 extern const struct iw_handler_def wext_handler_def
;
324 /*******************************************************************************
325 * P R I V A T E D A T A
326 ********************************************************************************
329 /*******************************************************************************
331 ********************************************************************************
334 /*******************************************************************************
335 * F U N C T I O N D E C L A R A T I O N S
336 ********************************************************************************
338 /* wireless extensions' ioctls */
339 int wext_support_ioctl(IN
struct net_device
*prDev
, IN
struct ifreq
*prIfReq
, IN
int i4Cmd
);
342 wext_set_rate(IN
struct net_device
*prNetDev
,
343 IN
struct iw_request_info
*prIwReqInfo
, IN
struct iw_param
*prRate
, IN
char *pcExtra
);
346 wext_indicate_wext_event(IN P_GLUE_INFO_T prGlueInfo
,
347 IN
unsigned int u4Cmd
,
348 IN
unsigned char *pucData
, IN
unsigned int u4DataLen
);
350 struct iw_statistics
*wext_get_wireless_stats(struct net_device
*prDev
);
352 int wext_get_priv(IN
struct net_device
*prNetDev
, IN
struct ifreq
*prIfReq
);
355 wextSrchDesiredWPAIE(IN PUINT_8 pucIEStart
,
356 IN INT_32 i4TotalIeLen
,
357 IN UINT_8 ucDesiredElemId
, OUT PUINT_8
* ppucDesiredIE
);
361 wextSrchDesiredWPSIE(IN PUINT_8 pucIEStart
,
362 IN INT_32 i4TotalIeLen
,
363 IN UINT_8 ucDesiredElemId
, OUT PUINT_8
* ppucDesiredIE
);
366 #if CFG_SUPPORT_PASSPOINT
368 wextSrchDesiredHS20IE(IN PUINT_8 pucIEStart
, IN INT_32 i4TotalIeLen
, OUT PUINT_8
* ppucDesiredIE
);
371 wextSrchDesiredInterworkingIE(IN PUINT_8 pucIEStart
,
372 IN INT_32 i4TotalIeLen
, OUT PUINT_8
* ppucDesiredIE
);
375 wextSrchDesiredAdvProtocolIE(IN PUINT_8 pucIEStart
,
376 IN INT_32 i4TotalIeLen
, OUT PUINT_8
* ppucDesiredIE
);
379 wextSrchDesiredRoamingConsortiumIE(IN PUINT_8 pucIEStart
,
380 IN INT_32 i4TotalIeLen
, OUT PUINT_8
* ppucDesiredIE
);
381 #endif /* CFG_SUPPORT_PASSPOINT */
385 wextSrchDesiredWAPIIE(IN PUINT_8 pucIEStart
, IN INT_32 i4TotalIeLen
, OUT PUINT_8
* ppucDesiredIE
);
387 /*******************************************************************************
389 ********************************************************************************
392 #endif /* WIRELESS_EXT */
394 #endif /* _GL_WEXT_H */