aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/phy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/phy.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/phy.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 6284c389ba18..4932bf2f35eb 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -115,7 +115,7 @@ static unsigned int ath5k_hw_rfb_op(struct ath5k_hw *ah,
115\**********************/ 115\**********************/
116 116
117/* 117/*
118 * This code is used to optimize rf gain on different environments 118 * This code is used to optimize RF gain on different environments
119 * (temperature mostly) based on feedback from a power detector. 119 * (temperature mostly) based on feedback from a power detector.
120 * 120 *
121 * It's only used on RF5111 and RF5112, later RF chips seem to have 121 * It's only used on RF5111 and RF5112, later RF chips seem to have
@@ -302,7 +302,7 @@ static bool ath5k_hw_rf_check_gainf_readback(struct ath5k_hw *ah)
302} 302}
303 303
304/* Perform gain_F adjustment by choosing the right set 304/* Perform gain_F adjustment by choosing the right set
305 * of parameters from rf gain optimization ladder */ 305 * of parameters from RF gain optimization ladder */
306static s8 ath5k_hw_rf_gainf_adjust(struct ath5k_hw *ah) 306static s8 ath5k_hw_rf_gainf_adjust(struct ath5k_hw *ah)
307{ 307{
308 const struct ath5k_gain_opt *go; 308 const struct ath5k_gain_opt *go;
@@ -367,7 +367,7 @@ done:
367 return ret; 367 return ret;
368} 368}
369 369
370/* Main callback for thermal rf gain calibration engine 370/* Main callback for thermal RF gain calibration engine
371 * Check for a new gain reading and schedule an adjustment 371 * Check for a new gain reading and schedule an adjustment
372 * if needed. 372 * if needed.
373 * 373 *
@@ -433,7 +433,7 @@ done:
433 return ah->ah_gain.g_state; 433 return ah->ah_gain.g_state;
434} 434}
435 435
436/* Write initial rf gain table to set the RF sensitivity 436/* Write initial RF gain table to set the RF sensitivity
437 * this one works on all RF chips and has nothing to do 437 * this one works on all RF chips and has nothing to do
438 * with gain_F calibration */ 438 * with gain_F calibration */
439int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq) 439int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq)
@@ -496,7 +496,7 @@ int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq)
496 496
497 497
498/* 498/*
499 * Setup RF registers by writing rf buffer on hw 499 * Setup RF registers by writing RF buffer on hw
500 */ 500 */
501int ath5k_hw_rfregs_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, 501int ath5k_hw_rfregs_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
502 unsigned int mode) 502 unsigned int mode)
@@ -571,7 +571,7 @@ int ath5k_hw_rfregs_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
571 return -EINVAL; 571 return -EINVAL;
572 } 572 }
573 573
574 /* If it's the first time we set rf buffer, allocate 574 /* If it's the first time we set RF buffer, allocate
575 * ah->ah_rf_banks based on ah->ah_rf_banks_size 575 * ah->ah_rf_banks based on ah->ah_rf_banks_size
576 * we set above */ 576 * we set above */
577 if (ah->ah_rf_banks == NULL) { 577 if (ah->ah_rf_banks == NULL) {
@@ -1377,7 +1377,7 @@ ath5k_hw_rf511x_iq_calibrate(struct ath5k_hw *ah)
1377 1377
1378 /* protect against divide by 0 and loss of sign bits */ 1378 /* protect against divide by 0 and loss of sign bits */
1379 if (i_coffd == 0 || q_coffd < 2) 1379 if (i_coffd == 0 || q_coffd < 2)
1380 return -1; 1380 return 0;
1381 1381
1382 i_coff = (-iq_corr) / i_coffd; 1382 i_coff = (-iq_corr) / i_coffd;
1383 i_coff = clamp(i_coff, -32, 31); /* signed 6 bit */ 1383 i_coff = clamp(i_coff, -32, 31); /* signed 6 bit */
@@ -1582,7 +1582,7 @@ ath5k_hw_set_spur_mitigation_filter(struct ath5k_hw *ah,
1582 else if (curr_sym_off >= 31 && curr_sym_off <= 46) 1582 else if (curr_sym_off >= 31 && curr_sym_off <= 46)
1583 mag_mask[2] |= 1583 mag_mask[2] |=
1584 plt_mag_map << (curr_sym_off - 31) * 2; 1584 plt_mag_map << (curr_sym_off - 31) * 2;
1585 else if (curr_sym_off >= 46 && curr_sym_off <= 53) 1585 else if (curr_sym_off >= 47 && curr_sym_off <= 53)
1586 mag_mask[3] |= 1586 mag_mask[3] |=
1587 plt_mag_map << (curr_sym_off - 47) * 2; 1587 plt_mag_map << (curr_sym_off - 47) * 2;
1588 1588
@@ -2987,7 +2987,7 @@ ath5k_setup_rate_powertable(struct ath5k_hw *ah, u16 max_pwr,
2987 2987
2988 2988
2989/* 2989/*
2990 * Set transmition power 2990 * Set transmission power
2991 */ 2991 */
2992int 2992int
2993ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel, 2993ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
@@ -3035,9 +3035,6 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
3035 /* Limit max power if we have a CTL available */ 3035 /* Limit max power if we have a CTL available */
3036 ath5k_get_max_ctl_power(ah, channel); 3036 ath5k_get_max_ctl_power(ah, channel);
3037 3037
3038 /* FIXME: Tx power limit for this regdomain
3039 * XXX: Mac80211/CRDA will do that anyway ? */
3040
3041 /* FIXME: Antenna reduction stuff */ 3038 /* FIXME: Antenna reduction stuff */
3042 3039
3043 /* FIXME: Limit power on turbo modes */ 3040 /* FIXME: Limit power on turbo modes */