aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2014-01-14 02:55:17 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-01-16 14:55:42 -0500
commit522aaa182a8d942d29e37e1f80b3f5b3c68cc475 (patch)
treef71789161880751d66db2c9c7a4c55115ebdc78a /drivers/net
parent1908861f2fb072446eabbdc4a01c3bec40ed2f7c (diff)
ath9k: Fix IQ calibration
This patch fixes a bug in the TX IQ calibration post processing routine because of which the driver disables TX IQ correction even though the calibration results are valid. This fix is applicable for all chips in the AR9003 family. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_calib.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 8c145cd98c1c..4eb35aa64f35 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -655,8 +655,8 @@ static bool ar9003_hw_calc_iq_corr(struct ath_hw *ah,
655 if (i2_m_q2_a0_d1 > 0x800) 655 if (i2_m_q2_a0_d1 > 0x800)
656 i2_m_q2_a0_d1 = -((0xfff - i2_m_q2_a0_d1) + 1); 656 i2_m_q2_a0_d1 = -((0xfff - i2_m_q2_a0_d1) + 1);
657 657
658 if (i2_p_q2_a0_d1 > 0x800) 658 if (i2_p_q2_a0_d1 > 0x1000)
659 i2_p_q2_a0_d1 = -((0xfff - i2_p_q2_a0_d1) + 1); 659 i2_p_q2_a0_d1 = -((0x1fff - i2_p_q2_a0_d1) + 1);
660 660
661 if (iq_corr_a0_d1 > 0x800) 661 if (iq_corr_a0_d1 > 0x800)
662 iq_corr_a0_d1 = -((0xfff - iq_corr_a0_d1) + 1); 662 iq_corr_a0_d1 = -((0xfff - iq_corr_a0_d1) + 1);
@@ -700,6 +700,19 @@ static bool ar9003_hw_calc_iq_corr(struct ath_hw *ah,
700 return false; 700 return false;
701 } 701 }
702 702
703 if ((i2_p_q2_a0_d0 < 1024) || (i2_p_q2_a0_d0 > 2047) ||
704 (i2_p_q2_a1_d0 < 0) || (i2_p_q2_a1_d1 < 0) ||
705 (i2_p_q2_a0_d0 <= i2_m_q2_a0_d0) ||
706 (i2_p_q2_a0_d0 <= iq_corr_a0_d0) ||
707 (i2_p_q2_a0_d1 <= i2_m_q2_a0_d1) ||
708 (i2_p_q2_a0_d1 <= iq_corr_a0_d1) ||
709 (i2_p_q2_a1_d0 <= i2_m_q2_a1_d0) ||
710 (i2_p_q2_a1_d0 <= iq_corr_a1_d0) ||
711 (i2_p_q2_a1_d1 <= i2_m_q2_a1_d1) ||
712 (i2_p_q2_a1_d1 <= iq_corr_a1_d1)) {
713 return false;
714 }
715
703 mag_a0_d0 = (i2_m_q2_a0_d0 * res_scale) / i2_p_q2_a0_d0; 716 mag_a0_d0 = (i2_m_q2_a0_d0 * res_scale) / i2_p_q2_a0_d0;
704 phs_a0_d0 = (iq_corr_a0_d0 * res_scale) / i2_p_q2_a0_d0; 717 phs_a0_d0 = (iq_corr_a0_d0 * res_scale) / i2_p_q2_a0_d0;
705 718