[package] mac80211: add ath9k init values patch
[openwrt.git] / package / mac80211 / patches / 309-rt2x00-Fix-MCS-rx_mask-rt2800pci.patch
1 From e53f1806ad975dce4888ec16398735e4c6ad6cde Mon Sep 17 00:00:00 2001
2 From: Ivo van Doorn <IvDoorn@gmail.com>
3 Date: Sat, 7 Feb 2009 17:18:03 +0100
4 Subject: [PATCH] rt2x00: Fix MCS rx_mask (rt2800pci)
5
6 Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
7 ---
8  drivers/net/wireless/rt2x00/rt2800pci.c |   22 ++++++++++++++++++++--
9  1 files changed, 20 insertions(+), 2 deletions(-)
10
11 --- a/drivers/net/wireless/rt2x00/rt2800pci.c
12 +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
13 @@ -2193,6 +2193,13 @@ static int rt2800pci_validate_eeprom(str
14                 rt2x00_set_field16(&word, EEPROM_ANTENNA_RF_TYPE, RF2820);
15                 rt2x00_eeprom_write(rt2x00dev, EEPROM_ANTENNA, word);
16                 EEPROM(rt2x00dev, "Antenna: 0x%04x\n", word);
17 +       } else if (rt2x00_rev(&rt2x00dev->chip) < RT2883_VERSION) {
18 +               /*
19 +                * There is a max of 2 RX streams for RT2860 series
20 +                */
21 +               if (rt2x00_get_field16(word, EEPROM_ANTENNA_RXPATH) > 2)
22 +                       rt2x00_set_field16(&word, EEPROM_ANTENNA_RXPATH, 2);
23 +               rt2x00_eeprom_write(rt2x00dev, EEPROM_ANTENNA, word);
24         }
25  
26         rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word);
27 @@ -2416,6 +2423,7 @@ static int rt2800pci_probe_hw_mode(struc
28         char *tx_power1;
29         char *tx_power2;
30         unsigned int i;
31 +       u16 eeprom;
32  
33         /*
34          * Initialize all hw fields.
35 @@ -2432,6 +2440,8 @@ static int rt2800pci_probe_hw_mode(struc
36                                 rt2x00_eeprom_addr(rt2x00dev,
37                                                    EEPROM_MAC_ADDR_0));
38  
39 +       rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom);
40 +
41         /*
42          * Initialize hw_mode information.
43          */
44 @@ -2463,11 +2473,19 @@ static int rt2800pci_probe_hw_mode(struc
45             IEEE80211_HT_CAP_PSMP_SUPPORT;
46         spec->ht.ampdu_factor = 3;
47         spec->ht.ampdu_density = 4;
48 -       spec->ht.mcs.rx_mask[0] = 0xff;
49 -       spec->ht.mcs.rx_mask[1] = 0xff;
50         spec->ht.mcs.tx_params =
51             IEEE80211_HT_MCS_TX_DEFINED;
52  
53 +       switch (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH)) {
54 +       case 3:
55 +               spec->ht.mcs.rx_mask[2] = 0xff;
56 +       case 2:
57 +               spec->ht.mcs.rx_mask[1] = 0xff;
58 +       case 1:
59 +               spec->ht.mcs.rx_mask[0] = 0xff;
60 +               break;
61 +       }
62 +
63         /*
64          * Create channel information array
65          */