aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/wext.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/wext.c')
-rw-r--r--net/mac80211/wext.c59
1 files changed, 4 insertions, 55 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index acd5808b87f4..b337d7d5edb3 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -173,8 +173,9 @@ static int ieee80211_ioctl_giwrange(struct net_device *dev,
173 range->num_encoding_sizes = 2; 173 range->num_encoding_sizes = 2;
174 range->max_encoding_tokens = NUM_DEFAULT_KEYS; 174 range->max_encoding_tokens = NUM_DEFAULT_KEYS;
175 175
176 /* cfg80211 requires this, and enforces 0..100 */
176 if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC) 177 if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)
177 range->max_qual.level = local->hw.max_signal; 178 range->max_qual.level = 100;
178 else if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) 179 else if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM)
179 range->max_qual.level = -110; 180 range->max_qual.level = -110;
180 else 181 else
@@ -415,58 +416,6 @@ static int ieee80211_ioctl_giwap(struct net_device *dev,
415} 416}
416 417
417 418
418static int ieee80211_ioctl_siwscan(struct net_device *dev,
419 struct iw_request_info *info,
420 union iwreq_data *wrqu, char *extra)
421{
422 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
423 struct iw_scan_req *req = NULL;
424 u8 *ssid = NULL;
425 size_t ssid_len = 0;
426
427 if (!netif_running(dev))
428 return -ENETDOWN;
429
430 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
431 sdata->vif.type != NL80211_IFTYPE_ADHOC &&
432 sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
433 return -EOPNOTSUPP;
434
435 /* if SSID was specified explicitly then use that */
436 if (wrqu->data.length == sizeof(struct iw_scan_req) &&
437 wrqu->data.flags & IW_SCAN_THIS_ESSID) {
438 req = (struct iw_scan_req *)extra;
439 ssid = req->essid;
440 ssid_len = req->essid_len;
441 }
442
443 return ieee80211_request_scan(sdata, ssid, ssid_len);
444}
445
446
447static int ieee80211_ioctl_giwscan(struct net_device *dev,
448 struct iw_request_info *info,
449 struct iw_point *data, char *extra)
450{
451 int res;
452 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
453 struct ieee80211_sub_if_data *sdata;
454
455 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
456
457 if (local->sw_scanning || local->hw_scanning)
458 return -EAGAIN;
459
460 res = ieee80211_scan_results(local, info, extra, data->length);
461 if (res >= 0) {
462 data->length = res;
463 return 0;
464 }
465 data->length = 0;
466 return res;
467}
468
469
470static int ieee80211_ioctl_siwrate(struct net_device *dev, 419static int ieee80211_ioctl_siwrate(struct net_device *dev,
471 struct iw_request_info *info, 420 struct iw_request_info *info,
472 struct iw_param *rate, char *extra) 421 struct iw_param *rate, char *extra)
@@ -1165,8 +1114,8 @@ static const iw_handler ieee80211_handler[] =
1165 (iw_handler) ieee80211_ioctl_giwap, /* SIOCGIWAP */ 1114 (iw_handler) ieee80211_ioctl_giwap, /* SIOCGIWAP */
1166 (iw_handler) ieee80211_ioctl_siwmlme, /* SIOCSIWMLME */ 1115 (iw_handler) ieee80211_ioctl_siwmlme, /* SIOCSIWMLME */
1167 (iw_handler) NULL, /* SIOCGIWAPLIST */ 1116 (iw_handler) NULL, /* SIOCGIWAPLIST */
1168 (iw_handler) ieee80211_ioctl_siwscan, /* SIOCSIWSCAN */ 1117 (iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
1169 (iw_handler) ieee80211_ioctl_giwscan, /* SIOCGIWSCAN */ 1118 (iw_handler) cfg80211_wext_giwscan, /* SIOCGIWSCAN */
1170 (iw_handler) ieee80211_ioctl_siwessid, /* SIOCSIWESSID */ 1119 (iw_handler) ieee80211_ioctl_siwessid, /* SIOCSIWESSID */
1171 (iw_handler) ieee80211_ioctl_giwessid, /* SIOCGIWESSID */ 1120 (iw_handler) ieee80211_ioctl_giwessid, /* SIOCGIWESSID */
1172 (iw_handler) NULL, /* SIOCSIWNICKN */ 1121 (iw_handler) NULL, /* SIOCSIWNICKN */