diff options
author | Ilan Peer <ilan.peer@intel.com> | 2014-01-09 09:37:23 (GMT) |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-01-09 13:24:24 (GMT) |
commit | bdfbec2d2d240e9c528caae9c743801629b60166 (patch) | |
tree | d35ed71d3af26f7bbc681da4cbfcee99f8685476 /drivers/net/wireless/libertas/cfg.c | |
parent | 685328b296acc810541d2532957912690273c64a (diff) | |
download | linux-bdfbec2d2d240e9c528caae9c743801629b60166.tar.xz |
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 'drivers/net/wireless/libertas/cfg.c')
-rw-r--r-- | drivers/net/wireless/libertas/cfg.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 116f4ab..32f7500 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c @@ -1268,14 +1268,9 @@ static struct cfg80211_scan_request * _new_connect_scan_req(struct wiphy *wiphy, struct cfg80211_connect_params *sme) { struct cfg80211_scan_request *creq = NULL; - int i, n_channels = 0; + int i, n_channels = ieee80211_get_num_supported_channels(wiphy); enum ieee80211_band band; - for (band = 0; band < IEEE80211_NUM_BANDS; band++) { - if (wiphy->bands[band]) - n_channels += wiphy->bands[band]->n_channels; - } - creq = kzalloc(sizeof(*creq) + sizeof(struct cfg80211_ssid) + n_channels * sizeof(void *), GFP_ATOMIC); |