All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath5k: Fix I/Q calibration
@ 2009-11-19 22:02 Lukáš Turek
  2009-11-21  9:01 ` Nick Kossifidis
  0 siblings, 1 reply; 2+ messages in thread
From: Lukáš Turek @ 2009-11-19 22:02 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1134 bytes --]

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>
---
 drivers/net/wireless/ath/ath5k/phy.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 8959907..6af0a73 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -1399,7 +1399,7 @@ 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)
@@ -1407,7 +1407,7 @@ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah,
 	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)
-- 
1.6.4.4

--
Lukas Turek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ath5k: Fix I/Q calibration
  2009-11-19 22:02 [PATCH] ath5k: Fix I/Q calibration Lukáš Turek
@ 2009-11-21  9:01 ` Nick Kossifidis
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Kossifidis @ 2009-11-21  9:01 UTC (permalink / raw)
  To: 8an; +Cc: linville, linux-wireless

2009/11/20 Lukáš Turek <8an@praha12.net>:
> 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>
> ---
>  drivers/net/wireless/ath/ath5k/phy.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
> index 8959907..6af0a73 100644
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -1399,7 +1399,7 @@ 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)
> @@ -1407,7 +1407,7 @@ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah,
>        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)
> --
> 1.6.4.4


Acked-by: Nick Kossifidis <mickflemm@gmail.com>


-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-21  9:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-19 22:02 [PATCH] ath5k: Fix I/Q calibration Lukáš Turek
2009-11-21  9:01 ` Nick Kossifidis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.