summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-11-10 11:27:19 +0100
committerLuciano Coelho <luciano.coelho@nokia.com>2010-11-22 16:45:11 +0200
commitb7417d930afdc214daa24299912d984e7f4f390a (patch)
treef17b2eed017b8ce5b86c99c728d92e5df0538043 /drivers/net/wireless/wl12xx
parent91433029e42e58d8536299f32fa55cf589adff35 (diff)
wl1271: Prevent ad-hoc and active scanning on 11a DFS frequencies
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> Tested-by: Tuomas Katila <ext-tuomas.2.katila@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx')
-rw-r--r--drivers/net/wireless/wl12xx/main.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index c00523008be..07243282e50 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/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;