aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/chan.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/chan.c')
-rw-r--r--net/mac80211/chan.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 931be419ab5a..7d0baa89c784 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -22,7 +22,7 @@ static void ieee80211_change_chanctx(struct ieee80211_local *local,
22 drv_change_chanctx(local, ctx, IEEE80211_CHANCTX_CHANGE_WIDTH); 22 drv_change_chanctx(local, ctx, IEEE80211_CHANCTX_CHANGE_WIDTH);
23 23
24 if (!local->use_chanctx) { 24 if (!local->use_chanctx) {
25 local->_oper_channel_type = cfg80211_get_chandef_type(chandef); 25 local->_oper_chandef = *chandef;
26 ieee80211_hw_config(local, 0); 26 ieee80211_hw_config(local, 0);
27 } 27 }
28} 28}
@@ -85,9 +85,7 @@ ieee80211_new_chanctx(struct ieee80211_local *local,
85 ieee80211_hw_config(local, changed); 85 ieee80211_hw_config(local, changed);
86 86
87 if (!local->use_chanctx) { 87 if (!local->use_chanctx) {
88 local->_oper_channel_type = 88 local->_oper_chandef = *chandef;
89 cfg80211_get_chandef_type(chandef);
90 local->_oper_channel = chandef->chan;
91 ieee80211_hw_config(local, 0); 89 ieee80211_hw_config(local, 0);
92 } else { 90 } else {
93 err = drv_add_chanctx(local, ctx); 91 err = drv_add_chanctx(local, ctx);
@@ -117,7 +115,10 @@ static void ieee80211_free_chanctx(struct ieee80211_local *local,
117 WARN_ON_ONCE(ctx->refcount != 0); 115 WARN_ON_ONCE(ctx->refcount != 0);
118 116
119 if (!local->use_chanctx) { 117 if (!local->use_chanctx) {
120 local->_oper_channel_type = NL80211_CHAN_NO_HT; 118 struct cfg80211_chan_def *chandef = &local->_oper_chandef;
119 chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
120 chandef->center_freq1 = chandef->chan->center_freq;
121 chandef->center_freq2 = 0;
121 ieee80211_hw_config(local, 0); 122 ieee80211_hw_config(local, 0);
122 } else { 123 } else {
123 drv_remove_chanctx(local, ctx); 124 drv_remove_chanctx(local, ctx);