406-ath_relax_default_regd.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --- a/drivers/net/wireless/ath/regd.c
  2. +++ b/drivers/net/wireless/ath/regd.c
  3. @@ -114,6 +114,16 @@ static const struct ieee80211_regdomain
  4. )
  5. };
  6. +static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
  7. +{
  8. + return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
  9. +}
  10. +
  11. +static bool is_default_regd(struct ath_regulatory *reg)
  12. +{
  13. + return ath_regd_get_eepromRD(reg) == CTRY_DEFAULT;
  14. +}
  15. +
  16. static bool dynamic_country_user_possible(struct ath_regulatory *reg)
  17. {
  18. if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  19. @@ -122,6 +132,9 @@ static bool dynamic_country_user_possibl
  20. if (IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
  21. return true;
  22. + if (is_default_regd(reg))
  23. + return true;
  24. +
  25. switch (reg->country_code) {
  26. case CTRY_UNITED_STATES:
  27. case CTRY_JAPAN1:
  28. @@ -207,11 +220,6 @@ static inline bool is_wwr_sku(u16 regd)
  29. (regd == WORLD));
  30. }
  31. -static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
  32. -{
  33. - return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
  34. -}
  35. -
  36. bool ath_is_world_regd(struct ath_regulatory *reg)
  37. {
  38. return is_wwr_sku(ath_regd_get_eepromRD(reg));
  39. @@ -652,6 +660,9 @@ ath_regd_init_wiphy(struct ath_regulator
  40. if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
  41. return 0;
  42. + if (is_default_regd(reg))
  43. + return 0;
  44. +
  45. wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
  46. REGULATORY_CUSTOM_REG;