Skip to contentSkip to conversation

ath5k: Fix I/Q calibration

PATCH In review Lukáš Turek 2 participants 2 messages Nov 19, 2009 – Nov 21, 2009 Atheros ATH5K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath5k: Fix I/Q calibration

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.

---
 drivers/net/wireless/ath/ath5k/phy.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath5k/phy.c +2 -2
index 8959907..6af0a73 100644
@@ -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)
Signature · 4 lines
1.6.4.4

--
Lukas Turek
maintainer Acked-by on v1 1/1
#1 lore raw

2009/11/20 Lukáš Turek <[email protected]>:

Quoted 32 lines

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.

---
 drivers/net/wireless/ath/ath5k/phy.c |    4 ++--

 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath5k/phy.c +2 -3
index 8959907..6af0a73 100644
@@ -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)
--
Quoted 1 line

1.6.4.4

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