diff options
author | Ilan Peer <ilan.peer@intel.com> | 2014-01-09 11:37:23 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-01-09 14:24:24 +0100 |
commit | bdfbec2d2d240e9c528caae9c743801629b60166 (patch) | |
tree | d35ed71d3af26f7bbc681da4cbfcee99f8685476 /net/wireless/sme.c | |
parent | 685328b296acc810541d2532957912690273c64a (diff) | |
download | talos-op-linux-bdfbec2d2d240e9c528caae9c743801629b60166.tar.gz talos-op-linux-bdfbec2d2d240e9c528caae9c743801629b60166.zip |
cfg80211: Add a function to get the number of supported channels
Add a utility function to get the number of channels supported by
the device, and update the places in the code that need this data.
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
[replace another occurrence in libertas, fix kernel-doc, fix bugs]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
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 3f64202358f4..c854f1ce22db 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); |