Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+10 -1
+10 -1
net/mac80211/util.c
··· 1339 1339 int ext_rates_len; 1340 1340 int shift; 1341 1341 u32 rate_flags; 1342 + bool have_80mhz = false; 1342 1343 1343 1344 *offset = 0; 1344 1345 ··· 1468 1467 *offset = noffset; 1469 1468 } 1470 1469 1471 - if (sband->vht_cap.vht_supported) { 1470 + /* Check if any channel in this sband supports at least 80 MHz */ 1471 + for (i = 0; i < sband->n_channels; i++) { 1472 + if (!(sband->channels[i].flags & IEEE80211_CHAN_NO_80MHZ)) { 1473 + have_80mhz = true; 1474 + break; 1475 + } 1476 + } 1477 + 1478 + if (sband->vht_cap.vht_supported && have_80mhz) { 1472 1479 if (end - pos < 2 + sizeof(struct ieee80211_vht_cap)) 1473 1480 goto out_err; 1474 1481 pos = ieee80211_ie_build_vht_cap(pos, &sband->vht_cap,