aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-10-03 14:00:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-10-10 13:53:07 -0400
commit0beb1bbf19c72f17809e42b8f33522a55c2cc18c (patch)
tree33f11ce7ea2559c55a80b30c5751a12a50578d62
parent1dc254ac9f04f23d332ed8eea79055f067c90627 (diff)
rt2x00: rt2800lib: fix VGC adjustment for RT5592
In commit 3d81535ea5940446510a8a5cee1c6ad23c90c753 (rt2800: 5592: add chip specific vgc calculations) the rt2800_link_tuner function has been modified to adjust VGC level for the RT5592 chipset. On the RT5592 chipset, the VGC level must be adjusted only if rssi is greater than -65. However the current code adjusts the VGC value by 0x10 regardless of the actual chipset if the rssi value is between -80 and -65. Fix the broken behaviour by reordering the if-else statements. Cc: stable@vger.kernel.org Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 5a230c42fb0d..be68b0485833 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -4478,10 +4478,13 @@ void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual,
4478 4478
4479 vgc = rt2800_get_default_vgc(rt2x00dev); 4479 vgc = rt2800_get_default_vgc(rt2x00dev);
4480 4480
4481 if (rt2x00_rt(rt2x00dev, RT5592) && qual->rssi > -65) 4481 if (rt2x00_rt(rt2x00dev, RT5592)) {
4482 vgc += 0x20; 4482 if (qual->rssi > -65)
4483 else if (qual->rssi > -80) 4483 vgc += 0x20;
4484 vgc += 0x10; 4484 } else {
4485 if (qual->rssi > -80)
4486 vgc += 0x10;
4487 }
4485 4488
4486 rt2800_set_vgc(rt2x00dev, qual, vgc); 4489 rt2800_set_vgc(rt2x00dev, qual, vgc);
4487} 4490}