Commit e25aa82a authored by Gabor Juhos's avatar Gabor Juhos Committed by John W. Linville

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: default avatarGabor Juhos <juhosg@openwrt.org>
Acked-by: default avatarStanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0beb1bbf
...@@ -4471,19 +4471,34 @@ void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual, ...@@ -4471,19 +4471,34 @@ void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual,
if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C)) if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C))
return; return;
/*
* When RSSI is better then -80 increase VGC level with 0x10, except /* When RSSI is better than a certain threshold, increase VGC
* for rt5592 chip. * with a chip specific value in order to improve the balance
* between sensibility and noise isolation.
*/ */
vgc = rt2800_get_default_vgc(rt2x00dev); vgc = rt2800_get_default_vgc(rt2x00dev);
if (rt2x00_rt(rt2x00dev, RT5592)) { switch (rt2x00dev->chip.rt) {
case RT3572:
case RT3593:
if (qual->rssi > -65) {
if (rt2x00dev->curr_band == IEEE80211_BAND_2GHZ)
vgc += 0x20;
else
vgc += 0x10;
}
break;
case RT5592:
if (qual->rssi > -65) if (qual->rssi > -65)
vgc += 0x20; vgc += 0x20;
} else { break;
default:
if (qual->rssi > -80) if (qual->rssi > -80)
vgc += 0x10; vgc += 0x10;
break;
} }
rt2800_set_vgc(rt2x00dev, qual, vgc); rt2800_set_vgc(rt2x00dev, qual, vgc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment