aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h2
-rw-r--r--drivers/net/wireless/ath/ath5k/pcu.c13
-rw-r--r--drivers/net/wireless/ath/ath5k/phy.c1
3 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 0cba2e315d9a..4a367cdb3eb9 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1201,7 +1201,7 @@ void ath5k_hw_set_ack_bitrate_high(struct ath5k_hw *ah, bool high);
1201/* Clock rate related functions */ 1201/* Clock rate related functions */
1202unsigned int ath5k_hw_htoclock(struct ath5k_hw *ah, unsigned int usec); 1202unsigned int ath5k_hw_htoclock(struct ath5k_hw *ah, unsigned int usec);
1203unsigned int ath5k_hw_clocktoh(struct ath5k_hw *ah, unsigned int clock); 1203unsigned int ath5k_hw_clocktoh(struct ath5k_hw *ah, unsigned int clock);
1204unsigned int ath5k_hw_get_clockrate(struct ath5k_hw *ah); 1204void ath5k_hw_set_clockrate(struct ath5k_hw *ah);
1205 1205
1206/* Queue Control Unit, DFS Control Unit Functions */ 1206/* Queue Control Unit, DFS Control Unit Functions */
1207int ath5k_hw_get_tx_queueprops(struct ath5k_hw *ah, int queue, 1207int ath5k_hw_get_tx_queueprops(struct ath5k_hw *ah, int queue,
diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c
index 095d30b50ec7..074b4c644399 100644
--- a/drivers/net/wireless/ath/ath5k/pcu.c
+++ b/drivers/net/wireless/ath/ath5k/pcu.c
@@ -207,7 +207,8 @@ static int ath5k_hw_set_cts_timeout(struct ath5k_hw *ah, unsigned int timeout)
207 */ 207 */
208unsigned int ath5k_hw_htoclock(struct ath5k_hw *ah, unsigned int usec) 208unsigned int ath5k_hw_htoclock(struct ath5k_hw *ah, unsigned int usec)
209{ 209{
210 return usec * ath5k_hw_get_clockrate(ah); 210 struct ath_common *common = ath5k_hw_common(ah);
211 return usec * common->clockrate;
211} 212}
212 213
213/** 214/**
@@ -216,17 +217,19 @@ unsigned int ath5k_hw_htoclock(struct ath5k_hw *ah, unsigned int usec)
216 */ 217 */
217unsigned int ath5k_hw_clocktoh(struct ath5k_hw *ah, unsigned int clock) 218unsigned int ath5k_hw_clocktoh(struct ath5k_hw *ah, unsigned int clock)
218{ 219{
219 return clock / ath5k_hw_get_clockrate(ah); 220 struct ath_common *common = ath5k_hw_common(ah);
221 return clock / common->clockrate;
220} 222}
221 223
222/** 224/**
223 * ath5k_hw_get_clockrate - Get the clock rate for current mode 225 * ath5k_hw_set_clockrate - Set common->clockrate for the current channel
224 * 226 *
225 * @ah: The &struct ath5k_hw 227 * @ah: The &struct ath5k_hw
226 */ 228 */
227unsigned int ath5k_hw_get_clockrate(struct ath5k_hw *ah) 229void ath5k_hw_set_clockrate(struct ath5k_hw *ah)
228{ 230{
229 struct ieee80211_channel *channel = ah->ah_current_channel; 231 struct ieee80211_channel *channel = ah->ah_current_channel;
232 struct ath_common *common = ath5k_hw_common(ah);
230 int clock; 233 int clock;
231 234
232 if (channel->hw_value & CHANNEL_5GHZ) 235 if (channel->hw_value & CHANNEL_5GHZ)
@@ -240,7 +243,7 @@ unsigned int ath5k_hw_get_clockrate(struct ath5k_hw *ah)
240 if (channel->hw_value & CHANNEL_TURBO) 243 if (channel->hw_value & CHANNEL_TURBO)
241 clock *= 2; 244 clock *= 2;
242 245
243 return clock; 246 common->clockrate = clock;
244} 247}
245 248
246/** 249/**
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 61da913e7c8f..219367884e64 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -1093,6 +1093,7 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel)
1093 1093
1094 ah->ah_current_channel = channel; 1094 ah->ah_current_channel = channel;
1095 ah->ah_turbo = channel->hw_value == CHANNEL_T ? true : false; 1095 ah->ah_turbo = channel->hw_value == CHANNEL_T ? true : false;
1096 ath5k_hw_set_clockrate(ah);
1096 1097
1097 return 0; 1098 return 0;
1098} 1099}