ath9k_hw: fix 5 GHz frequency selection on AR934x/AR955x with 25 MHz refclock
authorFelix Fietkau <nbd@openwrt.org>
Fri, 13 Jul 2012 23:26:54 +0000 (01:26 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 17 Jul 2012 19:11:32 +0000 (15:11 -0400)
The old code was an accidental copy&paste of the 2.4 GHz version,
which doesn't work.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ar9003_phy.c

index d2346dbad6cd5cd56c76511e1ae3ed9d738aa214..e476f9f92ce3bed0992873283e99a4f75e78a5be 100644 (file)
@@ -117,8 +117,8 @@ static int ar9003_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
                    ah->is_clk_25mhz) {
                        u32 chan_frac;
 
-                       channelSel = (freq * 2) / 75;
-                       chan_frac = (((freq * 2) % 75) * 0x20000) / 75;
+                       channelSel = freq / 75;
+                       chan_frac = ((freq % 75) * 0x20000) / 75;
                        channelSel = (channelSel << 17) | chan_frac;
                } else {
                        channelSel = CHANSEL_5G(freq);