402-ath_regd_optional.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. --- a/drivers/net/wireless/ath/regd.c
  2. +++ b/drivers/net/wireless/ath/regd.c
  3. @@ -116,6 +116,9 @@ static const struct ieee80211_regdomain
  4. static bool dynamic_country_user_possible(struct ath_regulatory *reg)
  5. {
  6. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  7. + return true;
  8. +
  9. if (IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
  10. return true;
  11. @@ -188,6 +191,8 @@ static bool dynamic_country_user_possibl
  12. static bool ath_reg_dyn_country_user_allow(struct ath_regulatory *reg)
  13. {
  14. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  15. + return true;
  16. if (!IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_REG_HINTS))
  17. return false;
  18. if (!dynamic_country_user_possible(reg))
  19. @@ -341,6 +346,9 @@ ath_reg_apply_beaconing_flags(struct wip
  20. struct ieee80211_channel *ch;
  21. unsigned int i;
  22. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  23. + return;
  24. +
  25. for (band = 0; band < NUM_NL80211_BANDS; band++) {
  26. if (!wiphy->bands[band])
  27. continue;
  28. @@ -374,6 +382,9 @@ ath_reg_apply_ir_flags(struct wiphy *wip
  29. {
  30. struct ieee80211_supported_band *sband;
  31. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  32. + return;
  33. +
  34. sband = wiphy->bands[NL80211_BAND_2GHZ];
  35. if (!sband)
  36. return;
  37. @@ -402,6 +413,9 @@ static void ath_reg_apply_radar_flags(st
  38. struct ieee80211_channel *ch;
  39. unsigned int i;
  40. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  41. + return;
  42. +
  43. if (!wiphy->bands[NL80211_BAND_5GHZ])
  44. return;
  45. @@ -634,6 +648,10 @@ ath_regd_init_wiphy(struct ath_regulator
  46. const struct ieee80211_regdomain *regd;
  47. wiphy->reg_notifier = reg_notifier;
  48. +
  49. + if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  50. + return 0;
  51. +
  52. wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
  53. REGULATORY_CUSTOM_REG;
  54. --- a/drivers/net/wireless/ath/Kconfig
  55. +++ b/drivers/net/wireless/ath/Kconfig
  56. @@ -23,6 +23,9 @@ config WLAN_VENDOR_ATH
  57. if WLAN_VENDOR_ATH
  58. +config ATH_USER_REGD
  59. + bool "Do not enforce EEPROM regulatory restrictions"
  60. +
  61. config ATH_DEBUG
  62. bool "Atheros wireless debugging"
  63. ---help---
  64. --- a/.local-symbols
  65. +++ b/.local-symbols
  66. @@ -130,6 +130,7 @@ ADM8211=
  67. ATH_COMMON=
  68. WLAN_VENDOR_ATH=
  69. ATH_DEBUG=
  70. +ATH_USER_REGD=
  71. ATH_TRACEPOINTS=
  72. ATH_REG_DYNAMIC_USER_REG_HINTS=
  73. ATH_REG_DYNAMIC_USER_CERT_TESTING=