Skip to content

Commit

Permalink
rt2x00: rt2800lib: fix VGC adjustment for RT5592
Browse files Browse the repository at this point in the history
commit 0beb1bb upstream.

In commit 3d81535
(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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Gabor Juhos authored and Greg Kroah-Hartman committed Nov 29, 2013
1 parent e1480ff commit a8ead97
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/net/wireless/rt2x00/rt2800lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3423,10 +3423,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);
}
Expand Down

0 comments on commit a8ead97

Please sign in to comment.