diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800lib.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 2ab88840a3e5..8a4ed7642bcf 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -896,8 +896,7 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, | |||
896 | rt2x00_set_field8(&bbp, BBP3_HT40_PLUS, conf_is_ht40_plus(conf)); | 896 | rt2x00_set_field8(&bbp, BBP3_HT40_PLUS, conf_is_ht40_plus(conf)); |
897 | rt2800_bbp_write(rt2x00dev, 3, bbp); | 897 | rt2800_bbp_write(rt2x00dev, 3, bbp); |
898 | 898 | ||
899 | if (rt2x00_rt(rt2x00dev, RT2860) && | 899 | if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C)) { |
900 | (rt2x00_rev(rt2x00dev) == RT2860C_VERSION)) { | ||
901 | if (conf_is_ht40(conf)) { | 900 | if (conf_is_ht40(conf)) { |
902 | rt2800_bbp_write(rt2x00dev, 69, 0x1a); | 901 | rt2800_bbp_write(rt2x00dev, 69, 0x1a); |
903 | rt2800_bbp_write(rt2x00dev, 70, 0x0a); | 902 | rt2800_bbp_write(rt2x00dev, 70, 0x0a); |
@@ -1060,8 +1059,7 @@ static u8 rt2800_get_default_vgc(struct rt2x00_dev *rt2x00dev) | |||
1060 | { | 1059 | { |
1061 | if (rt2x00dev->curr_band == IEEE80211_BAND_2GHZ) { | 1060 | if (rt2x00dev->curr_band == IEEE80211_BAND_2GHZ) { |
1062 | if (rt2x00_is_usb(rt2x00dev) && | 1061 | if (rt2x00_is_usb(rt2x00dev) && |
1063 | rt2x00_rt(rt2x00dev, RT3070) && | 1062 | rt2x00_rt_rev(rt2x00dev, RT3070, REV_RT3070E)) |
1064 | (rt2x00_rev(rt2x00dev) == RT3070_VERSION)) | ||
1065 | return 0x1c + (2 * rt2x00dev->lna_gain); | 1063 | return 0x1c + (2 * rt2x00dev->lna_gain); |
1066 | else | 1064 | else |
1067 | return 0x2e + rt2x00dev->lna_gain; | 1065 | return 0x2e + rt2x00dev->lna_gain; |
@@ -1092,8 +1090,7 @@ EXPORT_SYMBOL_GPL(rt2800_reset_tuner); | |||
1092 | void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual, | 1090 | void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual, |
1093 | const u32 count) | 1091 | const u32 count) |
1094 | { | 1092 | { |
1095 | if (rt2x00_rt(rt2x00dev, RT2860) && | 1093 | if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C)) |
1096 | (rt2x00_rev(rt2x00dev) == RT2860C_VERSION)) | ||
1097 | return; | 1094 | return; |
1098 | 1095 | ||
1099 | /* | 1096 | /* |
@@ -1179,8 +1176,7 @@ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) | |||
1179 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); | 1176 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); |
1180 | 1177 | ||
1181 | if (rt2x00_is_usb(rt2x00dev) && | 1178 | if (rt2x00_is_usb(rt2x00dev) && |
1182 | rt2x00_rt(rt2x00dev, RT3070) && | 1179 | rt2x00_rt_rev(rt2x00dev, RT3070, REV_RT3070E)) { |
1183 | (rt2x00_rev(rt2x00dev) == RT3070_VERSION)) { | ||
1184 | rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000400); | 1180 | rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000400); |
1185 | rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000); | 1181 | rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000); |
1186 | rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); | 1182 | rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); |
@@ -1207,11 +1203,9 @@ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) | |||
1207 | 1203 | ||
1208 | rt2800_register_read(rt2x00dev, MAX_LEN_CFG, ®); | 1204 | rt2800_register_read(rt2x00dev, MAX_LEN_CFG, ®); |
1209 | rt2x00_set_field32(®, MAX_LEN_CFG_MAX_MPDU, AGGREGATION_SIZE); | 1205 | rt2x00_set_field32(®, MAX_LEN_CFG_MAX_MPDU, AGGREGATION_SIZE); |
1210 | if ((rt2x00_rt(rt2x00dev, RT2872) && | 1206 | if (rt2x00_rt_rev_gte(rt2x00dev, RT2872, REV_RT2872E) || |
1211 | (rt2x00_rev(rt2x00dev) >= RT2880E_VERSION)) || | ||
1212 | rt2x00_rt(rt2x00dev, RT2883) || | 1207 | rt2x00_rt(rt2x00dev, RT2883) || |
1213 | (rt2x00_rt(rt2x00dev, RT3070) && | 1208 | rt2x00_rt_rev_lt(rt2x00dev, RT3070, REV_RT3070E)) |
1214 | (rt2x00_rev(rt2x00dev) < RT3070_VERSION))) | ||
1215 | rt2x00_set_field32(®, MAX_LEN_CFG_MAX_PSDU, 2); | 1209 | rt2x00_set_field32(®, MAX_LEN_CFG_MAX_PSDU, 2); |
1216 | else | 1210 | else |
1217 | rt2x00_set_field32(®, MAX_LEN_CFG_MAX_PSDU, 1); | 1211 | rt2x00_set_field32(®, MAX_LEN_CFG_MAX_PSDU, 1); |
@@ -1490,14 +1484,12 @@ int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
1490 | rt2800_bbp_write(rt2x00dev, 103, 0x00); | 1484 | rt2800_bbp_write(rt2x00dev, 103, 0x00); |
1491 | rt2800_bbp_write(rt2x00dev, 105, 0x05); | 1485 | rt2800_bbp_write(rt2x00dev, 105, 0x05); |
1492 | 1486 | ||
1493 | if (rt2x00_rt(rt2x00dev, RT2860) && | 1487 | if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C)) { |
1494 | (rt2x00_rev(rt2x00dev) == RT2860C_VERSION)) { | ||
1495 | rt2800_bbp_write(rt2x00dev, 69, 0x16); | 1488 | rt2800_bbp_write(rt2x00dev, 69, 0x16); |
1496 | rt2800_bbp_write(rt2x00dev, 73, 0x12); | 1489 | rt2800_bbp_write(rt2x00dev, 73, 0x12); |
1497 | } | 1490 | } |
1498 | 1491 | ||
1499 | if (rt2x00_rt(rt2x00dev, RT2860) && | 1492 | if (rt2x00_rt_rev_gte(rt2x00dev, RT2860, REV_RT2860D)) |
1500 | (rt2x00_rev(rt2x00dev) > RT2860D_VERSION)) | ||
1501 | rt2800_bbp_write(rt2x00dev, 84, 0x19); | 1493 | rt2800_bbp_write(rt2x00dev, 84, 0x19); |
1502 | 1494 | ||
1503 | if (rt2x00_rt(rt2x00dev, RT2872)) { | 1495 | if (rt2x00_rt(rt2x00dev, RT2872)) { |
@@ -1507,8 +1499,7 @@ int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
1507 | } | 1499 | } |
1508 | 1500 | ||
1509 | if (rt2x00_is_usb(rt2x00dev) && | 1501 | if (rt2x00_is_usb(rt2x00dev) && |
1510 | rt2x00_rt(rt2x00dev, RT3070) && | 1502 | rt2x00_rt_rev(rt2x00dev, RT3070, REV_RT3070E)) { |
1511 | (rt2x00_rev(rt2x00dev) == RT3070_VERSION)) { | ||
1512 | rt2800_bbp_write(rt2x00dev, 70, 0x0a); | 1503 | rt2800_bbp_write(rt2x00dev, 70, 0x0a); |
1513 | rt2800_bbp_write(rt2x00dev, 84, 0x99); | 1504 | rt2800_bbp_write(rt2x00dev, 84, 0x99); |
1514 | rt2800_bbp_write(rt2x00dev, 105, 0x05); | 1505 | rt2800_bbp_write(rt2x00dev, 105, 0x05); |
@@ -1594,8 +1585,7 @@ int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) | |||
1594 | u8 bbp; | 1585 | u8 bbp; |
1595 | 1586 | ||
1596 | if (rt2x00_is_usb(rt2x00dev) && | 1587 | if (rt2x00_is_usb(rt2x00dev) && |
1597 | rt2x00_rt(rt2x00dev, RT3070) && | 1588 | !rt2x00_rt_rev(rt2x00dev, RT3070, REV_RT3070E)) |
1598 | (rt2x00_rev(rt2x00dev) != RT3070_VERSION)) | ||
1599 | return 0; | 1589 | return 0; |
1600 | 1590 | ||
1601 | if (rt2x00_is_pci(rt2x00dev) || rt2x00_is_soc(rt2x00dev)) { | 1591 | if (rt2x00_is_pci(rt2x00dev) || rt2x00_is_soc(rt2x00dev)) { |