]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ath5k: fix I/Q calibration (for real)
authorBruno Randolf <br1@einfach.org>
Tue, 9 Mar 2010 07:56:05 +0000 (16:56 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 23:01:13 +0000 (16:01 -0700)
commitb55c7626ed9e89a5260ec43712a87495978ed519
tree3dcb1ef498e22e50788d51f7986e730f5fa2910f
parent266623b31c992d23a8651b15032c365e8db39fe2
ath5k: fix I/Q calibration (for real)

commit 86415d43efd4f7093979cfa8a80232114266f1a4 upstream.

I/Q calibration was completely broken, resulting in a high number of CRC errors
on received packets. before i could see around 10% to 20% CRC errors, with this
patch they are between 0% and 3%.

1.) the removal of the mask in commit "ath5k: Fix I/Q calibration
(f1cf2dbd0f798b71b1590e7aca6647f2caef1649)" resulted in no mask beeing used
when writing the I/Q values into the register. additional errors in the
calculation of the values (see 2.) resulted too high numbers, exceeding the
masks, so wrong values like 0xfffffffe were written. to be safe we should
always use the bitmask when writing parts of a register.

2.) using a (s32) cast for q_coff is a wrong conversion to signed, since we
convert to a signed value later by substracting 128. this resulted in too low
numbers for Q many times, which were limited to -16 by the boundary check later
on.

3.) checked everything against the HAL sources and took over comments and minor
optimizations from there.

4.) we can't use ENABLE_BITS when we want to write a number (the number can
contain zeros). also always write the correction values first and set ENABLE
bit last, like the HAL does.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/ath/ath5k/phy.c
drivers/net/wireless/ath/ath5k/reg.h