aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-25 07:51:49 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-08-20 08:13:38 -0400
commit466f310d100ff54f346c1be481af9935c42467b3 (patch)
tree419fe4d27f6b24f8c9979f0c2717b8339fc656bb /net/mac80211
parentd348f69f59af769c405c2f43a2d326d7123ef75a (diff)
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: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mesh.c11
-rw-r--r--net/mac80211/mesh_plink.c7
2 files changed, 10 insertions, 8 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 035cd0c8ce33..f2d0d213bcfb 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -109,11 +109,11 @@ bool mesh_matches_local(struct ieee80211_sub_if_data *sdata,
109 109
110 /* Disallow HT40+/- mismatch */ 110 /* Disallow HT40+/- mismatch */
111 if (ie->ht_operation && 111 if (ie->ht_operation &&
112 (local->_oper_channel_type == NL80211_CHAN_HT40MINUS || 112 (sdata->vif.bss_conf.channel_type == NL80211_CHAN_HT40MINUS ||
113 local->_oper_channel_type == NL80211_CHAN_HT40PLUS) && 113 sdata->vif.bss_conf.channel_type == NL80211_CHAN_HT40PLUS) &&
114 (sta_channel_type == NL80211_CHAN_HT40MINUS || 114 (sta_channel_type == NL80211_CHAN_HT40MINUS ||
115 sta_channel_type == NL80211_CHAN_HT40PLUS) && 115 sta_channel_type == NL80211_CHAN_HT40PLUS) &&
116 local->_oper_channel_type != sta_channel_type) 116 sdata->vif.bss_conf.channel_type != sta_channel_type)
117 goto mismatch; 117 goto mismatch;
118 118
119 return true; 119 return true;
@@ -375,7 +375,7 @@ int mesh_add_ht_cap_ie(struct sk_buff *skb,
375 375
376 sband = local->hw.wiphy->bands[local->oper_channel->band]; 376 sband = local->hw.wiphy->bands[local->oper_channel->band];
377 if (!sband->ht_cap.ht_supported || 377 if (!sband->ht_cap.ht_supported ||
378 local->_oper_channel_type == NL80211_CHAN_NO_HT) 378 sdata->vif.bss_conf.channel_type == NL80211_CHAN_NO_HT)
379 return 0; 379 return 0;
380 380
381 if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_cap)) 381 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{ 392{
393 struct ieee80211_local *local = sdata->local; 393 struct ieee80211_local *local = sdata->local;
394 struct ieee80211_channel *channel = local->oper_channel; 394 struct ieee80211_channel *channel = local->oper_channel;
395 enum nl80211_channel_type channel_type = local->_oper_channel_type; 395 enum nl80211_channel_type channel_type =
396 sdata->vif.bss_conf.channel_type;
396 struct ieee80211_supported_band *sband = 397 struct ieee80211_supported_band *sband =
397 local->hw.wiphy->bands[channel->band]; 398 local->hw.wiphy->bands[channel->band];
398 struct ieee80211_sta_ht_cap *ht_cap = &sband->ht_cap; 399 struct ieee80211_sta_ht_cap *ht_cap = &sband->ht_cap;
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 5fd1250f7866..54ce1af491eb 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -117,7 +117,7 @@ static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata)
117 u16 ht_opmode; 117 u16 ht_opmode;
118 bool non_ht_sta = false, ht20_sta = false; 118 bool non_ht_sta = false, ht20_sta = false;
119 119
120 if (local->_oper_channel_type == NL80211_CHAN_NO_HT) 120 if (sdata->vif.bss_conf.channel_type == NL80211_CHAN_NO_HT)
121 return 0; 121 return 0;
122 122
123 rcu_read_lock(); 123 rcu_read_lock();
@@ -147,7 +147,8 @@ out:
147 147
148 if (non_ht_sta) 148 if (non_ht_sta)
149 ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED; 149 ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED;
150 else if (ht20_sta && local->_oper_channel_type > NL80211_CHAN_HT20) 150 else if (ht20_sta &&
151 sdata->vif.bss_conf.channel_type > NL80211_CHAN_HT20)
151 ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_20MHZ; 152 ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_20MHZ;
152 else 153 else
153 ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONE; 154 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 380
380 sta->sta.supp_rates[band] = rates; 381 sta->sta.supp_rates[band] = rates;
381 if (elems->ht_cap_elem && 382 if (elems->ht_cap_elem &&
382 sdata->local->_oper_channel_type != NL80211_CHAN_NO_HT) 383 sdata->vif.bss_conf.channel_type != NL80211_CHAN_NO_HT)
383 ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, 384 ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
384 elems->ht_cap_elem, 385 elems->ht_cap_elem,
385 &sta->sta.ht_cap); 386 &sta->sta.ht_cap);