All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ganapathi Bhat <ganapathi.bhat@nxp.com>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Brian Norris <briannorris@chromium.org>,
	Cathy Luo <cluo@marvell.com>, Zhiyuan Yang <yangzy@marvell.com>,
	Rakesh Parmar <rakeshp@marvell.com>,
	Ganapathi Bhat <ganapathi.bhat@nxp.com>,
	Cathy Luo <xiaohua.luo@nxp.com>
Subject: [PATCH] wireless: fix enabling channel 12 for custom regulatory domain
Date: Fri, 20 Dec 2019 10:14:32 +0000	[thread overview]
Message-ID: <1576836859-8945-1-git-send-email-ganapathi.bhat@nxp.com> (raw)

'e33e2241e272 ("Revert "cfg80211: Use 5MHz bandwidth by
default when checking usable channels"")' fixed a broken
regulatory(which leave channel 12 open for AP). We need similar
fix, in case of custom regulatory domain as well.

Signed-off-by: Cathy Luo <xiaohua.luo@nxp.com>
Signed-off-by: Ganapathi Bhat <ganapathi.bhat@nxp.com>
---
 net/wireless/reg.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 446c76d..91fa3df 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2261,14 +2261,15 @@ static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator)
 
 static void handle_channel_custom(struct wiphy *wiphy,
 				  struct ieee80211_channel *chan,
-				  const struct ieee80211_regdomain *regd)
+				  const struct ieee80211_regdomain *regd,
+				  u32 min_bw)
 {
 	u32 bw_flags = 0;
 	const struct ieee80211_reg_rule *reg_rule = NULL;
 	const struct ieee80211_power_rule *power_rule = NULL;
 	u32 bw;
 
-	for (bw = MHZ_TO_KHZ(20); bw >= MHZ_TO_KHZ(5); bw = bw / 2) {
+	for (bw = MHZ_TO_KHZ(20); bw >= min_bw; bw = bw / 2) {
 		reg_rule = freq_reg_info_regd(MHZ_TO_KHZ(chan->center_freq),
 					      regd, bw);
 		if (!IS_ERR(reg_rule))
@@ -2325,7 +2326,7 @@ static void handle_band_custom(struct wiphy *wiphy,
 		return;
 
 	for (i = 0; i < sband->n_channels; i++)
-		handle_channel_custom(wiphy, &sband->channels[i], regd);
+		handle_channel_custom(wiphy, &sband->channels[i], regd, MHZ_TO_KHZ(20));
 }
 
 /* Used by drivers prior to wiphy registration */
-- 
1.9.1


                 reply	other threads:[~2019-12-20 10:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1576836859-8945-1-git-send-email-ganapathi.bhat@nxp.com \
    --to=ganapathi.bhat@nxp.com \
    --cc=briannorris@chromium.org \
    --cc=cluo@marvell.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rakeshp@marvell.com \
    --cc=xiaohua.luo@nxp.com \
    --cc=yangzy@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.