diff options
author | Nick Kossifidis <mickflemm@gmail.com> | 2010-11-23 14:48:32 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-30 13:53:44 -0500 |
commit | 73a06a683455f472cc09ad249064c66a41e29e39 (patch) | |
tree | 44679588073799d3031a88ec590e5ce9a9d30897 /drivers/net | |
parent | 3bb17654605965226e5b322dbc22ece5ff354ac5 (diff) |
ath5k: Use correct clock when setting ofdm timings
* Use correct clock value when setting OFDM timings on
non-default bwmodes.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/phy.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index 31239ab6a00..95b602b4f44 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c | |||
@@ -228,8 +228,20 @@ static inline int ath5k_hw_write_ofdm_timings(struct ath5k_hw *ah, | |||
228 | * ALGO: coef = (5 * clock / carrier_freq) / 2 | 228 | * ALGO: coef = (5 * clock / carrier_freq) / 2 |
229 | * we scale coef by shifting clock value by 24 for | 229 | * we scale coef by shifting clock value by 24 for |
230 | * better precision since we use integers */ | 230 | * better precision since we use integers */ |
231 | /* TODO: Half/quarter rate */ | 231 | switch (ah->ah_bwmode) { |
232 | clock = (channel->hw_value & CHANNEL_TURBO) ? 80 : 40; | 232 | case AR5K_BWMODE_40MHZ: |
233 | clock = 40 * 2; | ||
234 | break; | ||
235 | case AR5K_BWMODE_10MHZ: | ||
236 | clock = 40 / 2; | ||
237 | break; | ||
238 | case AR5K_BWMODE_5MHZ: | ||
239 | clock = 40 / 4; | ||
240 | break; | ||
241 | default: | ||
242 | clock = 40; | ||
243 | break; | ||
244 | } | ||
233 | coef_scaled = ((5 * (clock << 24)) / 2) / channel->center_freq; | 245 | coef_scaled = ((5 * (clock << 24)) / 2) / channel->center_freq; |
234 | 246 | ||
235 | /* Get exponent | 247 | /* Get exponent |