diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-10-03 14:00:41 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-10-10 13:53:07 -0400 |
commit | e25aa82a89db9e3b09d02b5481aa375c7712a10d (patch) | |
tree | fc48f449ba793cffcef9f785088e7e1214668c73 /drivers/net | |
parent | 0beb1bbf19c72f17809e42b8f33522a55c2cc18c (diff) |
rt2x00: rt2800lib: fix VGC adjustment for RT3572 and RT3593
The Ralink DPO_RT5572_LinuxSTA_2.6.1.3_20121022
reference driver uses different RSSI threshold
and VGC adjustment values for the RT3572 and
RT3593 chipsets.
Update the rt2800_link_tuner function to use the
same values. Also change the comment in the function
to make it more generic.
References:
RT35xx_ChipAGCAdjust function in chips/rt35xx.c
RSSI_FOR_MID_LOW_SENSIBILITY constant in include/chip/rtmp_phy.h
RT3593_R66_MID_LOW_SENS_GET macro in include/chip/rt3593.h
RT3593_R66_NON_MID_LOW_SEMS_GET macro in include/chips/rt3593.h
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index be68b0485833..a114cab413e9 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -4471,19 +4471,34 @@ void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual, | |||
4471 | 4471 | ||
4472 | if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C)) | 4472 | if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C)) |
4473 | return; | 4473 | return; |
4474 | /* | 4474 | |
4475 | * When RSSI is better then -80 increase VGC level with 0x10, except | 4475 | /* When RSSI is better than a certain threshold, increase VGC |
4476 | * for rt5592 chip. | 4476 | * with a chip specific value in order to improve the balance |
4477 | * between sensibility and noise isolation. | ||
4477 | */ | 4478 | */ |
4478 | 4479 | ||
4479 | vgc = rt2800_get_default_vgc(rt2x00dev); | 4480 | vgc = rt2800_get_default_vgc(rt2x00dev); |
4480 | 4481 | ||
4481 | if (rt2x00_rt(rt2x00dev, RT5592)) { | 4482 | switch (rt2x00dev->chip.rt) { |
4483 | case RT3572: | ||
4484 | case RT3593: | ||
4485 | if (qual->rssi > -65) { | ||
4486 | if (rt2x00dev->curr_band == IEEE80211_BAND_2GHZ) | ||
4487 | vgc += 0x20; | ||
4488 | else | ||
4489 | vgc += 0x10; | ||
4490 | } | ||
4491 | break; | ||
4492 | |||
4493 | case RT5592: | ||
4482 | if (qual->rssi > -65) | 4494 | if (qual->rssi > -65) |
4483 | vgc += 0x20; | 4495 | vgc += 0x20; |
4484 | } else { | 4496 | break; |
4497 | |||
4498 | default: | ||
4485 | if (qual->rssi > -80) | 4499 | if (qual->rssi > -80) |
4486 | vgc += 0x10; | 4500 | vgc += 0x10; |
4501 | break; | ||
4487 | } | 4502 | } |
4488 | 4503 | ||
4489 | rt2800_set_vgc(rt2x00dev, qual, vgc); | 4504 | rt2800_set_vgc(rt2x00dev, qual, vgc); |