Use IEEE80211_RATE_MANDATORY_G instead of IEEE80211_RATE_MANDATORY_B to get all mandatory rates in 2.4 GHz band. It is safe to do so because ERP mandatory rates are a superset of HR/DSSS mandatory rates. Also limit to OFDM rates for 10 MHz and 5 MHz channels as originally intended by commit 74608aca4d82e. Signed-off-by: Richard Schütz <rschuetz@xxxxxxxxxxxxxx> --- net/wireless/util.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/wireless/util.c b/net/wireless/util.c index c69b5c31caf8..386070e0035a 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -51,16 +51,17 @@ u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband, if (sband->band == NL80211_BAND_2GHZ) { if (scan_width == NL80211_BSS_CHAN_WIDTH_5 || scan_width == NL80211_BSS_CHAN_WIDTH_10) - mandatory_flag = IEEE80211_RATE_MANDATORY_G; + mandatory_flag = IEEE80211_RATE_MANDATORY_G | + IEEE80211_RATE_ERP_G; else - mandatory_flag = IEEE80211_RATE_MANDATORY_B; + mandatory_flag = IEEE80211_RATE_MANDATORY_G; } else { mandatory_flag = IEEE80211_RATE_MANDATORY_A; } bitrates = sband->bitrates; for (i = 0; i < sband->n_bitrates; i++) - if (bitrates[i].flags & mandatory_flag) + if ((bitrates[i].flags & mandatory_flag) == mandatory_flag) mandatory_rates |= BIT(i); return mandatory_rates; } -- 2.14.1