600-21-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 1616650aea676541d4dc8adc6f4219856d193c8b Mon Sep 17 00:00:00 2001
  2. From: Gabor Juhos <juhosg@openwrt.org>
  3. Date: Tue, 1 Oct 2013 17:27:57 +0200
  4. Subject: [PATCH] rt2x00: rt2800lib: fix EEPROM LNA validation for RT3883
  5. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  6. ---
  7. drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 9 ++++++---
  8. 1 file changed, 6 insertions(+), 3 deletions(-)
  9. --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  10. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  11. @@ -9074,7 +9074,8 @@ static int rt2800_validate_eeprom(struct
  12. rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_BG2, &word);
  13. if (abs(rt2x00_get_field16(word, EEPROM_RSSI_BG2_OFFSET2)) > 10)
  14. rt2x00_set_field16(&word, EEPROM_RSSI_BG2_OFFSET2, 0);
  15. - if (!rt2x00_rt(rt2x00dev, RT3593)) {
  16. + if (!rt2x00_rt(rt2x00dev, RT3593) &&
  17. + !rt2x00_rt(rt2x00dev, RT3883)) {
  18. if (rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0x00 ||
  19. rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0xff)
  20. rt2x00_set_field16(&word, EEPROM_RSSI_BG2_LNA_A1,
  21. @@ -9094,7 +9095,8 @@ static int rt2800_validate_eeprom(struct
  22. rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_A2, &word);
  23. if (abs(rt2x00_get_field16(word, EEPROM_RSSI_A2_OFFSET2)) > 10)
  24. rt2x00_set_field16(&word, EEPROM_RSSI_A2_OFFSET2, 0);
  25. - if (!rt2x00_rt(rt2x00dev, RT3593)) {
  26. + if (!rt2x00_rt(rt2x00dev, RT3593) &&
  27. + !rt2x00_rt(rt2x00dev, RT3883)) {
  28. if (rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0x00 ||
  29. rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0xff)
  30. rt2x00_set_field16(&word, EEPROM_RSSI_A2_LNA_A2,
  31. @@ -9102,7 +9104,8 @@ static int rt2800_validate_eeprom(struct
  32. }
  33. rt2800_eeprom_write(rt2x00dev, EEPROM_RSSI_A2, word);
  34. - if (rt2x00_rt(rt2x00dev, RT3593)) {
  35. + if (rt2x00_rt(rt2x00dev, RT3593) ||
  36. + rt2x00_rt(rt2x00dev, RT3883)) {
  37. rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &word);
  38. if (rt2x00_get_field16(word, EEPROM_EXT_LNA2_A1) == 0x00 ||
  39. rt2x00_get_field16(word, EEPROM_EXT_LNA2_A1) == 0xff)