summaryrefslogtreecommitdiff
path: root/net/wireless/scan.c
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2014-01-09 11:37:23 +0200
committerJohannes Berg <johannes.berg@intel.com>2014-01-09 14:24:24 +0100
commitbdfbec2d2d240e9c528caae9c743801629b60166 (patch)
treed35ed71d3af26f7bbc681da4cbfcee99f8685476 /net/wireless/scan.c
parent685328b296acc810541d2532957912690273c64a (diff)
downloadlinux-bdfbec2d2d240e9c528caae9c743801629b60166.tar.gz
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/scan.c')
-rw-r--r--net/wireless/scan.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index a32d52a04c27..b528e31da2cf 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -1089,11 +1089,8 @@ int cfg80211_wext_siwscan(struct net_device *dev,
/* Determine number of channels, needed to allocate creq */
if (wreq && wreq->num_channels)
n_channels = wreq->num_channels;
- else {
- for (band = 0; band < IEEE80211_NUM_BANDS; band++)
- if (wiphy->bands[band])
- n_channels += wiphy->bands[band]->n_channels;
- }
+ else
+ n_channels = ieee80211_get_num_supported_channels(wiphy);
creq = kzalloc(sizeof(*creq) + sizeof(struct cfg80211_ssid) +
n_channels * sizeof(void *),