summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2015-08-15 15:39:53 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-09-04 08:31:41 -0400
commit52a45f38ca5998db0394e782d137595a82a08b43 (patch)
treece43b7bfa34b879c66ffb54f1aa155737b80b4ab /net/mac80211/mlme.c
parent549cc1c560128d583698ba9a73af283fe87dbab8 (diff)
mac80211: avoid VHT usage with no 80MHz chans allowed
Currently if 80MHz channels are not allowed for use, the VHT IE is not included in the probe request for an AP. This is not good enough if the AP is configured with the wrong regulatory and supports VHT even where prohibited or in TDLS scenarios. Mark the ifmgd with the DISABLE_VHT flag for the misbehaving-AP case, and unset VHT support from the peer-station entry for the TDLS case. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 705ef1d040ed..cd7e55e08a23 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -4267,6 +4267,8 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
4267 struct ieee80211_supported_band *sband; 4267 struct ieee80211_supported_band *sband;
4268 struct cfg80211_chan_def chandef; 4268 struct cfg80211_chan_def chandef;
4269 int ret; 4269 int ret;
4270 u32 i;
4271 bool have_80mhz;
4270 4272
4271 sband = local->hw.wiphy->bands[cbss->channel->band]; 4273 sband = local->hw.wiphy->bands[cbss->channel->band];
4272 4274
@@ -4317,6 +4319,20 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
4317 } 4319 }
4318 } 4320 }
4319 4321
4322 /* Allow VHT if at least one channel on the sband supports 80 MHz */
4323 have_80mhz = false;
4324 for (i = 0; i < sband->n_channels; i++) {
4325 if (sband->channels[i].flags & (IEEE80211_CHAN_DISABLED |
4326 IEEE80211_CHAN_NO_80MHZ))
4327 continue;
4328
4329 have_80mhz = true;
4330 break;
4331 }
4332
4333 if (!have_80mhz)
4334 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
4335
4320 ifmgd->flags |= ieee80211_determine_chantype(sdata, sband, 4336 ifmgd->flags |= ieee80211_determine_chantype(sdata, sband,
4321 cbss->channel, 4337 cbss->channel,
4322 ht_cap, ht_oper, vht_oper, 4338 ht_cap, ht_oper, vht_oper,