Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath5k: store the clock rate in common data on channel changes

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Felix Fietkau and committed by
John W. Linville
9d119f3e dfdac8ac

+10 -6
+1 -1
drivers/net/wireless/ath/ath5k/ath5k.h
··· 1201 1201 /* Clock rate related functions */ 1202 1202 unsigned int ath5k_hw_htoclock(struct ath5k_hw *ah, unsigned int usec); 1203 1203 unsigned int ath5k_hw_clocktoh(struct ath5k_hw *ah, unsigned int clock); 1204 - unsigned int ath5k_hw_get_clockrate(struct ath5k_hw *ah); 1204 + void ath5k_hw_set_clockrate(struct ath5k_hw *ah); 1205 1205 1206 1206 /* Queue Control Unit, DFS Control Unit Functions */ 1207 1207 int ath5k_hw_get_tx_queueprops(struct ath5k_hw *ah, int queue,
+8 -5
drivers/net/wireless/ath/ath5k/pcu.c
··· 207 207 */ 208 208 unsigned 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 /** ··· 217 216 */ 218 217 unsigned int ath5k_hw_clocktoh(struct ath5k_hw *ah, unsigned int clock) 219 218 { 220 - return clock / ath5k_hw_get_clockrate(ah); 219 + struct ath_common *common = ath5k_hw_common(ah); 220 + return clock / common->clockrate; 221 221 } 222 222 223 223 /** 224 - * ath5k_hw_get_clockrate - Get the clock rate for current mode 224 + * ath5k_hw_set_clockrate - Set common->clockrate for the current channel 225 225 * 226 226 * @ah: The &struct ath5k_hw 227 227 */ 228 - unsigned int ath5k_hw_get_clockrate(struct ath5k_hw *ah) 228 + void ath5k_hw_set_clockrate(struct ath5k_hw *ah) 229 229 { 230 230 struct ieee80211_channel *channel = ah->ah_current_channel; 231 + struct ath_common *common = ath5k_hw_common(ah); 231 232 int clock; 232 233 233 234 if (channel->hw_value & CHANNEL_5GHZ) ··· 243 240 if (channel->hw_value & CHANNEL_TURBO) 244 241 clock *= 2; 245 242 246 - return clock; 243 + common->clockrate = clock; 247 244 } 248 245 249 246 /**
+1
drivers/net/wireless/ath/ath5k/phy.c
··· 1093 1093 1094 1094 ah->ah_current_channel = channel; 1095 1095 ah->ah_turbo = channel->hw_value == CHANNEL_T ? true : false; 1096 + ath5k_hw_set_clockrate(ah); 1096 1097 1097 1098 return 0; 1098 1099 }