406-ath_relax_default_regd.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --- a/drivers/net/wireless/ath/regd.c
  2. +++ b/drivers/net/wireless/ath/regd.c
  3. @@ -114,10 +114,22 @@ 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 (config_enabled(CPTCFG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
  19. return true;
  20. + if (is_default_regd(reg))
  21. + return true;
  22. switch (reg->country_code) {
  23. case CTRY_UNITED_STATES:
  24. @@ -202,11 +214,6 @@ static inline bool is_wwr_sku(u16 regd)
  25. (regd == WORLD));
  26. }
  27. -static u16 ath_regd_get_eepromRD(struct ath_regulatory *reg)
  28. -{
  29. - return reg->current_rd & ~WORLDWIDE_ROAMING_FLAG;
  30. -}
  31. -
  32. bool ath_is_world_regd(struct ath_regulatory *reg)
  33. {
  34. return is_wwr_sku(ath_regd_get_eepromRD(reg));
  35. @@ -650,6 +657,9 @@ ath_regd_init_wiphy(struct ath_regulator
  36. return 0;
  37. #endif
  38. + if (is_default_regd(reg))
  39. + return 0;
  40. +
  41. wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
  42. REGULATORY_CUSTOM_REG;