wifi: mac80211: Restrict probe request rates for minimal content

When IEEE80211_PROBE_FLAG_MIN_CONTENT is set, restrict the probe
request supported rates per Draft P802.11bi D5.0 specification:

- 2 GHz: only include 1, 2, 5.5, 6, 11, 12, 24 Mb/s
- 5/6 GHz: only include 6, 12, 24 Mb/s

Also skip the Extended Supported Rates element for minimal
content probes.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Assisted-by: GitHub-Copilot:claude-opus-4-6
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260922143146.13a6fab60516.I3ebb1fa5d41622b1a0ddf9d008328fc19ad980a1@changeid
[drop strange comment about extended element]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Ilan Peer 2026-09-22 14:41:29 +03:00 committed by Johannes Berg
parent 55ab5eccd1
commit dc16bea6fe

View File

@ -1283,6 +1283,28 @@ static int ieee80211_put_preq_ies_band(struct sk_buff *skb,
if (band == NL80211_BAND_S1GHZ)
return ieee80211_put_s1g_cap(skb, &sband->s1g_cap);
/*
* For EPP minimal content probes, restrict supported rates:
* - 2 GHz: only 1, 2, 5.5, 6, 11, 12, 24 Mb/s
* - 5/6 GHz: only 6, 12, 24 Mb/s
*/
if (flags & IEEE80211_PROBE_FLAG_MIN_CONTENT) {
for (i = 0; i < sband->n_bitrates; i++) {
u16 rate = sband->bitrates[i].bitrate;
if (band == NL80211_BAND_2GHZ) {
if (rate != 10 && rate != 20 &&
rate != 55 && rate != 60 &&
rate != 110 && rate != 120 &&
rate != 240)
rate_mask &= ~BIT(i);
} else {
if (rate != 60 && rate != 120 && rate != 240)
rate_mask &= ~BIT(i);
}
}
}
err = ieee80211_put_srates_elem(skb, sband, 0,
~rate_mask, WLAN_EID_SUPP_RATES);
if (err)