Commit 251c9ba1 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

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: default avatarLuis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ba94c049
...@@ -302,6 +302,7 @@ static void ath_force_no_ir_freq(struct wiphy *wiphy, u16 center_freq) ...@@ -302,6 +302,7 @@ static void ath_force_no_ir_freq(struct wiphy *wiphy, u16 center_freq)
static void static void
__ath_reg_apply_beaconing_flags(struct wiphy *wiphy, __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
struct ath_regulatory *reg,
enum nl80211_reg_initiator initiator, enum nl80211_reg_initiator initiator,
struct ieee80211_channel *ch) struct ieee80211_channel *ch)
{ {
...@@ -313,6 +314,10 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy, ...@@ -313,6 +314,10 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
case NL80211_REGDOM_SET_BY_COUNTRY_IE: case NL80211_REGDOM_SET_BY_COUNTRY_IE:
ath_force_clear_no_ir_chan(wiphy, ch); ath_force_clear_no_ir_chan(wiphy, ch);
break; 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: default:
if (ch->beacon_found) if (ch->beacon_found)
ch->flags &= ~IEEE80211_CHAN_NO_IR; ch->flags &= ~IEEE80211_CHAN_NO_IR;
...@@ -328,6 +333,7 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy, ...@@ -328,6 +333,7 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
*/ */
static void static void
ath_reg_apply_beaconing_flags(struct wiphy *wiphy, ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
struct ath_regulatory *reg,
enum nl80211_reg_initiator initiator) enum nl80211_reg_initiator initiator)
{ {
enum ieee80211_band band; enum ieee80211_band band;
...@@ -341,8 +347,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy, ...@@ -341,8 +347,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
sband = wiphy->bands[band]; sband = wiphy->bands[band];
for (i = 0; i < sband->n_channels; i++) { for (i = 0; i < sband->n_channels; i++) {
ch = &sband->channels[i]; ch = &sband->channels[i];
__ath_reg_apply_beaconing_flags(wiphy, initiator, ch); __ath_reg_apply_beaconing_flags(wiphy, reg,
initiator, ch);
} }
} }
} }
...@@ -363,6 +369,7 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy, ...@@ -363,6 +369,7 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
*/ */
static void static void
ath_reg_apply_ir_flags(struct wiphy *wiphy, ath_reg_apply_ir_flags(struct wiphy *wiphy,
struct ath_regulatory *reg,
enum nl80211_reg_initiator initiator) enum nl80211_reg_initiator initiator)
{ {
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
...@@ -376,6 +383,12 @@ ath_reg_apply_ir_flags(struct wiphy *wiphy, ...@@ -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, 2467);
ath_force_clear_no_ir_freq(wiphy, 2472); ath_force_clear_no_ir_freq(wiphy, 2472);
break; 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: default:
ath_force_no_ir_freq(wiphy, 2467); ath_force_no_ir_freq(wiphy, 2467);
ath_force_no_ir_freq(wiphy, 2472); ath_force_no_ir_freq(wiphy, 2472);
...@@ -424,12 +437,15 @@ static void ath_reg_apply_world_flags(struct wiphy *wiphy, ...@@ -424,12 +437,15 @@ static void ath_reg_apply_world_flags(struct wiphy *wiphy,
case 0x66: case 0x66:
case 0x67: case 0x67:
case 0x6C: case 0x6C:
ath_reg_apply_beaconing_flags(wiphy, initiator); ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
break; break;
case 0x68: case 0x68:
ath_reg_apply_beaconing_flags(wiphy, initiator); ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
ath_reg_apply_ir_flags(wiphy, initiator); ath_reg_apply_ir_flags(wiphy, reg, initiator);
break; break;
default:
if (ath_reg_dyn_country_user_allow(reg))
ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment