From: Ilan Peer 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 Assisted-by: GitHub-Copilot:claude-opus-4-6 Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/mac80211/util.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index a96078a6bfa2..1b930fada529 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1283,6 +1283,29 @@ 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 + * Do not include Extended Supported Rates element. + */ + 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) -- 2.34.1