diff options
-rw-r--r-- | net/mac80211/ieee80211_ioctl.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 66e8a976b311..ef74a91e02a5 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c | |||
@@ -345,6 +345,8 @@ static int ieee80211_ioctl_giwrange(struct net_device *dev, | |||
345 | { | 345 | { |
346 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 346 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
347 | struct iw_range *range = (struct iw_range *) extra; | 347 | struct iw_range *range = (struct iw_range *) extra; |
348 | struct ieee80211_hw_mode *mode = NULL; | ||
349 | int c = 0; | ||
348 | 350 | ||
349 | data->length = sizeof(struct iw_range); | 351 | data->length = sizeof(struct iw_range); |
350 | memset(range, 0, sizeof(struct iw_range)); | 352 | memset(range, 0, sizeof(struct iw_range)); |
@@ -378,6 +380,29 @@ static int ieee80211_ioctl_giwrange(struct net_device *dev, | |||
378 | range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | | 380 | range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | |
379 | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; | 381 | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; |
380 | 382 | ||
383 | list_for_each_entry(mode, &local->modes_list, list) { | ||
384 | int i = 0; | ||
385 | |||
386 | if (!(local->enabled_modes & (1 << mode->mode)) || | ||
387 | (local->hw_modes & local->enabled_modes & | ||
388 | (1 << MODE_IEEE80211G) && mode->mode == MODE_IEEE80211B)) | ||
389 | continue; | ||
390 | |||
391 | while (i < mode->num_channels && c < IW_MAX_FREQUENCIES) { | ||
392 | struct ieee80211_channel *chan = &mode->channels[i]; | ||
393 | |||
394 | if (chan->flag & IEEE80211_CHAN_W_SCAN) { | ||
395 | range->freq[c].i = chan->chan; | ||
396 | range->freq[c].m = chan->freq * 100000; | ||
397 | range->freq[c].e = 1; | ||
398 | c++; | ||
399 | } | ||
400 | i++; | ||
401 | } | ||
402 | } | ||
403 | range->num_channels = c; | ||
404 | range->num_frequency = c; | ||
405 | |||
381 | IW_EVENT_CAPA_SET_KERNEL(range->event_capa); | 406 | IW_EVENT_CAPA_SET_KERNEL(range->event_capa); |
382 | IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWTHRSPY); | 407 | IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWTHRSPY); |
383 | IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP); | 408 | IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP); |