1 --- a/drivers/net/wireless/ath/ath5k/pcu.c
2 +++ b/drivers/net/wireless/ath/ath5k/pcu.c
3 @@ -207,7 +207,8 @@ static int ath5k_hw_set_cts_timeout(stru
5 unsigned int ath5k_hw_htoclock(struct ath5k_hw *ah, unsigned int usec)
7 - return usec * ath5k_hw_get_clockrate(ah);
8 + struct ath_common *common = ath5k_hw_common(ah);
9 + return usec * common->clockrate;
13 @@ -216,17 +217,19 @@ unsigned int ath5k_hw_htoclock(struct at
15 unsigned int ath5k_hw_clocktoh(struct ath5k_hw *ah, unsigned int clock)
17 - return clock / ath5k_hw_get_clockrate(ah);
18 + struct ath_common *common = ath5k_hw_common(ah);
19 + return clock / common->clockrate;
23 - * ath5k_hw_get_clockrate - Get the clock rate for current mode
24 + * ath5k_hw_set_clockrate - Set common->clockrate for the current channel
26 * @ah: The &struct ath5k_hw
28 -unsigned int ath5k_hw_get_clockrate(struct ath5k_hw *ah)
29 +void ath5k_hw_set_clockrate(struct ath5k_hw *ah)
31 struct ieee80211_channel *channel = ah->ah_current_channel;
32 + struct ath_common *common = ath5k_hw_common(ah);
35 if (channel->hw_value & CHANNEL_5GHZ)
36 @@ -240,7 +243,7 @@ unsigned int ath5k_hw_get_clockrate(stru
37 if (channel->hw_value & CHANNEL_TURBO)
41 + common->clockrate = clock;
45 --- a/drivers/net/wireless/ath/ath5k/ath5k.h
46 +++ b/drivers/net/wireless/ath/ath5k/ath5k.h
47 @@ -1201,7 +1201,7 @@ void ath5k_hw_set_ack_bitrate_high(struc
48 /* Clock rate related functions */
49 unsigned int ath5k_hw_htoclock(struct ath5k_hw *ah, unsigned int usec);
50 unsigned int ath5k_hw_clocktoh(struct ath5k_hw *ah, unsigned int clock);
51 -unsigned int ath5k_hw_get_clockrate(struct ath5k_hw *ah);
52 +void ath5k_hw_set_clockrate(struct ath5k_hw *ah);
54 /* Queue Control Unit, DFS Control Unit Functions */
55 int ath5k_hw_get_tx_queueprops(struct ath5k_hw *ah, int queue,
56 --- a/drivers/net/wireless/ath/ath5k/phy.c
57 +++ b/drivers/net/wireless/ath/ath5k/phy.c
58 @@ -1093,6 +1093,7 @@ int ath5k_hw_channel(struct ath5k_hw *ah
60 ah->ah_current_channel = channel;
61 ah->ah_turbo = channel->hw_value == CHANNEL_T ? true : false;
62 + ath5k_hw_set_clockrate(ah);