600-20-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From c49b2d829aa1c816a46a577cdec6d2ff14d9f06e Mon Sep 17 00:00:00 2001
  2. From: Gabor Juhos <juhosg@openwrt.org>
  3. Date: Tue, 1 Oct 2013 15:40:08 +0200
  4. Subject: [PATCH] rt2x00: rt2800lib: fix VGC setup for RT3883
  5. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  6. ---
  7. drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 11 +++++++++--
  8. 1 file changed, 9 insertions(+), 2 deletions(-)
  9. --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  10. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  11. @@ -5338,7 +5338,8 @@ static u8 rt2800_get_default_vgc(struct
  12. else
  13. vgc = 0x2e + rt2x00dev->lna_gain;
  14. } else { /* 5GHZ band */
  15. - if (rt2x00_rt(rt2x00dev, RT3593))
  16. + if (rt2x00_rt(rt2x00dev, RT3593) ||
  17. + rt2x00_rt(rt2x00dev, RT3883))
  18. vgc = 0x20 + (rt2x00dev->lna_gain * 5) / 3;
  19. else if (rt2x00_rt(rt2x00dev, RT5592))
  20. vgc = 0x24 + (2 * rt2x00dev->lna_gain);
  21. @@ -5358,7 +5359,8 @@ static inline void rt2800_set_vgc(struct
  22. {
  23. if (qual->vgc_level != vgc_level) {
  24. if (rt2x00_rt(rt2x00dev, RT3572) ||
  25. - rt2x00_rt(rt2x00dev, RT3593)) {
  26. + rt2x00_rt(rt2x00dev, RT3593) ||
  27. + rt2x00_rt(rt2x00dev, RT3883)) {
  28. rt2800_bbp_write_with_rx_chain(rt2x00dev, 66,
  29. vgc_level);
  30. } else if (rt2x00_rt(rt2x00dev, RT5592)) {
  31. @@ -5405,6 +5407,11 @@ void rt2800_link_tuner(struct rt2x00_dev
  32. }
  33. break;
  34. + case RT3883:
  35. + if (qual->rssi > -65)
  36. + vgc += 0x10;
  37. + break;
  38. +
  39. case RT5592:
  40. if (qual->rssi > -65)
  41. vgc += 0x20;