Commit 466f310d authored by Johannes Berg's avatar Johannes Berg

mac80211: mesh: don't use global channel type

Using local->_oper_channel_type in the mesh code is
completely wrong as this value is the combination
of the various interface channel types and can be
a different value from the mesh interface in case
there are multiple virtual interfaces.

Use sdata->vif.bss_conf.channel_type instead as it
tracks the per-vif channel type.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent d348f69f
...@@ -109,11 +109,11 @@ bool mesh_matches_local(struct ieee80211_sub_if_data *sdata, ...@@ -109,11 +109,11 @@ bool mesh_matches_local(struct ieee80211_sub_if_data *sdata,
/* Disallow HT40+/- mismatch */ /* Disallow HT40+/- mismatch */
if (ie->ht_operation && if (ie->ht_operation &&
(local->_oper_channel_type == NL80211_CHAN_HT40MINUS || (sdata->vif.bss_conf.channel_type == NL80211_CHAN_HT40MINUS ||
local->_oper_channel_type == NL80211_CHAN_HT40PLUS) && sdata->vif.bss_conf.channel_type == NL80211_CHAN_HT40PLUS) &&
(sta_channel_type == NL80211_CHAN_HT40MINUS || (sta_channel_type == NL80211_CHAN_HT40MINUS ||
sta_channel_type == NL80211_CHAN_HT40PLUS) && sta_channel_type == NL80211_CHAN_HT40PLUS) &&
local->_oper_channel_type != sta_channel_type) sdata->vif.bss_conf.channel_type != sta_channel_type)
goto mismatch; goto mismatch;
return true; return true;
...@@ -375,7 +375,7 @@ int mesh_add_ht_cap_ie(struct sk_buff *skb, ...@@ -375,7 +375,7 @@ int mesh_add_ht_cap_ie(struct sk_buff *skb,
sband = local->hw.wiphy->bands[local->oper_channel->band]; sband = local->hw.wiphy->bands[local->oper_channel->band];
if (!sband->ht_cap.ht_supported || if (!sband->ht_cap.ht_supported ||
local->_oper_channel_type == NL80211_CHAN_NO_HT) sdata->vif.bss_conf.channel_type == NL80211_CHAN_NO_HT)
return 0; return 0;
if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_cap)) if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_cap))
...@@ -392,7 +392,8 @@ int mesh_add_ht_oper_ie(struct sk_buff *skb, ...@@ -392,7 +392,8 @@ int mesh_add_ht_oper_ie(struct sk_buff *skb,
{ {
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct ieee80211_channel *channel = local->oper_channel; struct ieee80211_channel *channel = local->oper_channel;
enum nl80211_channel_type channel_type = local->_oper_channel_type; enum nl80211_channel_type channel_type =
sdata->vif.bss_conf.channel_type;
struct ieee80211_supported_band *sband = struct ieee80211_supported_band *sband =
local->hw.wiphy->bands[channel->band]; local->hw.wiphy->bands[channel->band];
struct ieee80211_sta_ht_cap *ht_cap = &sband->ht_cap; struct ieee80211_sta_ht_cap *ht_cap = &sband->ht_cap;
......
...@@ -117,7 +117,7 @@ static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata) ...@@ -117,7 +117,7 @@ static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata)
u16 ht_opmode; u16 ht_opmode;
bool non_ht_sta = false, ht20_sta = false; bool non_ht_sta = false, ht20_sta = false;
if (local->_oper_channel_type == NL80211_CHAN_NO_HT) if (sdata->vif.bss_conf.channel_type == NL80211_CHAN_NO_HT)
return 0; return 0;
rcu_read_lock(); rcu_read_lock();
...@@ -147,7 +147,8 @@ static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata) ...@@ -147,7 +147,8 @@ static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata)
if (non_ht_sta) if (non_ht_sta)
ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED; ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED;
else if (ht20_sta && local->_oper_channel_type > NL80211_CHAN_HT20) else if (ht20_sta &&
sdata->vif.bss_conf.channel_type > NL80211_CHAN_HT20)
ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_20MHZ; ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_20MHZ;
else else
ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONE; ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
...@@ -379,7 +380,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, ...@@ -379,7 +380,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
sta->sta.supp_rates[band] = rates; sta->sta.supp_rates[band] = rates;
if (elems->ht_cap_elem && if (elems->ht_cap_elem &&
sdata->local->_oper_channel_type != NL80211_CHAN_NO_HT) sdata->vif.bss_conf.channel_type != NL80211_CHAN_NO_HT)
ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
elems->ht_cap_elem, elems->ht_cap_elem,
&sta->sta.ht_cap); &sta->sta.ht_cap);
......
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