1 diff -u -p linux/include/linux/wireless.we17.h linux/include/linux/wireless.h
2 --- linux/include/linux/wireless.we17.h 2005-05-20 11:25:49.000000000 -0700
3 +++ linux/include/linux/wireless.h 2005-05-20 11:29:05.000000000 -0700
6 * This file define a set of standard wireless extensions
8 - * Version : 17 21.6.04
9 + * Version : 18 12.3.05
11 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
12 - * Copyright (c) 1997-2004 Jean Tourrilhes, All Rights Reserved.
13 + * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved.
16 #ifndef _LINUX_WIRELESS_H
18 * (there is some stuff that will be added in the future...)
19 * I just plan to increment with each new version.
21 -#define WIRELESS_EXT 17
22 +#define WIRELESS_EXT 18
27 * - Document (struct iw_quality *)->updated, add new flags (INVALID)
28 * - Wireless Event capability in struct iw_range
29 * - Add support for relative TxPower (yick !)
31 + * V17 to V18 (From Jouni Malinen <jkmaline@cc.hut.fi>)
33 + * - Add support for WPA/WPA2
34 + * - Add extended encoding configuration (SIOCSIWENCODEEXT and
36 + * - Add SIOCSIWGENIE/SIOCGIWGENIE
38 + * - Add SIOCSIWPMKSA
39 + * - Add struct iw_range bit field for supported encoding capabilities
40 + * - Add optional scan request parameters for SIOCSIWSCAN
41 + * - Add SIOCSIWAUTH/SIOCGIWAUTH for setting authentication and WPA
42 + * related parameters (extensible up to 4096 parameter values)
43 + * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE,
44 + * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND
47 /**************************** CONSTANTS ****************************/
49 #define SIOCSIWPOWER 0x8B2C /* set Power Management settings */
50 #define SIOCGIWPOWER 0x8B2D /* get Power Management settings */
52 +/* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM).
53 + * This ioctl uses struct iw_point and data buffer that includes IE id and len
54 + * fields. More than one IE may be included in the request. Setting the generic
55 + * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers
56 + * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers
57 + * are required to report the used IE as a wireless event, e.g., when
58 + * associating with an AP. */
59 +#define SIOCSIWGENIE 0x8B30 /* set generic IE */
60 +#define SIOCGIWGENIE 0x8B31 /* get generic IE */
62 +/* WPA : IEEE 802.11 MLME requests */
63 +#define SIOCSIWMLME 0x8B16 /* request MLME operation; uses
65 +/* WPA : Authentication mode parameters */
66 +#define SIOCSIWAUTH 0x8B32 /* set authentication mode params */
67 +#define SIOCGIWAUTH 0x8B33 /* get authentication mode params */
69 +/* WPA : Extended version of encoding configuration */
70 +#define SIOCSIWENCODEEXT 0x8B34 /* set encoding token & mode */
71 +#define SIOCGIWENCODEEXT 0x8B35 /* get encoding token & mode */
73 +/* WPA2 : PMKSA cache management */
74 +#define SIOCSIWPMKSA 0x8B36 /* PMKSA cache operation */
76 /* -------------------- DEV PRIVATE IOCTL LIST -------------------- */
78 /* These 32 ioctl are wireless device private, for 16 commands.
80 #define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */
81 #define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */
82 #define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */
83 +#define IWEVGENIE 0x8C05 /* Generic IE (WPA, RSN, WMM, ..)
84 + * (scan results); This includes id and
85 + * length fields. One IWEVGENIE may
86 + * contain more than one IE. Scan
87 + * results may contain one or more
88 + * IWEVGENIE events. */
89 +#define IWEVMICHAELMICFAILURE 0x8C06 /* Michael MIC failure
90 + * (struct iw_michaelmicfailure)
92 +#define IWEVASSOCREQIE 0x8C07 /* IEs used in (Re)Association Request.
93 + * The data includes id and length
94 + * fields and may contain more than one
95 + * IE. This event is required in
96 + * Managed mode if the driver
97 + * generates its own WPA/RSN IE. This
98 + * should be sent just before
99 + * IWEVREGISTERED event for the
101 +#define IWEVASSOCRESPIE 0x8C08 /* IEs used in (Re)Association
102 + * Response. The data includes id and
103 + * length fields and may contain more
104 + * than one IE. This may be sent
105 + * between IWEVASSOCREQIE and
106 + * IWEVREGISTERED events for the
108 +#define IWEVPMKIDCAND 0x8C09 /* PMKID candidate for RSN
109 + * pre-authentication
110 + * (struct iw_pmkid_cand) */
112 #define IWEVFIRST 0x8C00
114 @@ -432,12 +499,94 @@
115 #define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */
116 #define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */
117 #define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */
118 +/* struct iw_scan_req scan_type */
119 +#define IW_SCAN_TYPE_ACTIVE 0
120 +#define IW_SCAN_TYPE_PASSIVE 1
121 /* Maximum size of returned data */
122 #define IW_SCAN_MAX_DATA 4096 /* In bytes */
124 /* Max number of char in custom event - use multiple of them if needed */
125 #define IW_CUSTOM_MAX 256 /* In bytes */
127 +/* Generic information element */
128 +#define IW_GENERIC_IE_MAX 1024
130 +/* MLME requests (SIOCSIWMLME / struct iw_mlme) */
131 +#define IW_MLME_DEAUTH 0
132 +#define IW_MLME_DISASSOC 1
134 +/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
135 +#define IW_AUTH_INDEX 0x0FFF
136 +#define IW_AUTH_FLAGS 0xF000
137 +/* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095)
138 + * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the
139 + * parameter that is being set/get to; value will be read/written to
140 + * struct iw_param value field) */
141 +#define IW_AUTH_WPA_VERSION 0
142 +#define IW_AUTH_CIPHER_PAIRWISE 1
143 +#define IW_AUTH_CIPHER_GROUP 2
144 +#define IW_AUTH_KEY_MGMT 3
145 +#define IW_AUTH_TKIP_COUNTERMEASURES 4
146 +#define IW_AUTH_DROP_UNENCRYPTED 5
147 +#define IW_AUTH_80211_AUTH_ALG 6
148 +#define IW_AUTH_WPA_ENABLED 7
149 +#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
150 +#define IW_AUTH_ROAMING_CONTROL 9
151 +#define IW_AUTH_PRIVACY_INVOKED 10
153 +/* IW_AUTH_WPA_VERSION values (bit field) */
154 +#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
155 +#define IW_AUTH_WPA_VERSION_WPA 0x00000002
156 +#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
158 +/* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */
159 +#define IW_AUTH_CIPHER_NONE 0x00000001
160 +#define IW_AUTH_CIPHER_WEP40 0x00000002
161 +#define IW_AUTH_CIPHER_TKIP 0x00000004
162 +#define IW_AUTH_CIPHER_CCMP 0x00000008
163 +#define IW_AUTH_CIPHER_WEP104 0x00000010
165 +/* IW_AUTH_KEY_MGMT values (bit field) */
166 +#define IW_AUTH_KEY_MGMT_802_1X 1
167 +#define IW_AUTH_KEY_MGMT_PSK 2
169 +/* IW_AUTH_80211_AUTH_ALG values (bit field) */
170 +#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001
171 +#define IW_AUTH_ALG_SHARED_KEY 0x00000002
172 +#define IW_AUTH_ALG_LEAP 0x00000004
174 +/* IW_AUTH_ROAMING_CONTROL values */
175 +#define IW_AUTH_ROAMING_ENABLE 0 /* driver/firmware based roaming */
176 +#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming
179 +/* SIOCSIWENCODEEXT definitions */
180 +#define IW_ENCODE_SEQ_MAX_SIZE 8
181 +/* struct iw_encode_ext ->alg */
182 +#define IW_ENCODE_ALG_NONE 0
183 +#define IW_ENCODE_ALG_WEP 1
184 +#define IW_ENCODE_ALG_TKIP 2
185 +#define IW_ENCODE_ALG_CCMP 3
186 +/* struct iw_encode_ext ->ext_flags */
187 +#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
188 +#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
189 +#define IW_ENCODE_EXT_GROUP_KEY 0x00000004
190 +#define IW_ENCODE_EXT_SET_TX_KEY 0x00000008
192 +/* IWEVMICHAELMICFAILURE : struct iw_michaelmicfailure ->flags */
193 +#define IW_MICFAILURE_KEY_ID 0x00000003 /* Key ID 0..3 */
194 +#define IW_MICFAILURE_GROUP 0x00000004
195 +#define IW_MICFAILURE_PAIRWISE 0x00000008
196 +#define IW_MICFAILURE_STAKEY 0x00000010
197 +#define IW_MICFAILURE_COUNT 0x00000060 /* 1 or 2 (0 = count not supported)
200 +/* Bit field values for enc_capa in struct iw_range */
201 +#define IW_ENC_CAPA_WPA 0x00000001
202 +#define IW_ENC_CAPA_WPA2 0x00000002
203 +#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004
204 +#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008
206 /* Event capability macros - in (struct iw_range *)->event_capa
207 * Because we have more than 32 possible events, we use an array of
208 * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */
209 @@ -546,6 +695,132 @@ struct iw_thrspy
210 struct iw_quality high; /* High threshold */
214 + * Optional data for scan request
216 + * Note: these optional parameters are controlling parameters for the
217 + * scanning behavior, these do not apply to getting scan results
218 + * (SIOCGIWSCAN). Drivers are expected to keep a local BSS table and
219 + * provide a merged results with all BSSes even if the previous scan
220 + * request limited scanning to a subset, e.g., by specifying an SSID.
221 + * Especially, scan results are required to include an entry for the
222 + * current BSS if the driver is in Managed mode and associated with an AP.
226 + __u8 scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */
228 + __u8 num_channels; /* num entries in channel_list;
229 + * 0 = scan all allowed channels */
230 + __u8 flags; /* reserved as padding; use zero, this may
231 + * be used in the future for adding flags
232 + * to request different scan behavior */
233 + struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or
234 + * individual address of a specific BSS */
237 + * Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using
238 + * the current ESSID. This allows scan requests for specific ESSID
239 + * without having to change the current ESSID and potentially breaking
240 + * the current association.
242 + __u8 essid[IW_ESSID_MAX_SIZE];
245 + * Optional parameters for changing the default scanning behavior.
246 + * These are based on the MLME-SCAN.request from IEEE Std 802.11.
247 + * TU is 1.024 ms. If these are set to 0, driver is expected to use
248 + * reasonable default values. min_channel_time defines the time that
249 + * will be used to wait for the first reply on each channel. If no
250 + * replies are received, next channel will be scanned after this. If
251 + * replies are received, total time waited on the channel is defined by
252 + * max_channel_time.
254 + __u32 min_channel_time; /* in TU */
255 + __u32 max_channel_time; /* in TU */
257 + struct iw_freq channel_list[IW_MAX_FREQUENCIES];
260 +/* ------------------------- WPA SUPPORT ------------------------- */
263 + * Extended data structure for get/set encoding (this is used with
264 + * SIOCSIWENCODEEXT/SIOCGIWENCODEEXT. struct iw_point and IW_ENCODE_*
265 + * flags are used in the same way as with SIOCSIWENCODE/SIOCGIWENCODE and
266 + * only the data contents changes (key data -> this structure, including
269 + * If the new key is the first group key, it will be set as the default
270 + * TX key. Otherwise, default TX key index is only changed if
271 + * IW_ENCODE_EXT_SET_TX_KEY flag is set.
273 + * Key will be changed with SIOCSIWENCODEEXT in all cases except for
274 + * special "change TX key index" operation which is indicated by setting
275 + * key_len = 0 and ext_flags |= IW_ENCODE_EXT_SET_TX_KEY.
277 + * tx_seq/rx_seq are only used when respective
278 + * IW_ENCODE_EXT_{TX,RX}_SEQ_VALID flag is set in ext_flags. Normal
279 + * TKIP/CCMP operation is to set RX seq with SIOCSIWENCODEEXT and start
280 + * TX seq from zero whenever key is changed. SIOCGIWENCODEEXT is normally
281 + * used only by an Authenticator (AP or an IBSS station) to get the
282 + * current TX sequence number. Using TX_SEQ_VALID for SIOCSIWENCODEEXT and
283 + * RX_SEQ_VALID for SIOCGIWENCODEEXT are optional, but can be useful for
284 + * debugging/testing.
286 +struct iw_encode_ext
288 + __u32 ext_flags; /* IW_ENCODE_EXT_* */
289 + __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
290 + __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
291 + struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast
292 + * (group) keys or unicast address for
293 + * individual keys */
294 + __u16 alg; /* IW_ENCODE_ALG_* */
299 +/* SIOCSIWMLME data */
302 + __u16 cmd; /* IW_MLME_* */
304 + struct sockaddr addr;
307 +/* SIOCSIWPMKSA data */
308 +#define IW_PMKSA_ADD 1
309 +#define IW_PMKSA_REMOVE 2
310 +#define IW_PMKSA_FLUSH 3
312 +#define IW_PMKID_LEN 16
316 + __u32 cmd; /* IW_PMKSA_* */
317 + struct sockaddr bssid;
318 + __u8 pmkid[IW_PMKID_LEN];
321 +/* IWEVMICHAELMICFAILURE data */
322 +struct iw_michaelmicfailure
325 + struct sockaddr src_addr;
326 + __u8 tsc[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
329 +/* IWEVPMKIDCAND data */
330 +#define IW_PMKID_CAND_PREAUTH 0x00000001 /* RNS pre-authentication enabled */
331 +struct iw_pmkid_cand
333 + __u32 flags; /* IW_PMKID_CAND_* */
334 + __u32 index; /* the smaller the index, the higher the
336 + struct sockaddr bssid;
339 /* ------------------------ WIRELESS STATS ------------------------ */
341 * Wireless statistics (used for /proc/net/wireless)
342 @@ -725,6 +1000,8 @@ struct iw_range
343 struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */
344 /* Note : this frequency list doesn't need to fit channel numbers,
345 * because each entry contain its channel index */
347 + __u32 enc_capa; /* IW_ENC_CAPA_* bit field */
351 diff -u -p linux/net/core/wireless.we17.c linux/net/core/wireless.c
352 --- linux/net/core/wireless.we17.c 2005-05-20 11:26:11.000000000 -0700
353 +++ linux/net/core/wireless.c 2005-05-20 15:37:09.000000000 -0700
355 * This file implement the Wireless Extensions APIs.
357 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
358 - * Copyright (c) 1997-2004 Jean Tourrilhes, All Rights Reserved.
359 + * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved.
361 * (As all part of the Linux kernel, this file is GPL)
363 @@ -137,12 +137,12 @@ static const struct iw_ioctl_description
364 { IW_HEADER_TYPE_ADDR, 0, 0, 0, 0, 0},
366 { IW_HEADER_TYPE_ADDR, 0, 0, 0, 0, IW_DESCR_FLAG_DUMP},
368 - { IW_HEADER_TYPE_NULL, 0, 0, 0, 0, 0},
370 + { IW_HEADER_TYPE_POINT, 0, 1, sizeof(struct iw_mlme), sizeof(struct iw_mlme), 0},
372 { IW_HEADER_TYPE_POINT, 0, (sizeof(struct sockaddr) + sizeof(struct iw_quality)), 0, IW_MAX_AP, IW_DESCR_FLAG_NOMAX},
374 - { IW_HEADER_TYPE_PARAM, 0, 0, 0, 0, 0},
375 + { IW_HEADER_TYPE_POINT, 0, 1, 0, sizeof(struct iw_scan_req), 0},
377 { IW_HEADER_TYPE_POINT, 0, 1, 0, IW_SCAN_MAX_DATA, IW_DESCR_FLAG_NOMAX},
379 @@ -185,6 +185,25 @@ static const struct iw_ioctl_description
380 { IW_HEADER_TYPE_PARAM, 0, 0, 0, 0, 0},
382 { IW_HEADER_TYPE_PARAM, 0, 0, 0, 0, 0},
384 + { IW_HEADER_TYPE_NULL, 0, 0, 0, 0, 0},
386 + { IW_HEADER_TYPE_NULL, 0, 0, 0, 0, 0},
388 + { IW_HEADER_TYPE_POINT, 0, 1, 0, IW_GENERIC_IE_MAX, 0},
390 + { IW_HEADER_TYPE_POINT, 0, 1, 0, IW_GENERIC_IE_MAX, 0},
392 + { IW_HEADER_TYPE_PARAM, 0, 0, 0, 0, 0},
394 + { IW_HEADER_TYPE_PARAM, 0, 0, 0, 0, 0},
395 + /* SIOCSIWENCODEEXT */
396 + { IW_HEADER_TYPE_POINT, 0, 1, sizeof(struct iw_encode_ext), sizeof(struct iw_encode_ext) + IW_ENCODING_TOKEN_MAX, 0},
397 + /* SIOCGIWENCODEEXT */
398 + { IW_HEADER_TYPE_POINT, 0, 1, sizeof(struct iw_encode_ext), sizeof(struct iw_encode_ext) + IW_ENCODING_TOKEN_MAX, 0},
400 + { IW_HEADER_TYPE_POINT, 0, 1, sizeof(struct iw_pmksa), sizeof(struct iw_pmksa), 0},
403 static const int standard_ioctl_num = (sizeof(standard_ioctl) /
404 sizeof(struct iw_ioctl_description));
405 @@ -204,6 +223,16 @@ static const struct iw_ioctl_description
406 { IW_HEADER_TYPE_ADDR, 0, 0, 0, 0, 0},
408 { IW_HEADER_TYPE_ADDR, 0, 0, 0, 0, 0},
410 + { IW_HEADER_TYPE_POINT, 0, 1, 0, IW_GENERIC_IE_MAX, 0},
411 + /* IWEVMICHAELMICFAILURE */
412 + { IW_HEADER_TYPE_POINT, 0, 1, 0, sizeof(struct iw_michaelmicfailure), 0},
413 + /* IWEVASSOCREQIE */
414 + { IW_HEADER_TYPE_POINT, 0, 1, 0, IW_GENERIC_IE_MAX, 0},
415 + /* IWEVASSOCRESPIE */
416 + { IW_HEADER_TYPE_POINT, 0, 1, 0, IW_GENERIC_IE_MAX, 0},
417 + /* IWEVPMKIDCAND */
418 + { IW_HEADER_TYPE_POINT, 0, 1, 0, sizeof(struct iw_pmkid_cand), 0},
420 static const int standard_event_num = (sizeof(standard_event) /
421 sizeof(struct iw_ioctl_description));