diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-10-14 20:42:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-10-18 14:04:41 -0400 |
commit | 94e7876daa4396d7a997d57dfcceaab6851bd017 (patch) | |
tree | 4ed9b6036dc982c150088dc49158c136e35972ac /drivers/net/wireless/ath/regd.c | |
parent | 4da225bbc366a4efd6458636c155b34ac9784d4b (diff) |
ath: add support for proper dynamic regulatory hints
This enables support for dynamic user regulatory hints.
This is enabled only when CFG80211_CERTIFICATION_ONUS
is selected. For US and JP this is explicitly disabled
unless the systems are being used for strict controlled
testing.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/regd.c')
-rw-r--r-- | drivers/net/wireless/ath/regd.c | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c index 7222eebba47e..c00687e05688 100644 --- a/drivers/net/wireless/ath/regd.c +++ b/drivers/net/wireless/ath/regd.c | |||
@@ -392,6 +392,89 @@ static void ath_reg_dyn_country(struct wiphy *wiphy, | |||
392 | reg_initiator_name(request->initiator)); | 392 | reg_initiator_name(request->initiator)); |
393 | } | 393 | } |
394 | 394 | ||
395 | static bool dynamic_country_user_possible(struct ath_regulatory *reg) | ||
396 | { | ||
397 | if (config_enabled(CONFIG_ATH_REG_DYNAMIC_USER_CERT_TESTING)) | ||
398 | return true; | ||
399 | |||
400 | switch (reg->country_code) { | ||
401 | case CTRY_UNITED_STATES: | ||
402 | case CTRY_JAPAN1: | ||
403 | case CTRY_JAPAN2: | ||
404 | case CTRY_JAPAN3: | ||
405 | case CTRY_JAPAN4: | ||
406 | case CTRY_JAPAN5: | ||
407 | case CTRY_JAPAN6: | ||
408 | case CTRY_JAPAN7: | ||
409 | case CTRY_JAPAN8: | ||
410 | case CTRY_JAPAN9: | ||
411 | case CTRY_JAPAN10: | ||
412 | case CTRY_JAPAN11: | ||
413 | case CTRY_JAPAN12: | ||
414 | case CTRY_JAPAN13: | ||
415 | case CTRY_JAPAN14: | ||
416 | case CTRY_JAPAN15: | ||
417 | case CTRY_JAPAN16: | ||
418 | case CTRY_JAPAN17: | ||
419 | case CTRY_JAPAN18: | ||
420 | case CTRY_JAPAN19: | ||
421 | case CTRY_JAPAN20: | ||
422 | case CTRY_JAPAN21: | ||
423 | case CTRY_JAPAN22: | ||
424 | case CTRY_JAPAN23: | ||
425 | case CTRY_JAPAN24: | ||
426 | case CTRY_JAPAN25: | ||
427 | case CTRY_JAPAN26: | ||
428 | case CTRY_JAPAN27: | ||
429 | case CTRY_JAPAN28: | ||
430 | case CTRY_JAPAN29: | ||
431 | case CTRY_JAPAN30: | ||
432 | case CTRY_JAPAN31: | ||
433 | case CTRY_JAPAN32: | ||
434 | case CTRY_JAPAN33: | ||
435 | case CTRY_JAPAN34: | ||
436 | case CTRY_JAPAN35: | ||
437 | case CTRY_JAPAN36: | ||
438 | case CTRY_JAPAN37: | ||
439 | case CTRY_JAPAN38: | ||
440 | case CTRY_JAPAN39: | ||
441 | case CTRY_JAPAN40: | ||
442 | case CTRY_JAPAN41: | ||
443 | case CTRY_JAPAN42: | ||
444 | case CTRY_JAPAN43: | ||
445 | case CTRY_JAPAN44: | ||
446 | case CTRY_JAPAN45: | ||
447 | case CTRY_JAPAN46: | ||
448 | case CTRY_JAPAN47: | ||
449 | case CTRY_JAPAN48: | ||
450 | case CTRY_JAPAN49: | ||
451 | case CTRY_JAPAN50: | ||
452 | case CTRY_JAPAN51: | ||
453 | case CTRY_JAPAN52: | ||
454 | case CTRY_JAPAN53: | ||
455 | case CTRY_JAPAN54: | ||
456 | case CTRY_JAPAN55: | ||
457 | case CTRY_JAPAN56: | ||
458 | case CTRY_JAPAN57: | ||
459 | case CTRY_JAPAN58: | ||
460 | case CTRY_JAPAN59: | ||
461 | return false; | ||
462 | } | ||
463 | |||
464 | return true; | ||
465 | } | ||
466 | |||
467 | static void ath_reg_dyn_country_user(struct wiphy *wiphy, | ||
468 | struct ath_regulatory *reg, | ||
469 | struct regulatory_request *request) | ||
470 | { | ||
471 | if (!config_enabled(CONFIG_ATH_REG_DYNAMIC_USER_REG_HINTS)) | ||
472 | return; | ||
473 | if (!dynamic_country_user_possible(reg)) | ||
474 | return; | ||
475 | ath_reg_dyn_country(wiphy, reg, request); | ||
476 | } | ||
477 | |||
395 | void ath_reg_notifier_apply(struct wiphy *wiphy, | 478 | void ath_reg_notifier_apply(struct wiphy *wiphy, |
396 | struct regulatory_request *request, | 479 | struct regulatory_request *request, |
397 | struct ath_regulatory *reg) | 480 | struct ath_regulatory *reg) |
@@ -424,6 +507,7 @@ void ath_reg_notifier_apply(struct wiphy *wiphy, | |||
424 | case NL80211_REGDOM_SET_BY_DRIVER: | 507 | case NL80211_REGDOM_SET_BY_DRIVER: |
425 | break; | 508 | break; |
426 | case NL80211_REGDOM_SET_BY_USER: | 509 | case NL80211_REGDOM_SET_BY_USER: |
510 | ath_reg_dyn_country_user(wiphy, reg, request); | ||
427 | break; | 511 | break; |
428 | case NL80211_REGDOM_SET_BY_COUNTRY_IE: | 512 | case NL80211_REGDOM_SET_BY_COUNTRY_IE: |
429 | ath_reg_dyn_country(wiphy, reg, request); | 513 | ath_reg_dyn_country(wiphy, reg, request); |