linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: check correct maximum bandwidth for quarter and half rate.
@ 2015-06-09 15:27 Matthias May
  2015-06-09 20:29 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias May @ 2015-06-09 15:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: Matthias May

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@neratec.com>
---
 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 = &regd->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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-10 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-09 15:27 [PATCH] cfg80211: check correct maximum bandwidth for quarter and half rate Matthias May
2015-06-09 20:29 ` Johannes Berg
2015-06-10 12:26   ` Matthias May
2015-06-10 12:35     ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).