From 1ed19c13ce0169c1fe91d3389166e105f891c0a8 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Wed, 28 Jan 2009 12:17:49 -0800 Subject: [PATCH] --- yaml --- r: 134377 b: refs/heads/master c: 7519a8f0778bdb14f07cf685fa5fee6ab07e734c h: refs/heads/master i: 134375: acaff59f04f9515c7febfd6ba054e4ffbe227811 v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/ath9k/regd.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 5eecf3695019..d4552236b249 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 547e4c2e64d0be5e8491abb49ee6b0f0f8272de1 +refs/heads/master: 7519a8f0778bdb14f07cf685fa5fee6ab07e734c diff --git a/trunk/drivers/net/wireless/ath9k/regd.c b/trunk/drivers/net/wireless/ath9k/regd.c index cccec40139c2..dfcc3b5274cb 100644 --- a/trunk/drivers/net/wireless/ath9k/regd.c +++ b/trunk/drivers/net/wireless/ath9k/regd.c @@ -160,8 +160,12 @@ static bool ath9k_is_radar_freq(u16 center_freq) return (center_freq >= 5260 && center_freq <= 5700); } -/* Enable adhoc on 5 GHz if allowed by 11d */ -static void ath9k_reg_apply_5ghz_adhoc_flags(struct wiphy *wiphy, +/* + * Enable adhoc on 5 GHz if allowed by 11d. + * Remove passive scan if channel is allowed by 11d, + * except when on radar frequencies. + */ +static void ath9k_reg_apply_5ghz_beaconing_flags(struct wiphy *wiphy, enum reg_set_by setby) { struct ieee80211_supported_band *sband; @@ -189,6 +193,10 @@ static void ath9k_reg_apply_5ghz_adhoc_flags(struct wiphy *wiphy, * probe */ if (!(reg_rule->flags & NL80211_RRF_NO_IBSS)) ch->flags &= ~NL80211_RRF_NO_IBSS; + if (!ath9k_is_radar_freq(ch->center_freq)) + continue; + if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) + ch->flags &= ~NL80211_RRF_PASSIVE_SCAN; } } @@ -283,10 +291,10 @@ void ath9k_reg_apply_world_flags(struct wiphy *wiphy, enum reg_set_by setby) case 0x63: case 0x66: case 0x67: - ath9k_reg_apply_5ghz_adhoc_flags(wiphy, setby); + ath9k_reg_apply_5ghz_beaconing_flags(wiphy, setby); break; case 0x68: - ath9k_reg_apply_5ghz_adhoc_flags(wiphy, setby); + ath9k_reg_apply_5ghz_beaconing_flags(wiphy, setby); ath9k_reg_apply_active_scan_flags(wiphy, setby); break; }