aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-11-24 09:49:44 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-11-25 05:05:33 -0500
commit40a11ca83de91f6bb2306580e7732ad3d97f201a (patch)
tree7328cc826ce65a33bf84edc0d8880fc33401338c /net/mac80211/util.c
parentea9eba6a8b6b5d7a48b902d92dc2adb63b4371c0 (diff)
mac80211: check if channels allow 80 MHz for VHT probe requests
If there are no channels allowing 80 MHz to be used, then the station isn't really VHT capable even if the driver and device support it in general. In this case, exclude the VHT capability IE from probe request frames. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index bb9664cb8831..974ebe70f5b0 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1339,6 +1339,7 @@ static int ieee80211_build_preq_ies_band(struct ieee80211_local *local,
1339 int ext_rates_len; 1339 int ext_rates_len;
1340 int shift; 1340 int shift;
1341 u32 rate_flags; 1341 u32 rate_flags;
1342 bool have_80mhz = false;
1342 1343
1343 *offset = 0; 1344 *offset = 0;
1344 1345
@@ -1467,7 +1468,15 @@ static int ieee80211_build_preq_ies_band(struct ieee80211_local *local,
1467 *offset = noffset; 1468 *offset = noffset;
1468 } 1469 }
1469 1470
1470 if (sband->vht_cap.vht_supported) { 1471 /* Check if any channel in this sband supports at least 80 MHz */
1472 for (i = 0; i < sband->n_channels; i++) {
1473 if (!(sband->channels[i].flags & IEEE80211_CHAN_NO_80MHZ)) {
1474 have_80mhz = true;
1475 break;
1476 }
1477 }
1478
1479 if (sband->vht_cap.vht_supported && have_80mhz) {
1471 if (end - pos < 2 + sizeof(struct ieee80211_vht_cap)) 1480 if (end - pos < 2 + sizeof(struct ieee80211_vht_cap))
1472 goto out_err; 1481 goto out_err;
1473 pos = ieee80211_ie_build_vht_cap(pos, &sband->vht_cap, 1482 pos = ieee80211_ie_build_vht_cap(pos, &sband->vht_cap,