diff mbox

mwifiex: apply radar flag

Message ID 1490870450-6601-1-git-send-email-akarwar@marvell.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Amitkumar Karwar March 30, 2017, 10:40 a.m. UTC
From: Karthik D A <karthida@marvell.com>

When IEEE80211_CHAN_RADAR is set by cfg80211, passive scan must be
performed. In mwifiex,active scan is performed even though flag is
set from cfg80211. mwifiex_reg_apply_radar_flags() function added
in this patch correctly uses radar flag.

Signed-off-by: Karthik D A <karthida@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Kalle Valo April 5, 2017, 10:48 a.m. UTC | #1
Amitkumar Karwar <akarwar@marvell.com> wrote:
> From: Karthik D A <karthida@marvell.com>
> 
> When IEEE80211_CHAN_RADAR is set by cfg80211, passive scan must be
> performed. In mwifiex,active scan is performed even though flag is
> set from cfg80211. mwifiex_reg_apply_radar_flags() function added
> in this patch correctly uses radar flag.
> 
> Signed-off-by: Karthik D A <karthida@marvell.com>
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>

Please use Karthik's full name.

Patch set to Changes Requested.
Ganapathi Bhat April 5, 2017, 11:18 a.m. UTC | #2
> From: Kalle Valo [mailto:kvalo@codeaurora.org]

> Sent: Wednesday, April 05, 2017 4:19 PM

> To: Amitkumar Karwar

> Cc: linux-wireless@vger.kernel.org; Ganapathi Bhat; Karthik

> Doddayennegere Ananthapadmanabha; Amitkumar Karwar

> Subject: [EXT] Re: mwifiex: apply radar flag

> 

> Amitkumar Karwar <akarwar@marvell.com> wrote:

> > From: Karthik D A <karthida@marvell.com>

> >

> > When IEEE80211_CHAN_RADAR is set by cfg80211, passive scan must be

> > performed. In mwifiex,active scan is performed even though flag is

> set

> > from cfg80211. mwifiex_reg_apply_radar_flags() function added in this

> > patch correctly uses radar flag.

> >

> > Signed-off-by: Karthik D A <karthida@marvell.com>

> > Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>

> 

> Please use Karthik's full name.


Ok Kalle. I will submit v2 with correction.

> 

> Patch set to Changes Requested.

> 

> --



Regards,
Ganapathi
diff mbox

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 1e3bd43..44d0617 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -594,6 +594,24 @@  int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy)
 	return 0;
 }
 
+static void mwifiex_reg_apply_radar_flags(struct wiphy *wiphy)
+{
+	struct ieee80211_supported_band *sband;
+	struct ieee80211_channel *chan;
+	unsigned int i;
+
+	if (!wiphy->bands[NL80211_BAND_5GHZ])
+		return;
+	sband = wiphy->bands[NL80211_BAND_5GHZ];
+
+	for (i = 0; i < sband->n_channels; i++) {
+		chan = &sband->channels[i];
+		if ((!(chan->flags & IEEE80211_CHAN_DISABLED)) &&
+		    (chan->flags & IEEE80211_CHAN_RADAR))
+			chan->flags |= IEEE80211_CHAN_NO_IR;
+	}
+}
+
 /*
  * CFG802.11 regulatory domain callback function.
  *
@@ -613,6 +631,7 @@  static void mwifiex_reg_notifier(struct wiphy *wiphy,
 	mwifiex_dbg(adapter, INFO,
 		    "info: cfg80211 regulatory domain callback for %c%c\n",
 		    request->alpha2[0], request->alpha2[1]);
+	mwifiex_reg_apply_radar_flags(wiphy);
 
 	switch (request->initiator) {
 	case NL80211_REGDOM_SET_BY_DRIVER: