diff options
-rw-r--r-- | drivers/net/wireless/ath9k/regd.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/regd.h | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath9k/regd.c b/drivers/net/wireless/ath9k/regd.c index 99994626081d..979351540e69 100644 --- a/drivers/net/wireless/ath9k/regd.c +++ b/drivers/net/wireless/ath9k/regd.c | |||
@@ -106,6 +106,12 @@ static const struct ieee80211_regdomain ath9k_world_regdom_67_68_6A = { | |||
106 | } | 106 | } |
107 | }; | 107 | }; |
108 | 108 | ||
109 | static inline bool is_wwr_sku(u16 regd) | ||
110 | { | ||
111 | return ((regd & WORLD_SKU_MASK) == WORLD_SKU_PREFIX) || | ||
112 | (regd == WORLD); | ||
113 | } | ||
114 | |||
109 | static u16 ath9k_regd_get_eepromRD(struct ath_hw *ah) | 115 | static u16 ath9k_regd_get_eepromRD(struct ath_hw *ah) |
110 | { | 116 | { |
111 | return ah->regulatory.current_rd & ~WORLDWIDE_ROAMING_FLAG; | 117 | return ah->regulatory.current_rd & ~WORLDWIDE_ROAMING_FLAG; |
@@ -118,7 +124,7 @@ u16 ath9k_regd_get_rd(struct ath_hw *ah) | |||
118 | 124 | ||
119 | bool ath9k_is_world_regd(struct ath_hw *ah) | 125 | bool ath9k_is_world_regd(struct ath_hw *ah) |
120 | { | 126 | { |
121 | return isWwrSKU(ah); | 127 | return is_wwr_sku(ath9k_regd_get_eepromRD(ah)); |
122 | } | 128 | } |
123 | 129 | ||
124 | const struct ieee80211_regdomain *ath9k_default_world_regdomain(void) | 130 | const struct ieee80211_regdomain *ath9k_default_world_regdomain(void) |
@@ -463,7 +469,8 @@ u32 ath9k_regd_get_ctl(struct ath_hw *ah, struct ath9k_channel *chan) | |||
463 | u32 ctl = NO_CTL; | 469 | u32 ctl = NO_CTL; |
464 | 470 | ||
465 | if (!ah->regulatory.regpair || | 471 | if (!ah->regulatory.regpair || |
466 | (ah->regulatory.country_code == CTRY_DEFAULT && isWwrSKU(ah))) { | 472 | (ah->regulatory.country_code == CTRY_DEFAULT && |
473 | is_wwr_sku(ath9k_regd_get_eepromRD(ah)))) { | ||
467 | if (IS_CHAN_B(chan)) | 474 | if (IS_CHAN_B(chan)) |
468 | ctl = SD_NO_CTL | CTL_11B; | 475 | ctl = SD_NO_CTL | CTL_11B; |
469 | else if (IS_CHAN_G(chan)) | 476 | else if (IS_CHAN_G(chan)) |
diff --git a/drivers/net/wireless/ath9k/regd.h b/drivers/net/wireless/ath9k/regd.h index 53a9f4627f3c..8f0bfcc907b5 100644 --- a/drivers/net/wireless/ath9k/regd.h +++ b/drivers/net/wireless/ath9k/regd.h | |||
@@ -20,11 +20,6 @@ | |||
20 | #define COUNTRY_ERD_FLAG 0x8000 | 20 | #define COUNTRY_ERD_FLAG 0x8000 |
21 | #define WORLDWIDE_ROAMING_FLAG 0x4000 | 21 | #define WORLDWIDE_ROAMING_FLAG 0x4000 |
22 | 22 | ||
23 | #define isWwrSKU(_ah) \ | ||
24 | (((ath9k_regd_get_eepromRD((_ah)) & WORLD_SKU_MASK) == \ | ||
25 | WORLD_SKU_PREFIX) || \ | ||
26 | (ath9k_regd_get_eepromRD(_ah) == WORLD)) | ||
27 | |||
28 | #define MULTI_DOMAIN_MASK 0xFF00 | 23 | #define MULTI_DOMAIN_MASK 0xFF00 |
29 | 24 | ||
30 | #define WORLD_SKU_MASK 0x00F0 | 25 | #define WORLD_SKU_MASK 0x00F0 |