Skip to content

Commit

Permalink
ath5k: Fix I/Q calibration
Browse files Browse the repository at this point in the history
The sign of correction coefficients was lost in the calculations, which
caused high packetloss in 802.11a mode after the results were applied.
Fixed by removing unneccesary and broken AND with a bit mask.

Signed-off-by: Lukas Turek <8an@praha12.net>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Lukáš Turek authored and John W. Linville committed Nov 23, 2009
1 parent 98e3ac9 commit f1cf2db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath5k/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1399,15 +1399,15 @@ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah,
if (i_coffd == 0 || q_coffd == 0)
goto done;

i_coff = ((-iq_corr) / i_coffd) & 0x3f;
i_coff = ((-iq_corr) / i_coffd);

/* Boundary check */
if (i_coff > 31)
i_coff = 31;
if (i_coff < -32)
i_coff = -32;

q_coff = (((s32)i_pwr / q_coffd) - 128) & 0x1f;
q_coff = (((s32)i_pwr / q_coffd) - 128);

/* Boundary check */
if (q_coff > 15)
Expand Down

0 comments on commit f1cf2db

Please sign in to comment.