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/nl80211.c | |
parent | 685328b296acc810541d2532957912690273c64a (diff) |
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/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 20857126f74..d0afd82ebd7 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5285,12 +5285,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info) goto unlock; } } else { - enum ieee80211_band band; - n_channels = 0; - - for (band = 0; band < IEEE80211_NUM_BANDS; band++) - if (wiphy->bands[band]) - n_channels += wiphy->bands[band]->n_channels; + n_channels = ieee80211_get_num_supported_channels(wiphy); } if (info->attrs[NL80211_ATTR_SCAN_SSIDS]) @@ -5498,11 +5493,7 @@ static int nl80211_start_sched_scan(struct sk_buff *skb, if (!n_channels) return -EINVAL; } else { - n_channels = 0; - - for (band = 0; band < IEEE80211_NUM_BANDS; band++) - if (wiphy->bands[band]) - n_channels += wiphy->bands[band]->n_channels; + n_channels = ieee80211_get_num_supported_channels(wiphy); } if (info->attrs[NL80211_ATTR_SCAN_SSIDS]) |