When using quarter and half rates we might want to use self defined frequencies with self defined country codes closer to the border. To avoid these frequencies to be disabled, we need to check if the frequency fits the band with the actual bandwidth. Signed-off-by: Matthias May <matthias.may@xxxxxxxxxxx> --- net/wireless/reg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index fc2f135..c8fabda 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -1016,6 +1016,7 @@ freq_reg_info_regd(struct wiphy *wiphy, u32 center_freq, for (i = 0; i < regd->n_reg_rules; i++) { const struct ieee80211_reg_rule *rr; const struct ieee80211_freq_range *fr = NULL; + u32 max_bw = MHZ_TO_KHZ(20); rr = ®d->reg_rules[i]; fr = &rr->freq_range; @@ -1028,8 +1028,10 @@ freq_reg_info_regd(struct wiphy *wiphy, u32 center_freq, */ if (!band_rule_found) band_rule_found = freq_in_rule_band(fr, center_freq); + if (fr->max_bandwidth_khz < max_bw) + max_bw = fr->max_bandwidth_khz; - bw_fits = reg_does_bw_fit(fr, center_freq, MHZ_TO_KHZ(20)); + bw_fits = reg_does_bw_fit(fr, center_freq, max_bw); if (band_rule_found && bw_fits) return rr; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html