2014-04-23 07:52:18 +00:00
|
|
|
From 1616650aea676541d4dc8adc6f4219856d193c8b Mon Sep 17 00:00:00 2001
|
|
|
|
From: Gabor Juhos <juhosg@openwrt.org>
|
|
|
|
Date: Tue, 1 Oct 2013 17:27:57 +0200
|
|
|
|
Subject: [PATCH] rt2x00: rt2800lib: fix EEPROM LNA validation for RT3883
|
|
|
|
|
|
|
|
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
|
|
---
|
2015-12-04 22:39:37 +00:00
|
|
|
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 9 ++++++---
|
2014-04-23 07:52:18 +00:00
|
|
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
|
2015-12-04 22:39:37 +00:00
|
|
|
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
|
|
|
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
2017-03-30 16:08:49 +00:00
|
|
|
@@ -9074,7 +9074,8 @@ static int rt2800_validate_eeprom(struct
|
2014-04-23 07:52:18 +00:00
|
|
|
rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_BG2, &word);
|
|
|
|
if (abs(rt2x00_get_field16(word, EEPROM_RSSI_BG2_OFFSET2)) > 10)
|
|
|
|
rt2x00_set_field16(&word, EEPROM_RSSI_BG2_OFFSET2, 0);
|
|
|
|
- if (!rt2x00_rt(rt2x00dev, RT3593)) {
|
|
|
|
+ if (!rt2x00_rt(rt2x00dev, RT3593) &&
|
|
|
|
+ !rt2x00_rt(rt2x00dev, RT3883)) {
|
|
|
|
if (rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0x00 ||
|
|
|
|
rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0xff)
|
|
|
|
rt2x00_set_field16(&word, EEPROM_RSSI_BG2_LNA_A1,
|
2017-03-30 16:08:49 +00:00
|
|
|
@@ -9094,7 +9095,8 @@ static int rt2800_validate_eeprom(struct
|
2014-04-23 07:52:18 +00:00
|
|
|
rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_A2, &word);
|
|
|
|
if (abs(rt2x00_get_field16(word, EEPROM_RSSI_A2_OFFSET2)) > 10)
|
|
|
|
rt2x00_set_field16(&word, EEPROM_RSSI_A2_OFFSET2, 0);
|
|
|
|
- if (!rt2x00_rt(rt2x00dev, RT3593)) {
|
|
|
|
+ if (!rt2x00_rt(rt2x00dev, RT3593) &&
|
|
|
|
+ !rt2x00_rt(rt2x00dev, RT3883)) {
|
|
|
|
if (rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0x00 ||
|
|
|
|
rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0xff)
|
|
|
|
rt2x00_set_field16(&word, EEPROM_RSSI_A2_LNA_A2,
|
2017-03-30 16:08:49 +00:00
|
|
|
@@ -9102,7 +9104,8 @@ static int rt2800_validate_eeprom(struct
|
2014-04-23 07:52:18 +00:00
|
|
|
}
|
|
|
|
rt2800_eeprom_write(rt2x00dev, EEPROM_RSSI_A2, word);
|
|
|
|
|
|
|
|
- if (rt2x00_rt(rt2x00dev, RT3593)) {
|
|
|
|
+ if (rt2x00_rt(rt2x00dev, RT3593) ||
|
|
|
|
+ rt2x00_rt(rt2x00dev, RT3883)) {
|
|
|
|
rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &word);
|
|
|
|
if (rt2x00_get_field16(word, EEPROM_EXT_LNA2_A1) == 0x00 ||
|
|
|
|
rt2x00_get_field16(word, EEPROM_EXT_LNA2_A1) == 0xff)
|