linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/4] rt2x00: rt2800lib: fix VGC adjustment for RT5592
@ 2013-10-03 18:00 Gabor Juhos
  2013-10-03 18:00 ` [PATCH v2 2/4] rt2x00: rt2800lib: fix VGC adjustment for RT3572 and RT3593 Gabor Juhos
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Gabor Juhos @ 2013-10-03 18:00 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, users, Gabor Juhos, stable

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>
---
 drivers/net/wireless/rt2x00/rt2800lib.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index f414978..2690081 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -4469,10 +4469,13 @@ void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual,
 
 	vgc = rt2800_get_default_vgc(rt2x00dev);
 
-	if (rt2x00_rt(rt2x00dev, RT5592) && qual->rssi > -65)
-		vgc += 0x20;
-	else if (qual->rssi > -80)
-		vgc += 0x10;
+	if (rt2x00_rt(rt2x00dev, RT5592)) {
+		if (qual->rssi > -65)
+			vgc += 0x20;
+	} else {
+		if (qual->rssi > -80)
+			vgc += 0x10;
+	}
 
 	rt2800_set_vgc(rt2x00dev, qual, vgc);
 }
-- 
1.7.10

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

end of thread, other threads:[~2013-10-04 19:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-03 18:00 [PATCH v2 1/4] rt2x00: rt2800lib: fix VGC adjustment for RT5592 Gabor Juhos
2013-10-03 18:00 ` [PATCH v2 2/4] rt2x00: rt2800lib: fix VGC adjustment for RT3572 and RT3593 Gabor Juhos
2013-10-04 14:27   ` [rt2x00-users] " Stanislaw Gruszka
2013-10-03 18:00 ` [PATCH v2 3/4] rt2x00: rt2800lib: fix default VGC values for RT3593 Gabor Juhos
2013-10-04 14:38   ` [rt2x00-users] " Stanislaw Gruszka
2013-10-04 19:59     ` Gabor Juhos
2013-10-03 18:00 ` [PATCH v2 4/4] rt2x00: rt2800lib: fix VGC programming for RT3572 and RT3593 Gabor Juhos
2013-10-04 14:39   ` [rt2x00-users] " Stanislaw Gruszka
2013-10-04 14:19 ` [rt2x00-users] [PATCH v2 1/4] rt2x00: rt2800lib: fix VGC adjustment for RT5592 Stanislaw Gruszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).