diff options
author | John W. Linville <linville@tuxdriver.com> | 2014-01-13 20:40:59 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-01-13 20:40:59 +0100 |
commit | f13352519ee8c4b22b87fc1a47743d1f53ea193e (patch) | |
tree | 48c18144f3e5e530ec61d5eadbb5a34675a69fe8 /net/wireless/sme.c | |
parent | Merge branch 'for-linville' of git://github.com/kvalo/ath (diff) | |
parent | mac80211_hwsim: restore regulatory testing functionality (diff) | |
download | linux-f13352519ee8c4b22b87fc1a47743d1f53ea193e.tar.xz linux-f13352519ee8c4b22b87fc1a47743d1f53ea193e.zip |
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r-- | net/wireless/sme.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 5d6e7bb2fc89..a63509118508 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -70,18 +70,11 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev) if (rdev->scan_req) return -EBUSY; - if (wdev->conn->params.channel) { + if (wdev->conn->params.channel) n_channels = 1; - } else { - enum ieee80211_band band; - n_channels = 0; + else + n_channels = ieee80211_get_num_supported_channels(wdev->wiphy); - for (band = 0; band < IEEE80211_NUM_BANDS; band++) { - if (!wdev->wiphy->bands[band]) - continue; - n_channels += wdev->wiphy->bands[band]->n_channels; - } - } request = kzalloc(sizeof(*request) + sizeof(request->ssids[0]) + sizeof(request->channels[0]) * n_channels, GFP_KERNEL); |