diff options
author | Christian Lamparter <chunkeey@googlemail.com> | 2009-09-29 14:47:25 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-09-29 17:25:16 -0400 |
commit | e16c1bb67a0010b5bad26ddc3e691655fd7456e3 (patch) | |
tree | d051731baf91baced7b3811ceab61ec94b005912 /drivers/net | |
parent | 78bd6bbf3c12f49e2cb6897bfd73a62325ed3aaa (diff) |
ar9170: fix bug in iq-auto calibration value calculation
This patch fixes a embarrassing bug which was introduced by:
"[PATCH] ar9170: implement frequency calibration for one-stage/openfw"
The phy_data variable initialization has to done outside the for-loop
scope. This is because the for-loop uses u32 phy_data variable more
like a 4-byte field. But in each run only a single byte is calculated.
Therefore phy_data content needs to stay the same for at least 3 more
iterations, before the complete set can be uploaded.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ar9170/phy.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ar9170/phy.c b/drivers/net/wireless/ath/ar9170/phy.c index b3e5cf3735b0..dbd488da18b1 100644 --- a/drivers/net/wireless/ath/ar9170/phy.c +++ b/drivers/net/wireless/ath/ar9170/phy.c | |||
@@ -1141,7 +1141,8 @@ static int ar9170_set_freq_cal_data(struct ar9170 *ar, | |||
1141 | u8 vpds[2][AR5416_PD_GAIN_ICEPTS]; | 1141 | u8 vpds[2][AR5416_PD_GAIN_ICEPTS]; |
1142 | u8 pwrs[2][AR5416_PD_GAIN_ICEPTS]; | 1142 | u8 pwrs[2][AR5416_PD_GAIN_ICEPTS]; |
1143 | int chain, idx, i; | 1143 | int chain, idx, i; |
1144 | u8 f; | 1144 | u32 phy_data = 0; |
1145 | u8 f, tmp; | ||
1145 | 1146 | ||
1146 | switch (channel->band) { | 1147 | switch (channel->band) { |
1147 | case IEEE80211_BAND_2GHZ: | 1148 | case IEEE80211_BAND_2GHZ: |
@@ -1208,9 +1209,6 @@ static int ar9170_set_freq_cal_data(struct ar9170 *ar, | |||
1208 | } | 1209 | } |
1209 | 1210 | ||
1210 | for (i = 0; i < 76; i++) { | 1211 | for (i = 0; i < 76; i++) { |
1211 | u32 phy_data; | ||
1212 | u8 tmp; | ||
1213 | |||
1214 | if (i < 25) { | 1212 | if (i < 25) { |
1215 | tmp = ar9170_interpolate_val(i, &pwrs[0][0], | 1213 | tmp = ar9170_interpolate_val(i, &pwrs[0][0], |
1216 | &vpds[0][0]); | 1214 | &vpds[0][0]); |