Commit f2d9330e authored by Johannes Berg's avatar Johannes Berg

mac80211: clean up channel use in ieee80211_config_ht_tx

The channel use is confusing, some uses the channel
context and some the bss_conf.chandef. The latter is
fine, so get rid of the channel context part.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 08e6effa
...@@ -181,7 +181,6 @@ static u32 ieee80211_config_ht_tx(struct ieee80211_sub_if_data *sdata, ...@@ -181,7 +181,6 @@ static u32 ieee80211_config_ht_tx(struct ieee80211_sub_if_data *sdata,
{ {
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
struct ieee80211_chanctx_conf *chanctx_conf;
struct ieee80211_channel *chan; struct ieee80211_channel *chan;
u32 changed = 0; u32 changed = 0;
u16 ht_opmode; u16 ht_opmode;
...@@ -190,23 +189,16 @@ static u32 ieee80211_config_ht_tx(struct ieee80211_sub_if_data *sdata, ...@@ -190,23 +189,16 @@ static u32 ieee80211_config_ht_tx(struct ieee80211_sub_if_data *sdata,
if (WARN_ON_ONCE(!sta)) if (WARN_ON_ONCE(!sta))
return 0; return 0;
rcu_read_lock(); chan = sdata->vif.bss_conf.chandef.chan;
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
if (WARN_ON(!chanctx_conf)) {
rcu_read_unlock();
return 0;
}
chan = chanctx_conf->def.chan;
rcu_read_unlock();
sband = local->hw.wiphy->bands[chan->band]; sband = local->hw.wiphy->bands[chan->band];
switch (sdata->vif.bss_conf.chandef.width) { switch (sdata->vif.bss_conf.chandef.width) {
case NL80211_CHAN_WIDTH_40: case NL80211_CHAN_WIDTH_40:
if (sdata->vif.bss_conf.chandef.chan->center_freq > if (chan->center_freq >
sdata->vif.bss_conf.chandef.center_freq1 && sdata->vif.bss_conf.chandef.center_freq1 &&
chan->flags & IEEE80211_CHAN_NO_HT40MINUS) chan->flags & IEEE80211_CHAN_NO_HT40MINUS)
disable_40 = true; disable_40 = true;
if (sdata->vif.bss_conf.chandef.chan->center_freq < if (chan->center_freq <
sdata->vif.bss_conf.chandef.center_freq1 && sdata->vif.bss_conf.chandef.center_freq1 &&
chan->flags & IEEE80211_CHAN_NO_HT40PLUS) chan->flags & IEEE80211_CHAN_NO_HT40PLUS)
disable_40 = true; disable_40 = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment