diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-10-30 00:10:07 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-12-05 15:45:51 -0500 |
commit | 251c9ba19143caa5eb5b6ec52c77c70c9d7b3d8f (patch) | |
tree | ce58d1454542d6b27e98fd2db1c0f541777bbabe | |
parent | ba94c049e555d1701d547025f7d547a582833d03 (diff) | |
download | op-kernel-dev-251c9ba19143caa5eb5b6ec52c77c70c9d7b3d8f.zip op-kernel-dev-251c9ba19143caa5eb5b6ec52c77c70c9d7b3d8f.tar.gz |
ath: fix dynamic user regulatory domain support
As it stands dynamic user regulatory domain support is
only possible for a few programmed regulatory domains as
a few countries do not allow for this.
The existing code however only would take advantage of
the feature if a custom world regulatory domain is used
though as that's when we clear beconing flags. We need
to lift this restriction as otherwise this feature is
pointless.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/regd.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c index 4a6c232..9e15473 100644 --- a/drivers/net/wireless/ath/regd.c +++ b/drivers/net/wireless/ath/regd.c @@ -302,6 +302,7 @@ static void ath_force_no_ir_freq(struct wiphy *wiphy, u16 center_freq) static void __ath_reg_apply_beaconing_flags(struct wiphy *wiphy, + struct ath_regulatory *reg, enum nl80211_reg_initiator initiator, struct ieee80211_channel *ch) { @@ -313,6 +314,10 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy, case NL80211_REGDOM_SET_BY_COUNTRY_IE: ath_force_clear_no_ir_chan(wiphy, ch); break; + case NL80211_REGDOM_SET_BY_USER: + if (ath_reg_dyn_country_user_allow(reg)) + ath_force_clear_no_ir_chan(wiphy, ch); + break; default: if (ch->beacon_found) ch->flags &= ~IEEE80211_CHAN_NO_IR; @@ -328,6 +333,7 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy, */ static void ath_reg_apply_beaconing_flags(struct wiphy *wiphy, + struct ath_regulatory *reg, enum nl80211_reg_initiator initiator) { enum ieee80211_band band; @@ -341,8 +347,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy, sband = wiphy->bands[band]; for (i = 0; i < sband->n_channels; i++) { ch = &sband->channels[i]; - __ath_reg_apply_beaconing_flags(wiphy, initiator, ch); - + __ath_reg_apply_beaconing_flags(wiphy, reg, + initiator, ch); } } } @@ -363,7 +369,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy, */ static void ath_reg_apply_ir_flags(struct wiphy *wiphy, - enum nl80211_reg_initiator initiator) + struct ath_regulatory *reg, + enum nl80211_reg_initiator initiator) { struct ieee80211_supported_band *sband; @@ -376,6 +383,12 @@ ath_reg_apply_ir_flags(struct wiphy *wiphy, ath_force_clear_no_ir_freq(wiphy, 2467); ath_force_clear_no_ir_freq(wiphy, 2472); break; + case NL80211_REGDOM_SET_BY_USER: + if (!ath_reg_dyn_country_user_allow(reg)) + break; + ath_force_clear_no_ir_freq(wiphy, 2467); + ath_force_clear_no_ir_freq(wiphy, 2472); + break; default: ath_force_no_ir_freq(wiphy, 2467); ath_force_no_ir_freq(wiphy, 2472); @@ -424,12 +437,15 @@ static void ath_reg_apply_world_flags(struct wiphy *wiphy, case 0x66: case 0x67: case 0x6C: - ath_reg_apply_beaconing_flags(wiphy, initiator); + ath_reg_apply_beaconing_flags(wiphy, reg, initiator); break; case 0x68: - ath_reg_apply_beaconing_flags(wiphy, initiator); - ath_reg_apply_ir_flags(wiphy, initiator); + ath_reg_apply_beaconing_flags(wiphy, reg, initiator); + ath_reg_apply_ir_flags(wiphy, reg, initiator); break; + default: + if (ath_reg_dyn_country_user_allow(reg)) + ath_reg_apply_beaconing_flags(wiphy, reg, initiator); } } |