1 From d91bfd139f98e60222e7556b696b8caa66f658bb Mon Sep 17 00:00:00 2001
2 From: Ivo van Doorn <IvDoorn@gmail.com>
3 Date: Sat, 7 Feb 2009 17:18:34 +0100
4 Subject: [PATCH] rt2x00: Fix MCS rx_mask (rt2800usb)
6 Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
8 drivers/net/wireless/rt2x00/rt2800usb.c | 22 ++++++++++++++++++++--
9 1 files changed, 20 insertions(+), 2 deletions(-)
11 diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
12 index ab00d4d..1709e87 100644
13 --- a/drivers/net/wireless/rt2x00/rt2800usb.c
14 +++ b/drivers/net/wireless/rt2x00/rt2800usb.c
15 @@ -2215,6 +2215,13 @@ static int rt2800usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
16 rt2x00_set_field16(&word, EEPROM_ANTENNA_RF_TYPE, RF2820);
17 rt2x00_eeprom_write(rt2x00dev, EEPROM_ANTENNA, word);
18 EEPROM(rt2x00dev, "Antenna: 0x%04x\n", word);
19 + } else if (rt2x00_rev(&rt2x00dev->chip) < RT2883_VERSION) {
21 + * There is a max of 2 RX streams for RT2860 series
23 + if (rt2x00_get_field16(word, EEPROM_ANTENNA_RXPATH) > 2)
24 + rt2x00_set_field16(&word, EEPROM_ANTENNA_RXPATH, 2);
25 + rt2x00_eeprom_write(rt2x00dev, EEPROM_ANTENNA, word);
28 rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word);
29 @@ -2465,6 +2472,7 @@ static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
36 * Initialize all hw fields.
37 @@ -2481,6 +2489,8 @@ static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
38 rt2x00_eeprom_addr(rt2x00dev,
41 + rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom);
44 * Initialize HT information.
46 @@ -2495,11 +2505,19 @@ static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
47 IEEE80211_HT_CAP_PSMP_SUPPORT;
48 spec->ht.ampdu_factor = 3;
49 spec->ht.ampdu_density = 4;
50 - spec->ht.mcs.rx_mask[0] = 0xff;
51 - spec->ht.mcs.rx_mask[1] = 0xff;
52 spec->ht.mcs.tx_params =
53 IEEE80211_HT_MCS_TX_DEFINED;
55 + switch (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH)) {
57 + spec->ht.mcs.rx_mask[2] = 0xff;
59 + spec->ht.mcs.rx_mask[1] = 0xff;
61 + spec->ht.mcs.rx_mask[0] = 0xff;
66 * Initialize hw_mode information.