mac80211: add might_sleep to hw_config
[deliverable/linux.git] / net / mac80211 / wext.c
CommitLineData
f0706e82
JB
1/*
2 * Copyright 2002-2005, Instant802 Networks, Inc.
3 * Copyright 2005-2006, Devicescape Software, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#include <linux/module.h>
11#include <linux/init.h>
12#include <linux/netdevice.h>
13#include <linux/types.h>
14#include <linux/slab.h>
15#include <linux/skbuff.h>
16#include <linux/etherdevice.h>
17#include <linux/if_arp.h>
18#include <linux/wireless.h>
19#include <net/iw_handler.h>
20#include <asm/uaccess.h>
21
22#include <net/mac80211.h>
23#include "ieee80211_i.h"
2c8dccc7
JB
24#include "led.h"
25#include "rate.h"
f0706e82
JB
26#include "wpa.h"
27#include "aes_ccm.h"
f0706e82 28
b708e610 29
f698d856 30static int ieee80211_set_encryption(struct ieee80211_sub_if_data *sdata, u8 *sta_addr,
628a140b
JB
31 int idx, int alg, int remove,
32 int set_tx_key, const u8 *_key,
33 size_t key_len)
f0706e82 34{
f698d856 35 struct ieee80211_local *local = sdata->local;
d0709a65 36 struct sta_info *sta;
11a843b7 37 struct ieee80211_key *key;
3b96766f 38 int err;
f0706e82 39
139c3a04
VB
40 if (idx < 0 || idx >= NUM_DEFAULT_KEYS) {
41 printk(KERN_DEBUG "%s: set_encrypt - invalid idx=%d\n",
f698d856 42 sdata->dev->name, idx);
139c3a04
VB
43 return -EINVAL;
44 }
45
db4d1169 46 if (remove) {
3b96766f
JB
47 rcu_read_lock();
48
49 err = 0;
50
db4d1169
JB
51 if (is_broadcast_ether_addr(sta_addr)) {
52 key = sdata->keys[idx];
53 } else {
54 sta = sta_info_get(local, sta_addr);
3b96766f
JB
55 if (!sta) {
56 err = -ENOENT;
57 goto out_unlock;
58 }
db4d1169 59 key = sta->key;
f0706e82
JB
60 }
61
d0709a65 62 ieee80211_key_free(key);
db4d1169
JB
63 } else {
64 key = ieee80211_key_alloc(alg, idx, key_len, _key);
65 if (!key)
66 return -ENOMEM;
67
d0709a65 68 sta = NULL;
3b96766f
JB
69 err = 0;
70
71 rcu_read_lock();
d0709a65 72
db4d1169
JB
73 if (!is_broadcast_ether_addr(sta_addr)) {
74 set_tx_key = 0;
75 /*
76 * According to the standard, the key index of a
77 * pairwise key must be zero. However, some AP are
78 * broken when it comes to WEP key indices, so we
79 * work around this.
80 */
81 if (idx != 0 && alg != ALG_WEP) {
d0709a65 82 ieee80211_key_free(key);
3b96766f
JB
83 err = -EINVAL;
84 goto out_unlock;
db4d1169 85 }
f0706e82 86
db4d1169
JB
87 sta = sta_info_get(local, sta_addr);
88 if (!sta) {
d0709a65 89 ieee80211_key_free(key);
3b96766f
JB
90 err = -ENOENT;
91 goto out_unlock;
db4d1169 92 }
f0706e82
JB
93 }
94
23976efe
EG
95 if (alg == ALG_WEP &&
96 key_len != LEN_WEP40 && key_len != LEN_WEP104) {
97 ieee80211_key_free(key);
98 err = -EINVAL;
99 goto out_unlock;
100 }
101
db4d1169 102 ieee80211_key_link(key, sdata, sta);
f0706e82 103
db4d1169
JB
104 if (set_tx_key || (!sta && !sdata->default_key && key))
105 ieee80211_set_default_key(sdata, idx);
db4d1169 106 }
f0706e82 107
3b96766f
JB
108 out_unlock:
109 rcu_read_unlock();
110
111 return err;
f0706e82
JB
112}
113
114static int ieee80211_ioctl_siwgenie(struct net_device *dev,
115 struct iw_request_info *info,
116 struct iw_point *data, char *extra)
117{
118 struct ieee80211_sub_if_data *sdata;
f0706e82 119
ddd3d2be
JB
120 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
121
122 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)
f0706e82
JB
123 return -EOPNOTSUPP;
124
05c914fe
JB
125 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
126 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
f698d856 127 int ret = ieee80211_sta_set_extra_ie(sdata, extra, data->length);
f0706e82
JB
128 if (ret)
129 return ret;
d6f2da5b 130 sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL;
f698d856 131 ieee80211_sta_req_auth(sdata, &sdata->u.sta);
f0706e82
JB
132 return 0;
133 }
134
f0706e82
JB
135 return -EOPNOTSUPP;
136}
137
f0706e82
JB
138static int ieee80211_ioctl_giwname(struct net_device *dev,
139 struct iw_request_info *info,
140 char *name, char *extra)
141{
f37d08bd
TW
142 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
143 struct ieee80211_supported_band *sband;
144 u8 is_ht = 0, is_a = 0, is_b = 0, is_g = 0;
145
146
147 sband = local->hw.wiphy->bands[IEEE80211_BAND_5GHZ];
148 if (sband) {
149 is_a = 1;
d9fe60de 150 is_ht |= sband->ht_cap.ht_supported;
f37d08bd
TW
151 }
152
153 sband = local->hw.wiphy->bands[IEEE80211_BAND_2GHZ];
154 if (sband) {
155 int i;
156 /* Check for mandatory rates */
157 for (i = 0; i < sband->n_bitrates; i++) {
158 if (sband->bitrates[i].bitrate == 10)
159 is_b = 1;
160 if (sband->bitrates[i].bitrate == 60)
161 is_g = 1;
162 }
d9fe60de 163 is_ht |= sband->ht_cap.ht_supported;
f37d08bd
TW
164 }
165
8318d78a 166 strcpy(name, "IEEE 802.11");
f37d08bd
TW
167 if (is_a)
168 strcat(name, "a");
169 if (is_b)
170 strcat(name, "b");
171 if (is_g)
172 strcat(name, "g");
173 if (is_ht)
174 strcat(name, "n");
f0706e82
JB
175
176 return 0;
177}
178
179
180static int ieee80211_ioctl_giwrange(struct net_device *dev,
181 struct iw_request_info *info,
182 struct iw_point *data, char *extra)
183{
184 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
185 struct iw_range *range = (struct iw_range *) extra;
8318d78a 186 enum ieee80211_band band;
333af2f0 187 int c = 0;
f0706e82
JB
188
189 data->length = sizeof(struct iw_range);
190 memset(range, 0, sizeof(struct iw_range));
191
192 range->we_version_compiled = WIRELESS_EXT;
193 range->we_version_source = 21;
194 range->retry_capa = IW_RETRY_LIMIT;
195 range->retry_flags = IW_RETRY_LIMIT;
196 range->min_retry = 0;
197 range->max_retry = 255;
198 range->min_rts = 0;
199 range->max_rts = 2347;
200 range->min_frag = 256;
201 range->max_frag = 2346;
202
203 range->encoding_size[0] = 5;
204 range->encoding_size[1] = 13;
205 range->num_encoding_sizes = 2;
206 range->max_encoding_tokens = NUM_DEFAULT_KEYS;
207
566bfe5a
BR
208 if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC ||
209 local->hw.flags & IEEE80211_HW_SIGNAL_DB)
210 range->max_qual.level = local->hw.max_signal;
211 else if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM)
212 range->max_qual.level = -110;
213 else
214 range->max_qual.level = 0;
215
216 if (local->hw.flags & IEEE80211_HW_NOISE_DBM)
217 range->max_qual.noise = -110;
218 else
219 range->max_qual.noise = 0;
220
221 range->max_qual.qual = 100;
f0706e82
JB
222 range->max_qual.updated = local->wstats_flags;
223
566bfe5a
BR
224 range->avg_qual.qual = 50;
225 /* not always true but better than nothing */
226 range->avg_qual.level = range->max_qual.level / 2;
227 range->avg_qual.noise = range->max_qual.noise / 2;
f0706e82
JB
228 range->avg_qual.updated = local->wstats_flags;
229
230 range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
231 IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
232
333af2f0 233
8318d78a
JB
234 for (band = 0; band < IEEE80211_NUM_BANDS; band ++) {
235 int i;
236 struct ieee80211_supported_band *sband;
237
238 sband = local->hw.wiphy->bands[band];
239
240 if (!sband)
333af2f0
HL
241 continue;
242
8318d78a
JB
243 for (i = 0; i < sband->n_channels && c < IW_MAX_FREQUENCIES; i++) {
244 struct ieee80211_channel *chan = &sband->channels[i];
333af2f0 245
8318d78a
JB
246 if (!(chan->flags & IEEE80211_CHAN_DISABLED)) {
247 range->freq[c].i =
248 ieee80211_frequency_to_channel(
249 chan->center_freq);
250 range->freq[c].m = chan->center_freq;
251 range->freq[c].e = 6;
333af2f0
HL
252 c++;
253 }
333af2f0
HL
254 }
255 }
256 range->num_channels = c;
257 range->num_frequency = c;
258
f0706e82 259 IW_EVENT_CAPA_SET_KERNEL(range->event_capa);
f0706e82
JB
260 IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP);
261 IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWSCAN);
262
374fdfbc
DW
263 range->scan_capa |= IW_SCAN_CAPA_ESSID;
264
f0706e82
JB
265 return 0;
266}
267
268
f0706e82
JB
269static int ieee80211_ioctl_siwmode(struct net_device *dev,
270 struct iw_request_info *info,
271 __u32 *mode, char *extra)
272{
273 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
274 int type;
275
05c914fe 276 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
f0706e82
JB
277 return -EOPNOTSUPP;
278
279 switch (*mode) {
280 case IW_MODE_INFRA:
05c914fe 281 type = NL80211_IFTYPE_STATION;
f0706e82
JB
282 break;
283 case IW_MODE_ADHOC:
05c914fe 284 type = NL80211_IFTYPE_ADHOC;
f0706e82 285 break;
b454048c 286 case IW_MODE_REPEAT:
05c914fe 287 type = NL80211_IFTYPE_WDS;
b454048c 288 break;
f0706e82 289 case IW_MODE_MONITOR:
05c914fe 290 type = NL80211_IFTYPE_MONITOR;
f0706e82
JB
291 break;
292 default:
293 return -EINVAL;
294 }
295
f3947e2d 296 return ieee80211_if_change_type(sdata, type);
f0706e82
JB
297}
298
299
300static int ieee80211_ioctl_giwmode(struct net_device *dev,
301 struct iw_request_info *info,
302 __u32 *mode, char *extra)
303{
304 struct ieee80211_sub_if_data *sdata;
305
306 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
51fb61e7 307 switch (sdata->vif.type) {
05c914fe 308 case NL80211_IFTYPE_AP:
f0706e82
JB
309 *mode = IW_MODE_MASTER;
310 break;
05c914fe 311 case NL80211_IFTYPE_STATION:
f0706e82
JB
312 *mode = IW_MODE_INFRA;
313 break;
05c914fe 314 case NL80211_IFTYPE_ADHOC:
f0706e82
JB
315 *mode = IW_MODE_ADHOC;
316 break;
05c914fe 317 case NL80211_IFTYPE_MONITOR:
f0706e82
JB
318 *mode = IW_MODE_MONITOR;
319 break;
05c914fe 320 case NL80211_IFTYPE_WDS:
f0706e82
JB
321 *mode = IW_MODE_REPEAT;
322 break;
05c914fe 323 case NL80211_IFTYPE_AP_VLAN:
f0706e82
JB
324 *mode = IW_MODE_SECOND; /* FIXME */
325 break;
326 default:
327 *mode = IW_MODE_AUTO;
328 break;
329 }
330 return 0;
331}
332
f0706e82
JB
333static int ieee80211_ioctl_siwfreq(struct net_device *dev,
334 struct iw_request_info *info,
335 struct iw_freq *freq, char *extra)
336{
f0706e82
JB
337 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
338
05c914fe 339 if (sdata->vif.type == NL80211_IFTYPE_STATION)
d6f2da5b 340 sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_CHANNEL_SEL;
f0706e82
JB
341
342 /* freq->e == 0: freq->m = channel; otherwise freq = m * 10^e */
343 if (freq->e == 0) {
344 if (freq->m < 0) {
05c914fe 345 if (sdata->vif.type == NL80211_IFTYPE_STATION)
d6f2da5b
JS
346 sdata->u.sta.flags |=
347 IEEE80211_STA_AUTO_CHANNEL_SEL;
f0706e82
JB
348 return 0;
349 } else
f698d856 350 return ieee80211_set_freq(sdata,
8318d78a 351 ieee80211_channel_to_frequency(freq->m));
f0706e82
JB
352 } else {
353 int i, div = 1000000;
354 for (i = 0; i < freq->e; i++)
355 div /= 10;
356 if (div > 0)
f698d856 357 return ieee80211_set_freq(sdata, freq->m / div);
f0706e82
JB
358 else
359 return -EINVAL;
360 }
361}
362
363
364static int ieee80211_ioctl_giwfreq(struct net_device *dev,
365 struct iw_request_info *info,
366 struct iw_freq *freq, char *extra)
367{
368 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
369
8318d78a 370 freq->m = local->hw.conf.channel->center_freq;
f0706e82
JB
371 freq->e = 6;
372
373 return 0;
374}
375
376
377static int ieee80211_ioctl_siwessid(struct net_device *dev,
378 struct iw_request_info *info,
379 struct iw_point *data, char *ssid)
380{
f0706e82
JB
381 struct ieee80211_sub_if_data *sdata;
382 size_t len = data->length;
383
384 /* iwconfig uses nul termination in SSID.. */
385 if (len > 0 && ssid[len - 1] == '\0')
386 len--;
387
388 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
05c914fe
JB
389 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
390 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
f0706e82 391 int ret;
ddd3d2be 392 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) {
f0706e82
JB
393 if (len > IEEE80211_MAX_SSID_LEN)
394 return -EINVAL;
395 memcpy(sdata->u.sta.ssid, ssid, len);
396 sdata->u.sta.ssid_len = len;
397 return 0;
398 }
d6f2da5b
JS
399 if (data->flags)
400 sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_SSID_SEL;
401 else
402 sdata->u.sta.flags |= IEEE80211_STA_AUTO_SSID_SEL;
f698d856 403 ret = ieee80211_sta_set_ssid(sdata, ssid, len);
f0706e82
JB
404 if (ret)
405 return ret;
f698d856 406 ieee80211_sta_req_auth(sdata, &sdata->u.sta);
f0706e82
JB
407 return 0;
408 }
409
05c914fe 410 if (sdata->vif.type == NL80211_IFTYPE_AP) {
f0706e82
JB
411 memcpy(sdata->u.ap.ssid, ssid, len);
412 memset(sdata->u.ap.ssid + len, 0,
413 IEEE80211_MAX_SSID_LEN - len);
414 sdata->u.ap.ssid_len = len;
9d139c81 415 return ieee80211_if_config(sdata, IEEE80211_IFCC_SSID);
f0706e82
JB
416 }
417 return -EOPNOTSUPP;
418}
419
420
421static int ieee80211_ioctl_giwessid(struct net_device *dev,
422 struct iw_request_info *info,
423 struct iw_point *data, char *ssid)
424{
425 size_t len;
426
427 struct ieee80211_sub_if_data *sdata;
428 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
05c914fe
JB
429 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
430 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
f698d856 431 int res = ieee80211_sta_get_ssid(sdata, ssid, &len);
f0706e82
JB
432 if (res == 0) {
433 data->length = len;
434 data->flags = 1;
435 } else
436 data->flags = 0;
437 return res;
438 }
439
05c914fe 440 if (sdata->vif.type == NL80211_IFTYPE_AP) {
f0706e82
JB
441 len = sdata->u.ap.ssid_len;
442 if (len > IW_ESSID_MAX_SIZE)
443 len = IW_ESSID_MAX_SIZE;
444 memcpy(ssid, sdata->u.ap.ssid, len);
445 data->length = len;
446 data->flags = 1;
447 return 0;
448 }
449 return -EOPNOTSUPP;
450}
451
452
453static int ieee80211_ioctl_siwap(struct net_device *dev,
454 struct iw_request_info *info,
455 struct sockaddr *ap_addr, char *extra)
456{
f0706e82
JB
457 struct ieee80211_sub_if_data *sdata;
458
459 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
05c914fe
JB
460 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
461 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
f0706e82 462 int ret;
ddd3d2be 463 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) {
f0706e82
JB
464 memcpy(sdata->u.sta.bssid, (u8 *) &ap_addr->sa_data,
465 ETH_ALEN);
466 return 0;
467 }
d6f2da5b
JS
468 if (is_zero_ether_addr((u8 *) &ap_addr->sa_data))
469 sdata->u.sta.flags |= IEEE80211_STA_AUTO_BSSID_SEL |
470 IEEE80211_STA_AUTO_CHANNEL_SEL;
471 else if (is_broadcast_ether_addr((u8 *) &ap_addr->sa_data))
472 sdata->u.sta.flags |= IEEE80211_STA_AUTO_BSSID_SEL;
f0706e82 473 else
d6f2da5b 474 sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL;
f698d856 475 ret = ieee80211_sta_set_bssid(sdata, (u8 *) &ap_addr->sa_data);
f0706e82
JB
476 if (ret)
477 return ret;
f698d856 478 ieee80211_sta_req_auth(sdata, &sdata->u.sta);
f0706e82 479 return 0;
05c914fe 480 } else if (sdata->vif.type == NL80211_IFTYPE_WDS) {
44213b5e
JB
481 /*
482 * If it is necessary to update the WDS peer address
483 * while the interface is running, then we need to do
484 * more work here, namely if it is running we need to
485 * add a new and remove the old STA entry, this is
486 * normally handled by _open() and _stop().
487 */
488 if (netif_running(dev))
489 return -EBUSY;
490
491 memcpy(&sdata->u.wds.remote_addr, (u8 *) &ap_addr->sa_data,
492 ETH_ALEN);
493
494 return 0;
f0706e82
JB
495 }
496
497 return -EOPNOTSUPP;
498}
499
500
501static int ieee80211_ioctl_giwap(struct net_device *dev,
502 struct iw_request_info *info,
503 struct sockaddr *ap_addr, char *extra)
504{
505 struct ieee80211_sub_if_data *sdata;
506
507 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
05c914fe
JB
508 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
509 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
48c2fc59
TW
510 if (sdata->u.sta.state == IEEE80211_STA_MLME_ASSOCIATED ||
511 sdata->u.sta.state == IEEE80211_STA_MLME_IBSS_JOINED) {
d4231ca3
AK
512 ap_addr->sa_family = ARPHRD_ETHER;
513 memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN);
514 return 0;
515 } else {
516 memset(&ap_addr->sa_data, 0, ETH_ALEN);
517 return 0;
518 }
05c914fe 519 } else if (sdata->vif.type == NL80211_IFTYPE_WDS) {
f0706e82
JB
520 ap_addr->sa_family = ARPHRD_ETHER;
521 memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN);
522 return 0;
523 }
524
525 return -EOPNOTSUPP;
526}
527
528
529static int ieee80211_ioctl_siwscan(struct net_device *dev,
530 struct iw_request_info *info,
107acb23 531 union iwreq_data *wrqu, char *extra)
f0706e82 532{
f0706e82 533 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
107acb23 534 struct iw_scan_req *req = NULL;
f0706e82
JB
535 u8 *ssid = NULL;
536 size_t ssid_len = 0;
537
538 if (!netif_running(dev))
539 return -ENETDOWN;
540
05c914fe
JB
541 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
542 sdata->vif.type != NL80211_IFTYPE_ADHOC &&
543 sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
544 sdata->vif.type != NL80211_IFTYPE_AP)
d114f399 545 return -EOPNOTSUPP;
d114f399
JL
546
547 /* if SSID was specified explicitly then use that */
107acb23
BM
548 if (wrqu->data.length == sizeof(struct iw_scan_req) &&
549 wrqu->data.flags & IW_SCAN_THIS_ESSID) {
550 req = (struct iw_scan_req *)extra;
551 ssid = req->essid;
552 ssid_len = req->essid_len;
f0706e82 553 }
f27b62d3 554
c2b13452 555 return ieee80211_request_scan(sdata, ssid, ssid_len);
f0706e82
JB
556}
557
558
559static int ieee80211_ioctl_giwscan(struct net_device *dev,
560 struct iw_request_info *info,
561 struct iw_point *data, char *extra)
562{
563 int res;
564 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
f698d856
JBG
565 struct ieee80211_sub_if_data *sdata;
566
567 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
ece8eddd 568
c2b13452 569 if (local->sw_scanning || local->hw_scanning)
f0706e82 570 return -EAGAIN;
ece8eddd 571
c2b13452 572 res = ieee80211_scan_results(local, info, extra, data->length);
f0706e82
JB
573 if (res >= 0) {
574 data->length = res;
575 return 0;
576 }
577 data->length = 0;
578 return res;
579}
580
581
1fd5e589
LF
582static int ieee80211_ioctl_siwrate(struct net_device *dev,
583 struct iw_request_info *info,
584 struct iw_param *rate, char *extra)
585{
586 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
8318d78a 587 int i, err = -EINVAL;
1fd5e589
LF
588 u32 target_rate = rate->value / 100000;
589 struct ieee80211_sub_if_data *sdata;
8318d78a 590 struct ieee80211_supported_band *sband;
1fd5e589
LF
591
592 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
8318d78a
JB
593
594 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
595
1fd5e589
LF
596 /* target_rate = -1, rate->fixed = 0 means auto only, so use all rates
597 * target_rate = X, rate->fixed = 1 means only rate X
598 * target_rate = X, rate->fixed = 0 means all rates <= X */
3e122be0
JB
599 sdata->max_ratectrl_rateidx = -1;
600 sdata->force_unicast_rateidx = -1;
1fd5e589
LF
601 if (rate->value < 0)
602 return 0;
8318d78a
JB
603
604 for (i=0; i< sband->n_bitrates; i++) {
605 struct ieee80211_rate *brate = &sband->bitrates[i];
606 int this_rate = brate->bitrate;
1fd5e589 607
1fd5e589 608 if (target_rate == this_rate) {
3e122be0 609 sdata->max_ratectrl_rateidx = i;
1fd5e589 610 if (rate->fixed)
3e122be0 611 sdata->force_unicast_rateidx = i;
8318d78a
JB
612 err = 0;
613 break;
1fd5e589
LF
614 }
615 }
8318d78a 616 return err;
1fd5e589
LF
617}
618
b3d88ad4
LF
619static int ieee80211_ioctl_giwrate(struct net_device *dev,
620 struct iw_request_info *info,
621 struct iw_param *rate, char *extra)
622{
623 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
624 struct sta_info *sta;
625 struct ieee80211_sub_if_data *sdata;
8318d78a 626 struct ieee80211_supported_band *sband;
b3d88ad4
LF
627
628 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
8318d78a 629
05c914fe 630 if (sdata->vif.type != NL80211_IFTYPE_STATION)
b3d88ad4 631 return -EOPNOTSUPP;
8318d78a
JB
632
633 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
634
380a942b
JB
635 rcu_read_lock();
636
637 sta = sta_info_get(local, sdata->u.sta.bssid);
638
ae17e986
JB
639 if (sta && sta->last_txrate_idx < sband->n_bitrates)
640 rate->value = sband->bitrates[sta->last_txrate_idx].bitrate;
b3d88ad4
LF
641 else
642 rate->value = 0;
380a942b
JB
643
644 rcu_read_unlock();
645
646 if (!sta)
647 return -ENODEV;
648
8318d78a 649 rate->value *= 100000;
d0709a65 650
b3d88ad4
LF
651 return 0;
652}
653
61609bc0
MB
654static int ieee80211_ioctl_siwtxpower(struct net_device *dev,
655 struct iw_request_info *info,
656 union iwreq_data *data, char *extra)
657{
658 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
e8975581 659 u32 reconf_flags = 0;
8318d78a 660 int new_power_level;
61609bc0
MB
661
662 if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM)
663 return -EINVAL;
664 if (data->txpower.flags & IW_TXPOW_RANGE)
665 return -EINVAL;
61609bc0 666
6a432955
MN
667 if (data->txpower.fixed) {
668 new_power_level = data->txpower.value;
669 } else {
8318d78a
JB
670 /*
671 * Automatic power level. Use maximum power for the current
672 * channel. Should be part of rate control.
673 */
674 struct ieee80211_channel* chan = local->hw.conf.channel;
6a432955
MN
675 if (!chan)
676 return -EINVAL;
677
8318d78a 678 new_power_level = chan->max_power;
6a432955
MN
679 }
680
681 if (local->hw.conf.power_level != new_power_level) {
682 local->hw.conf.power_level = new_power_level;
e8975581 683 reconf_flags |= IEEE80211_CONF_CHANGE_POWER;
61609bc0 684 }
6a432955 685
61609bc0
MB
686 if (local->hw.conf.radio_enabled != !(data->txpower.disabled)) {
687 local->hw.conf.radio_enabled = !(data->txpower.disabled);
e8975581 688 reconf_flags |= IEEE80211_CONF_CHANGE_RADIO_ENABLED;
cdcb006f 689 ieee80211_led_radio(local, local->hw.conf.radio_enabled);
61609bc0 690 }
6a432955 691
e8975581
JB
692 if (reconf_flags)
693 ieee80211_hw_config(local, reconf_flags);
61609bc0
MB
694
695 return 0;
696}
697
fe6aa301
LF
698static int ieee80211_ioctl_giwtxpower(struct net_device *dev,
699 struct iw_request_info *info,
700 union iwreq_data *data, char *extra)
701{
702 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
703
704 data->txpower.fixed = 1;
705 data->txpower.disabled = !(local->hw.conf.radio_enabled);
706 data->txpower.value = local->hw.conf.power_level;
707 data->txpower.flags = IW_TXPOW_DBM;
708
709 return 0;
710}
711
f0706e82
JB
712static int ieee80211_ioctl_siwrts(struct net_device *dev,
713 struct iw_request_info *info,
714 struct iw_param *rts, char *extra)
715{
716 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
717
718 if (rts->disabled)
719 local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
fa6adfe9
EG
720 else if (!rts->fixed)
721 /* if the rts value is not fixed, then take default */
722 local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
f0706e82
JB
723 else if (rts->value < 0 || rts->value > IEEE80211_MAX_RTS_THRESHOLD)
724 return -EINVAL;
725 else
726 local->rts_threshold = rts->value;
727
728 /* If the wlan card performs RTS/CTS in hardware/firmware,
729 * configure it here */
730
731 if (local->ops->set_rts_threshold)
732 local->ops->set_rts_threshold(local_to_hw(local),
733 local->rts_threshold);
734
735 return 0;
736}
737
738static int ieee80211_ioctl_giwrts(struct net_device *dev,
739 struct iw_request_info *info,
740 struct iw_param *rts, char *extra)
741{
742 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
743
744 rts->value = local->rts_threshold;
745 rts->disabled = (rts->value >= IEEE80211_MAX_RTS_THRESHOLD);
746 rts->fixed = 1;
747
748 return 0;
749}
750
751
752static int ieee80211_ioctl_siwfrag(struct net_device *dev,
753 struct iw_request_info *info,
754 struct iw_param *frag, char *extra)
755{
756 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
757
758 if (frag->disabled)
759 local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD;
e4abd4d4
EG
760 else if (!frag->fixed)
761 local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD;
f0706e82
JB
762 else if (frag->value < 256 ||
763 frag->value > IEEE80211_MAX_FRAG_THRESHOLD)
764 return -EINVAL;
765 else {
766 /* Fragment length must be even, so strip LSB. */
767 local->fragmentation_threshold = frag->value & ~0x1;
768 }
769
770 /* If the wlan card performs fragmentation in hardware/firmware,
771 * configure it here */
772
773 if (local->ops->set_frag_threshold)
4233df6b 774 return local->ops->set_frag_threshold(
f0706e82
JB
775 local_to_hw(local),
776 local->fragmentation_threshold);
777
778 return 0;
779}
780
781static int ieee80211_ioctl_giwfrag(struct net_device *dev,
782 struct iw_request_info *info,
783 struct iw_param *frag, char *extra)
784{
785 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
786
787 frag->value = local->fragmentation_threshold;
788 frag->disabled = (frag->value >= IEEE80211_MAX_RTS_THRESHOLD);
789 frag->fixed = 1;
790
791 return 0;
792}
793
794
795static int ieee80211_ioctl_siwretry(struct net_device *dev,
796 struct iw_request_info *info,
797 struct iw_param *retry, char *extra)
798{
799 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
800
801 if (retry->disabled ||
802 (retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
803 return -EINVAL;
804
9124b077
JB
805 if (retry->flags & IW_RETRY_MAX) {
806 local->hw.conf.long_frame_max_tx_count = retry->value;
807 } else if (retry->flags & IW_RETRY_MIN) {
808 local->hw.conf.short_frame_max_tx_count = retry->value;
809 } else {
810 local->hw.conf.long_frame_max_tx_count = retry->value;
811 local->hw.conf.short_frame_max_tx_count = retry->value;
f0706e82
JB
812 }
813
9124b077 814 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_RETRY_LIMITS);
f0706e82
JB
815
816 return 0;
817}
818
819
820static int ieee80211_ioctl_giwretry(struct net_device *dev,
821 struct iw_request_info *info,
822 struct iw_param *retry, char *extra)
823{
824 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
825
826 retry->disabled = 0;
827 if (retry->flags == 0 || retry->flags & IW_RETRY_MIN) {
828 /* first return min value, iwconfig will ask max value
829 * later if needed */
830 retry->flags |= IW_RETRY_LIMIT;
9124b077
JB
831 retry->value = local->hw.conf.short_frame_max_tx_count;
832 if (local->hw.conf.long_frame_max_tx_count !=
833 local->hw.conf.short_frame_max_tx_count)
f0706e82
JB
834 retry->flags |= IW_RETRY_MIN;
835 return 0;
836 }
837 if (retry->flags & IW_RETRY_MAX) {
838 retry->flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
9124b077 839 retry->value = local->hw.conf.long_frame_max_tx_count;
f0706e82
JB
840 }
841
842 return 0;
843}
844
f0706e82
JB
845static int ieee80211_ioctl_siwmlme(struct net_device *dev,
846 struct iw_request_info *info,
847 struct iw_point *data, char *extra)
848{
849 struct ieee80211_sub_if_data *sdata;
850 struct iw_mlme *mlme = (struct iw_mlme *) extra;
851
852 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
05c914fe
JB
853 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
854 sdata->vif.type != NL80211_IFTYPE_ADHOC)
f0706e82
JB
855 return -EINVAL;
856
857 switch (mlme->cmd) {
858 case IW_MLME_DEAUTH:
859 /* TODO: mlme->addr.sa_data */
f698d856 860 return ieee80211_sta_deauthenticate(sdata, mlme->reason_code);
f0706e82
JB
861 case IW_MLME_DISASSOC:
862 /* TODO: mlme->addr.sa_data */
f698d856 863 return ieee80211_sta_disassociate(sdata, mlme->reason_code);
f0706e82
JB
864 default:
865 return -EOPNOTSUPP;
866 }
867}
868
869
870static int ieee80211_ioctl_siwencode(struct net_device *dev,
871 struct iw_request_info *info,
872 struct iw_point *erq, char *keybuf)
873{
874 struct ieee80211_sub_if_data *sdata;
875 int idx, i, alg = ALG_WEP;
876 u8 bcaddr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
628a140b 877 int remove = 0;
f0706e82
JB
878
879 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
880
881 idx = erq->flags & IW_ENCODE_INDEX;
882 if (idx == 0) {
883 if (sdata->default_key)
884 for (i = 0; i < NUM_DEFAULT_KEYS; i++) {
885 if (sdata->default_key == sdata->keys[i]) {
886 idx = i;
887 break;
888 }
889 }
890 } else if (idx < 1 || idx > 4)
891 return -EINVAL;
892 else
893 idx--;
894
895 if (erq->flags & IW_ENCODE_DISABLED)
628a140b 896 remove = 1;
f0706e82
JB
897 else if (erq->length == 0) {
898 /* No key data - just set the default TX key index */
11a843b7 899 ieee80211_set_default_key(sdata, idx);
f0706e82
JB
900 return 0;
901 }
902
903 return ieee80211_set_encryption(
f698d856 904 sdata, bcaddr,
628a140b 905 idx, alg, remove,
f0706e82
JB
906 !sdata->default_key,
907 keybuf, erq->length);
908}
909
910
911static int ieee80211_ioctl_giwencode(struct net_device *dev,
912 struct iw_request_info *info,
913 struct iw_point *erq, char *key)
914{
915 struct ieee80211_sub_if_data *sdata;
916 int idx, i;
917
918 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
919
920 idx = erq->flags & IW_ENCODE_INDEX;
921 if (idx < 1 || idx > 4) {
922 idx = -1;
923 if (!sdata->default_key)
924 idx = 0;
925 else for (i = 0; i < NUM_DEFAULT_KEYS; i++) {
926 if (sdata->default_key == sdata->keys[i]) {
927 idx = i;
928 break;
929 }
930 }
931 if (idx < 0)
932 return -EINVAL;
933 } else
934 idx--;
935
936 erq->flags = idx + 1;
937
938 if (!sdata->keys[idx]) {
939 erq->length = 0;
940 erq->flags |= IW_ENCODE_DISABLED;
941 return 0;
942 }
943
8f20fc24 944 memcpy(key, sdata->keys[idx]->conf.key,
11a843b7 945 min_t(int, erq->length, sdata->keys[idx]->conf.keylen));
8f20fc24 946 erq->length = sdata->keys[idx]->conf.keylen;
f0706e82
JB
947 erq->flags |= IW_ENCODE_ENABLED;
948
05c914fe 949 if (sdata->vif.type == NL80211_IFTYPE_STATION) {
b9fcc4f2
EG
950 struct ieee80211_if_sta *ifsta = &sdata->u.sta;
951 switch (ifsta->auth_alg) {
952 case WLAN_AUTH_OPEN:
953 case WLAN_AUTH_LEAP:
954 erq->flags |= IW_ENCODE_OPEN;
955 break;
956 case WLAN_AUTH_SHARED_KEY:
957 erq->flags |= IW_ENCODE_RESTRICTED;
958 break;
959 }
960 }
961
f0706e82
JB
962 return 0;
963}
964
49292d56
SO
965static int ieee80211_ioctl_siwpower(struct net_device *dev,
966 struct iw_request_info *info,
967 struct iw_param *wrq,
968 char *extra)
969{
970 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
971 struct ieee80211_conf *conf = &local->hw.conf;
972
973 if (wrq->disabled) {
974 conf->flags &= ~IEEE80211_CONF_PS;
e8975581 975 return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
49292d56
SO
976 }
977
978 switch (wrq->flags & IW_POWER_MODE) {
979 case IW_POWER_ON: /* If not specified */
980 case IW_POWER_MODE: /* If set all mask */
981 case IW_POWER_ALL_R: /* If explicitely state all */
982 conf->flags |= IEEE80211_CONF_PS;
983 break;
984 default: /* Otherwise we don't support it */
985 return -EINVAL;
986 }
987
e8975581 988 return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
49292d56
SO
989}
990
991static int ieee80211_ioctl_giwpower(struct net_device *dev,
992 struct iw_request_info *info,
993 union iwreq_data *wrqu,
994 char *extra)
995{
996 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
997 struct ieee80211_conf *conf = &local->hw.conf;
998
999 wrqu->power.disabled = !(conf->flags & IEEE80211_CONF_PS);
1000
1001 return 0;
1002}
1003
f0706e82
JB
1004static int ieee80211_ioctl_siwauth(struct net_device *dev,
1005 struct iw_request_info *info,
1006 struct iw_param *data, char *extra)
1007{
f0706e82
JB
1008 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1009 int ret = 0;
1010
1011 switch (data->flags & IW_AUTH_INDEX) {
1012 case IW_AUTH_WPA_VERSION:
1013 case IW_AUTH_CIPHER_PAIRWISE:
1014 case IW_AUTH_CIPHER_GROUP:
1015 case IW_AUTH_WPA_ENABLED:
1016 case IW_AUTH_RX_UNENCRYPTED_EAPOL:
f0706e82 1017 case IW_AUTH_KEY_MGMT:
5b98b1f7 1018 break;
b1357a81
JB
1019 case IW_AUTH_DROP_UNENCRYPTED:
1020 sdata->drop_unencrypted = !!data->value;
1021 break;
5b98b1f7 1022 case IW_AUTH_PRIVACY_INVOKED:
05c914fe 1023 if (sdata->vif.type != NL80211_IFTYPE_STATION)
f0706e82
JB
1024 ret = -EINVAL;
1025 else {
5b98b1f7 1026 sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED;
f0706e82 1027 /*
5b98b1f7
JB
1028 * Privacy invoked by wpa_supplicant, store the
1029 * value and allow associating to a protected
1030 * network without having a key up front.
f0706e82 1031 */
5b98b1f7
JB
1032 if (data->value)
1033 sdata->u.sta.flags |=
1034 IEEE80211_STA_PRIVACY_INVOKED;
f0706e82
JB
1035 }
1036 break;
1037 case IW_AUTH_80211_AUTH_ALG:
05c914fe
JB
1038 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
1039 sdata->vif.type == NL80211_IFTYPE_ADHOC)
f0706e82
JB
1040 sdata->u.sta.auth_algs = data->value;
1041 else
1042 ret = -EOPNOTSUPP;
1043 break;
f0706e82
JB
1044 default:
1045 ret = -EOPNOTSUPP;
1046 break;
1047 }
1048 return ret;
1049}
1050
1051/* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */
1052static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev)
1053{
1054 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
1055 struct iw_statistics *wstats = &local->wstats;
1056 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1057 struct sta_info *sta = NULL;
1058
98dd6a57
JB
1059 rcu_read_lock();
1060
05c914fe
JB
1061 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
1062 sdata->vif.type == NL80211_IFTYPE_ADHOC)
f0706e82
JB
1063 sta = sta_info_get(local, sdata->u.sta.bssid);
1064 if (!sta) {
1065 wstats->discard.fragment = 0;
1066 wstats->discard.misc = 0;
1067 wstats->qual.qual = 0;
1068 wstats->qual.level = 0;
1069 wstats->qual.noise = 0;
1070 wstats->qual.updated = IW_QUAL_ALL_INVALID;
1071 } else {
566bfe5a
BR
1072 wstats->qual.level = sta->last_signal;
1073 wstats->qual.qual = sta->last_qual;
f0706e82
JB
1074 wstats->qual.noise = sta->last_noise;
1075 wstats->qual.updated = local->wstats_flags;
f0706e82 1076 }
98dd6a57
JB
1077
1078 rcu_read_unlock();
1079
f0706e82
JB
1080 return wstats;
1081}
1082
1083static int ieee80211_ioctl_giwauth(struct net_device *dev,
1084 struct iw_request_info *info,
1085 struct iw_param *data, char *extra)
1086{
1087 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1088 int ret = 0;
1089
1090 switch (data->flags & IW_AUTH_INDEX) {
1091 case IW_AUTH_80211_AUTH_ALG:
05c914fe
JB
1092 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
1093 sdata->vif.type == NL80211_IFTYPE_ADHOC)
f0706e82
JB
1094 data->value = sdata->u.sta.auth_algs;
1095 else
1096 ret = -EOPNOTSUPP;
1097 break;
1098 default:
1099 ret = -EOPNOTSUPP;
1100 break;
1101 }
1102 return ret;
1103}
1104
1105
1106static int ieee80211_ioctl_siwencodeext(struct net_device *dev,
1107 struct iw_request_info *info,
1108 struct iw_point *erq, char *extra)
1109{
1110 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1111 struct iw_encode_ext *ext = (struct iw_encode_ext *) extra;
628a140b 1112 int uninitialized_var(alg), idx, i, remove = 0;
f0706e82
JB
1113
1114 switch (ext->alg) {
1115 case IW_ENCODE_ALG_NONE:
628a140b 1116 remove = 1;
f0706e82
JB
1117 break;
1118 case IW_ENCODE_ALG_WEP:
1119 alg = ALG_WEP;
1120 break;
1121 case IW_ENCODE_ALG_TKIP:
1122 alg = ALG_TKIP;
1123 break;
1124 case IW_ENCODE_ALG_CCMP:
1125 alg = ALG_CCMP;
1126 break;
1127 default:
1128 return -EOPNOTSUPP;
1129 }
1130
1131 if (erq->flags & IW_ENCODE_DISABLED)
628a140b 1132 remove = 1;
f0706e82
JB
1133
1134 idx = erq->flags & IW_ENCODE_INDEX;
1135 if (idx < 1 || idx > 4) {
1136 idx = -1;
1137 if (!sdata->default_key)
1138 idx = 0;
1139 else for (i = 0; i < NUM_DEFAULT_KEYS; i++) {
1140 if (sdata->default_key == sdata->keys[i]) {
1141 idx = i;
1142 break;
1143 }
1144 }
1145 if (idx < 0)
1146 return -EINVAL;
1147 } else
1148 idx--;
1149
f698d856 1150 return ieee80211_set_encryption(sdata, ext->addr.sa_data, idx, alg,
628a140b 1151 remove,
f0706e82
JB
1152 ext->ext_flags &
1153 IW_ENCODE_EXT_SET_TX_KEY,
1154 ext->key, ext->key_len);
1155}
1156
1157
f0706e82
JB
1158/* Structures to export the Wireless Handlers */
1159
1160static const iw_handler ieee80211_handler[] =
1161{
1162 (iw_handler) NULL, /* SIOCSIWCOMMIT */
1163 (iw_handler) ieee80211_ioctl_giwname, /* SIOCGIWNAME */
1164 (iw_handler) NULL, /* SIOCSIWNWID */
1165 (iw_handler) NULL, /* SIOCGIWNWID */
1166 (iw_handler) ieee80211_ioctl_siwfreq, /* SIOCSIWFREQ */
1167 (iw_handler) ieee80211_ioctl_giwfreq, /* SIOCGIWFREQ */
1168 (iw_handler) ieee80211_ioctl_siwmode, /* SIOCSIWMODE */
1169 (iw_handler) ieee80211_ioctl_giwmode, /* SIOCGIWMODE */
1170 (iw_handler) NULL, /* SIOCSIWSENS */
1171 (iw_handler) NULL, /* SIOCGIWSENS */
1172 (iw_handler) NULL /* not used */, /* SIOCSIWRANGE */
1173 (iw_handler) ieee80211_ioctl_giwrange, /* SIOCGIWRANGE */
1174 (iw_handler) NULL /* not used */, /* SIOCSIWPRIV */
1175 (iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */
1176 (iw_handler) NULL /* not used */, /* SIOCSIWSTATS */
1177 (iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */
5d4ecd93
JB
1178 (iw_handler) NULL, /* SIOCSIWSPY */
1179 (iw_handler) NULL, /* SIOCGIWSPY */
1180 (iw_handler) NULL, /* SIOCSIWTHRSPY */
1181 (iw_handler) NULL, /* SIOCGIWTHRSPY */
f0706e82
JB
1182 (iw_handler) ieee80211_ioctl_siwap, /* SIOCSIWAP */
1183 (iw_handler) ieee80211_ioctl_giwap, /* SIOCGIWAP */
1184 (iw_handler) ieee80211_ioctl_siwmlme, /* SIOCSIWMLME */
1185 (iw_handler) NULL, /* SIOCGIWAPLIST */
1186 (iw_handler) ieee80211_ioctl_siwscan, /* SIOCSIWSCAN */
1187 (iw_handler) ieee80211_ioctl_giwscan, /* SIOCGIWSCAN */
1188 (iw_handler) ieee80211_ioctl_siwessid, /* SIOCSIWESSID */
1189 (iw_handler) ieee80211_ioctl_giwessid, /* SIOCGIWESSID */
1190 (iw_handler) NULL, /* SIOCSIWNICKN */
1191 (iw_handler) NULL, /* SIOCGIWNICKN */
1192 (iw_handler) NULL, /* -- hole -- */
1193 (iw_handler) NULL, /* -- hole -- */
1fd5e589 1194 (iw_handler) ieee80211_ioctl_siwrate, /* SIOCSIWRATE */
b3d88ad4 1195 (iw_handler) ieee80211_ioctl_giwrate, /* SIOCGIWRATE */
f0706e82
JB
1196 (iw_handler) ieee80211_ioctl_siwrts, /* SIOCSIWRTS */
1197 (iw_handler) ieee80211_ioctl_giwrts, /* SIOCGIWRTS */
1198 (iw_handler) ieee80211_ioctl_siwfrag, /* SIOCSIWFRAG */
1199 (iw_handler) ieee80211_ioctl_giwfrag, /* SIOCGIWFRAG */
61609bc0 1200 (iw_handler) ieee80211_ioctl_siwtxpower, /* SIOCSIWTXPOW */
fe6aa301 1201 (iw_handler) ieee80211_ioctl_giwtxpower, /* SIOCGIWTXPOW */
f0706e82
JB
1202 (iw_handler) ieee80211_ioctl_siwretry, /* SIOCSIWRETRY */
1203 (iw_handler) ieee80211_ioctl_giwretry, /* SIOCGIWRETRY */
1204 (iw_handler) ieee80211_ioctl_siwencode, /* SIOCSIWENCODE */
1205 (iw_handler) ieee80211_ioctl_giwencode, /* SIOCGIWENCODE */
49292d56
SO
1206 (iw_handler) ieee80211_ioctl_siwpower, /* SIOCSIWPOWER */
1207 (iw_handler) ieee80211_ioctl_giwpower, /* SIOCGIWPOWER */
f0706e82
JB
1208 (iw_handler) NULL, /* -- hole -- */
1209 (iw_handler) NULL, /* -- hole -- */
1210 (iw_handler) ieee80211_ioctl_siwgenie, /* SIOCSIWGENIE */
1211 (iw_handler) NULL, /* SIOCGIWGENIE */
1212 (iw_handler) ieee80211_ioctl_siwauth, /* SIOCSIWAUTH */
1213 (iw_handler) ieee80211_ioctl_giwauth, /* SIOCGIWAUTH */
1214 (iw_handler) ieee80211_ioctl_siwencodeext, /* SIOCSIWENCODEEXT */
1215 (iw_handler) NULL, /* SIOCGIWENCODEEXT */
1216 (iw_handler) NULL, /* SIOCSIWPMKSA */
1217 (iw_handler) NULL, /* -- hole -- */
1218};
1219
f0706e82
JB
1220const struct iw_handler_def ieee80211_iw_handler_def =
1221{
1222 .num_standard = ARRAY_SIZE(ieee80211_handler),
f0706e82 1223 .standard = (iw_handler *) ieee80211_handler,
f0706e82
JB
1224 .get_wireless_stats = ieee80211_get_wireless_stats,
1225};
This page took 0.268498 seconds and 5 git commands to generate.