aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-10-29 19:10:07 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-12-05 15:45:51 -0500
commit251c9ba19143caa5eb5b6ec52c77c70c9d7b3d8f (patch)
treece58d1454542d6b27e98fd2db1c0f541777bbabe
parentba94c049e555d1701d547025f7d547a582833d03 (diff)
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.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 4a6c232c6c9b..9e154732afaa 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)
302 302
303static void 303static void
304__ath_reg_apply_beaconing_flags(struct wiphy *wiphy, 304__ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
305 struct ath_regulatory *reg,
305 enum nl80211_reg_initiator initiator, 306 enum nl80211_reg_initiator initiator,
306 struct ieee80211_channel *ch) 307 struct ieee80211_channel *ch)
307{ 308{
@@ -313,6 +314,10 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
313 case NL80211_REGDOM_SET_BY_COUNTRY_IE: 314 case NL80211_REGDOM_SET_BY_COUNTRY_IE:
314 ath_force_clear_no_ir_chan(wiphy, ch); 315 ath_force_clear_no_ir_chan(wiphy, ch);
315 break; 316 break;
317 case NL80211_REGDOM_SET_BY_USER:
318 if (ath_reg_dyn_country_user_allow(reg))
319 ath_force_clear_no_ir_chan(wiphy, ch);
320 break;
316 default: 321 default:
317 if (ch->beacon_found) 322 if (ch->beacon_found)
318 ch->flags &= ~IEEE80211_CHAN_NO_IR; 323 ch->flags &= ~IEEE80211_CHAN_NO_IR;
@@ -328,6 +333,7 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
328 */ 333 */
329static void 334static void
330ath_reg_apply_beaconing_flags(struct wiphy *wiphy, 335ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
336 struct ath_regulatory *reg,
331 enum nl80211_reg_initiator initiator) 337 enum nl80211_reg_initiator initiator)
332{ 338{
333 enum ieee80211_band band; 339 enum ieee80211_band band;
@@ -341,8 +347,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
341 sband = wiphy->bands[band]; 347 sband = wiphy->bands[band];
342 for (i = 0; i < sband->n_channels; i++) { 348 for (i = 0; i < sband->n_channels; i++) {
343 ch = &sband->channels[i]; 349 ch = &sband->channels[i];
344 __ath_reg_apply_beaconing_flags(wiphy, initiator, ch); 350 __ath_reg_apply_beaconing_flags(wiphy, reg,
345 351 initiator, ch);
346 } 352 }
347 } 353 }
348} 354}
@@ -363,7 +369,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
363 */ 369 */
364static void 370static void
365ath_reg_apply_ir_flags(struct wiphy *wiphy, 371ath_reg_apply_ir_flags(struct wiphy *wiphy,
366 enum nl80211_reg_initiator initiator) 372 struct ath_regulatory *reg,
373 enum nl80211_reg_initiator initiator)
367{ 374{
368 struct ieee80211_supported_band *sband; 375 struct ieee80211_supported_band *sband;
369 376
@@ -376,6 +383,12 @@ ath_reg_apply_ir_flags(struct wiphy *wiphy,
376 ath_force_clear_no_ir_freq(wiphy, 2467); 383 ath_force_clear_no_ir_freq(wiphy, 2467);
377 ath_force_clear_no_ir_freq(wiphy, 2472); 384 ath_force_clear_no_ir_freq(wiphy, 2472);
378 break; 385 break;
386 case NL80211_REGDOM_SET_BY_USER:
387 if (!ath_reg_dyn_country_user_allow(reg))
388 break;
389 ath_force_clear_no_ir_freq(wiphy, 2467);
390 ath_force_clear_no_ir_freq(wiphy, 2472);
391 break;
379 default: 392 default:
380 ath_force_no_ir_freq(wiphy, 2467); 393 ath_force_no_ir_freq(wiphy, 2467);
381 ath_force_no_ir_freq(wiphy, 2472); 394 ath_force_no_ir_freq(wiphy, 2472);
@@ -424,12 +437,15 @@ static void ath_reg_apply_world_flags(struct wiphy *wiphy,
424 case 0x66: 437 case 0x66:
425 case 0x67: 438 case 0x67:
426 case 0x6C: 439 case 0x6C:
427 ath_reg_apply_beaconing_flags(wiphy, initiator); 440 ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
428 break; 441 break;
429 case 0x68: 442 case 0x68:
430 ath_reg_apply_beaconing_flags(wiphy, initiator); 443 ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
431 ath_reg_apply_ir_flags(wiphy, initiator); 444 ath_reg_apply_ir_flags(wiphy, reg, initiator);
432 break; 445 break;
446 default:
447 if (ath_reg_dyn_country_user_allow(reg))
448 ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
433 } 449 }
434} 450}
435 451