402-ath_regd_optional.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. --- a/drivers/net/wireless/ath/regd.c
  2. +++ b/drivers/net/wireless/ath/regd.c
  3. @@ -24,6 +24,7 @@
  4. #include "regd_common.h"
  5. static int __ath_regd_init(struct ath_regulatory *reg);
  6. +static struct reg_dmn_pair_mapping *ath_get_regpair(int regdmn);
  7. /*
  8. * This is a set of common rules used by our world regulatory domains.
  9. @@ -116,6 +117,9 @@ static const struct ieee80211_regdomain
  10. static bool dynamic_country_user_possible(struct ath_regulatory *reg)
  11. {
  12. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  13. + return true;
  14. +
  15. if (IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
  16. return true;
  17. @@ -188,6 +192,8 @@ static bool dynamic_country_user_possibl
  18. static bool ath_reg_dyn_country_user_allow(struct ath_regulatory *reg)
  19. {
  20. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  21. + return true;
  22. if (!IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_REG_HINTS))
  23. return false;
  24. if (!dynamic_country_user_possible(reg))
  25. @@ -345,6 +351,9 @@ ath_reg_apply_beaconing_flags(struct wip
  26. struct ieee80211_channel *ch;
  27. unsigned int i;
  28. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  29. + return;
  30. +
  31. for (band = 0; band < NUM_NL80211_BANDS; band++) {
  32. if (!wiphy->bands[band])
  33. continue;
  34. @@ -379,6 +388,9 @@ ath_reg_apply_ir_flags(struct wiphy *wip
  35. {
  36. struct ieee80211_supported_band *sband;
  37. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  38. + return;
  39. +
  40. sband = wiphy->bands[NL80211_BAND_2GHZ];
  41. if (!sband)
  42. return;
  43. @@ -408,6 +420,9 @@ static void ath_reg_apply_radar_flags(st
  44. struct ieee80211_channel *ch;
  45. unsigned int i;
  46. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  47. + return;
  48. +
  49. if (!wiphy->bands[NL80211_BAND_5GHZ])
  50. return;
  51. @@ -640,6 +655,10 @@ ath_regd_init_wiphy(struct ath_regulator
  52. const struct ieee80211_regdomain *regd;
  53. wiphy->reg_notifier = reg_notifier;
  54. +
  55. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  56. + return 0;
  57. +
  58. wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
  59. REGULATORY_CUSTOM_REG;
  60. --- a/drivers/net/wireless/ath/Kconfig
  61. +++ b/drivers/net/wireless/ath/Kconfig
  62. @@ -24,6 +24,9 @@ config WLAN_VENDOR_ATH
  63. if WLAN_VENDOR_ATH
  64. +config ATH_USER_REGD
  65. + bool "Do not enforce EEPROM regulatory restrictions"
  66. +
  67. config ATH_DEBUG
  68. bool "Atheros wireless debugging"
  69. help
  70. --- a/local-symbols
  71. +++ b/local-symbols
  72. @@ -102,6 +102,7 @@ ADM8211=
  73. ATH_COMMON=
  74. WLAN_VENDOR_ATH=
  75. ATH_DEBUG=
  76. +ATH_USER_REGD=
  77. ATH_TRACEPOINTS=
  78. ATH_REG_DYNAMIC_USER_REG_HINTS=
  79. ATH_REG_DYNAMIC_USER_CERT_TESTING=