aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2009-04-30 15:55:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:56 -0400
commit6752ee90aa7c933294a10dbd9ea51f12dece7eb1 (patch)
treea978d68cb53a9389ad01f4ae27cde0d36ad84bee
parent57e6c56dbb52d680f61dd629759fe2974840ed93 (diff)
ath5k: use ctl settings based on current regdomain
Update ath5k to use the ctl settings for tx power based on current regulatory domain. Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath5k/phy.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 6737ba0a4de3..d0d1c350025a 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -2158,8 +2158,6 @@ done:
2158 * Get the max edge power for this channel if 2158 * Get the max edge power for this channel if
2159 * we have such data from EEPROM's Conformance Test 2159 * we have such data from EEPROM's Conformance Test
2160 * Limits (CTL), and limit max power if needed. 2160 * Limits (CTL), and limit max power if needed.
2161 *
2162 * FIXME: Only works for world regulatory domains
2163 */ 2161 */
2164static void 2162static void
2165ath5k_get_max_ctl_power(struct ath5k_hw *ah, 2163ath5k_get_max_ctl_power(struct ath5k_hw *ah,
@@ -2175,26 +2173,23 @@ ath5k_get_max_ctl_power(struct ath5k_hw *ah,
2175 u8 ctl_idx = 0xFF; 2173 u8 ctl_idx = 0xFF;
2176 u32 target = channel->center_freq; 2174 u32 target = channel->center_freq;
2177 2175
2178 /* Find out a CTL for our mode that's not mapped 2176 ctl_mode = ath_regd_get_band_ctl(&ah->ah_regulatory, channel->band);
2179 * on a specific reg domain. 2177
2180 *
2181 * TODO: Map our current reg domain to one of the 3 available
2182 * reg domain ids so that we can support more CTLs. */
2183 switch (channel->hw_value & CHANNEL_MODES) { 2178 switch (channel->hw_value & CHANNEL_MODES) {
2184 case CHANNEL_A: 2179 case CHANNEL_A:
2185 ctl_mode = AR5K_CTL_11A | AR5K_CTL_NO_REGDOMAIN; 2180 ctl_mode |= AR5K_CTL_11A;
2186 break; 2181 break;
2187 case CHANNEL_G: 2182 case CHANNEL_G:
2188 ctl_mode = AR5K_CTL_11G | AR5K_CTL_NO_REGDOMAIN; 2183 ctl_mode |= AR5K_CTL_11G;
2189 break; 2184 break;
2190 case CHANNEL_B: 2185 case CHANNEL_B:
2191 ctl_mode = AR5K_CTL_11B | AR5K_CTL_NO_REGDOMAIN; 2186 ctl_mode |= AR5K_CTL_11B;
2192 break; 2187 break;
2193 case CHANNEL_T: 2188 case CHANNEL_T:
2194 ctl_mode = AR5K_CTL_TURBO | AR5K_CTL_NO_REGDOMAIN; 2189 ctl_mode |= AR5K_CTL_TURBO;
2195 break; 2190 break;
2196 case CHANNEL_TG: 2191 case CHANNEL_TG:
2197 ctl_mode = AR5K_CTL_TURBOG | AR5K_CTL_NO_REGDOMAIN; 2192 ctl_mode |= AR5K_CTL_TURBOG;
2198 break; 2193 break;
2199 case CHANNEL_XR: 2194 case CHANNEL_XR:
2200 /* Fall through */ 2195 /* Fall through */