upgrade to latest compat-wireless and rt2800 version
[openwrt.git] / package / mac80211 / patches / 310-rt2x00-Fix-MCS-rx_mask-rt2800usb.patch
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)
5
6 Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
7 ---
8 drivers/net/wireless/rt2x00/rt2800usb.c | 22 ++++++++++++++++++++--
9 1 files changed, 20 insertions(+), 2 deletions(-)
10
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) {
20 + /*
21 + * There is a max of 2 RX streams for RT2860 series
22 + */
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);
26 }
27
28 rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word);
29 @@ -2465,6 +2472,7 @@ static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
30 char *tx_power1;
31 char *tx_power2;
32 unsigned int i;
33 + u16 eeprom;
34
35 /*
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,
39 EEPROM_MAC_ADDR_0));
40
41 + rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom);
42 +
43 /*
44 * Initialize HT information.
45 */
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;
54
55 + switch (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH)) {
56 + case 3:
57 + spec->ht.mcs.rx_mask[2] = 0xff;
58 + case 2:
59 + spec->ht.mcs.rx_mask[1] = 0xff;
60 + case 1:
61 + spec->ht.mcs.rx_mask[0] = 0xff;
62 + break;
63 + }
64 +
65 /*
66 * Initialize hw_mode information.
67 */
68 --
69 1.6.0
70
This page took 0.042217 seconds and 5 git commands to generate.