2009-02-21 22:38:07 +02:00
|
|
|
From d91bfd139f98e60222e7556b696b8caa66f658bb Mon Sep 17 00:00:00 2001
|
2009-02-08 12:22:43 +02:00
|
|
|
From: Ivo van Doorn <IvDoorn@gmail.com>
|
|
|
|
Date: Sat, 7 Feb 2009 17:18:34 +0100
|
|
|
|
Subject: [PATCH] rt2x00: Fix MCS rx_mask (rt2800usb)
|
|
|
|
|
|
|
|
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
|
|
|
|
---
|
|
|
|
drivers/net/wireless/rt2x00/rt2800usb.c | 22 ++++++++++++++++++++--
|
|
|
|
1 files changed, 20 insertions(+), 2 deletions(-)
|
|
|
|
|
2009-02-21 22:38:07 +02:00
|
|
|
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
|
|
|
|
index ab00d4d..1709e87 100644
|
2009-02-08 12:22:43 +02:00
|
|
|
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
|
|
|
|
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
|
2009-02-21 22:38:07 +02:00
|
|
|
@@ -2215,6 +2215,13 @@ static int rt2800usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
|
2009-02-08 12:22:43 +02:00
|
|
|
rt2x00_set_field16(&word, EEPROM_ANTENNA_RF_TYPE, RF2820);
|
|
|
|
rt2x00_eeprom_write(rt2x00dev, EEPROM_ANTENNA, word);
|
|
|
|
EEPROM(rt2x00dev, "Antenna: 0x%04x\n", word);
|
|
|
|
+ } else if (rt2x00_rev(&rt2x00dev->chip) < RT2883_VERSION) {
|
|
|
|
+ /*
|
|
|
|
+ * There is a max of 2 RX streams for RT2860 series
|
|
|
|
+ */
|
|
|
|
+ if (rt2x00_get_field16(word, EEPROM_ANTENNA_RXPATH) > 2)
|
|
|
|
+ rt2x00_set_field16(&word, EEPROM_ANTENNA_RXPATH, 2);
|
|
|
|
+ rt2x00_eeprom_write(rt2x00dev, EEPROM_ANTENNA, word);
|
|
|
|
}
|
|
|
|
|
|
|
|
rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word);
|
2009-02-21 22:38:07 +02:00
|
|
|
@@ -2465,6 +2472,7 @@ static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
|
2009-02-08 12:22:43 +02:00
|
|
|
char *tx_power1;
|
|
|
|
char *tx_power2;
|
|
|
|
unsigned int i;
|
|
|
|
+ u16 eeprom;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize all hw fields.
|
2009-02-21 22:38:07 +02:00
|
|
|
@@ -2481,6 +2489,8 @@ static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
|
2009-02-08 12:22:43 +02:00
|
|
|
rt2x00_eeprom_addr(rt2x00dev,
|
|
|
|
EEPROM_MAC_ADDR_0));
|
|
|
|
|
|
|
|
+ rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom);
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* Initialize HT information.
|
|
|
|
*/
|
2009-02-21 22:38:07 +02:00
|
|
|
@@ -2495,11 +2505,19 @@ static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
|
2009-02-08 12:22:43 +02:00
|
|
|
IEEE80211_HT_CAP_PSMP_SUPPORT;
|
|
|
|
spec->ht.ampdu_factor = 3;
|
|
|
|
spec->ht.ampdu_density = 4;
|
|
|
|
- spec->ht.mcs.rx_mask[0] = 0xff;
|
|
|
|
- spec->ht.mcs.rx_mask[1] = 0xff;
|
|
|
|
spec->ht.mcs.tx_params =
|
|
|
|
IEEE80211_HT_MCS_TX_DEFINED;
|
|
|
|
|
|
|
|
+ switch (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH)) {
|
|
|
|
+ case 3:
|
|
|
|
+ spec->ht.mcs.rx_mask[2] = 0xff;
|
|
|
|
+ case 2:
|
|
|
|
+ spec->ht.mcs.rx_mask[1] = 0xff;
|
|
|
|
+ case 1:
|
|
|
|
+ spec->ht.mcs.rx_mask[0] = 0xff;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* Initialize hw_mode information.
|
|
|
|
*/
|
2009-02-21 22:38:07 +02:00
|
|
|
--
|
|
|
|
1.6.0
|
|
|
|
|