[brcm63xx] package the bcm63xx-spi driver
[openwrt.git] / package / mac80211 / patches / 407-ath9k-fix-AR_SREV_9100_OR_LATER-macro.patch
1 From e379668f86409b5027f58a14614f6c876484404c Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Thu, 5 Mar 2009 08:32:55 +0100
4 Subject: [PATCH v2 3/3] ath9k: fix AR_SREV_9100_OR_LATER macro
5
6 The current macro is wrong, because detects some AR5416 devices as an
7 AR9100 device. The AR5416 devices would have performance issues after
8 this change, because the contents of the ar5416 specific and of the
9 ar9100 specificinitval arrays are swapped. Fortunately we can correct
10 this with the rename of the arrays simply.
11
12 Changes-licesed-under: ISC
13
14 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
15 Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
16 ---
17  drivers/net/wireless/ath9k/initvals.h |   44 ++++++++++++++++----------------
18  drivers/net/wireless/ath9k/reg.h      |    2 +-
19  2 files changed, 23 insertions(+), 23 deletions(-)
20
21 --- a/drivers/net/wireless/ath9k/initvals.h
22 +++ b/drivers/net/wireless/ath9k/initvals.h
23 @@ -14,7 +14,7 @@
24   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25   */
26  
27 -static const u32 ar5416Modes_9100[][6] = {
28 +static const u32 ar5416Modes[][6] = {
29      { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 },
30      { 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 },
31      { 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180 },
32 @@ -78,7 +78,7 @@ static const u32 ar5416Modes_9100[][6] =
33      { 0x0000a334, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
34  };
35  
36 -static const u32 ar5416Common_9100[][2] = {
37 +static const u32 ar5416Common[][2] = {
38      { 0x0000000c, 0x00000000 },
39      { 0x00000030, 0x00020015 },
40      { 0x00000034, 0x00000005 },
41 @@ -456,12 +456,12 @@ static const u32 ar5416Common_9100[][2] 
42      { 0x0000a3e0, 0x000001ce },
43  };
44  
45 -static const u32 ar5416Bank0_9100[][2] = {
46 +static const u32 ar5416Bank0[][2] = {
47      { 0x000098b0, 0x1e5795e5 },
48      { 0x000098e0, 0x02008020 },
49  };
50  
51 -static const u32 ar5416BB_RfGain_9100[][3] = {
52 +static const u32 ar5416BB_RfGain[][3] = {
53      { 0x00009a00, 0x00000000, 0x00000000 },
54      { 0x00009a04, 0x00000040, 0x00000040 },
55      { 0x00009a08, 0x00000080, 0x00000080 },
56 @@ -528,21 +528,21 @@ static const u32 ar5416BB_RfGain_9100[][
57      { 0x00009afc, 0x000000f9, 0x000000f9 },
58  };
59  
60 -static const u32 ar5416Bank1_9100[][2] = {
61 +static const u32 ar5416Bank1[][2] = {
62      { 0x000098b0, 0x02108421 },
63      { 0x000098ec, 0x00000008 },
64  };
65  
66 -static const u32 ar5416Bank2_9100[][2] = {
67 +static const u32 ar5416Bank2[][2] = {
68      { 0x000098b0, 0x0e73ff17 },
69      { 0x000098e0, 0x00000420 },
70  };
71  
72 -static const u32 ar5416Bank3_9100[][3] = {
73 +static const u32 ar5416Bank3[][3] = {
74      { 0x000098f0, 0x01400018, 0x01c00018 },
75  };
76  
77 -static const u32 ar5416Bank6_9100[][3] = {
78 +static const u32 ar5416Bank6[][3] = {
79  
80      { 0x0000989c, 0x00000000, 0x00000000 },
81      { 0x0000989c, 0x00000000, 0x00000000 },
82 @@ -579,7 +579,7 @@ static const u32 ar5416Bank6_9100[][3] =
83      { 0x000098d0, 0x0000000f, 0x0010000f },
84  };
85  
86 -static const u32 ar5416Bank6TPC_9100[][3] = {
87 +static const u32 ar5416Bank6TPC[][3] = {
88      { 0x0000989c, 0x00000000, 0x00000000 },
89      { 0x0000989c, 0x00000000, 0x00000000 },
90      { 0x0000989c, 0x00000000, 0x00000000 },
91 @@ -615,13 +615,13 @@ static const u32 ar5416Bank6TPC_9100[][3
92      { 0x000098d0, 0x0000000f, 0x0010000f },
93  };
94  
95 -static const u32 ar5416Bank7_9100[][2] = {
96 +static const u32 ar5416Bank7[][2] = {
97      { 0x0000989c, 0x00000500 },
98      { 0x0000989c, 0x00000800 },
99      { 0x000098cc, 0x0000000e },
100  };
101  
102 -static const u32 ar5416Addac_9100[][2] = {
103 +static const u32 ar5416Addac[][2] = {
104      {0x0000989c,  0x00000000 },
105      {0x0000989c,  0x00000003 },
106      {0x0000989c,  0x00000000 },
107 @@ -661,7 +661,7 @@ static const u32 ar5416Addac_9100[][2] =
108      {0x000098cc,  0x00000000 },
109  };
110  
111 -static const u32 ar5416Modes[][6] = {
112 +static const u32 ar5416Modes_9100[][6] = {
113      { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 },
114      { 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 },
115      { 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180 },
116 @@ -735,7 +735,7 @@ static const u32 ar5416Modes[][6] = {
117      { 0x0000a334, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
118  };
119  
120 -static const u32 ar5416Common[][2] = {
121 +static const u32 ar5416Common_9100[][2] = {
122      { 0x0000000c, 0x00000000 },
123      { 0x00000030, 0x00020015 },
124      { 0x00000034, 0x00000005 },
125 @@ -1109,12 +1109,12 @@ static const u32 ar5416Common[][2] = {
126      { 0x0000a3e0, 0x000001ce },
127  };
128  
129 -static const u32 ar5416Bank0[][2] = {
130 +static const u32 ar5416Bank0_9100[][2] = {
131      { 0x000098b0, 0x1e5795e5 },
132      { 0x000098e0, 0x02008020 },
133  };
134  
135 -static const u32 ar5416BB_RfGain[][3] = {
136 +static const u32 ar5416BB_RfGain_9100[][3] = {
137      { 0x00009a00, 0x00000000, 0x00000000 },
138      { 0x00009a04, 0x00000040, 0x00000040 },
139      { 0x00009a08, 0x00000080, 0x00000080 },
140 @@ -1181,21 +1181,21 @@ static const u32 ar5416BB_RfGain[][3] = 
141      { 0x00009afc, 0x000000f9, 0x000000f9 },
142  };
143  
144 -static const u32 ar5416Bank1[][2] = {
145 +static const u32 ar5416Bank1_9100[][2] = {
146      { 0x000098b0, 0x02108421},
147      { 0x000098ec, 0x00000008},
148  };
149  
150 -static const u32 ar5416Bank2[][2] = {
151 +static const u32 ar5416Bank2_9100[][2] = {
152      { 0x000098b0, 0x0e73ff17},
153      { 0x000098e0, 0x00000420},
154  };
155  
156 -static const u32 ar5416Bank3[][3] = {
157 +static const u32 ar5416Bank3_9100[][3] = {
158      { 0x000098f0, 0x01400018, 0x01c00018 },
159  };
160  
161 -static const u32 ar5416Bank6[][3] = {
162 +static const u32 ar5416Bank6_9100[][3] = {
163  
164      { 0x0000989c, 0x00000000, 0x00000000 },
165      { 0x0000989c, 0x00000000, 0x00000000 },
166 @@ -1233,7 +1233,7 @@ static const u32 ar5416Bank6[][3] = {
167  };
168  
169  
170 -static const u32 ar5416Bank6TPC[][3] = {
171 +static const u32 ar5416Bank6TPC_9100[][3] = {
172  
173      { 0x0000989c, 0x00000000, 0x00000000 },
174      { 0x0000989c, 0x00000000, 0x00000000 },
175 @@ -1270,13 +1270,13 @@ static const u32 ar5416Bank6TPC[][3] = {
176      { 0x000098d0, 0x0000000f, 0x0010000f },
177  };
178  
179 -static const u32 ar5416Bank7[][2] = {
180 +static const u32 ar5416Bank7_9100[][2] = {
181      { 0x0000989c, 0x00000500 },
182      { 0x0000989c, 0x00000800 },
183      { 0x000098cc, 0x0000000e },
184  };
185  
186 -static const u32 ar5416Addac[][2] = {
187 +static const u32 ar5416Addac_9100[][2] = {
188      {0x0000989c, 0x00000000 },
189      {0x0000989c, 0x00000000 },
190      {0x0000989c, 0x00000000 },
191 --- a/drivers/net/wireless/ath9k/reg.h
192 +++ b/drivers/net/wireless/ath9k/reg.h
193 @@ -754,7 +754,7 @@
194  #define AR_SREV_9100(ah) \
195         ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
196  #define AR_SREV_9100_OR_LATER(_ah) \
197 -       (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE))
198 +       (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))
199  
200  #define AR_SREV_9160(_ah) \
201         (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160))