linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] wl1271: Prevent ad-hoc and active scanning on 11a DFS frequencies
@ 2010-11-10 10:27 juuso.oikarinen
  2010-11-10 10:27 ` [PATCH 2/2] Revert "wl1271: Change supported channel order for a more optimal scan" juuso.oikarinen
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: juuso.oikarinen @ 2010-11-10 10:27 UTC (permalink / raw)
  To: luciano.coelho; +Cc: linux-wireless

From: Juuso Oikarinen <juuso.oikarinen@nokia.com>

The wl1271 does not support radar detection. Hence, prevent ad-hoc and
active scanning on frequencies requiring DFS.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
---
 drivers/net/wireless/wl12xx/wl1271_main.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index f5b1d19..eb9f821 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -335,6 +335,27 @@ out:
 	return NOTIFY_OK;
 }
 
+static int wl1271_reg_notify(struct wiphy *wiphy,
+			     struct regulatory_request *request) {
+	struct ieee80211_supported_band *band;
+	struct ieee80211_channel *ch;
+	int i;
+
+	band = wiphy->bands[IEEE80211_BAND_5GHZ];
+	for (i = 0; i < band->n_channels; i++) {
+		ch = &band->channels[i];
+		if (ch->flags % IEEE80211_CHAN_DISABLED)
+			continue;
+
+		if (ch->flags & IEEE80211_CHAN_RADAR)
+			ch->flags |= IEEE80211_CHAN_NO_IBSS |
+				     IEEE80211_CHAN_PASSIVE_SCAN;
+
+	}
+
+	return 0;
+}
+
 static void wl1271_conf_init(struct wl1271 *wl)
 {
 
@@ -2590,6 +2611,8 @@ int wl1271_init_ieee80211(struct wl1271 *wl)
 	wl->hw->queues = 4;
 	wl->hw->max_rates = 1;
 
+	wl->hw->wiphy->reg_notifier = wl1271_reg_notify;
+
 	SET_IEEE80211_DEV(wl->hw, wl1271_wl_to_dev(wl));
 
 	return 0;
-- 
1.7.1


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

end of thread, other threads:[~2010-11-22  6:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-10 10:27 [PATCH 1/2] wl1271: Prevent ad-hoc and active scanning on 11a DFS frequencies juuso.oikarinen
2010-11-10 10:27 ` [PATCH 2/2] Revert "wl1271: Change supported channel order for a more optimal scan" juuso.oikarinen
2010-11-10 11:18   ` Gery Kahn
2010-11-10 11:21     ` Juuso Oikarinen
2010-11-10 11:36       ` Gery Kahn
2010-11-10 11:42         ` Juuso Oikarinen
2010-11-11 19:47           ` Gery Kahn
2010-11-10 11:02 ` [PATCH 1/2] wl1271: Prevent ad-hoc and active scanning on 11a DFS frequencies Tuomas Katila
2010-11-11  9:35 ` Luciano Coelho
2010-11-11 12:15 ` Luciano Coelho
2010-11-17  6:52 ` Gabay, Benzy
2010-11-17  7:00   ` Juuso Oikarinen
2010-11-17  8:25     ` Gabay, Benzy
2010-11-17  8:34       ` Juuso Oikarinen
2010-11-17  9:57         ` Bruno Randolf

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).