diff options
author | John W. Linville <linville@tuxdriver.com> | 2013-04-22 14:58:14 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-04-22 14:58:14 -0400 |
commit | 6475cb05ee17870c7c8d44146dbe09044e6db33d (patch) | |
tree | 68fc82e4b9c4c4a1b261869add66bef3ee054926 /net/mac80211/main.c | |
parent | e563589f7187699b0217854467d857f53b29cc50 (diff) | |
parent | 1eb32179f0593051e7536378a879f5bdd108416a (diff) | |
download | linux-6475cb05ee17870c7c8d44146dbe09044e6db33d.tar.bz2 |
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r-- | net/mac80211/main.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 52136fd5ba97..8a7bfc47d577 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -668,6 +668,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) int channels, max_bitrates; bool supp_ht, supp_vht; netdev_features_t feature_whitelist; + struct cfg80211_chan_def dflt_chandef = {}; static const u32 cipher_suites[] = { /* keep WEP first, it may be removed below */ WLAN_CIPHER_SUITE_WEP40, @@ -745,19 +746,19 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) sband = local->hw.wiphy->bands[band]; if (!sband) continue; - if (!local->use_chanctx && !local->_oper_chandef.chan) { + + if (!dflt_chandef.chan) { + cfg80211_chandef_create(&dflt_chandef, + &sband->channels[0], + NL80211_CHAN_NO_HT); /* init channel we're on */ - struct cfg80211_chan_def chandef = { - .chan = &sband->channels[0], - .width = NL80211_CHAN_NO_HT, - .center_freq1 = sband->channels[0].center_freq, - .center_freq2 = 0 - }; - local->hw.conf.chandef = local->_oper_chandef = chandef; + if (!local->use_chanctx && !local->_oper_chandef.chan) { + local->hw.conf.chandef = dflt_chandef; + local->_oper_chandef = dflt_chandef; + } + local->monitor_chandef = dflt_chandef; } - cfg80211_chandef_create(&local->monitor_chandef, - &sband->channels[0], - NL80211_CHAN_NO_HT); + channels += sband->n_channels; if (max_bitrates < sband->n_bitrates) |