aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNick Kossifidis <mick@madwifi-project.org>2009-02-08 23:00:34 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-13 13:44:42 -0500
commit33a31826b4fe9f26d6b383bad19b7ae522fda006 (patch)
treee0cd44187c8362f3fe9402f752508df559c6d5b9 /drivers
parent7b08b3b4a973de20d28d8a322c002c0a5444002a (diff)
ath5k: PHY code cleanup
* Clean up initial rf buffer settings (new file rfbufer.h) and introduce a new way to access specific rf registers (will use it later) * Clean up initial rf gain settings by moving them on a new file (rfgain.h) so we can later work on gain optimization functions * Update initial rf buffer settings and initial rf gain settings from HALs. This breaks things for now because our current dumps come from pre-configured rf buffer (regdumps already had the needed values set from binary HAL). Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath5k/phy.c1171
-rw-r--r--drivers/net/wireless/ath5k/rfbuffer.h1118
-rw-r--r--drivers/net/wireless/ath5k/rfgain.h480
3 files changed, 1636 insertions, 1133 deletions
diff --git a/drivers/net/wireless/ath5k/phy.c b/drivers/net/wireless/ath5k/phy.c
index 7ba18e09463b..5021749a439e 100644
--- a/drivers/net/wireless/ath5k/phy.c
+++ b/drivers/net/wireless/ath5k/phy.c
@@ -2,7 +2,7 @@
2 * PHY functions 2 * PHY functions
3 * 3 *
4 * Copyright (c) 2004-2007 Reyk Floeter <reyk@openbsd.org> 4 * Copyright (c) 2004-2007 Reyk Floeter <reyk@openbsd.org>
5 * Copyright (c) 2006-2007 Nick Kossifidis <mickflemm@gmail.com> 5 * Copyright (c) 2006-2009 Nick Kossifidis <mickflemm@gmail.com>
6 * Copyright (c) 2007-2008 Jiri Slaby <jirislaby@gmail.com> 6 * Copyright (c) 2007-2008 Jiri Slaby <jirislaby@gmail.com>
7 * 7 *
8 * Permission to use, copy, modify, and distribute this software for any 8 * Permission to use, copy, modify, and distribute this software for any
@@ -26,1084 +26,8 @@
26#include "ath5k.h" 26#include "ath5k.h"
27#include "reg.h" 27#include "reg.h"
28#include "base.h" 28#include "base.h"
29 29#include "rfbuffer.h"
30/* Struct to hold initial RF register values (RF Banks) */ 30#include "rfgain.h"
31struct ath5k_ini_rf {
32 u8 rf_bank; /* check out ath5k_reg.h */
33 u16 rf_register; /* register address */
34 u32 rf_value[5]; /* register value for different modes (above) */
35};
36
37/*
38 * Mode-specific RF Gain table (64bytes) for RF5111/5112
39 * (RF5110 only comes with AR5210 and only supports a/turbo a mode so initial
40 * RF Gain values are included in AR5K_AR5210_INI)
41 */
42struct ath5k_ini_rfgain {
43 u16 rfg_register; /* RF Gain register address */
44 u32 rfg_value[2]; /* [freq (see below)] */
45};
46
47struct ath5k_gain_opt {
48 u32 go_default;
49 u32 go_steps_count;
50 const struct ath5k_gain_opt_step go_step[AR5K_GAIN_STEP_COUNT];
51};
52
53/* RF5111 mode-specific init registers */
54static const struct ath5k_ini_rf rfregs_5111[] = {
55 { 0, 0x989c,
56 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
57 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
58 { 0, 0x989c,
59 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
60 { 0, 0x989c,
61 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
62 { 0, 0x989c,
63 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
64 { 0, 0x989c,
65 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
66 { 0, 0x989c,
67 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
68 { 0, 0x989c,
69 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
70 { 0, 0x989c,
71 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
72 { 0, 0x989c,
73 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
74 { 0, 0x989c,
75 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
76 { 0, 0x989c,
77 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
78 { 0, 0x989c,
79 { 0x00380000, 0x00380000, 0x00380000, 0x00380000, 0x00380000 } },
80 { 0, 0x989c,
81 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
82 { 0, 0x989c,
83 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
84 { 0, 0x989c,
85 { 0x00000000, 0x00000000, 0x000000c0, 0x00000080, 0x00000080 } },
86 { 0, 0x989c,
87 { 0x000400f9, 0x000400f9, 0x000400ff, 0x000400fd, 0x000400fd } },
88 { 0, 0x98d4,
89 { 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x00000004 } },
90 { 1, 0x98d4,
91 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
92 { 2, 0x98d4,
93 { 0x00000010, 0x00000014, 0x00000010, 0x00000010, 0x00000014 } },
94 { 3, 0x98d8,
95 { 0x00601068, 0x00601068, 0x00601068, 0x00601068, 0x00601068 } },
96 { 6, 0x989c,
97 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
98 { 6, 0x989c,
99 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
100 { 6, 0x989c,
101 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
102 { 6, 0x989c,
103 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
104 { 6, 0x989c,
105 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
106 { 6, 0x989c,
107 { 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000 } },
108 { 6, 0x989c,
109 { 0x04000000, 0x04000000, 0x04000000, 0x04000000, 0x04000000 } },
110 { 6, 0x989c,
111 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
112 { 6, 0x989c,
113 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
114 { 6, 0x989c,
115 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
116 { 6, 0x989c,
117 { 0x00000000, 0x00000000, 0x0a000000, 0x00000000, 0x00000000 } },
118 { 6, 0x989c,
119 { 0x003800c0, 0x00380080, 0x023800c0, 0x003800c0, 0x003800c0 } },
120 { 6, 0x989c,
121 { 0x00020006, 0x00020006, 0x00000006, 0x00020006, 0x00020006 } },
122 { 6, 0x989c,
123 { 0x00000089, 0x00000089, 0x00000089, 0x00000089, 0x00000089 } },
124 { 6, 0x989c,
125 { 0x000000a0, 0x000000a0, 0x000000a0, 0x000000a0, 0x000000a0 } },
126 { 6, 0x989c,
127 { 0x00040007, 0x00040007, 0x00040007, 0x00040007, 0x00040007 } },
128 { 6, 0x98d4,
129 { 0x0000001a, 0x0000001a, 0x0000001a, 0x0000001a, 0x0000001a } },
130 { 7, 0x989c,
131 { 0x00000040, 0x00000048, 0x00000040, 0x00000040, 0x00000040 } },
132 { 7, 0x989c,
133 { 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010 } },
134 { 7, 0x989c,
135 { 0x00000008, 0x00000008, 0x00000008, 0x00000008, 0x00000008 } },
136 { 7, 0x989c,
137 { 0x0000004f, 0x0000004f, 0x0000004f, 0x0000004f, 0x0000004f } },
138 { 7, 0x989c,
139 { 0x000000f1, 0x000000f1, 0x00000061, 0x000000f1, 0x000000f1 } },
140 { 7, 0x989c,
141 { 0x0000904f, 0x0000904f, 0x0000904c, 0x0000904f, 0x0000904f } },
142 { 7, 0x989c,
143 { 0x0000125a, 0x0000125a, 0x0000129a, 0x0000125a, 0x0000125a } },
144 { 7, 0x98cc,
145 { 0x0000000e, 0x0000000e, 0x0000000f, 0x0000000e, 0x0000000e } },
146};
147
148/* Initial RF Gain settings for RF5111 */
149static const struct ath5k_ini_rfgain rfgain_5111[] = {
150 /* 5Ghz 2Ghz */
151 { AR5K_RF_GAIN(0), { 0x000001a9, 0x00000000 } },
152 { AR5K_RF_GAIN(1), { 0x000001e9, 0x00000040 } },
153 { AR5K_RF_GAIN(2), { 0x00000029, 0x00000080 } },
154 { AR5K_RF_GAIN(3), { 0x00000069, 0x00000150 } },
155 { AR5K_RF_GAIN(4), { 0x00000199, 0x00000190 } },
156 { AR5K_RF_GAIN(5), { 0x000001d9, 0x000001d0 } },
157 { AR5K_RF_GAIN(6), { 0x00000019, 0x00000010 } },
158 { AR5K_RF_GAIN(7), { 0x00000059, 0x00000044 } },
159 { AR5K_RF_GAIN(8), { 0x00000099, 0x00000084 } },
160 { AR5K_RF_GAIN(9), { 0x000001a5, 0x00000148 } },
161 { AR5K_RF_GAIN(10), { 0x000001e5, 0x00000188 } },
162 { AR5K_RF_GAIN(11), { 0x00000025, 0x000001c8 } },
163 { AR5K_RF_GAIN(12), { 0x000001c8, 0x00000014 } },
164 { AR5K_RF_GAIN(13), { 0x00000008, 0x00000042 } },
165 { AR5K_RF_GAIN(14), { 0x00000048, 0x00000082 } },
166 { AR5K_RF_GAIN(15), { 0x00000088, 0x00000178 } },
167 { AR5K_RF_GAIN(16), { 0x00000198, 0x000001b8 } },
168 { AR5K_RF_GAIN(17), { 0x000001d8, 0x000001f8 } },
169 { AR5K_RF_GAIN(18), { 0x00000018, 0x00000012 } },
170 { AR5K_RF_GAIN(19), { 0x00000058, 0x00000052 } },
171 { AR5K_RF_GAIN(20), { 0x00000098, 0x00000092 } },
172 { AR5K_RF_GAIN(21), { 0x000001a4, 0x0000017c } },
173 { AR5K_RF_GAIN(22), { 0x000001e4, 0x000001bc } },
174 { AR5K_RF_GAIN(23), { 0x00000024, 0x000001fc } },
175 { AR5K_RF_GAIN(24), { 0x00000064, 0x0000000a } },
176 { AR5K_RF_GAIN(25), { 0x000000a4, 0x0000004a } },
177 { AR5K_RF_GAIN(26), { 0x000000e4, 0x0000008a } },
178 { AR5K_RF_GAIN(27), { 0x0000010a, 0x0000015a } },
179 { AR5K_RF_GAIN(28), { 0x0000014a, 0x0000019a } },
180 { AR5K_RF_GAIN(29), { 0x0000018a, 0x000001da } },
181 { AR5K_RF_GAIN(30), { 0x000001ca, 0x0000000e } },
182 { AR5K_RF_GAIN(31), { 0x0000000a, 0x0000004e } },
183 { AR5K_RF_GAIN(32), { 0x0000004a, 0x0000008e } },
184 { AR5K_RF_GAIN(33), { 0x0000008a, 0x0000015e } },
185 { AR5K_RF_GAIN(34), { 0x000001ba, 0x0000019e } },
186 { AR5K_RF_GAIN(35), { 0x000001fa, 0x000001de } },
187 { AR5K_RF_GAIN(36), { 0x0000003a, 0x00000009 } },
188 { AR5K_RF_GAIN(37), { 0x0000007a, 0x00000049 } },
189 { AR5K_RF_GAIN(38), { 0x00000186, 0x00000089 } },
190 { AR5K_RF_GAIN(39), { 0x000001c6, 0x00000179 } },
191 { AR5K_RF_GAIN(40), { 0x00000006, 0x000001b9 } },
192 { AR5K_RF_GAIN(41), { 0x00000046, 0x000001f9 } },
193 { AR5K_RF_GAIN(42), { 0x00000086, 0x00000039 } },
194 { AR5K_RF_GAIN(43), { 0x000000c6, 0x00000079 } },
195 { AR5K_RF_GAIN(44), { 0x000000c6, 0x000000b9 } },
196 { AR5K_RF_GAIN(45), { 0x000000c6, 0x000001bd } },
197 { AR5K_RF_GAIN(46), { 0x000000c6, 0x000001fd } },
198 { AR5K_RF_GAIN(47), { 0x000000c6, 0x0000003d } },
199 { AR5K_RF_GAIN(48), { 0x000000c6, 0x0000007d } },
200 { AR5K_RF_GAIN(49), { 0x000000c6, 0x000000bd } },
201 { AR5K_RF_GAIN(50), { 0x000000c6, 0x000000fd } },
202 { AR5K_RF_GAIN(51), { 0x000000c6, 0x000000fd } },
203 { AR5K_RF_GAIN(52), { 0x000000c6, 0x000000fd } },
204 { AR5K_RF_GAIN(53), { 0x000000c6, 0x000000fd } },
205 { AR5K_RF_GAIN(54), { 0x000000c6, 0x000000fd } },
206 { AR5K_RF_GAIN(55), { 0x000000c6, 0x000000fd } },
207 { AR5K_RF_GAIN(56), { 0x000000c6, 0x000000fd } },
208 { AR5K_RF_GAIN(57), { 0x000000c6, 0x000000fd } },
209 { AR5K_RF_GAIN(58), { 0x000000c6, 0x000000fd } },
210 { AR5K_RF_GAIN(59), { 0x000000c6, 0x000000fd } },
211 { AR5K_RF_GAIN(60), { 0x000000c6, 0x000000fd } },
212 { AR5K_RF_GAIN(61), { 0x000000c6, 0x000000fd } },
213 { AR5K_RF_GAIN(62), { 0x000000c6, 0x000000fd } },
214 { AR5K_RF_GAIN(63), { 0x000000c6, 0x000000fd } },
215};
216
217static const struct ath5k_gain_opt rfgain_opt_5111 = {
218 4,
219 9,
220 {
221 { { 4, 1, 1, 1 }, 6 },
222 { { 4, 0, 1, 1 }, 4 },
223 { { 3, 1, 1, 1 }, 3 },
224 { { 4, 0, 0, 1 }, 1 },
225 { { 4, 1, 1, 0 }, 0 },
226 { { 4, 0, 1, 0 }, -2 },
227 { { 3, 1, 1, 0 }, -3 },
228 { { 4, 0, 0, 0 }, -4 },
229 { { 2, 1, 1, 0 }, -6 }
230 }
231};
232
233/* RF5112 mode-specific init registers */
234static const struct ath5k_ini_rf rfregs_5112[] = {
235 { 1, 0x98d4,
236 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
237 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
238 { 2, 0x98d0,
239 { 0x03060408, 0x03070408, 0x03060408, 0x03060408, 0x03070408 } },
240 { 3, 0x98dc,
241 { 0x00a0c0c0, 0x00a0c0c0, 0x00e0c0c0, 0x00e0c0c0, 0x00e0c0c0 } },
242 { 6, 0x989c,
243 { 0x00a00000, 0x00a00000, 0x00a00000, 0x00a00000, 0x00a00000 } },
244 { 6, 0x989c,
245 { 0x000a0000, 0x000a0000, 0x000a0000, 0x000a0000, 0x000a0000 } },
246 { 6, 0x989c,
247 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
248 { 6, 0x989c,
249 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
250 { 6, 0x989c,
251 { 0x00660000, 0x00660000, 0x00660000, 0x00660000, 0x00660000 } },
252 { 6, 0x989c,
253 { 0x00db0000, 0x00db0000, 0x00db0000, 0x00db0000, 0x00db0000 } },
254 { 6, 0x989c,
255 { 0x00f10000, 0x00f10000, 0x00f10000, 0x00f10000, 0x00f10000 } },
256 { 6, 0x989c,
257 { 0x00120000, 0x00120000, 0x00120000, 0x00120000, 0x00120000 } },
258 { 6, 0x989c,
259 { 0x00120000, 0x00120000, 0x00120000, 0x00120000, 0x00120000 } },
260 { 6, 0x989c,
261 { 0x00730000, 0x00730000, 0x00730000, 0x00730000, 0x00730000 } },
262 { 6, 0x989c,
263 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
264 { 6, 0x989c,
265 { 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000 } },
266 { 6, 0x989c,
267 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
268 { 6, 0x989c,
269 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
270 { 6, 0x989c,
271 { 0x008b0000, 0x008b0000, 0x008b0000, 0x008b0000, 0x008b0000 } },
272 { 6, 0x989c,
273 { 0x00600000, 0x00600000, 0x00600000, 0x00600000, 0x00600000 } },
274 { 6, 0x989c,
275 { 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000 } },
276 { 6, 0x989c,
277 { 0x00840000, 0x00840000, 0x00840000, 0x00840000, 0x00840000 } },
278 { 6, 0x989c,
279 { 0x00640000, 0x00640000, 0x00640000, 0x00640000, 0x00640000 } },
280 { 6, 0x989c,
281 { 0x00200000, 0x00200000, 0x00200000, 0x00200000, 0x00200000 } },
282 { 6, 0x989c,
283 { 0x00240000, 0x00240000, 0x00240000, 0x00240000, 0x00240000 } },
284 { 6, 0x989c,
285 { 0x00250000, 0x00250000, 0x00250000, 0x00250000, 0x00250000 } },
286 { 6, 0x989c,
287 { 0x00110000, 0x00110000, 0x00110000, 0x00110000, 0x00110000 } },
288 { 6, 0x989c,
289 { 0x00110000, 0x00110000, 0x00110000, 0x00110000, 0x00110000 } },
290 { 6, 0x989c,
291 { 0x00510000, 0x00510000, 0x00510000, 0x00510000, 0x00510000 } },
292 { 6, 0x989c,
293 { 0x1c040000, 0x1c040000, 0x1c040000, 0x1c040000, 0x1c040000 } },
294 { 6, 0x989c,
295 { 0x000a0000, 0x000a0000, 0x000a0000, 0x000a0000, 0x000a0000 } },
296 { 6, 0x989c,
297 { 0x00a10000, 0x00a10000, 0x00a10000, 0x00a10000, 0x00a10000 } },
298 { 6, 0x989c,
299 { 0x00400000, 0x00400000, 0x00400000, 0x00400000, 0x00400000 } },
300 { 6, 0x989c,
301 { 0x03090000, 0x03090000, 0x03090000, 0x03090000, 0x03090000 } },
302 { 6, 0x989c,
303 { 0x06000000, 0x06000000, 0x06000000, 0x06000000, 0x06000000 } },
304 { 6, 0x989c,
305 { 0x000000b0, 0x000000b0, 0x000000a8, 0x000000a8, 0x000000a8 } },
306 { 6, 0x989c,
307 { 0x0000002e, 0x0000002e, 0x0000002e, 0x0000002e, 0x0000002e } },
308 { 6, 0x989c,
309 { 0x006c4a41, 0x006c4a41, 0x006c4af1, 0x006c4a61, 0x006c4a61 } },
310 { 6, 0x989c,
311 { 0x0050892a, 0x0050892a, 0x0050892b, 0x0050892b, 0x0050892b } },
312 { 6, 0x989c,
313 { 0x00842400, 0x00842400, 0x00842400, 0x00842400, 0x00842400 } },
314 { 6, 0x989c,
315 { 0x00c69200, 0x00c69200, 0x00c69200, 0x00c69200, 0x00c69200 } },
316 { 6, 0x98d0,
317 { 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c } },
318 { 7, 0x989c,
319 { 0x00000094, 0x00000094, 0x00000094, 0x00000094, 0x00000094 } },
320 { 7, 0x989c,
321 { 0x00000091, 0x00000091, 0x00000091, 0x00000091, 0x00000091 } },
322 { 7, 0x989c,
323 { 0x0000000a, 0x0000000a, 0x00000012, 0x00000012, 0x00000012 } },
324 { 7, 0x989c,
325 { 0x00000080, 0x00000080, 0x00000080, 0x00000080, 0x00000080 } },
326 { 7, 0x989c,
327 { 0x000000c1, 0x000000c1, 0x000000c1, 0x000000c1, 0x000000c1 } },
328 { 7, 0x989c,
329 { 0x00000060, 0x00000060, 0x00000060, 0x00000060, 0x00000060 } },
330 { 7, 0x989c,
331 { 0x000000f0, 0x000000f0, 0x000000f0, 0x000000f0, 0x000000f0 } },
332 { 7, 0x989c,
333 { 0x00000022, 0x00000022, 0x00000022, 0x00000022, 0x00000022 } },
334 { 7, 0x989c,
335 { 0x00000092, 0x00000092, 0x00000092, 0x00000092, 0x00000092 } },
336 { 7, 0x989c,
337 { 0x000000d4, 0x000000d4, 0x000000d4, 0x000000d4, 0x000000d4 } },
338 { 7, 0x989c,
339 { 0x000014cc, 0x000014cc, 0x000014cc, 0x000014cc, 0x000014cc } },
340 { 7, 0x989c,
341 { 0x0000048c, 0x0000048c, 0x0000048c, 0x0000048c, 0x0000048c } },
342 { 7, 0x98c4,
343 { 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003 } },
344};
345
346/* RF5112A mode-specific init registers */
347static const struct ath5k_ini_rf rfregs_5112a[] = {
348 { 1, 0x98d4,
349 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
350 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
351 { 2, 0x98d0,
352 { 0x03060408, 0x03070408, 0x03060408, 0x03060408, 0x03070408 } },
353 { 3, 0x98dc,
354 { 0x00a0c0c0, 0x00a0c0c0, 0x00e0c0c0, 0x00e0c0c0, 0x00e0c0c0 } },
355 { 6, 0x989c,
356 { 0x0f000000, 0x0f000000, 0x0f000000, 0x0f000000, 0x0f000000 } },
357 { 6, 0x989c,
358 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
359 { 6, 0x989c,
360 { 0x00800000, 0x00800000, 0x00800000, 0x00800000, 0x00800000 } },
361 { 6, 0x989c,
362 { 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000 } },
363 { 6, 0x989c,
364 { 0x00010000, 0x00010000, 0x00010000, 0x00010000, 0x00010000 } },
365 { 6, 0x989c,
366 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
367 { 6, 0x989c,
368 { 0x00180000, 0x00180000, 0x00180000, 0x00180000, 0x00180000 } },
369 { 6, 0x989c,
370 { 0x00600000, 0x00600000, 0x006e0000, 0x006e0000, 0x006e0000 } },
371 { 6, 0x989c,
372 { 0x00c70000, 0x00c70000, 0x00c70000, 0x00c70000, 0x00c70000 } },
373 { 6, 0x989c,
374 { 0x004b0000, 0x004b0000, 0x004b0000, 0x004b0000, 0x004b0000 } },
375 { 6, 0x989c,
376 { 0x04480000, 0x04480000, 0x04480000, 0x04480000, 0x04480000 } },
377 { 6, 0x989c,
378 { 0x00220000, 0x00220000, 0x00220000, 0x00220000, 0x00220000 } },
379 { 6, 0x989c,
380 { 0x00e40000, 0x00e40000, 0x00e40000, 0x00e40000, 0x00e40000 } },
381 { 6, 0x989c,
382 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
383 { 6, 0x989c,
384 { 0x00fc0000, 0x00fc0000, 0x00fc0000, 0x00fc0000, 0x00fc0000 } },
385 { 6, 0x989c,
386 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
387 { 6, 0x989c,
388 { 0x043f0000, 0x043f0000, 0x043f0000, 0x043f0000, 0x043f0000 } },
389 { 6, 0x989c,
390 { 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000 } },
391 { 6, 0x989c,
392 { 0x00190000, 0x00190000, 0x00190000, 0x00190000, 0x00190000 } },
393 { 6, 0x989c,
394 { 0x00240000, 0x00240000, 0x00240000, 0x00240000, 0x00240000 } },
395 { 6, 0x989c,
396 { 0x00b40000, 0x00b40000, 0x00b40000, 0x00b40000, 0x00b40000 } },
397 { 6, 0x989c,
398 { 0x00990000, 0x00990000, 0x00990000, 0x00990000, 0x00990000 } },
399 { 6, 0x989c,
400 { 0x00500000, 0x00500000, 0x00500000, 0x00500000, 0x00500000 } },
401 { 6, 0x989c,
402 { 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000 } },
403 { 6, 0x989c,
404 { 0x00120000, 0x00120000, 0x00120000, 0x00120000, 0x00120000 } },
405 { 6, 0x989c,
406 { 0xc0320000, 0xc0320000, 0xc0320000, 0xc0320000, 0xc0320000 } },
407 { 6, 0x989c,
408 { 0x01740000, 0x01740000, 0x01740000, 0x01740000, 0x01740000 } },
409 { 6, 0x989c,
410 { 0x00110000, 0x00110000, 0x00110000, 0x00110000, 0x00110000 } },
411 { 6, 0x989c,
412 { 0x86280000, 0x86280000, 0x86280000, 0x86280000, 0x86280000 } },
413 { 6, 0x989c,
414 { 0x31840000, 0x31840000, 0x31840000, 0x31840000, 0x31840000 } },
415 { 6, 0x989c,
416 { 0x00020080, 0x00020080, 0x00020080, 0x00020080, 0x00020080 } },
417 { 6, 0x989c,
418 { 0x00080009, 0x00080009, 0x00080009, 0x00080009, 0x00080009 } },
419 { 6, 0x989c,
420 { 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003 } },
421 { 6, 0x989c,
422 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
423 { 6, 0x989c,
424 { 0x000000b2, 0x000000b2, 0x000000b2, 0x000000b2, 0x000000b2 } },
425 { 6, 0x989c,
426 { 0x00b02084, 0x00b02084, 0x00b02084, 0x00b02084, 0x00b02084 } },
427 { 6, 0x989c,
428 { 0x004125a4, 0x004125a4, 0x004125a4, 0x004125a4, 0x004125a4 } },
429 { 6, 0x989c,
430 { 0x00119220, 0x00119220, 0x00119220, 0x00119220, 0x00119220 } },
431 { 6, 0x989c,
432 { 0x001a4800, 0x001a4800, 0x001a4800, 0x001a4800, 0x001a4800 } },
433 { 6, 0x98d8,
434 { 0x000b0230, 0x000b0230, 0x000b0230, 0x000b0230, 0x000b0230 } },
435 { 7, 0x989c,
436 { 0x00000094, 0x00000094, 0x00000094, 0x00000094, 0x00000094 } },
437 { 7, 0x989c,
438 { 0x00000091, 0x00000091, 0x00000091, 0x00000091, 0x00000091 } },
439 { 7, 0x989c,
440 { 0x00000012, 0x00000012, 0x00000012, 0x00000012, 0x00000012 } },
441 { 7, 0x989c,
442 { 0x00000080, 0x00000080, 0x00000080, 0x00000080, 0x00000080 } },
443 { 7, 0x989c,
444 { 0x000000d9, 0x000000d9, 0x000000d9, 0x000000d9, 0x000000d9 } },
445 { 7, 0x989c,
446 { 0x00000060, 0x00000060, 0x00000060, 0x00000060, 0x00000060 } },
447 { 7, 0x989c,
448 { 0x000000f0, 0x000000f0, 0x000000f0, 0x000000f0, 0x000000f0 } },
449 { 7, 0x989c,
450 { 0x000000a2, 0x000000a2, 0x000000a2, 0x000000a2, 0x000000a2 } },
451 { 7, 0x989c,
452 { 0x00000052, 0x00000052, 0x00000052, 0x00000052, 0x00000052 } },
453 { 7, 0x989c,
454 { 0x000000d4, 0x000000d4, 0x000000d4, 0x000000d4, 0x000000d4 } },
455 { 7, 0x989c,
456 { 0x000014cc, 0x000014cc, 0x000014cc, 0x000014cc, 0x000014cc } },
457 { 7, 0x989c,
458 { 0x0000048c, 0x0000048c, 0x0000048c, 0x0000048c, 0x0000048c } },
459 { 7, 0x98c4,
460 { 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003 } },
461};
462
463
464static const struct ath5k_ini_rf rfregs_2112a[] = {
465 { 1, AR5K_RF_BUFFER_CONTROL_4,
466 /* mode b mode g mode gTurbo */
467 { 0x00000020, 0x00000020, 0x00000020 } },
468 { 2, AR5K_RF_BUFFER_CONTROL_3,
469 { 0x03060408, 0x03060408, 0x03070408 } },
470 { 3, AR5K_RF_BUFFER_CONTROL_6,
471 { 0x00e020c0, 0x00e020c0, 0x00e020c0 } },
472 { 6, AR5K_RF_BUFFER,
473 { 0x0a000000, 0x0a000000, 0x0a000000 } },
474 { 6, AR5K_RF_BUFFER,
475 { 0x00000000, 0x00000000, 0x00000000 } },
476 { 6, AR5K_RF_BUFFER,
477 { 0x00800000, 0x00800000, 0x00800000 } },
478 { 6, AR5K_RF_BUFFER,
479 { 0x002a0000, 0x002a0000, 0x002a0000 } },
480 { 6, AR5K_RF_BUFFER,
481 { 0x00010000, 0x00010000, 0x00010000 } },
482 { 6, AR5K_RF_BUFFER,
483 { 0x00000000, 0x00000000, 0x00000000 } },
484 { 6, AR5K_RF_BUFFER,
485 { 0x00180000, 0x00180000, 0x00180000 } },
486 { 6, AR5K_RF_BUFFER,
487 { 0x006e0000, 0x006e0000, 0x006e0000 } },
488 { 6, AR5K_RF_BUFFER,
489 { 0x00c70000, 0x00c70000, 0x00c70000 } },
490 { 6, AR5K_RF_BUFFER,
491 { 0x004b0000, 0x004b0000, 0x004b0000 } },
492 { 6, AR5K_RF_BUFFER,
493 { 0x04480000, 0x04480000, 0x04480000 } },
494 { 6, AR5K_RF_BUFFER,
495 { 0x002a0000, 0x002a0000, 0x002a0000 } },
496 { 6, AR5K_RF_BUFFER,
497 { 0x00e40000, 0x00e40000, 0x00e40000 } },
498 { 6, AR5K_RF_BUFFER,
499 { 0x00000000, 0x00000000, 0x00000000 } },
500 { 6, AR5K_RF_BUFFER,
501 { 0x00fc0000, 0x00fc0000, 0x00fc0000 } },
502 { 6, AR5K_RF_BUFFER,
503 { 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
504 { 6, AR5K_RF_BUFFER,
505 { 0x043f0000, 0x043f0000, 0x043f0000 } },
506 { 6, AR5K_RF_BUFFER,
507 { 0x0c0c0000, 0x0c0c0000, 0x0c0c0000 } },
508 { 6, AR5K_RF_BUFFER,
509 { 0x02190000, 0x02190000, 0x02190000 } },
510 { 6, AR5K_RF_BUFFER,
511 { 0x00240000, 0x00240000, 0x00240000 } },
512 { 6, AR5K_RF_BUFFER,
513 { 0x00b40000, 0x00b40000, 0x00b40000 } },
514 { 6, AR5K_RF_BUFFER,
515 { 0x00990000, 0x00990000, 0x00990000 } },
516 { 6, AR5K_RF_BUFFER,
517 { 0x00500000, 0x00500000, 0x00500000 } },
518 { 6, AR5K_RF_BUFFER,
519 { 0x002a0000, 0x002a0000, 0x002a0000 } },
520 { 6, AR5K_RF_BUFFER,
521 { 0x00120000, 0x00120000, 0x00120000 } },
522 { 6, AR5K_RF_BUFFER,
523 { 0xc0320000, 0xc0320000, 0xc0320000 } },
524 { 6, AR5K_RF_BUFFER,
525 { 0x01740000, 0x01740000, 0x01740000 } },
526 { 6, AR5K_RF_BUFFER,
527 { 0x00110000, 0x00110000, 0x00110000 } },
528 { 6, AR5K_RF_BUFFER,
529 { 0x86280000, 0x86280000, 0x86280000 } },
530 { 6, AR5K_RF_BUFFER,
531 { 0x31840000, 0x31840000, 0x31840000 } },
532 { 6, AR5K_RF_BUFFER,
533 { 0x00f20080, 0x00f20080, 0x00f20080 } },
534 { 6, AR5K_RF_BUFFER,
535 { 0x00070019, 0x00070019, 0x00070019 } },
536 { 6, AR5K_RF_BUFFER,
537 { 0x00000000, 0x00000000, 0x00000000 } },
538 { 6, AR5K_RF_BUFFER,
539 { 0x00000000, 0x00000000, 0x00000000 } },
540 { 6, AR5K_RF_BUFFER,
541 { 0x000000b2, 0x000000b2, 0x000000b2 } },
542 { 6, AR5K_RF_BUFFER,
543 { 0x00b02184, 0x00b02184, 0x00b02184 } },
544 { 6, AR5K_RF_BUFFER,
545 { 0x004125a4, 0x004125a4, 0x004125a4 } },
546 { 6, AR5K_RF_BUFFER,
547 { 0x00119220, 0x00119220, 0x00119220 } },
548 { 6, AR5K_RF_BUFFER,
549 { 0x001a4800, 0x001a4800, 0x001a4800 } },
550 { 6, AR5K_RF_BUFFER_CONTROL_5,
551 { 0x000b0230, 0x000b0230, 0x000b0230 } },
552 { 7, AR5K_RF_BUFFER,
553 { 0x00000094, 0x00000094, 0x00000094 } },
554 { 7, AR5K_RF_BUFFER,
555 { 0x00000091, 0x00000091, 0x00000091 } },
556 { 7, AR5K_RF_BUFFER,
557 { 0x00000012, 0x00000012, 0x00000012 } },
558 { 7, AR5K_RF_BUFFER,
559 { 0x00000080, 0x00000080, 0x00000080 } },
560 { 7, AR5K_RF_BUFFER,
561 { 0x000000d9, 0x000000d9, 0x000000d9 } },
562 { 7, AR5K_RF_BUFFER,
563 { 0x00000060, 0x00000060, 0x00000060 } },
564 { 7, AR5K_RF_BUFFER,
565 { 0x000000f0, 0x000000f0, 0x000000f0 } },
566 { 7, AR5K_RF_BUFFER,
567 { 0x000000a2, 0x000000a2, 0x000000a2 } },
568 { 7, AR5K_RF_BUFFER,
569 { 0x00000052, 0x00000052, 0x00000052 } },
570 { 7, AR5K_RF_BUFFER,
571 { 0x000000d4, 0x000000d4, 0x000000d4 } },
572 { 7, AR5K_RF_BUFFER,
573 { 0x000014cc, 0x000014cc, 0x000014cc } },
574 { 7, AR5K_RF_BUFFER,
575 { 0x0000048c, 0x0000048c, 0x0000048c } },
576 { 7, AR5K_RF_BUFFER_CONTROL_1,
577 { 0x00000003, 0x00000003, 0x00000003 } },
578};
579
580/* RF5413/5414 mode-specific init registers */
581static const struct ath5k_ini_rf rfregs_5413[] = {
582 { 1, 0x98d4,
583 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
584 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
585 { 2, 0x98d0,
586 { 0x00000008, 0x00000008, 0x00000008, 0x00000008, 0x00000008 } },
587 { 3, 0x98dc,
588 { 0x00a000c0, 0x00a000c0, 0x00e000c0, 0x00e000c0, 0x00e000c0 } },
589 { 6, 0x989c,
590 { 0x33000000, 0x33000000, 0x33000000, 0x33000000, 0x33000000 } },
591 { 6, 0x989c,
592 { 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000 } },
593 { 6, 0x989c,
594 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
595 { 6, 0x989c,
596 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
597 { 6, 0x989c,
598 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
599 { 6, 0x989c,
600 { 0x1f000000, 0x1f000000, 0x1f000000, 0x1f000000, 0x1f000000 } },
601 { 6, 0x989c,
602 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
603 { 6, 0x989c,
604 { 0x00b80000, 0x00b80000, 0x00b80000, 0x00b80000, 0x00b80000 } },
605 { 6, 0x989c,
606 { 0x00b70000, 0x00b70000, 0x00b70000, 0x00b70000, 0x00b70000 } },
607 { 6, 0x989c,
608 { 0x00840000, 0x00840000, 0x00840000, 0x00840000, 0x00840000 } },
609 { 6, 0x989c,
610 { 0x00980000, 0x00980000, 0x00980000, 0x00980000, 0x00980000 } },
611 { 6, 0x989c,
612 { 0x00c00000, 0x00c00000, 0x00c00000, 0x00c00000, 0x00c00000 } },
613 { 6, 0x989c,
614 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
615 { 6, 0x989c,
616 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
617 { 6, 0x989c,
618 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
619 { 6, 0x989c,
620 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
621 { 6, 0x989c,
622 { 0x00d70000, 0x00d70000, 0x00d70000, 0x00d70000, 0x00d70000 } },
623 { 6, 0x989c,
624 { 0x00610000, 0x00610000, 0x00610000, 0x00610000, 0x00610000 } },
625 { 6, 0x989c,
626 { 0x00fe0000, 0x00fe0000, 0x00fe0000, 0x00fe0000, 0x00fe0000 } },
627 { 6, 0x989c,
628 { 0x00de0000, 0x00de0000, 0x00de0000, 0x00de0000, 0x00de0000 } },
629 { 6, 0x989c,
630 { 0x007f0000, 0x007f0000, 0x007f0000, 0x007f0000, 0x007f0000 } },
631 { 6, 0x989c,
632 { 0x043d0000, 0x043d0000, 0x043d0000, 0x043d0000, 0x043d0000 } },
633 { 6, 0x989c,
634 { 0x00770000, 0x00770000, 0x00770000, 0x00770000, 0x00770000 } },
635 { 6, 0x989c,
636 { 0x00440000, 0x00440000, 0x00440000, 0x00440000, 0x00440000 } },
637 { 6, 0x989c,
638 { 0x00980000, 0x00980000, 0x00980000, 0x00980000, 0x00980000 } },
639 { 6, 0x989c,
640 { 0x00100080, 0x00100080, 0x00100080, 0x00100080, 0x00100080 } },
641 { 6, 0x989c,
642 { 0x0005c034, 0x0005c034, 0x0005c034, 0x0005c034, 0x0005c034 } },
643 { 6, 0x989c,
644 { 0x003100f0, 0x003100f0, 0x003100f0, 0x003100f0, 0x003100f0 } },
645 { 6, 0x989c,
646 { 0x000c011f, 0x000c011f, 0x000c011f, 0x000c011f, 0x000c011f } },
647 { 6, 0x989c,
648 { 0x00510040, 0x00510040, 0x005100a0, 0x005100a0, 0x005100a0 } },
649 { 6, 0x989c,
650 { 0x0050006a, 0x0050006a, 0x005000dd, 0x005000dd, 0x005000dd } },
651 { 6, 0x989c,
652 { 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000 } },
653 { 6, 0x989c,
654 { 0x00004044, 0x00004044, 0x00004044, 0x00004044, 0x00004044 } },
655 { 6, 0x989c,
656 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
657 { 6, 0x989c,
658 { 0x000060c0, 0x000060c0, 0x000060c0, 0x000060c0, 0x000060c0 } },
659 { 6, 0x989c,
660 { 0x00002c00, 0x00002c00, 0x00003600, 0x00003600, 0x00003600 } },
661 { 6, 0x98c8,
662 { 0x00000403, 0x00000403, 0x00040403, 0x00040403, 0x00040403 } },
663 { 7, 0x989c,
664 { 0x00006400, 0x00006400, 0x00006400, 0x00006400, 0x00006400 } },
665 { 7, 0x989c,
666 { 0x00000800, 0x00000800, 0x00000800, 0x00000800, 0x00000800 } },
667 { 7, 0x98cc,
668 { 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e } },
669};
670
671/* RF2413/2414 mode-specific init registers */
672static const struct ath5k_ini_rf rfregs_2413[] = {
673 { 1, AR5K_RF_BUFFER_CONTROL_4,
674 /* mode b mode g mode gTurbo */
675 { 0x00000020, 0x00000020, 0x00000020 } },
676 { 2, AR5K_RF_BUFFER_CONTROL_3,
677 { 0x02001408, 0x02001408, 0x02001408 } },
678 { 3, AR5K_RF_BUFFER_CONTROL_6,
679 { 0x00e020c0, 0x00e020c0, 0x00e020c0 } },
680 { 6, AR5K_RF_BUFFER,
681 { 0xf0000000, 0xf0000000, 0xf0000000 } },
682 { 6, AR5K_RF_BUFFER,
683 { 0x00000000, 0x00000000, 0x00000000 } },
684 { 6, AR5K_RF_BUFFER,
685 { 0x03000000, 0x03000000, 0x03000000 } },
686 { 6, AR5K_RF_BUFFER,
687 { 0x00000000, 0x00000000, 0x00000000 } },
688 { 6, AR5K_RF_BUFFER,
689 { 0x00000000, 0x00000000, 0x00000000 } },
690 { 6, AR5K_RF_BUFFER,
691 { 0x00000000, 0x00000000, 0x00000000 } },
692 { 6, AR5K_RF_BUFFER,
693 { 0x00000000, 0x00000000, 0x00000000 } },
694 { 6, AR5K_RF_BUFFER,
695 { 0x00000000, 0x00000000, 0x00000000 } },
696 { 6, AR5K_RF_BUFFER,
697 { 0x40400000, 0x40400000, 0x40400000 } },
698 { 6, AR5K_RF_BUFFER,
699 { 0x65050000, 0x65050000, 0x65050000 } },
700 { 6, AR5K_RF_BUFFER,
701 { 0x00000000, 0x00000000, 0x00000000 } },
702 { 6, AR5K_RF_BUFFER,
703 { 0x00000000, 0x00000000, 0x00000000 } },
704 { 6, AR5K_RF_BUFFER,
705 { 0x00420000, 0x00420000, 0x00420000 } },
706 { 6, AR5K_RF_BUFFER,
707 { 0x00b50000, 0x00b50000, 0x00b50000 } },
708 { 6, AR5K_RF_BUFFER,
709 { 0x00030000, 0x00030000, 0x00030000 } },
710 { 6, AR5K_RF_BUFFER,
711 { 0x00f70000, 0x00f70000, 0x00f70000 } },
712 { 6, AR5K_RF_BUFFER,
713 { 0x009d0000, 0x009d0000, 0x009d0000 } },
714 { 6, AR5K_RF_BUFFER,
715 { 0x00220000, 0x00220000, 0x00220000 } },
716 { 6, AR5K_RF_BUFFER,
717 { 0x04220000, 0x04220000, 0x04220000 } },
718 { 6, AR5K_RF_BUFFER,
719 { 0x00230018, 0x00230018, 0x00230018 } },
720 { 6, AR5K_RF_BUFFER,
721 { 0x00280050, 0x00280050, 0x00280050 } },
722 { 6, AR5K_RF_BUFFER,
723 { 0x005000c3, 0x005000c3, 0x005000c3 } },
724 { 6, AR5K_RF_BUFFER,
725 { 0x0004007f, 0x0004007f, 0x0004007f } },
726 { 6, AR5K_RF_BUFFER,
727 { 0x00000458, 0x00000458, 0x00000458 } },
728 { 6, AR5K_RF_BUFFER,
729 { 0x00000000, 0x00000000, 0x00000000 } },
730 { 6, AR5K_RF_BUFFER,
731 { 0x0000c000, 0x0000c000, 0x0000c000 } },
732 { 6, AR5K_RF_BUFFER_CONTROL_5,
733 { 0x00400230, 0x00400230, 0x00400230 } },
734 { 7, AR5K_RF_BUFFER,
735 { 0x00006400, 0x00006400, 0x00006400 } },
736 { 7, AR5K_RF_BUFFER,
737 { 0x00000800, 0x00000800, 0x00000800 } },
738 { 7, AR5K_RF_BUFFER_CONTROL_2,
739 { 0x0000000e, 0x0000000e, 0x0000000e } },
740};
741
742/* RF2425 mode-specific init registers */
743static const struct ath5k_ini_rf rfregs_2425[] = {
744 { 1, AR5K_RF_BUFFER_CONTROL_4,
745 /* mode g mode gTurbo */
746 { 0x00000020, 0x00000020 } },
747 { 2, AR5K_RF_BUFFER_CONTROL_3,
748 { 0x02001408, 0x02001408 } },
749 { 3, AR5K_RF_BUFFER_CONTROL_6,
750 { 0x00e020c0, 0x00e020c0 } },
751 { 6, AR5K_RF_BUFFER,
752 { 0x10000000, 0x10000000 } },
753 { 6, AR5K_RF_BUFFER,
754 { 0x00000000, 0x00000000 } },
755 { 6, AR5K_RF_BUFFER,
756 { 0x00000000, 0x00000000 } },
757 { 6, AR5K_RF_BUFFER,
758 { 0x00000000, 0x00000000 } },
759 { 6, AR5K_RF_BUFFER,
760 { 0x00000000, 0x00000000 } },
761 { 6, AR5K_RF_BUFFER,
762 { 0x00000000, 0x00000000 } },
763 { 6, AR5K_RF_BUFFER,
764 { 0x00000000, 0x00000000 } },
765 { 6, AR5K_RF_BUFFER,
766 { 0x00000000, 0x00000000 } },
767 { 6, AR5K_RF_BUFFER,
768 { 0x00000000, 0x00000000 } },
769 { 6, AR5K_RF_BUFFER,
770 { 0x00000000, 0x00000000 } },
771 { 6, AR5K_RF_BUFFER,
772 { 0x00000000, 0x00000000 } },
773 { 6, AR5K_RF_BUFFER,
774 { 0x002a0000, 0x002a0000 } },
775 { 6, AR5K_RF_BUFFER,
776 { 0x00000000, 0x00000000 } },
777 { 6, AR5K_RF_BUFFER,
778 { 0x00000000, 0x00000000 } },
779 { 6, AR5K_RF_BUFFER,
780 { 0x00100000, 0x00100000 } },
781 { 6, AR5K_RF_BUFFER,
782 { 0x00020000, 0x00020000 } },
783 { 6, AR5K_RF_BUFFER,
784 { 0x00730000, 0x00730000 } },
785 { 6, AR5K_RF_BUFFER,
786 { 0x00f80000, 0x00f80000 } },
787 { 6, AR5K_RF_BUFFER,
788 { 0x00e70000, 0x00e70000 } },
789 { 6, AR5K_RF_BUFFER,
790 { 0x00140000, 0x00140000 } },
791 { 6, AR5K_RF_BUFFER,
792 { 0x00910040, 0x00910040 } },
793 { 6, AR5K_RF_BUFFER,
794 { 0x0007001a, 0x0007001a } },
795 { 6, AR5K_RF_BUFFER,
796 { 0x00410000, 0x00410000 } },
797 { 6, AR5K_RF_BUFFER,
798 { 0x00810060, 0x00810060 } },
799 { 6, AR5K_RF_BUFFER,
800 { 0x00020803, 0x00020803 } },
801 { 6, AR5K_RF_BUFFER,
802 { 0x00000000, 0x00000000 } },
803 { 6, AR5K_RF_BUFFER,
804 { 0x00000000, 0x00000000 } },
805 { 6, AR5K_RF_BUFFER,
806 { 0x00001660, 0x00001660 } },
807 { 6, AR5K_RF_BUFFER,
808 { 0x00001688, 0x00001688 } },
809 { 6, AR5K_RF_BUFFER_CONTROL_1,
810 { 0x00000001, 0x00000001 } },
811 { 7, AR5K_RF_BUFFER,
812 { 0x00006400, 0x00006400 } },
813 { 7, AR5K_RF_BUFFER,
814 { 0x00000800, 0x00000800 } },
815 { 7, AR5K_RF_BUFFER_CONTROL_2,
816 { 0x0000000e, 0x0000000e } },
817};
818
819/* Initial RF Gain settings for RF5112 */
820static const struct ath5k_ini_rfgain rfgain_5112[] = {
821 /* 5Ghz 2Ghz */
822 { AR5K_RF_GAIN(0), { 0x00000007, 0x00000007 } },
823 { AR5K_RF_GAIN(1), { 0x00000047, 0x00000047 } },
824 { AR5K_RF_GAIN(2), { 0x00000087, 0x00000087 } },
825 { AR5K_RF_GAIN(3), { 0x000001a0, 0x000001a0 } },
826 { AR5K_RF_GAIN(4), { 0x000001e0, 0x000001e0 } },
827 { AR5K_RF_GAIN(5), { 0x00000020, 0x00000020 } },
828 { AR5K_RF_GAIN(6), { 0x00000060, 0x00000060 } },
829 { AR5K_RF_GAIN(7), { 0x000001a1, 0x000001a1 } },
830 { AR5K_RF_GAIN(8), { 0x000001e1, 0x000001e1 } },
831 { AR5K_RF_GAIN(9), { 0x00000021, 0x00000021 } },
832 { AR5K_RF_GAIN(10), { 0x00000061, 0x00000061 } },
833 { AR5K_RF_GAIN(11), { 0x00000162, 0x00000162 } },
834 { AR5K_RF_GAIN(12), { 0x000001a2, 0x000001a2 } },
835 { AR5K_RF_GAIN(13), { 0x000001e2, 0x000001e2 } },
836 { AR5K_RF_GAIN(14), { 0x00000022, 0x00000022 } },
837 { AR5K_RF_GAIN(15), { 0x00000062, 0x00000062 } },
838 { AR5K_RF_GAIN(16), { 0x00000163, 0x00000163 } },
839 { AR5K_RF_GAIN(17), { 0x000001a3, 0x000001a3 } },
840 { AR5K_RF_GAIN(18), { 0x000001e3, 0x000001e3 } },
841 { AR5K_RF_GAIN(19), { 0x00000023, 0x00000023 } },
842 { AR5K_RF_GAIN(20), { 0x00000063, 0x00000063 } },
843 { AR5K_RF_GAIN(21), { 0x00000184, 0x00000184 } },
844 { AR5K_RF_GAIN(22), { 0x000001c4, 0x000001c4 } },
845 { AR5K_RF_GAIN(23), { 0x00000004, 0x00000004 } },
846 { AR5K_RF_GAIN(24), { 0x000001ea, 0x0000000b } },
847 { AR5K_RF_GAIN(25), { 0x0000002a, 0x0000004b } },
848 { AR5K_RF_GAIN(26), { 0x0000006a, 0x0000008b } },
849 { AR5K_RF_GAIN(27), { 0x000000aa, 0x000001ac } },
850 { AR5K_RF_GAIN(28), { 0x000001ab, 0x000001ec } },
851 { AR5K_RF_GAIN(29), { 0x000001eb, 0x0000002c } },
852 { AR5K_RF_GAIN(30), { 0x0000002b, 0x00000012 } },
853 { AR5K_RF_GAIN(31), { 0x0000006b, 0x00000052 } },
854 { AR5K_RF_GAIN(32), { 0x000000ab, 0x00000092 } },
855 { AR5K_RF_GAIN(33), { 0x000001ac, 0x00000193 } },
856 { AR5K_RF_GAIN(34), { 0x000001ec, 0x000001d3 } },
857 { AR5K_RF_GAIN(35), { 0x0000002c, 0x00000013 } },
858 { AR5K_RF_GAIN(36), { 0x0000003a, 0x00000053 } },
859 { AR5K_RF_GAIN(37), { 0x0000007a, 0x00000093 } },
860 { AR5K_RF_GAIN(38), { 0x000000ba, 0x00000194 } },
861 { AR5K_RF_GAIN(39), { 0x000001bb, 0x000001d4 } },
862 { AR5K_RF_GAIN(40), { 0x000001fb, 0x00000014 } },
863 { AR5K_RF_GAIN(41), { 0x0000003b, 0x0000003a } },
864 { AR5K_RF_GAIN(42), { 0x0000007b, 0x0000007a } },
865 { AR5K_RF_GAIN(43), { 0x000000bb, 0x000000ba } },
866 { AR5K_RF_GAIN(44), { 0x000001bc, 0x000001bb } },
867 { AR5K_RF_GAIN(45), { 0x000001fc, 0x000001fb } },
868 { AR5K_RF_GAIN(46), { 0x0000003c, 0x0000003b } },
869 { AR5K_RF_GAIN(47), { 0x0000007c, 0x0000007b } },
870 { AR5K_RF_GAIN(48), { 0x000000bc, 0x000000bb } },
871 { AR5K_RF_GAIN(49), { 0x000000fc, 0x000001bc } },
872 { AR5K_RF_GAIN(50), { 0x000000fc, 0x000001fc } },
873 { AR5K_RF_GAIN(51), { 0x000000fc, 0x0000003c } },
874 { AR5K_RF_GAIN(52), { 0x000000fc, 0x0000007c } },
875 { AR5K_RF_GAIN(53), { 0x000000fc, 0x000000bc } },
876 { AR5K_RF_GAIN(54), { 0x000000fc, 0x000000fc } },
877 { AR5K_RF_GAIN(55), { 0x000000fc, 0x000000fc } },
878 { AR5K_RF_GAIN(56), { 0x000000fc, 0x000000fc } },
879 { AR5K_RF_GAIN(57), { 0x000000fc, 0x000000fc } },
880 { AR5K_RF_GAIN(58), { 0x000000fc, 0x000000fc } },
881 { AR5K_RF_GAIN(59), { 0x000000fc, 0x000000fc } },
882 { AR5K_RF_GAIN(60), { 0x000000fc, 0x000000fc } },
883 { AR5K_RF_GAIN(61), { 0x000000fc, 0x000000fc } },
884 { AR5K_RF_GAIN(62), { 0x000000fc, 0x000000fc } },
885 { AR5K_RF_GAIN(63), { 0x000000fc, 0x000000fc } },
886};
887
888/* Initial RF Gain settings for RF5413 */
889static const struct ath5k_ini_rfgain rfgain_5413[] = {
890 /* 5Ghz 2Ghz */
891 { AR5K_RF_GAIN(0), { 0x00000000, 0x00000000 } },
892 { AR5K_RF_GAIN(1), { 0x00000040, 0x00000040 } },
893 { AR5K_RF_GAIN(2), { 0x00000080, 0x00000080 } },
894 { AR5K_RF_GAIN(3), { 0x000001a1, 0x00000161 } },
895 { AR5K_RF_GAIN(4), { 0x000001e1, 0x000001a1 } },
896 { AR5K_RF_GAIN(5), { 0x00000021, 0x000001e1 } },
897 { AR5K_RF_GAIN(6), { 0x00000061, 0x00000021 } },
898 { AR5K_RF_GAIN(7), { 0x00000188, 0x00000061 } },
899 { AR5K_RF_GAIN(8), { 0x000001c8, 0x00000188 } },
900 { AR5K_RF_GAIN(9), { 0x00000008, 0x000001c8 } },
901 { AR5K_RF_GAIN(10), { 0x00000048, 0x00000008 } },
902 { AR5K_RF_GAIN(11), { 0x00000088, 0x00000048 } },
903 { AR5K_RF_GAIN(12), { 0x000001a9, 0x00000088 } },
904 { AR5K_RF_GAIN(13), { 0x000001e9, 0x00000169 } },
905 { AR5K_RF_GAIN(14), { 0x00000029, 0x000001a9 } },
906 { AR5K_RF_GAIN(15), { 0x00000069, 0x000001e9 } },
907 { AR5K_RF_GAIN(16), { 0x000001d0, 0x00000029 } },
908 { AR5K_RF_GAIN(17), { 0x00000010, 0x00000069 } },
909 { AR5K_RF_GAIN(18), { 0x00000050, 0x00000190 } },
910 { AR5K_RF_GAIN(19), { 0x00000090, 0x000001d0 } },
911 { AR5K_RF_GAIN(20), { 0x000001b1, 0x00000010 } },
912 { AR5K_RF_GAIN(21), { 0x000001f1, 0x00000050 } },
913 { AR5K_RF_GAIN(22), { 0x00000031, 0x00000090 } },
914 { AR5K_RF_GAIN(23), { 0x00000071, 0x00000171 } },
915 { AR5K_RF_GAIN(24), { 0x000001b8, 0x000001b1 } },
916 { AR5K_RF_GAIN(25), { 0x000001f8, 0x000001f1 } },
917 { AR5K_RF_GAIN(26), { 0x00000038, 0x00000031 } },
918 { AR5K_RF_GAIN(27), { 0x00000078, 0x00000071 } },
919 { AR5K_RF_GAIN(28), { 0x00000199, 0x00000198 } },
920 { AR5K_RF_GAIN(29), { 0x000001d9, 0x000001d8 } },
921 { AR5K_RF_GAIN(30), { 0x00000019, 0x00000018 } },
922 { AR5K_RF_GAIN(31), { 0x00000059, 0x00000058 } },
923 { AR5K_RF_GAIN(32), { 0x00000099, 0x00000098 } },
924 { AR5K_RF_GAIN(33), { 0x000000d9, 0x00000179 } },
925 { AR5K_RF_GAIN(34), { 0x000000f9, 0x000001b9 } },
926 { AR5K_RF_GAIN(35), { 0x000000f9, 0x000001f9 } },
927 { AR5K_RF_GAIN(36), { 0x000000f9, 0x00000039 } },
928 { AR5K_RF_GAIN(37), { 0x000000f9, 0x00000079 } },
929 { AR5K_RF_GAIN(38), { 0x000000f9, 0x000000b9 } },
930 { AR5K_RF_GAIN(39), { 0x000000f9, 0x000000f9 } },
931 { AR5K_RF_GAIN(40), { 0x000000f9, 0x000000f9 } },
932 { AR5K_RF_GAIN(41), { 0x000000f9, 0x000000f9 } },
933 { AR5K_RF_GAIN(42), { 0x000000f9, 0x000000f9 } },
934 { AR5K_RF_GAIN(43), { 0x000000f9, 0x000000f9 } },
935 { AR5K_RF_GAIN(44), { 0x000000f9, 0x000000f9 } },
936 { AR5K_RF_GAIN(45), { 0x000000f9, 0x000000f9 } },
937 { AR5K_RF_GAIN(46), { 0x000000f9, 0x000000f9 } },
938 { AR5K_RF_GAIN(47), { 0x000000f9, 0x000000f9 } },
939 { AR5K_RF_GAIN(48), { 0x000000f9, 0x000000f9 } },
940 { AR5K_RF_GAIN(49), { 0x000000f9, 0x000000f9 } },
941 { AR5K_RF_GAIN(50), { 0x000000f9, 0x000000f9 } },
942 { AR5K_RF_GAIN(51), { 0x000000f9, 0x000000f9 } },
943 { AR5K_RF_GAIN(52), { 0x000000f9, 0x000000f9 } },
944 { AR5K_RF_GAIN(53), { 0x000000f9, 0x000000f9 } },
945 { AR5K_RF_GAIN(54), { 0x000000f9, 0x000000f9 } },
946 { AR5K_RF_GAIN(55), { 0x000000f9, 0x000000f9 } },
947 { AR5K_RF_GAIN(56), { 0x000000f9, 0x000000f9 } },
948 { AR5K_RF_GAIN(57), { 0x000000f9, 0x000000f9 } },
949 { AR5K_RF_GAIN(58), { 0x000000f9, 0x000000f9 } },
950 { AR5K_RF_GAIN(59), { 0x000000f9, 0x000000f9 } },
951 { AR5K_RF_GAIN(60), { 0x000000f9, 0x000000f9 } },
952 { AR5K_RF_GAIN(61), { 0x000000f9, 0x000000f9 } },
953 { AR5K_RF_GAIN(62), { 0x000000f9, 0x000000f9 } },
954 { AR5K_RF_GAIN(63), { 0x000000f9, 0x000000f9 } },
955};
956
957/* Initial RF Gain settings for RF2413 */
958static const struct ath5k_ini_rfgain rfgain_2413[] = {
959 { AR5K_RF_GAIN(0), { 0x00000000 } },
960 { AR5K_RF_GAIN(1), { 0x00000040 } },
961 { AR5K_RF_GAIN(2), { 0x00000080 } },
962 { AR5K_RF_GAIN(3), { 0x00000181 } },
963 { AR5K_RF_GAIN(4), { 0x000001c1 } },
964 { AR5K_RF_GAIN(5), { 0x00000001 } },
965 { AR5K_RF_GAIN(6), { 0x00000041 } },
966 { AR5K_RF_GAIN(7), { 0x00000081 } },
967 { AR5K_RF_GAIN(8), { 0x00000168 } },
968 { AR5K_RF_GAIN(9), { 0x000001a8 } },
969 { AR5K_RF_GAIN(10), { 0x000001e8 } },
970 { AR5K_RF_GAIN(11), { 0x00000028 } },
971 { AR5K_RF_GAIN(12), { 0x00000068 } },
972 { AR5K_RF_GAIN(13), { 0x00000189 } },
973 { AR5K_RF_GAIN(14), { 0x000001c9 } },
974 { AR5K_RF_GAIN(15), { 0x00000009 } },
975 { AR5K_RF_GAIN(16), { 0x00000049 } },
976 { AR5K_RF_GAIN(17), { 0x00000089 } },
977 { AR5K_RF_GAIN(18), { 0x00000190 } },
978 { AR5K_RF_GAIN(19), { 0x000001d0 } },
979 { AR5K_RF_GAIN(20), { 0x00000010 } },
980 { AR5K_RF_GAIN(21), { 0x00000050 } },
981 { AR5K_RF_GAIN(22), { 0x00000090 } },
982 { AR5K_RF_GAIN(23), { 0x00000191 } },
983 { AR5K_RF_GAIN(24), { 0x000001d1 } },
984 { AR5K_RF_GAIN(25), { 0x00000011 } },
985 { AR5K_RF_GAIN(26), { 0x00000051 } },
986 { AR5K_RF_GAIN(27), { 0x00000091 } },
987 { AR5K_RF_GAIN(28), { 0x00000178 } },
988 { AR5K_RF_GAIN(29), { 0x000001b8 } },
989 { AR5K_RF_GAIN(30), { 0x000001f8 } },
990 { AR5K_RF_GAIN(31), { 0x00000038 } },
991 { AR5K_RF_GAIN(32), { 0x00000078 } },
992 { AR5K_RF_GAIN(33), { 0x00000199 } },
993 { AR5K_RF_GAIN(34), { 0x000001d9 } },
994 { AR5K_RF_GAIN(35), { 0x00000019 } },
995 { AR5K_RF_GAIN(36), { 0x00000059 } },
996 { AR5K_RF_GAIN(37), { 0x00000099 } },
997 { AR5K_RF_GAIN(38), { 0x000000d9 } },
998 { AR5K_RF_GAIN(39), { 0x000000f9 } },
999 { AR5K_RF_GAIN(40), { 0x000000f9 } },
1000 { AR5K_RF_GAIN(41), { 0x000000f9 } },
1001 { AR5K_RF_GAIN(42), { 0x000000f9 } },
1002 { AR5K_RF_GAIN(43), { 0x000000f9 } },
1003 { AR5K_RF_GAIN(44), { 0x000000f9 } },
1004 { AR5K_RF_GAIN(45), { 0x000000f9 } },
1005 { AR5K_RF_GAIN(46), { 0x000000f9 } },
1006 { AR5K_RF_GAIN(47), { 0x000000f9 } },
1007 { AR5K_RF_GAIN(48), { 0x000000f9 } },
1008 { AR5K_RF_GAIN(49), { 0x000000f9 } },
1009 { AR5K_RF_GAIN(50), { 0x000000f9 } },
1010 { AR5K_RF_GAIN(51), { 0x000000f9 } },
1011 { AR5K_RF_GAIN(52), { 0x000000f9 } },
1012 { AR5K_RF_GAIN(53), { 0x000000f9 } },
1013 { AR5K_RF_GAIN(54), { 0x000000f9 } },
1014 { AR5K_RF_GAIN(55), { 0x000000f9 } },
1015 { AR5K_RF_GAIN(56), { 0x000000f9 } },
1016 { AR5K_RF_GAIN(57), { 0x000000f9 } },
1017 { AR5K_RF_GAIN(58), { 0x000000f9 } },
1018 { AR5K_RF_GAIN(59), { 0x000000f9 } },
1019 { AR5K_RF_GAIN(60), { 0x000000f9 } },
1020 { AR5K_RF_GAIN(61), { 0x000000f9 } },
1021 { AR5K_RF_GAIN(62), { 0x000000f9 } },
1022 { AR5K_RF_GAIN(63), { 0x000000f9 } },
1023};
1024
1025/* Initial RF Gain settings for RF2425 */
1026static const struct ath5k_ini_rfgain rfgain_2425[] = {
1027 { AR5K_RF_GAIN(0), { 0x00000000 } },
1028 { AR5K_RF_GAIN(1), { 0x00000040 } },
1029 { AR5K_RF_GAIN(2), { 0x00000080 } },
1030 { AR5K_RF_GAIN(3), { 0x00000181 } },
1031 { AR5K_RF_GAIN(4), { 0x000001c1 } },
1032 { AR5K_RF_GAIN(5), { 0x00000001 } },
1033 { AR5K_RF_GAIN(6), { 0x00000041 } },
1034 { AR5K_RF_GAIN(7), { 0x00000081 } },
1035 { AR5K_RF_GAIN(8), { 0x00000188 } },
1036 { AR5K_RF_GAIN(9), { 0x000001c8 } },
1037 { AR5K_RF_GAIN(10), { 0x00000008 } },
1038 { AR5K_RF_GAIN(11), { 0x00000048 } },
1039 { AR5K_RF_GAIN(12), { 0x00000088 } },
1040 { AR5K_RF_GAIN(13), { 0x00000189 } },
1041 { AR5K_RF_GAIN(14), { 0x000001c9 } },
1042 { AR5K_RF_GAIN(15), { 0x00000009 } },
1043 { AR5K_RF_GAIN(16), { 0x00000049 } },
1044 { AR5K_RF_GAIN(17), { 0x00000089 } },
1045 { AR5K_RF_GAIN(18), { 0x000001b0 } },
1046 { AR5K_RF_GAIN(19), { 0x000001f0 } },
1047 { AR5K_RF_GAIN(20), { 0x00000030 } },
1048 { AR5K_RF_GAIN(21), { 0x00000070 } },
1049 { AR5K_RF_GAIN(22), { 0x00000171 } },
1050 { AR5K_RF_GAIN(23), { 0x000001b1 } },
1051 { AR5K_RF_GAIN(24), { 0x000001f1 } },
1052 { AR5K_RF_GAIN(25), { 0x00000031 } },
1053 { AR5K_RF_GAIN(26), { 0x00000071 } },
1054 { AR5K_RF_GAIN(27), { 0x000001b8 } },
1055 { AR5K_RF_GAIN(28), { 0x000001f8 } },
1056 { AR5K_RF_GAIN(29), { 0x00000038 } },
1057 { AR5K_RF_GAIN(30), { 0x00000078 } },
1058 { AR5K_RF_GAIN(31), { 0x000000b8 } },
1059 { AR5K_RF_GAIN(32), { 0x000001b9 } },
1060 { AR5K_RF_GAIN(33), { 0x000001f9 } },
1061 { AR5K_RF_GAIN(34), { 0x00000039 } },
1062 { AR5K_RF_GAIN(35), { 0x00000079 } },
1063 { AR5K_RF_GAIN(36), { 0x000000b9 } },
1064 { AR5K_RF_GAIN(37), { 0x000000f9 } },
1065 { AR5K_RF_GAIN(38), { 0x000000f9 } },
1066 { AR5K_RF_GAIN(39), { 0x000000f9 } },
1067 { AR5K_RF_GAIN(40), { 0x000000f9 } },
1068 { AR5K_RF_GAIN(41), { 0x000000f9 } },
1069 { AR5K_RF_GAIN(42), { 0x000000f9 } },
1070 { AR5K_RF_GAIN(43), { 0x000000f9 } },
1071 { AR5K_RF_GAIN(44), { 0x000000f9 } },
1072 { AR5K_RF_GAIN(45), { 0x000000f9 } },
1073 { AR5K_RF_GAIN(46), { 0x000000f9 } },
1074 { AR5K_RF_GAIN(47), { 0x000000f9 } },
1075 { AR5K_RF_GAIN(48), { 0x000000f9 } },
1076 { AR5K_RF_GAIN(49), { 0x000000f9 } },
1077 { AR5K_RF_GAIN(50), { 0x000000f9 } },
1078 { AR5K_RF_GAIN(51), { 0x000000f9 } },
1079 { AR5K_RF_GAIN(52), { 0x000000f9 } },
1080 { AR5K_RF_GAIN(53), { 0x000000f9 } },
1081 { AR5K_RF_GAIN(54), { 0x000000f9 } },
1082 { AR5K_RF_GAIN(55), { 0x000000f9 } },
1083 { AR5K_RF_GAIN(56), { 0x000000f9 } },
1084 { AR5K_RF_GAIN(57), { 0x000000f9 } },
1085 { AR5K_RF_GAIN(58), { 0x000000f9 } },
1086 { AR5K_RF_GAIN(59), { 0x000000f9 } },
1087 { AR5K_RF_GAIN(60), { 0x000000f9 } },
1088 { AR5K_RF_GAIN(61), { 0x000000f9 } },
1089 { AR5K_RF_GAIN(62), { 0x000000f9 } },
1090 { AR5K_RF_GAIN(63), { 0x000000f9 } },
1091};
1092
1093static const struct ath5k_gain_opt rfgain_opt_5112 = {
1094 1,
1095 8,
1096 {
1097 { { 3, 0, 0, 0, 0, 0, 0 }, 6 },
1098 { { 2, 0, 0, 0, 0, 0, 0 }, 0 },
1099 { { 1, 0, 0, 0, 0, 0, 0 }, -3 },
1100 { { 0, 0, 0, 0, 0, 0, 0 }, -6 },
1101 { { 0, 1, 1, 0, 0, 0, 0 }, -8 },
1102 { { 0, 1, 1, 0, 1, 1, 0 }, -10 },
1103 { { 0, 1, 0, 1, 1, 1, 0 }, -13 },
1104 { { 0, 1, 0, 1, 1, 0, 1 }, -16 },
1105 }
1106};
1107 31
1108/* 32/*
1109 * Used to modify RF Banks before writing them to AR5K_RF_BUFFER 33 * Used to modify RF Banks before writing them to AR5K_RF_BUFFER
@@ -1297,7 +221,7 @@ static int ath5k_hw_rf5111_rfregs(struct ath5k_hw *ah,
1297{ 221{
1298 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; 222 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
1299 u32 *rf; 223 u32 *rf;
1300 const unsigned int rf_size = ARRAY_SIZE(rfregs_5111); 224 const unsigned int rf_size = ARRAY_SIZE(rfb_5111);
1301 unsigned int i; 225 unsigned int i;
1302 int obdb = -1, bank = -1; 226 int obdb = -1, bank = -1;
1303 u32 ee_mode; 227 u32 ee_mode;
@@ -1308,17 +232,17 @@ static int ath5k_hw_rf5111_rfregs(struct ath5k_hw *ah,
1308 232
1309 /* Copy values to modify them */ 233 /* Copy values to modify them */
1310 for (i = 0; i < rf_size; i++) { 234 for (i = 0; i < rf_size; i++) {
1311 if (rfregs_5111[i].rf_bank >= AR5K_RF5111_INI_RF_MAX_BANKS) { 235 if (rfb_5111[i].rfb_bank >= AR5K_RF5111_INI_RF_MAX_BANKS) {
1312 ATH5K_ERR(ah->ah_sc, "invalid bank\n"); 236 ATH5K_ERR(ah->ah_sc, "invalid bank\n");
1313 return -EINVAL; 237 return -EINVAL;
1314 } 238 }
1315 239
1316 if (bank != rfregs_5111[i].rf_bank) { 240 if (bank != rfb_5111[i].rfb_bank) {
1317 bank = rfregs_5111[i].rf_bank; 241 bank = rfb_5111[i].rfb_bank;
1318 ah->ah_offset[bank] = i; 242 ah->ah_offset[bank] = i;
1319 } 243 }
1320 244
1321 rf[i] = rfregs_5111[i].rf_value[mode]; 245 rf[i] = rfb_5111[i].rfb_mode_data[mode];
1322 } 246 }
1323 247
1324 /* Modify bank 0 */ 248 /* Modify bank 0 */
@@ -1384,7 +308,7 @@ static int ath5k_hw_rf5111_rfregs(struct ath5k_hw *ah,
1384 /* Write RF values */ 308 /* Write RF values */
1385 for (i = 0; i < rf_size; i++) { 309 for (i = 0; i < rf_size; i++) {
1386 AR5K_REG_WAIT(i); 310 AR5K_REG_WAIT(i);
1387 ath5k_hw_reg_write(ah, rf[i], rfregs_5111[i].rf_register); 311 ath5k_hw_reg_write(ah, rf[i], rfb_5111[i].rfb_ctrl_register);
1388 } 312 }
1389 313
1390 return 0; 314 return 0;
@@ -1396,7 +320,7 @@ static int ath5k_hw_rf5111_rfregs(struct ath5k_hw *ah,
1396static int ath5k_hw_rf5112_rfregs(struct ath5k_hw *ah, 320static int ath5k_hw_rf5112_rfregs(struct ath5k_hw *ah,
1397 struct ieee80211_channel *channel, unsigned int mode) 321 struct ieee80211_channel *channel, unsigned int mode)
1398{ 322{
1399 const struct ath5k_ini_rf *rf_ini; 323 const struct ath5k_ini_rfbuffer *rf_ini;
1400 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; 324 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
1401 u32 *rf; 325 u32 *rf;
1402 unsigned int rf_size, i; 326 unsigned int rf_size, i;
@@ -1407,37 +331,27 @@ static int ath5k_hw_rf5112_rfregs(struct ath5k_hw *ah,
1407 331
1408 rf = ah->ah_rf_banks; 332 rf = ah->ah_rf_banks;
1409 333
1410 if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_2112A 334 if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_5112A) {
1411 && !test_bit(AR5K_MODE_11A, ah->ah_capabilities.cap_mode)) { 335 rf_ini = rfb_5112a;
1412 rf_ini = rfregs_2112a; 336 rf_size = ARRAY_SIZE(rfb_5112a);
1413 rf_size = ARRAY_SIZE(rfregs_5112a);
1414 if (mode < 2) {
1415 ATH5K_ERR(ah->ah_sc, "invalid channel mode: %i\n",
1416 mode);
1417 return -EINVAL;
1418 }
1419 mode = mode - 2; /*no a/turboa modes for 2112*/
1420 } else if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_5112A) {
1421 rf_ini = rfregs_5112a;
1422 rf_size = ARRAY_SIZE(rfregs_5112a);
1423 } else { 337 } else {
1424 rf_ini = rfregs_5112; 338 rf_ini = rfb_5112;
1425 rf_size = ARRAY_SIZE(rfregs_5112); 339 rf_size = ARRAY_SIZE(rfb_5112);
1426 } 340 }
1427 341
1428 /* Copy values to modify them */ 342 /* Copy values to modify them */
1429 for (i = 0; i < rf_size; i++) { 343 for (i = 0; i < rf_size; i++) {
1430 if (rf_ini[i].rf_bank >= AR5K_RF5112_INI_RF_MAX_BANKS) { 344 if (rf_ini[i].rfb_bank >= AR5K_RF5112_INI_RF_MAX_BANKS) {
1431 ATH5K_ERR(ah->ah_sc, "invalid bank\n"); 345 ATH5K_ERR(ah->ah_sc, "invalid bank\n");
1432 return -EINVAL; 346 return -EINVAL;
1433 } 347 }
1434 348
1435 if (bank != rf_ini[i].rf_bank) { 349 if (bank != rf_ini[i].rfb_bank) {
1436 bank = rf_ini[i].rf_bank; 350 bank = rf_ini[i].rfb_bank;
1437 ah->ah_offset[bank] = i; 351 ah->ah_offset[bank] = i;
1438 } 352 }
1439 353
1440 rf[i] = rf_ini[i].rf_value[mode]; 354 rf[i] = rf_ini[i].rfb_mode_data[mode];
1441 } 355 }
1442 356
1443 /* Modify bank 6 */ 357 /* Modify bank 6 */
@@ -1491,7 +405,7 @@ static int ath5k_hw_rf5112_rfregs(struct ath5k_hw *ah,
1491 405
1492 /* Write RF values */ 406 /* Write RF values */
1493 for (i = 0; i < rf_size; i++) 407 for (i = 0; i < rf_size; i++)
1494 ath5k_hw_reg_write(ah, rf[i], rf_ini[i].rf_register); 408 ath5k_hw_reg_write(ah, rf[i], rf_ini[i].rfb_ctrl_register);
1495 409
1496 return 0; 410 return 0;
1497} 411}
@@ -1503,7 +417,7 @@ static int ath5k_hw_rf5112_rfregs(struct ath5k_hw *ah,
1503static int ath5k_hw_rf5413_rfregs(struct ath5k_hw *ah, 417static int ath5k_hw_rf5413_rfregs(struct ath5k_hw *ah,
1504 struct ieee80211_channel *channel, unsigned int mode) 418 struct ieee80211_channel *channel, unsigned int mode)
1505{ 419{
1506 const struct ath5k_ini_rf *rf_ini; 420 const struct ath5k_ini_rfbuffer *rf_ini;
1507 u32 *rf; 421 u32 *rf;
1508 unsigned int rf_size, i; 422 unsigned int rf_size, i;
1509 int bank = -1; 423 int bank = -1;
@@ -1514,12 +428,12 @@ static int ath5k_hw_rf5413_rfregs(struct ath5k_hw *ah,
1514 428
1515 switch (ah->ah_radio) { 429 switch (ah->ah_radio) {
1516 case AR5K_RF5413: 430 case AR5K_RF5413:
1517 rf_ini = rfregs_5413; 431 rf_ini = rfb_5413;
1518 rf_size = ARRAY_SIZE(rfregs_5413); 432 rf_size = ARRAY_SIZE(rfb_5413);
1519 break; 433 break;
1520 case AR5K_RF2413: 434 case AR5K_RF2413:
1521 rf_ini = rfregs_2413; 435 rf_ini = rfb_2413;
1522 rf_size = ARRAY_SIZE(rfregs_2413); 436 rf_size = ARRAY_SIZE(rfb_2413);
1523 437
1524 if (mode < 2) { 438 if (mode < 2) {
1525 ATH5K_ERR(ah->ah_sc, 439 ATH5K_ERR(ah->ah_sc,
@@ -1527,11 +441,10 @@ static int ath5k_hw_rf5413_rfregs(struct ath5k_hw *ah,
1527 return -EINVAL; 441 return -EINVAL;
1528 } 442 }
1529 443
1530 mode = mode - 2;
1531 break; 444 break;
1532 case AR5K_RF2425: 445 case AR5K_RF2425:
1533 rf_ini = rfregs_2425; 446 rf_ini = rfb_2425;
1534 rf_size = ARRAY_SIZE(rfregs_2425); 447 rf_size = ARRAY_SIZE(rfb_2425);
1535 448
1536 if (mode < 2) { 449 if (mode < 2) {
1537 ATH5K_ERR(ah->ah_sc, 450 ATH5K_ERR(ah->ah_sc,
@@ -1539,12 +452,6 @@ static int ath5k_hw_rf5413_rfregs(struct ath5k_hw *ah,
1539 return -EINVAL; 452 return -EINVAL;
1540 } 453 }
1541 454
1542 /* Map b to g */
1543 if (mode == 2)
1544 mode = 0;
1545 else
1546 mode = mode - 3;
1547
1548 break; 455 break;
1549 default: 456 default:
1550 return -EINVAL; 457 return -EINVAL;
@@ -1552,17 +459,17 @@ static int ath5k_hw_rf5413_rfregs(struct ath5k_hw *ah,
1552 459
1553 /* Copy values to modify them */ 460 /* Copy values to modify them */
1554 for (i = 0; i < rf_size; i++) { 461 for (i = 0; i < rf_size; i++) {
1555 if (rf_ini[i].rf_bank >= AR5K_RF5112_INI_RF_MAX_BANKS) { 462 if (rf_ini[i].rfb_bank >= AR5K_RF5112_INI_RF_MAX_BANKS) {
1556 ATH5K_ERR(ah->ah_sc, "invalid bank\n"); 463 ATH5K_ERR(ah->ah_sc, "invalid bank\n");
1557 return -EINVAL; 464 return -EINVAL;
1558 } 465 }
1559 466
1560 if (bank != rf_ini[i].rf_bank) { 467 if (bank != rf_ini[i].rfb_bank) {
1561 bank = rf_ini[i].rf_bank; 468 bank = rf_ini[i].rfb_bank;
1562 ah->ah_offset[bank] = i; 469 ah->ah_offset[bank] = i;
1563 } 470 }
1564 471
1565 rf[i] = rf_ini[i].rf_value[mode]; 472 rf[i] = rf_ini[i].rfb_mode_data[mode];
1566 } 473 }
1567 474
1568 /* 475 /*
@@ -1577,7 +484,7 @@ static int ath5k_hw_rf5413_rfregs(struct ath5k_hw *ah,
1577 484
1578 /* Write RF values */ 485 /* Write RF values */
1579 for (i = 0; i < rf_size; i++) 486 for (i = 0; i < rf_size; i++)
1580 ath5k_hw_reg_write(ah, rf[i], rf_ini[i].rf_register); 487 ath5k_hw_reg_write(ah, rf[i], rf_ini[i].rfb_ctrl_register);
1581 488
1582 return 0; 489 return 0;
1583} 490}
@@ -1593,26 +500,26 @@ int ath5k_hw_rfregs(struct ath5k_hw *ah, struct ieee80211_channel *channel,
1593 500
1594 switch (ah->ah_radio) { 501 switch (ah->ah_radio) {
1595 case AR5K_RF5111: 502 case AR5K_RF5111:
1596 ah->ah_rf_banks_size = sizeof(rfregs_5111); 503 ah->ah_rf_banks_size = sizeof(rfb_5111);
1597 func = ath5k_hw_rf5111_rfregs; 504 func = ath5k_hw_rf5111_rfregs;
1598 break; 505 break;
1599 case AR5K_RF5112: 506 case AR5K_RF5112:
1600 if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_5112A) 507 if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_5112A)
1601 ah->ah_rf_banks_size = sizeof(rfregs_5112a); 508 ah->ah_rf_banks_size = sizeof(rfb_5112a);
1602 else 509 else
1603 ah->ah_rf_banks_size = sizeof(rfregs_5112); 510 ah->ah_rf_banks_size = sizeof(rfb_5112);
1604 func = ath5k_hw_rf5112_rfregs; 511 func = ath5k_hw_rf5112_rfregs;
1605 break; 512 break;
1606 case AR5K_RF5413: 513 case AR5K_RF5413:
1607 ah->ah_rf_banks_size = sizeof(rfregs_5413); 514 ah->ah_rf_banks_size = sizeof(rfb_5413);
1608 func = ath5k_hw_rf5413_rfregs; 515 func = ath5k_hw_rf5413_rfregs;
1609 break; 516 break;
1610 case AR5K_RF2413: 517 case AR5K_RF2413:
1611 ah->ah_rf_banks_size = sizeof(rfregs_2413); 518 ah->ah_rf_banks_size = sizeof(rfb_2413);
1612 func = ath5k_hw_rf5413_rfregs; 519 func = ath5k_hw_rf5413_rfregs;
1613 break; 520 break;
1614 case AR5K_RF2425: 521 case AR5K_RF2425:
1615 ah->ah_rf_banks_size = sizeof(rfregs_2425); 522 ah->ah_rf_banks_size = sizeof(rfb_2425);
1616 func = ath5k_hw_rf5413_rfregs; 523 func = ath5k_hw_rf5413_rfregs;
1617 break; 524 break;
1618 default: 525 default:
@@ -1656,12 +563,10 @@ int ath5k_hw_rfgain(struct ath5k_hw *ah, unsigned int freq)
1656 case AR5K_RF2413: 563 case AR5K_RF2413:
1657 ath5k_rfg = rfgain_2413; 564 ath5k_rfg = rfgain_2413;
1658 size = ARRAY_SIZE(rfgain_2413); 565 size = ARRAY_SIZE(rfgain_2413);
1659 freq = 0; /* only 2Ghz */
1660 break; 566 break;
1661 case AR5K_RF2425: 567 case AR5K_RF2425:
1662 ath5k_rfg = rfgain_2425; 568 ath5k_rfg = rfgain_2425;
1663 size = ARRAY_SIZE(rfgain_2425); 569 size = ARRAY_SIZE(rfgain_2425);
1664 freq = 0; /* only 2Ghz */
1665 break; 570 break;
1666 default: 571 default:
1667 return -EINVAL; 572 return -EINVAL;
diff --git a/drivers/net/wireless/ath5k/rfbuffer.h b/drivers/net/wireless/ath5k/rfbuffer.h
new file mode 100644
index 000000000000..526cf6cb845f
--- /dev/null
+++ b/drivers/net/wireless/ath5k/rfbuffer.h
@@ -0,0 +1,1118 @@
1/*
2 * RF Buffer handling functions
3 *
4 * Copyright (c) 2009 Nick Kossifidis <mickflemm@gmail.com>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
18 */
19
20/*
21 * Struct to hold default mode specific RF
22 * register values (RF Banks)
23 */
24struct ath5k_ini_rfbuffer {
25 u8 rfb_bank; /* RF Bank number */
26 u16 rfb_ctrl_register; /* RF Buffer control register */
27 u32 rfb_mode_data[5]; /* RF Buffer data for each mode */
28};
29
30/*
31 * Struct to hold RF Buffer field
32 * infos used to access certain RF
33 * analog registers
34 */
35struct ath5k_rfb_field {
36 u8 len; /* Field length */
37 u16 pos; /* Offset on the raw packet */
38 u8 col; /* Column -used for shifting */
39};
40
41/*
42 * RF analog register definition
43 */
44struct ath5k_rf_reg {
45 u8 bank; /* RF Buffer Bank number */
46 u8 index; /* Register's index on rf_regs_idx */
47 struct ath5k_rfb_field field; /* RF Buffer field for this register */
48};
49
50/* Map RF registers to indexes
51 * We do this to handle common bits and make our
52 * life easier by using an index for each register
53 * instead of a full rfb_field */
54enum ath5k_rf_regs_idx {
55 /* BANK 6 */
56 AR5K_RF_OB_2GHZ = 0,
57 AR5K_RF_OB_5GHZ,
58 AR5K_RF_DB_2GHZ,
59 AR5K_RF_DB_5GHZ,
60 AR5K_RF_FIXED_BIAS_A,
61 AR5K_RF_FIXED_BIAS_B,
62 AR5K_RF_PWD_XPD,
63 AR5K_RF_XPD_SEL,
64 AR5K_RF_XPD_GAIN,
65 AR5K_RF_PD_GAIN_LO,
66 AR5K_RF_PD_GAIN_HI,
67 AR5K_RF_HIGH_VC_CP,
68 AR5K_RF_MID_VC_CP,
69 AR5K_RF_LOW_VC_CP,
70 AR5K_RF_PUSH_UP,
71 AR5K_RF_PAD2GND,
72 AR5K_RF_XB2_LVL,
73 AR5K_RF_XB5_LVL,
74 AR5K_RF_PWD_ICLOBUF_2G,
75 AR5K_RF_DERBY_CHAN_SEL_MODE,
76 /* BANK 7 */
77 AR5K_RF_GAIN_I,
78 AR5K_RF_PLO_SEL,
79 AR5K_RF_RFGAIN_SEL,
80 AR5K_RF_WAIT_S,
81 AR5K_RF_WAIT_I,
82 AR5K_RF_MAX_TIME,
83 AR5K_RF_MIXGAIN_OVR,
84 AR5K_RF_PD_DELAY_A,
85 AR5K_RF_PD_DELAY_B,
86 AR5K_RF_PD_DELAY_XR,
87 AR5K_RF_PD_PERIOD_A,
88 AR5K_RF_PD_PERIOD_B,
89 AR5K_RF_PD_PERIOD_XR,
90};
91
92
93/*******************\
94* RF5111 (Sombrero) *
95\*******************/
96
97/* BANK 6 len pos col */
98#define AR5K_RF5111_OB_2GHZ { 3, 119, 0 }
99#define AR5K_RF5111_DB_2GHZ { 3, 122, 0 }
100
101#define AR5K_RF5111_OB_5GHZ { 3, 104, 0 }
102#define AR5K_RF5111_DB_5GHZ { 3, 107, 0 }
103
104#define AR5K_RF5111_PWD_XPD { 1, 95, 0 }
105#define AR5K_RF5111_XPD_GAIN { 4, 96, 0 }
106
107/* Access to PWD registers */
108#define AR5K_RF5111_PWD(_n) { 1, (135 - _n), 3 }
109
110/* BANK 7 len pos col */
111#define AR5K_RF5111_GAIN_I { 6, 29, 0 }
112#define AR5K_RF5111_PLO_SEL { 1, 4, 0 }
113#define AR5K_RF5111_RFGAIN_SEL { 1, 36, 0 }
114/* Only on AR5212 BaseBand and up */
115#define AR5K_RF5111_WAIT_S { 5, 19, 0 }
116#define AR5K_RF5111_WAIT_I { 5, 24, 0 }
117#define AR5K_RF5111_MAX_TIME { 2, 49, 0 }
118
119static const struct ath5k_rf_reg rf_regs_5111[] = {
120 {6, AR5K_RF_OB_2GHZ, AR5K_RF5111_OB_2GHZ},
121 {6, AR5K_RF_DB_2GHZ, AR5K_RF5111_DB_2GHZ},
122 {6, AR5K_RF_OB_5GHZ, AR5K_RF5111_OB_5GHZ},
123 {6, AR5K_RF_DB_5GHZ, AR5K_RF5111_DB_5GHZ},
124 {6, AR5K_RF_PWD_XPD, AR5K_RF5111_PWD_XPD},
125 {6, AR5K_RF_XPD_GAIN, AR5K_RF5111_XPD_GAIN},
126 {7, AR5K_RF_GAIN_I, AR5K_RF5111_GAIN_I},
127 {7, AR5K_RF_PLO_SEL, AR5K_RF5111_PLO_SEL},
128 {7, AR5K_RF_RFGAIN_SEL, AR5K_RF5111_RFGAIN_SEL},
129 {7, AR5K_RF_WAIT_S, AR5K_RF5111_WAIT_S},
130 {7, AR5K_RF_WAIT_I, AR5K_RF5111_WAIT_I},
131 {7, AR5K_RF_MAX_TIME, AR5K_RF5111_MAX_TIME}
132
133};
134
135/* Default mode specific settings */
136static const struct ath5k_ini_rfbuffer rfb_5111[] = {
137 { 0, 0x989c,
138 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
139 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
140 { 0, 0x989c,
141 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
142 { 0, 0x989c,
143 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
144 { 0, 0x989c,
145 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
146 { 0, 0x989c,
147 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
148 { 0, 0x989c,
149 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
150 { 0, 0x989c,
151 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
152 { 0, 0x989c,
153 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
154 { 0, 0x989c,
155 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
156 { 0, 0x989c,
157 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
158 { 0, 0x989c,
159 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
160 { 0, 0x989c,
161 { 0x00380000, 0x00380000, 0x00380000, 0x00380000, 0x00380000 } },
162 { 0, 0x989c,
163 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
164 { 0, 0x989c,
165 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
166 { 0, 0x989c,
167 { 0x00000000, 0x00000000, 0x000000c0, 0x00000080, 0x00000080 } },
168 { 0, 0x989c,
169 { 0x000400f9, 0x000400f9, 0x000400ff, 0x000400fd, 0x000400fd } },
170 { 0, 0x98d4,
171 { 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x00000004 } },
172 { 1, 0x98d4,
173 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
174 { 2, 0x98d4,
175 { 0x00000010, 0x00000014, 0x00000010, 0x00000010, 0x00000014 } },
176 { 3, 0x98d8,
177 { 0x00601068, 0x00601068, 0x00601068, 0x00601068, 0x00601068 } },
178 { 6, 0x989c,
179 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
180 { 6, 0x989c,
181 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
182 { 6, 0x989c,
183 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
184 { 6, 0x989c,
185 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
186 { 6, 0x989c,
187 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
188 { 6, 0x989c,
189 { 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000 } },
190 { 6, 0x989c,
191 { 0x04000000, 0x04000000, 0x04000000, 0x04000000, 0x04000000 } },
192 { 6, 0x989c,
193 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
194 { 6, 0x989c,
195 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
196 { 6, 0x989c,
197 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
198 { 6, 0x989c,
199 { 0x00000000, 0x00000000, 0x0a000000, 0x00000000, 0x00000000 } },
200 { 6, 0x989c,
201 { 0x003800c0, 0x00380080, 0x023800c0, 0x003800c0, 0x003800c0 } },
202 { 6, 0x989c,
203 { 0x00020006, 0x00020006, 0x00000006, 0x00020006, 0x00020006 } },
204 { 6, 0x989c,
205 { 0x00000089, 0x00000089, 0x00000089, 0x00000089, 0x00000089 } },
206 { 6, 0x989c,
207 { 0x000000a0, 0x000000a0, 0x000000a0, 0x000000a0, 0x000000a0 } },
208 { 6, 0x989c,
209 { 0x00040007, 0x00040007, 0x00040007, 0x00040007, 0x00040007 } },
210 { 6, 0x98d4,
211 { 0x0000001a, 0x0000001a, 0x0000001a, 0x0000001a, 0x0000001a } },
212 { 7, 0x989c,
213 { 0x00000040, 0x00000048, 0x00000040, 0x00000040, 0x00000040 } },
214 { 7, 0x989c,
215 { 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010 } },
216 { 7, 0x989c,
217 { 0x00000008, 0x00000008, 0x00000008, 0x00000008, 0x00000008 } },
218 { 7, 0x989c,
219 { 0x0000004f, 0x0000004f, 0x0000004f, 0x0000004f, 0x0000004f } },
220 { 7, 0x989c,
221 { 0x000000f1, 0x000000f1, 0x00000061, 0x000000f1, 0x000000f1 } },
222 { 7, 0x989c,
223 { 0x0000904f, 0x0000904f, 0x0000904c, 0x0000904f, 0x0000904f } },
224 { 7, 0x989c,
225 { 0x0000125a, 0x0000125a, 0x0000129a, 0x0000125a, 0x0000125a } },
226 { 7, 0x98cc,
227 { 0x0000000e, 0x0000000e, 0x0000000f, 0x0000000e, 0x0000000e } },
228};
229
230
231
232/***********************\
233* RF5112/RF2112 (Derby) *
234\***********************/
235
236/* BANK 7 (Common) len pos col */
237#define AR5K_RF5112X_GAIN_I { 6, 14, 0 }
238#define AR5K_RF5112X_MIXGAIN_OVR { 2, 37, 0 }
239#define AR5K_RF5112X_PD_DELAY_A { 4, 58, 0 }
240#define AR5K_RF5112X_PD_DELAY_B { 4, 62, 0 }
241#define AR5K_RF5112X_PD_DELAY_XR { 4, 66, 0 }
242#define AR5K_RF5112X_PD_PERIOD_A { 4, 70, 0 }
243#define AR5K_RF5112X_PD_PERIOD_B { 4, 74, 0 }
244#define AR5K_RF5112X_PD_PERIOD_XR { 4, 78, 0 }
245
246/* RFX112 (Derby 1) */
247
248/* BANK 6 len pos col */
249#define AR5K_RF5112_OB_2GHZ { 3, 269, 0 }
250#define AR5K_RF5112_DB_2GHZ { 3, 272, 0 }
251
252#define AR5K_RF5112_OB_5GHZ { 3, 261, 0 }
253#define AR5K_RF5112_DB_5GHZ { 3, 264, 0 }
254
255#define AR5K_RF5112_FIXED_BIAS_A { 1, 260, 0 }
256#define AR5K_RF5112_FIXED_BIAS_B { 1, 259, 0 }
257
258#define AR5K_RF5112_XPD_SEL { 1, 284, 0 }
259#define AR5K_RF5112_XPD_GAIN { 2, 252, 0 }
260
261/* Access to PWD registers */
262#define AR5K_RF5112_PWD(_n) { 1, (302 - _n), 3 }
263
264static const struct ath5k_rf_reg rf_regs_5112[] = {
265 {6, AR5K_RF_OB_2GHZ, AR5K_RF5112_OB_2GHZ},
266 {6, AR5K_RF_DB_2GHZ, AR5K_RF5112_DB_2GHZ},
267 {6, AR5K_RF_OB_5GHZ, AR5K_RF5112_OB_5GHZ},
268 {6, AR5K_RF_DB_5GHZ, AR5K_RF5112_DB_5GHZ},
269 {6, AR5K_RF_FIXED_BIAS_A, AR5K_RF5112_FIXED_BIAS_A},
270 {6, AR5K_RF_FIXED_BIAS_B, AR5K_RF5112_FIXED_BIAS_B},
271 {6, AR5K_RF_XPD_SEL, AR5K_RF5112_XPD_SEL},
272 {6, AR5K_RF_XPD_GAIN, AR5K_RF5112_XPD_GAIN},
273 {7, AR5K_RF_GAIN_I, AR5K_RF5112X_GAIN_I},
274 {7, AR5K_RF_MIXGAIN_OVR, AR5K_RF5112X_MIXGAIN_OVR},
275 {7, AR5K_RF_PD_DELAY_A, AR5K_RF5112X_PD_DELAY_A},
276 {7, AR5K_RF_PD_DELAY_B, AR5K_RF5112X_PD_DELAY_B},
277 {7, AR5K_RF_PD_DELAY_XR, AR5K_RF5112X_PD_DELAY_XR},
278 {7, AR5K_RF_PD_PERIOD_A, AR5K_RF5112X_PD_PERIOD_A},
279 {7, AR5K_RF_PD_PERIOD_B, AR5K_RF5112X_PD_PERIOD_B},
280 {7, AR5K_RF_PD_PERIOD_XR, AR5K_RF5112X_PD_PERIOD_XR},
281};
282
283/* Default mode specific settings */
284static const struct ath5k_ini_rfbuffer rfb_5112[] = {
285 { 1, 0x98d4,
286 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
287 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
288 { 2, 0x98d0,
289 { 0x03060408, 0x03070408, 0x03060408, 0x03060408, 0x03070408 } },
290 { 3, 0x98dc,
291 { 0x00a0c0c0, 0x00a0c0c0, 0x00e0c0c0, 0x00e0c0c0, 0x00e0c0c0 } },
292 { 6, 0x989c,
293 { 0x00a00000, 0x00a00000, 0x00a00000, 0x00a00000, 0x00a00000 } },
294 { 6, 0x989c,
295 { 0x000a0000, 0x000a0000, 0x000a0000, 0x000a0000, 0x000a0000 } },
296 { 6, 0x989c,
297 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
298 { 6, 0x989c,
299 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
300 { 6, 0x989c,
301 { 0x00660000, 0x00660000, 0x00660000, 0x00660000, 0x00660000 } },
302 { 6, 0x989c,
303 { 0x00db0000, 0x00db0000, 0x00db0000, 0x00db0000, 0x00db0000 } },
304 { 6, 0x989c,
305 { 0x00f10000, 0x00f10000, 0x00f10000, 0x00f10000, 0x00f10000 } },
306 { 6, 0x989c,
307 { 0x00120000, 0x00120000, 0x00120000, 0x00120000, 0x00120000 } },
308 { 6, 0x989c,
309 { 0x00120000, 0x00120000, 0x00120000, 0x00120000, 0x00120000 } },
310 { 6, 0x989c,
311 { 0x00730000, 0x00730000, 0x00730000, 0x00730000, 0x00730000 } },
312 { 6, 0x989c,
313 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
314 { 6, 0x989c,
315 { 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000 } },
316 { 6, 0x989c,
317 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
318 { 6, 0x989c,
319 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
320 { 6, 0x989c,
321 { 0x008b0000, 0x008b0000, 0x008b0000, 0x008b0000, 0x008b0000 } },
322 { 6, 0x989c,
323 { 0x00600000, 0x00600000, 0x00600000, 0x00600000, 0x00600000 } },
324 { 6, 0x989c,
325 { 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000 } },
326 { 6, 0x989c,
327 { 0x00840000, 0x00840000, 0x00840000, 0x00840000, 0x00840000 } },
328 { 6, 0x989c,
329 { 0x00640000, 0x00640000, 0x00640000, 0x00640000, 0x00640000 } },
330 { 6, 0x989c,
331 { 0x00200000, 0x00200000, 0x00200000, 0x00200000, 0x00200000 } },
332 { 6, 0x989c,
333 { 0x00240000, 0x00240000, 0x00240000, 0x00240000, 0x00240000 } },
334 { 6, 0x989c,
335 { 0x00250000, 0x00250000, 0x00250000, 0x00250000, 0x00250000 } },
336 { 6, 0x989c,
337 { 0x00110000, 0x00110000, 0x00110000, 0x00110000, 0x00110000 } },
338 { 6, 0x989c,
339 { 0x00110000, 0x00110000, 0x00110000, 0x00110000, 0x00110000 } },
340 { 6, 0x989c,
341 { 0x00510000, 0x00510000, 0x00510000, 0x00510000, 0x00510000 } },
342 { 6, 0x989c,
343 { 0x1c040000, 0x1c040000, 0x1c040000, 0x1c040000, 0x1c040000 } },
344 { 6, 0x989c,
345 { 0x000a0000, 0x000a0000, 0x000a0000, 0x000a0000, 0x000a0000 } },
346 { 6, 0x989c,
347 { 0x00a10000, 0x00a10000, 0x00a10000, 0x00a10000, 0x00a10000 } },
348 { 6, 0x989c,
349 { 0x00400000, 0x00400000, 0x00400000, 0x00400000, 0x00400000 } },
350 { 6, 0x989c,
351 { 0x03090000, 0x03090000, 0x03090000, 0x03090000, 0x03090000 } },
352 { 6, 0x989c,
353 { 0x06000000, 0x06000000, 0x06000000, 0x06000000, 0x06000000 } },
354 { 6, 0x989c,
355 { 0x000000b0, 0x000000b0, 0x000000a8, 0x000000a8, 0x000000a8 } },
356 { 6, 0x989c,
357 { 0x0000002e, 0x0000002e, 0x0000002e, 0x0000002e, 0x0000002e } },
358 { 6, 0x989c,
359 { 0x006c4a41, 0x006c4a41, 0x006c4af1, 0x006c4a61, 0x006c4a61 } },
360 { 6, 0x989c,
361 { 0x0050892a, 0x0050892a, 0x0050892b, 0x0050892b, 0x0050892b } },
362 { 6, 0x989c,
363 { 0x00842400, 0x00842400, 0x00842400, 0x00842400, 0x00842400 } },
364 { 6, 0x989c,
365 { 0x00c69200, 0x00c69200, 0x00c69200, 0x00c69200, 0x00c69200 } },
366 { 6, 0x98d0,
367 { 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c } },
368 { 7, 0x989c,
369 { 0x00000094, 0x00000094, 0x00000094, 0x00000094, 0x00000094 } },
370 { 7, 0x989c,
371 { 0x00000091, 0x00000091, 0x00000091, 0x00000091, 0x00000091 } },
372 { 7, 0x989c,
373 { 0x0000000a, 0x0000000a, 0x00000012, 0x00000012, 0x00000012 } },
374 { 7, 0x989c,
375 { 0x00000080, 0x00000080, 0x00000080, 0x00000080, 0x00000080 } },
376 { 7, 0x989c,
377 { 0x000000c1, 0x000000c1, 0x000000c1, 0x000000c1, 0x000000c1 } },
378 { 7, 0x989c,
379 { 0x00000060, 0x00000060, 0x00000060, 0x00000060, 0x00000060 } },
380 { 7, 0x989c,
381 { 0x000000f0, 0x000000f0, 0x000000f0, 0x000000f0, 0x000000f0 } },
382 { 7, 0x989c,
383 { 0x00000022, 0x00000022, 0x00000022, 0x00000022, 0x00000022 } },
384 { 7, 0x989c,
385 { 0x00000092, 0x00000092, 0x00000092, 0x00000092, 0x00000092 } },
386 { 7, 0x989c,
387 { 0x000000d4, 0x000000d4, 0x000000d4, 0x000000d4, 0x000000d4 } },
388 { 7, 0x989c,
389 { 0x000014cc, 0x000014cc, 0x000014cc, 0x000014cc, 0x000014cc } },
390 { 7, 0x989c,
391 { 0x0000048c, 0x0000048c, 0x0000048c, 0x0000048c, 0x0000048c } },
392 { 7, 0x98c4,
393 { 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003 } },
394};
395
396/* RFX112A (Derby 2) */
397
398/* BANK 6 len pos col */
399#define AR5K_RF5112A_OB_2GHZ { 3, 287, 0 }
400#define AR5K_RF5112A_DB_2GHZ { 3, 290, 0 }
401
402#define AR5K_RF5112A_OB_5GHZ { 3, 279, 0 }
403#define AR5K_RF5112A_DB_5GHZ { 3, 282, 0 }
404
405#define AR5K_RF5112A_FIXED_BIAS_A { 1, 278, 0 }
406#define AR5K_RF5112A_FIXED_BIAS_B { 1, 277, 0 }
407
408#define AR5K_RF5112A_XPD_SEL { 1, 302, 0 }
409#define AR5K_RF5112A_PDGAINLO { 2, 270, 0 }
410#define AR5K_RF5112A_PDGAINHI { 2, 257, 0 }
411
412/* Access to PWD registers */
413#define AR5K_RF5112A_PWD(_n) { 1, (306 - _n), 3 }
414
415/* Voltage regulators */
416#define AR5K_RF5112A_HIGH_VC_CP { 2, 90, 2 }
417#define AR5K_RF5112A_MID_VC_CP { 2, 92, 2 }
418#define AR5K_RF5112A_LOW_VC_CP { 2, 94, 2 }
419#define AR5K_RF5112A_PUSH_UP { 2, 94, 2 }
420
421/* Power consumption */
422#define AR5K_RF5112A_PAD2GND { 1, 281, 1 }
423#define AR5K_RF5112A_XB2_LVL { 2, 1, 3 }
424#define AR5K_RF5112A_XB5_LVL { 2, 3, 3 }
425
426static const struct ath5k_rf_reg rf_regs_5112a[] = {
427 {6, AR5K_RF_OB_2GHZ, AR5K_RF5112A_OB_2GHZ},
428 {6, AR5K_RF_DB_2GHZ, AR5K_RF5112A_DB_2GHZ},
429 {6, AR5K_RF_OB_5GHZ, AR5K_RF5112A_OB_5GHZ},
430 {6, AR5K_RF_DB_5GHZ, AR5K_RF5112A_DB_5GHZ},
431 {6, AR5K_RF_FIXED_BIAS_A, AR5K_RF5112A_FIXED_BIAS_A},
432 {6, AR5K_RF_FIXED_BIAS_B, AR5K_RF5112A_FIXED_BIAS_B},
433 {6, AR5K_RF_XPD_SEL, AR5K_RF5112A_XPD_SEL},
434 {6, AR5K_RF_PD_GAIN_LO, AR5K_RF5112A_PDGAINLO},
435 {6, AR5K_RF_PD_GAIN_HI, AR5K_RF5112A_PDGAINHI},
436 {6, AR5K_RF_HIGH_VC_CP, AR5K_RF5112A_HIGH_VC_CP},
437 {6, AR5K_RF_MID_VC_CP, AR5K_RF5112A_MID_VC_CP},
438 {6, AR5K_RF_LOW_VC_CP, AR5K_RF5112A_LOW_VC_CP},
439 {6, AR5K_RF_PUSH_UP, AR5K_RF5112A_PUSH_UP},
440 {6, AR5K_RF_PAD2GND, AR5K_RF5112A_PAD2GND},
441 {6, AR5K_RF_XB2_LVL, AR5K_RF5112A_XB2_LVL},
442 {6, AR5K_RF_XB5_LVL, AR5K_RF5112A_XB5_LVL},
443 {7, AR5K_RF_GAIN_I, AR5K_RF5112X_GAIN_I},
444 {7, AR5K_RF_MIXGAIN_OVR, AR5K_RF5112X_MIXGAIN_OVR},
445 {7, AR5K_RF_PD_DELAY_A, AR5K_RF5112X_PD_DELAY_A},
446 {7, AR5K_RF_PD_DELAY_B, AR5K_RF5112X_PD_DELAY_B},
447 {7, AR5K_RF_PD_DELAY_XR, AR5K_RF5112X_PD_DELAY_XR},
448 {7, AR5K_RF_PD_PERIOD_A, AR5K_RF5112X_PD_PERIOD_A},
449 {7, AR5K_RF_PD_PERIOD_B, AR5K_RF5112X_PD_PERIOD_B},
450 {7, AR5K_RF_PD_PERIOD_XR, AR5K_RF5112X_PD_PERIOD_XR},
451};
452
453/* Default mode specific settings */
454static const struct ath5k_ini_rfbuffer rfb_5112a[] = {
455 { 1, 0x98d4,
456 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
457 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
458 { 2, 0x98d0,
459 { 0x03060408, 0x03070408, 0x03060408, 0x03060408, 0x03070408 } },
460 { 3, 0x98dc,
461 { 0x00a020c0, 0x00a020c0, 0x00e020c0, 0x00e020c0, 0x00e020c0 } },
462 { 6, 0x989c,
463 { 0x0f000000, 0x0f000000, 0x0f000000, 0x0f000000, 0x0f000000 } },
464 { 6, 0x989c,
465 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
466 { 6, 0x989c,
467 { 0x00800000, 0x00800000, 0x00800000, 0x00800000, 0x00800000 } },
468 { 6, 0x989c,
469 { 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000 } },
470 { 6, 0x989c,
471 { 0x00010000, 0x00010000, 0x00010000, 0x00010000, 0x00010000 } },
472 { 6, 0x989c,
473 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
474 { 6, 0x989c,
475 { 0x00180000, 0x00180000, 0x00180000, 0x00180000, 0x00180000 } },
476 { 6, 0x989c,
477 { 0x00600000, 0x00600000, 0x006e0000, 0x006e0000, 0x006e0000 } },
478 { 6, 0x989c,
479 { 0x00c70000, 0x00c70000, 0x00c70000, 0x00c70000, 0x00c70000 } },
480 { 6, 0x989c,
481 { 0x004b0000, 0x004b0000, 0x004b0000, 0x004b0000, 0x004b0000 } },
482 { 6, 0x989c,
483 { 0x04480000, 0x04480000, 0x04480000, 0x04480000, 0x04480000 } },
484 { 6, 0x989c,
485 { 0x004c0000, 0x004c0000, 0x004c0000, 0x004c0000, 0x004c0000 } },
486 { 6, 0x989c,
487 { 0x00e40000, 0x00e40000, 0x00e40000, 0x00e40000, 0x00e40000 } },
488 { 6, 0x989c,
489 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
490 { 6, 0x989c,
491 { 0x00fc0000, 0x00fc0000, 0x00fc0000, 0x00fc0000, 0x00fc0000 } },
492 { 6, 0x989c,
493 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
494 { 6, 0x989c,
495 { 0x043f0000, 0x043f0000, 0x043f0000, 0x043f0000, 0x043f0000 } },
496 { 6, 0x989c,
497 { 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000, 0x000c0000 } },
498 { 6, 0x989c,
499 { 0x02190000, 0x02190000, 0x02190000, 0x02190000, 0x02190000 } },
500 { 6, 0x989c,
501 { 0x00240000, 0x00240000, 0x00240000, 0x00240000, 0x00240000 } },
502 { 6, 0x989c,
503 { 0x00b40000, 0x00b40000, 0x00b40000, 0x00b40000, 0x00b40000 } },
504 { 6, 0x989c,
505 { 0x00990000, 0x00990000, 0x00990000, 0x00990000, 0x00990000 } },
506 { 6, 0x989c,
507 { 0x00500000, 0x00500000, 0x00500000, 0x00500000, 0x00500000 } },
508 { 6, 0x989c,
509 { 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000 } },
510 { 6, 0x989c,
511 { 0x00120000, 0x00120000, 0x00120000, 0x00120000, 0x00120000 } },
512 { 6, 0x989c,
513 { 0xc0320000, 0xc0320000, 0xc0320000, 0xc0320000, 0xc0320000 } },
514 { 6, 0x989c,
515 { 0x01740000, 0x01740000, 0x01740000, 0x01740000, 0x01740000 } },
516 { 6, 0x989c,
517 { 0x00110000, 0x00110000, 0x00110000, 0x00110000, 0x00110000 } },
518 { 6, 0x989c,
519 { 0x86280000, 0x86280000, 0x86280000, 0x86280000, 0x86280000 } },
520 { 6, 0x989c,
521 { 0x31840000, 0x31840000, 0x31840000, 0x31840000, 0x31840000 } },
522 { 6, 0x989c,
523 { 0x00f20080, 0x00f20080, 0x00f20080, 0x00f20080, 0x00f20080 } },
524 { 6, 0x989c,
525 { 0x00270019, 0x00270019, 0x00270019, 0x00270019, 0x00270019 } },
526 { 6, 0x989c,
527 { 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003 } },
528 { 6, 0x989c,
529 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
530 { 6, 0x989c,
531 { 0x000000b2, 0x000000b2, 0x000000b2, 0x000000b2, 0x000000b2 } },
532 { 6, 0x989c,
533 { 0x00b02084, 0x00b02084, 0x00b02084, 0x00b02084, 0x00b02084 } },
534 { 6, 0x989c,
535 { 0x004125a4, 0x004125a4, 0x004125a4, 0x004125a4, 0x004125a4 } },
536 { 6, 0x989c,
537 { 0x00119220, 0x00119220, 0x00119220, 0x00119220, 0x00119220 } },
538 { 6, 0x989c,
539 { 0x001a4800, 0x001a4800, 0x001a4800, 0x001a4800, 0x001a4800 } },
540 { 6, 0x98d8,
541 { 0x000b0230, 0x000b0230, 0x000b0230, 0x000b0230, 0x000b0230 } },
542 { 7, 0x989c,
543 { 0x00000094, 0x00000094, 0x00000094, 0x00000094, 0x00000094 } },
544 { 7, 0x989c,
545 { 0x00000091, 0x00000091, 0x00000091, 0x00000091, 0x00000091 } },
546 { 7, 0x989c,
547 { 0x00000012, 0x00000012, 0x00000012, 0x00000012, 0x00000012 } },
548 { 7, 0x989c,
549 { 0x00000080, 0x00000080, 0x00000080, 0x00000080, 0x00000080 } },
550 { 7, 0x989c,
551 { 0x000000d9, 0x000000d9, 0x000000d9, 0x000000d9, 0x000000d9 } },
552 { 7, 0x989c,
553 { 0x00000060, 0x00000060, 0x00000060, 0x00000060, 0x00000060 } },
554 { 7, 0x989c,
555 { 0x000000f0, 0x000000f0, 0x000000f0, 0x000000f0, 0x000000f0 } },
556 { 7, 0x989c,
557 { 0x000000a2, 0x000000a2, 0x000000a2, 0x000000a2, 0x000000a2 } },
558 { 7, 0x989c,
559 { 0x00000052, 0x00000052, 0x00000052, 0x00000052, 0x00000052 } },
560 { 7, 0x989c,
561 { 0x000000d4, 0x000000d4, 0x000000d4, 0x000000d4, 0x000000d4 } },
562 { 7, 0x989c,
563 { 0x000014cc, 0x000014cc, 0x000014cc, 0x000014cc, 0x000014cc } },
564 { 7, 0x989c,
565 { 0x0000048c, 0x0000048c, 0x0000048c, 0x0000048c, 0x0000048c } },
566 { 7, 0x98c4,
567 { 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003 } },
568};
569
570
571
572/******************\
573* RF2413 (Griffin) *
574\******************/
575
576/* BANK 6 len pos col */
577#define AR5K_RF2413_OB_2GHZ { 3, 168, 0 }
578#define AR5K_RF2413_DB_2GHZ { 3, 165, 0 }
579
580static const struct ath5k_rf_reg rf_regs_2413[] = {
581 {6, AR5K_RF_OB_2GHZ, AR5K_RF2413_OB_2GHZ},
582 {6, AR5K_RF_DB_2GHZ, AR5K_RF2413_DB_2GHZ},
583};
584
585/* Default mode specific settings
586 * XXX: a/aTurbo ???
587 */
588static const struct ath5k_ini_rfbuffer rfb_2413[] = {
589 { 1, 0x98d4,
590 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
591 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
592 { 2, 0x98d0,
593 { 0x02001408, 0x02011408, 0x02001408, 0x02001408, 0x02011408 } },
594 { 3, 0x98dc,
595 { 0x00a020c0, 0x00a020c0, 0x00e020c0, 0x00e020c0, 0x00e020c0 } },
596 { 6, 0x989c,
597 { 0xf0000000, 0xf0000000, 0xf0000000, 0xf0000000, 0xf0000000 } },
598 { 6, 0x989c,
599 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
600 { 6, 0x989c,
601 { 0x03000000, 0x03000000, 0x03000000, 0x03000000, 0x03000000 } },
602 { 6, 0x989c,
603 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
604 { 6, 0x989c,
605 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
606 { 6, 0x989c,
607 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
608 { 6, 0x989c,
609 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
610 { 6, 0x989c,
611 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
612 { 6, 0x989c,
613 { 0x40400000, 0x40400000, 0x40400000, 0x40400000, 0x40400000 } },
614 { 6, 0x989c,
615 { 0x65050000, 0x65050000, 0x65050000, 0x65050000, 0x65050000 } },
616 { 6, 0x989c,
617 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
618 { 6, 0x989c,
619 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
620 { 6, 0x989c,
621 { 0x00420000, 0x00420000, 0x00420000, 0x00420000, 0x00420000 } },
622 { 6, 0x989c,
623 { 0x00b50000, 0x00b50000, 0x00b50000, 0x00b50000, 0x00b50000 } },
624 { 6, 0x989c,
625 { 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000 } },
626 { 6, 0x989c,
627 { 0x00f70000, 0x00f70000, 0x00f70000, 0x00f70000, 0x00f70000 } },
628 { 6, 0x989c,
629 { 0x009d0000, 0x009d0000, 0x009d0000, 0x009d0000, 0x009d0000 } },
630 { 6, 0x989c,
631 { 0x00220000, 0x00220000, 0x00220000, 0x00220000, 0x00220000 } },
632 { 6, 0x989c,
633 { 0x04220000, 0x04220000, 0x04220000, 0x04220000, 0x04220000 } },
634 { 6, 0x989c,
635 { 0x00230018, 0x00230018, 0x00230018, 0x00230018, 0x00230018 } },
636 { 6, 0x989c,
637 { 0x00280000, 0x00280000, 0x00280060, 0x00280060, 0x00280060 } },
638 { 6, 0x989c,
639 { 0x005000c0, 0x005000c0, 0x005000c3, 0x005000c3, 0x005000c3 } },
640 { 6, 0x989c,
641 { 0x0004007f, 0x0004007f, 0x0004007f, 0x0004007f, 0x0004007f } },
642 { 6, 0x989c,
643 { 0x00000458, 0x00000458, 0x00000458, 0x00000458, 0x00000458 } },
644 { 6, 0x989c,
645 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
646 { 6, 0x989c,
647 { 0x0000c000, 0x0000c000, 0x0000c000, 0x0000c000, 0x0000c000 } },
648 { 6, 0x98d8,
649 { 0x00400230, 0x00400230, 0x00400230, 0x00400230, 0x00400230 } },
650 { 7, 0x989c,
651 { 0x00006400, 0x00006400, 0x00006400, 0x00006400, 0x00006400 } },
652 { 7, 0x989c,
653 { 0x00000800, 0x00000800, 0x00000800, 0x00000800, 0x00000800 } },
654 { 7, 0x98cc,
655 { 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e } },
656};
657
658
659
660/***************************\
661* RF2315/RF2316 (Cobra SoC) *
662\***************************/
663
664/* BANK 6 len pos col */
665#define AR5K_RF2316_OB_2GHZ { 3, 178, 0 }
666#define AR5K_RF2316_DB_2GHZ { 3, 175, 0 }
667
668static const struct ath5k_rf_reg rf_regs_2316[] = {
669 {6, AR5K_RF_OB_2GHZ, AR5K_RF2316_OB_2GHZ},
670 {6, AR5K_RF_DB_2GHZ, AR5K_RF2316_DB_2GHZ},
671};
672
673/* Default mode specific settings */
674static const struct ath5k_ini_rfbuffer rfb_2316[] = {
675 { 1, 0x98d4,
676 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
677 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
678 { 2, 0x98d0,
679 { 0x02001408, 0x02011408, 0x02001408, 0x02001408, 0x02011408 } },
680 { 3, 0x98dc,
681 { 0x00a020c0, 0x00a020c0, 0x00e020c0, 0x00e020c0, 0x00e020c0 } },
682 { 6, 0x989c,
683 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
684 { 6, 0x989c,
685 { 0xc0000000, 0xc0000000, 0xc0000000, 0xc0000000, 0xc0000000 } },
686 { 6, 0x989c,
687 { 0x0f000000, 0x0f000000, 0x0f000000, 0x0f000000, 0x0f000000 } },
688 { 6, 0x989c,
689 { 0x02000000, 0x02000000, 0x02000000, 0x02000000, 0x02000000 } },
690 { 6, 0x989c,
691 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
692 { 6, 0x989c,
693 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
694 { 6, 0x989c,
695 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
696 { 6, 0x989c,
697 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
698 { 6, 0x989c,
699 { 0xf8000000, 0xf8000000, 0xf8000000, 0xf8000000, 0xf8000000 } },
700 { 6, 0x989c,
701 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
702 { 6, 0x989c,
703 { 0x95150000, 0x95150000, 0x95150000, 0x95150000, 0x95150000 } },
704 { 6, 0x989c,
705 { 0xc1000000, 0xc1000000, 0xc1000000, 0xc1000000, 0xc1000000 } },
706 { 6, 0x989c,
707 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
708 { 6, 0x989c,
709 { 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000 } },
710 { 6, 0x989c,
711 { 0x00d50000, 0x00d50000, 0x00d50000, 0x00d50000, 0x00d50000 } },
712 { 6, 0x989c,
713 { 0x000e0000, 0x000e0000, 0x000e0000, 0x000e0000, 0x000e0000 } },
714 { 6, 0x989c,
715 { 0x00dc0000, 0x00dc0000, 0x00dc0000, 0x00dc0000, 0x00dc0000 } },
716 { 6, 0x989c,
717 { 0x00770000, 0x00770000, 0x00770000, 0x00770000, 0x00770000 } },
718 { 6, 0x989c,
719 { 0x008a0000, 0x008a0000, 0x008a0000, 0x008a0000, 0x008a0000 } },
720 { 6, 0x989c,
721 { 0x10880000, 0x10880000, 0x10880000, 0x10880000, 0x10880000 } },
722 { 6, 0x989c,
723 { 0x008c0060, 0x008c0060, 0x008c0060, 0x008c0060, 0x008c0060 } },
724 { 6, 0x989c,
725 { 0x00a00000, 0x00a00000, 0x00a00080, 0x00a00080, 0x00a00080 } },
726 { 6, 0x989c,
727 { 0x00400000, 0x00400000, 0x0040000d, 0x0040000d, 0x0040000d } },
728 { 6, 0x989c,
729 { 0x00110400, 0x00110400, 0x00110400, 0x00110400, 0x00110400 } },
730 { 6, 0x989c,
731 { 0x00000060, 0x00000060, 0x00000060, 0x00000060, 0x00000060 } },
732 { 6, 0x989c,
733 { 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001 } },
734 { 6, 0x989c,
735 { 0x00000b00, 0x00000b00, 0x00000b00, 0x00000b00, 0x00000b00 } },
736 { 6, 0x989c,
737 { 0x00000be8, 0x00000be8, 0x00000be8, 0x00000be8, 0x00000be8 } },
738 { 6, 0x98c0,
739 { 0x00010000, 0x00010000, 0x00010000, 0x00010000, 0x00010000 } },
740 { 7, 0x989c,
741 { 0x00006400, 0x00006400, 0x00006400, 0x00006400, 0x00006400 } },
742 { 7, 0x989c,
743 { 0x00000800, 0x00000800, 0x00000800, 0x00000800, 0x00000800 } },
744 { 7, 0x98cc,
745 { 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e } },
746};
747
748
749
750/******************************\
751* RF5413/RF5424 (Eagle/Condor) *
752\******************************/
753
754/* BANK 6 len pos col */
755#define AR5K_RF5413_OB_2GHZ { 3, 241, 0 }
756#define AR5K_RF5413_DB_2GHZ { 3, 238, 0 }
757
758#define AR5K_RF5413_OB_5GHZ { 3, 247, 0 }
759#define AR5K_RF5413_DB_5GHZ { 3, 244, 0 }
760
761#define AR5K_RF5413_PWD_ICLOBUF2G { 3, 131, 3 }
762#define AR5K_RF5413_DERBY_CHAN_SEL_MODE { 1, 291, 2 }
763
764static const struct ath5k_rf_reg rf_regs_5413[] = {
765 {6, AR5K_RF_OB_2GHZ, AR5K_RF5413_OB_2GHZ},
766 {6, AR5K_RF_DB_2GHZ, AR5K_RF5413_DB_2GHZ},
767 {6, AR5K_RF_OB_5GHZ, AR5K_RF5413_OB_5GHZ},
768 {6, AR5K_RF_DB_5GHZ, AR5K_RF5413_DB_5GHZ},
769 {6, AR5K_RF_PWD_ICLOBUF_2G, AR5K_RF5413_PWD_ICLOBUF2G},
770 {6, AR5K_RF_DERBY_CHAN_SEL_MODE, AR5K_RF5413_DERBY_CHAN_SEL_MODE},
771};
772
773/* Default mode specific settings */
774static const struct ath5k_ini_rfbuffer rfb_5413[] = {
775 { 1, 0x98d4,
776 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
777 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
778 { 2, 0x98d0,
779 { 0x00000008, 0x00000008, 0x00000008, 0x00000008, 0x00000008 } },
780 { 3, 0x98dc,
781 { 0x00a000c0, 0x00a000c0, 0x00e000c0, 0x00e000c0, 0x00e000c0 } },
782 { 6, 0x989c,
783 { 0x33000000, 0x33000000, 0x33000000, 0x33000000, 0x33000000 } },
784 { 6, 0x989c,
785 { 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000 } },
786 { 6, 0x989c,
787 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
788 { 6, 0x989c,
789 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
790 { 6, 0x989c,
791 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
792 { 6, 0x989c,
793 { 0x1f000000, 0x1f000000, 0x1f000000, 0x1f000000, 0x1f000000 } },
794 { 6, 0x989c,
795 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
796 { 6, 0x989c,
797 { 0x00b80000, 0x00b80000, 0x00b80000, 0x00b80000, 0x00b80000 } },
798 { 6, 0x989c,
799 { 0x00b70000, 0x00b70000, 0x00b70000, 0x00b70000, 0x00b70000 } },
800 { 6, 0x989c,
801 { 0x00840000, 0x00840000, 0x00840000, 0x00840000, 0x00840000 } },
802 { 6, 0x989c,
803 { 0x00980000, 0x00980000, 0x00980000, 0x00980000, 0x00980000 } },
804 { 6, 0x989c,
805 { 0x00c00000, 0x00c00000, 0x00c00000, 0x00c00000, 0x00c00000 } },
806 { 6, 0x989c,
807 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
808 { 6, 0x989c,
809 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
810 { 6, 0x989c,
811 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
812 { 6, 0x989c,
813 { 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000 } },
814 { 6, 0x989c,
815 { 0x00d70000, 0x00d70000, 0x00d70000, 0x00d70000, 0x00d70000 } },
816 { 6, 0x989c,
817 { 0x00610000, 0x00610000, 0x00610000, 0x00610000, 0x00610000 } },
818 { 6, 0x989c,
819 { 0x00fe0000, 0x00fe0000, 0x00fe0000, 0x00fe0000, 0x00fe0000 } },
820 { 6, 0x989c,
821 { 0x00de0000, 0x00de0000, 0x00de0000, 0x00de0000, 0x00de0000 } },
822 { 6, 0x989c,
823 { 0x007f0000, 0x007f0000, 0x007f0000, 0x007f0000, 0x007f0000 } },
824 { 6, 0x989c,
825 { 0x043d0000, 0x043d0000, 0x043d0000, 0x043d0000, 0x043d0000 } },
826 { 6, 0x989c,
827 { 0x00770000, 0x00770000, 0x00770000, 0x00770000, 0x00770000 } },
828 { 6, 0x989c,
829 { 0x00440000, 0x00440000, 0x00440000, 0x00440000, 0x00440000 } },
830 { 6, 0x989c,
831 { 0x00980000, 0x00980000, 0x00980000, 0x00980000, 0x00980000 } },
832 { 6, 0x989c,
833 { 0x00100080, 0x00100080, 0x00100080, 0x00100080, 0x00100080 } },
834 { 6, 0x989c,
835 { 0x0005c034, 0x0005c034, 0x0005c034, 0x0005c034, 0x0005c034 } },
836 { 6, 0x989c,
837 { 0x003100f0, 0x003100f0, 0x003100f0, 0x003100f0, 0x003100f0 } },
838 { 6, 0x989c,
839 { 0x000c011f, 0x000c011f, 0x000c011f, 0x000c011f, 0x000c011f } },
840 { 6, 0x989c,
841 { 0x00510040, 0x00510040, 0x00510040, 0x00510040, 0x00510040 } },
842 { 6, 0x989c,
843 { 0x005000da, 0x005000da, 0x005000da, 0x005000da, 0x005000da } },
844 { 6, 0x989c,
845 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
846 { 6, 0x989c,
847 { 0x00004044, 0x00004044, 0x00004044, 0x00004044, 0x00004044 } },
848 { 6, 0x989c,
849 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
850 { 6, 0x989c,
851 { 0x000060c0, 0x000060c0, 0x000060c0, 0x000060c0, 0x000060c0 } },
852 { 6, 0x989c,
853 { 0x00002c00, 0x00002c00, 0x00003600, 0x00003600, 0x00002c00 } },
854 { 6, 0x98c8,
855 { 0x00000403, 0x00000403, 0x00040403, 0x00040403, 0x00040403 } },
856 { 7, 0x989c,
857 { 0x00006400, 0x00006400, 0x00006400, 0x00006400, 0x00006400 } },
858 { 7, 0x989c,
859 { 0x00000800, 0x00000800, 0x00000800, 0x00000800, 0x00000800 } },
860 { 7, 0x98cc,
861 { 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e } },
862};
863
864
865
866/***************************\
867* RF2425/RF2417 (Swan/Nala) *
868* AR2317 (Spider SoC) *
869\***************************/
870
871/* BANK 6 len pos col */
872#define AR5K_RF2425_OB_2GHZ { 3, 193, 0 }
873#define AR5K_RF2425_DB_2GHZ { 3, 190, 0 }
874
875static const struct ath5k_rf_reg rf_regs_2425[] = {
876 {6, AR5K_RF_OB_2GHZ, AR5K_RF2425_OB_2GHZ},
877 {6, AR5K_RF_DB_2GHZ, AR5K_RF2425_DB_2GHZ},
878};
879
880/* Default mode specific settings
881 * XXX: a/aTurbo ?
882 */
883static const struct ath5k_ini_rfbuffer rfb_2425[] = {
884 { 1, 0x98d4,
885 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
886 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
887 { 2, 0x98d0,
888 { 0x02001408, 0x02001408, 0x02001408, 0x02001408, 0x02001408 } },
889 { 3, 0x98dc,
890 { 0x00a020c0, 0x00a020c0, 0x00e020c0, 0x00e020c0, 0x00e020c0 } },
891 { 6, 0x989c,
892 { 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000 } },
893 { 6, 0x989c,
894 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
895 { 6, 0x989c,
896 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
897 { 6, 0x989c,
898 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
899 { 6, 0x989c,
900 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
901 { 6, 0x989c,
902 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
903 { 6, 0x989c,
904 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
905 { 6, 0x989c,
906 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
907 { 6, 0x989c,
908 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
909 { 6, 0x989c,
910 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
911 { 6, 0x989c,
912 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
913 { 6, 0x989c,
914 { 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000 } },
915 { 6, 0x989c,
916 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
917 { 6, 0x989c,
918 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
919 { 6, 0x989c,
920 { 0x00100000, 0x00100000, 0x00100000, 0x00100000, 0x00100000 } },
921 { 6, 0x989c,
922 { 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020000 } },
923 { 6, 0x989c,
924 { 0x00730000, 0x00730000, 0x00730000, 0x00730000, 0x00730000 } },
925 { 6, 0x989c,
926 { 0x00f80000, 0x00f80000, 0x00f80000, 0x00f80000, 0x00f80000 } },
927 { 6, 0x989c,
928 { 0x00e70000, 0x00e70000, 0x00e70000, 0x00e70000, 0x00e70000 } },
929 { 6, 0x989c,
930 { 0x00140000, 0x00140000, 0x00140000, 0x00140000, 0x00140000 } },
931 { 6, 0x989c,
932 { 0x00910040, 0x00910040, 0x00910040, 0x00910040, 0x00910040 } },
933 { 6, 0x989c,
934 { 0x0007001a, 0x0007001a, 0x0007001a, 0x0007001a, 0x0007001a } },
935 { 6, 0x989c,
936 { 0x00410000, 0x00410000, 0x00410000, 0x00410000, 0x00410000 } },
937 { 6, 0x989c,
938 { 0x00810000, 0x00810000, 0x00810060, 0x00810060, 0x00810060 } },
939 { 6, 0x989c,
940 { 0x00020800, 0x00020800, 0x00020803, 0x00020803, 0x00020803 } },
941 { 6, 0x989c,
942 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
943 { 6, 0x989c,
944 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
945 { 6, 0x989c,
946 { 0x00001660, 0x00001660, 0x00001660, 0x00001660, 0x00001660 } },
947 { 6, 0x989c,
948 { 0x00001688, 0x00001688, 0x00001688, 0x00001688, 0x00001688 } },
949 { 6, 0x98c4,
950 { 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001 } },
951 { 7, 0x989c,
952 { 0x00006400, 0x00006400, 0x00006400, 0x00006400, 0x00006400 } },
953 { 7, 0x989c,
954 { 0x00000800, 0x00000800, 0x00000800, 0x00000800, 0x00000800 } },
955 { 7, 0x98cc,
956 { 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e } },
957};
958
959/*
960 * TODO: Handle the few differences with swan during
961 * bank modification and get rid of this
962 */
963static const struct ath5k_ini_rfbuffer rfb_2317[] = {
964 { 1, 0x98d4,
965 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
966 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
967 { 2, 0x98d0,
968 { 0x02001408, 0x02011408, 0x02001408, 0x02001408, 0x02011408 } },
969 { 3, 0x98dc,
970 { 0x00a020c0, 0x00a020c0, 0x00e020c0, 0x00e020c0, 0x00e020c0 } },
971 { 6, 0x989c,
972 { 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000 } },
973 { 6, 0x989c,
974 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
975 { 6, 0x989c,
976 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
977 { 6, 0x989c,
978 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
979 { 6, 0x989c,
980 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
981 { 6, 0x989c,
982 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
983 { 6, 0x989c,
984 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
985 { 6, 0x989c,
986 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
987 { 6, 0x989c,
988 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
989 { 6, 0x989c,
990 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
991 { 6, 0x989c,
992 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
993 { 6, 0x989c,
994 { 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000 } },
995 { 6, 0x989c,
996 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
997 { 6, 0x989c,
998 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
999 { 6, 0x989c,
1000 { 0x00100000, 0x00100000, 0x00100000, 0x00100000, 0x00100000 } },
1001 { 6, 0x989c,
1002 { 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020000 } },
1003 { 6, 0x989c,
1004 { 0x00730000, 0x00730000, 0x00730000, 0x00730000, 0x00730000 } },
1005 { 6, 0x989c,
1006 { 0x00f80000, 0x00f80000, 0x00f80000, 0x00f80000, 0x00f80000 } },
1007 { 6, 0x989c,
1008 { 0x00e70000, 0x00e70000, 0x00e70000, 0x00e70000, 0x00e70000 } },
1009 { 6, 0x989c,
1010 { 0x00140100, 0x00140100, 0x00140100, 0x00140100, 0x00140100 } },
1011 { 6, 0x989c,
1012 { 0x00910040, 0x00910040, 0x00910040, 0x00910040, 0x00910040 } },
1013 { 6, 0x989c,
1014 { 0x0007001a, 0x0007001a, 0x0007001a, 0x0007001a, 0x0007001a } },
1015 { 6, 0x989c,
1016 { 0x00410000, 0x00410000, 0x00410000, 0x00410000, 0x00410000 } },
1017 { 6, 0x989c,
1018 { 0x00810000, 0x00810000, 0x00810060, 0x00810060, 0x00810060 } },
1019 { 6, 0x989c,
1020 { 0x00020800, 0x00020800, 0x00020803, 0x00020803, 0x00020803 } },
1021 { 6, 0x989c,
1022 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1023 { 6, 0x989c,
1024 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1025 { 6, 0x989c,
1026 { 0x00001660, 0x00001660, 0x00001660, 0x00001660, 0x00001660 } },
1027 { 6, 0x989c,
1028 { 0x00009688, 0x00009688, 0x00009688, 0x00009688, 0x00009688 } },
1029 { 6, 0x98c4,
1030 { 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001 } },
1031 { 7, 0x989c,
1032 { 0x00006400, 0x00006400, 0x00006400, 0x00006400, 0x00006400 } },
1033 { 7, 0x989c,
1034 { 0x00000800, 0x00000800, 0x00000800, 0x00000800, 0x00000800 } },
1035 { 7, 0x98cc,
1036 { 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e } },
1037};
1038
1039/*
1040 * TODO: Handle the few differences with swan during
1041 * bank modification and get rid of this
1042 * XXX: a/aTurbo ?
1043 */
1044static const struct ath5k_ini_rfbuffer rfb_2417[] = {
1045 { 1, 0x98d4,
1046 /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
1047 { 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020 } },
1048 { 2, 0x98d0,
1049 { 0x02001408, 0x02001408, 0x02001408, 0x02001408, 0x02001408 } },
1050 { 3, 0x98dc,
1051 { 0x00a020c0, 0x00a020c0, 0x00e020c0, 0x00e020c0, 0x00e020c0 } },
1052 { 6, 0x989c,
1053 { 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000 } },
1054 { 6, 0x989c,
1055 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1056 { 6, 0x989c,
1057 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1058 { 6, 0x989c,
1059 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1060 { 6, 0x989c,
1061 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1062 { 6, 0x989c,
1063 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1064 { 6, 0x989c,
1065 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1066 { 6, 0x989c,
1067 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1068 { 6, 0x989c,
1069 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1070 { 6, 0x989c,
1071 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1072 { 6, 0x989c,
1073 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1074 { 6, 0x989c,
1075 { 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000, 0x002a0000 } },
1076 { 6, 0x989c,
1077 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1078 { 6, 0x989c,
1079 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1080 { 6, 0x989c,
1081 { 0x00100000, 0x00100000, 0x00100000, 0x00100000, 0x00100000 } },
1082 { 6, 0x989c,
1083 { 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020000 } },
1084 { 6, 0x989c,
1085 { 0x00730000, 0x00730000, 0x00730000, 0x00730000, 0x00730000 } },
1086 { 6, 0x989c,
1087 { 0x00f80000, 0x00f80000, 0x00f80000, 0x00f80000, 0x00f80000 } },
1088 { 6, 0x989c,
1089 { 0x00e70000, 0x00e70000, 0x80e70000, 0x80e70000, 0x00e70000 } },
1090 { 6, 0x989c,
1091 { 0x00140000, 0x00140000, 0x00140000, 0x00140000, 0x00140000 } },
1092 { 6, 0x989c,
1093 { 0x00910040, 0x00910040, 0x00910040, 0x00910040, 0x00910040 } },
1094 { 6, 0x989c,
1095 { 0x0007001a, 0x0007001a, 0x0207001a, 0x0207001a, 0x0007001a } },
1096 { 6, 0x989c,
1097 { 0x00410000, 0x00410000, 0x00410000, 0x00410000, 0x00410000 } },
1098 { 6, 0x989c,
1099 { 0x00810000, 0x00810000, 0x00810060, 0x00810060, 0x00810060 } },
1100 { 6, 0x989c,
1101 { 0x00020800, 0x00020800, 0x00020803, 0x00020803, 0x00020803 } },
1102 { 6, 0x989c,
1103 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1104 { 6, 0x989c,
1105 { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } },
1106 { 6, 0x989c,
1107 { 0x00001660, 0x00001660, 0x00001660, 0x00001660, 0x00001660 } },
1108 { 6, 0x989c,
1109 { 0x00001688, 0x00001688, 0x00001688, 0x00001688, 0x00001688 } },
1110 { 6, 0x98c4,
1111 { 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001 } },
1112 { 7, 0x989c,
1113 { 0x00006400, 0x00006400, 0x00006400, 0x00006400, 0x00006400 } },
1114 { 7, 0x989c,
1115 { 0x00000800, 0x00000800, 0x00000800, 0x00000800, 0x00000800 } },
1116 { 7, 0x98cc,
1117 { 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e, 0x0000000e } },
1118};
diff --git a/drivers/net/wireless/ath5k/rfgain.h b/drivers/net/wireless/ath5k/rfgain.h
new file mode 100644
index 000000000000..6dd2ea13ff41
--- /dev/null
+++ b/drivers/net/wireless/ath5k/rfgain.h
@@ -0,0 +1,480 @@
1/*
2 * RF Gain optimization
3 *
4 * Copyright (c) 2004-2009 Reyk Floeter <reyk@openbsd.org>
5 * Copyright (c) 2006-2009 Nick Kossifidis <mickflemm@gmail.com>
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 *
19 */
20
21/*
22 * Mode-specific RF Gain table (64bytes) for RF5111/5112
23 * (RF5110 only comes with AR5210 and only supports a/turbo a mode so initial
24 * RF Gain values are included in AR5K_AR5210_INI)
25 */
26struct ath5k_ini_rfgain {
27 u16 rfg_register; /* RF Gain register address */
28 u32 rfg_value[2]; /* [freq (see below)] */
29};
30
31/* Initial RF Gain settings for RF5111 */
32static const struct ath5k_ini_rfgain rfgain_5111[] = {
33 /* 5Ghz 2Ghz */
34 { AR5K_RF_GAIN(0), { 0x000001a9, 0x00000000 } },
35 { AR5K_RF_GAIN(1), { 0x000001e9, 0x00000040 } },
36 { AR5K_RF_GAIN(2), { 0x00000029, 0x00000080 } },
37 { AR5K_RF_GAIN(3), { 0x00000069, 0x00000150 } },
38 { AR5K_RF_GAIN(4), { 0x00000199, 0x00000190 } },
39 { AR5K_RF_GAIN(5), { 0x000001d9, 0x000001d0 } },
40 { AR5K_RF_GAIN(6), { 0x00000019, 0x00000010 } },
41 { AR5K_RF_GAIN(7), { 0x00000059, 0x00000044 } },
42 { AR5K_RF_GAIN(8), { 0x00000099, 0x00000084 } },
43 { AR5K_RF_GAIN(9), { 0x000001a5, 0x00000148 } },
44 { AR5K_RF_GAIN(10), { 0x000001e5, 0x00000188 } },
45 { AR5K_RF_GAIN(11), { 0x00000025, 0x000001c8 } },
46 { AR5K_RF_GAIN(12), { 0x000001c8, 0x00000014 } },
47 { AR5K_RF_GAIN(13), { 0x00000008, 0x00000042 } },
48 { AR5K_RF_GAIN(14), { 0x00000048, 0x00000082 } },
49 { AR5K_RF_GAIN(15), { 0x00000088, 0x00000178 } },
50 { AR5K_RF_GAIN(16), { 0x00000198, 0x000001b8 } },
51 { AR5K_RF_GAIN(17), { 0x000001d8, 0x000001f8 } },
52 { AR5K_RF_GAIN(18), { 0x00000018, 0x00000012 } },
53 { AR5K_RF_GAIN(19), { 0x00000058, 0x00000052 } },
54 { AR5K_RF_GAIN(20), { 0x00000098, 0x00000092 } },
55 { AR5K_RF_GAIN(21), { 0x000001a4, 0x0000017c } },
56 { AR5K_RF_GAIN(22), { 0x000001e4, 0x000001bc } },
57 { AR5K_RF_GAIN(23), { 0x00000024, 0x000001fc } },
58 { AR5K_RF_GAIN(24), { 0x00000064, 0x0000000a } },
59 { AR5K_RF_GAIN(25), { 0x000000a4, 0x0000004a } },
60 { AR5K_RF_GAIN(26), { 0x000000e4, 0x0000008a } },
61 { AR5K_RF_GAIN(27), { 0x0000010a, 0x0000015a } },
62 { AR5K_RF_GAIN(28), { 0x0000014a, 0x0000019a } },
63 { AR5K_RF_GAIN(29), { 0x0000018a, 0x000001da } },
64 { AR5K_RF_GAIN(30), { 0x000001ca, 0x0000000e } },
65 { AR5K_RF_GAIN(31), { 0x0000000a, 0x0000004e } },
66 { AR5K_RF_GAIN(32), { 0x0000004a, 0x0000008e } },
67 { AR5K_RF_GAIN(33), { 0x0000008a, 0x0000015e } },
68 { AR5K_RF_GAIN(34), { 0x000001ba, 0x0000019e } },
69 { AR5K_RF_GAIN(35), { 0x000001fa, 0x000001de } },
70 { AR5K_RF_GAIN(36), { 0x0000003a, 0x00000009 } },
71 { AR5K_RF_GAIN(37), { 0x0000007a, 0x00000049 } },
72 { AR5K_RF_GAIN(38), { 0x00000186, 0x00000089 } },
73 { AR5K_RF_GAIN(39), { 0x000001c6, 0x00000179 } },
74 { AR5K_RF_GAIN(40), { 0x00000006, 0x000001b9 } },
75 { AR5K_RF_GAIN(41), { 0x00000046, 0x000001f9 } },
76 { AR5K_RF_GAIN(42), { 0x00000086, 0x00000039 } },
77 { AR5K_RF_GAIN(43), { 0x000000c6, 0x00000079 } },
78 { AR5K_RF_GAIN(44), { 0x000000c6, 0x000000b9 } },
79 { AR5K_RF_GAIN(45), { 0x000000c6, 0x000001bd } },
80 { AR5K_RF_GAIN(46), { 0x000000c6, 0x000001fd } },
81 { AR5K_RF_GAIN(47), { 0x000000c6, 0x0000003d } },
82 { AR5K_RF_GAIN(48), { 0x000000c6, 0x0000007d } },
83 { AR5K_RF_GAIN(49), { 0x000000c6, 0x000000bd } },
84 { AR5K_RF_GAIN(50), { 0x000000c6, 0x000000fd } },
85 { AR5K_RF_GAIN(51), { 0x000000c6, 0x000000fd } },
86 { AR5K_RF_GAIN(52), { 0x000000c6, 0x000000fd } },
87 { AR5K_RF_GAIN(53), { 0x000000c6, 0x000000fd } },
88 { AR5K_RF_GAIN(54), { 0x000000c6, 0x000000fd } },
89 { AR5K_RF_GAIN(55), { 0x000000c6, 0x000000fd } },
90 { AR5K_RF_GAIN(56), { 0x000000c6, 0x000000fd } },
91 { AR5K_RF_GAIN(57), { 0x000000c6, 0x000000fd } },
92 { AR5K_RF_GAIN(58), { 0x000000c6, 0x000000fd } },
93 { AR5K_RF_GAIN(59), { 0x000000c6, 0x000000fd } },
94 { AR5K_RF_GAIN(60), { 0x000000c6, 0x000000fd } },
95 { AR5K_RF_GAIN(61), { 0x000000c6, 0x000000fd } },
96 { AR5K_RF_GAIN(62), { 0x000000c6, 0x000000fd } },
97 { AR5K_RF_GAIN(63), { 0x000000c6, 0x000000fd } },
98};
99
100/* Initial RF Gain settings for RF5112 */
101static const struct ath5k_ini_rfgain rfgain_5112[] = {
102 /* 5Ghz 2Ghz */
103 { AR5K_RF_GAIN(0), { 0x00000007, 0x00000007 } },
104 { AR5K_RF_GAIN(1), { 0x00000047, 0x00000047 } },
105 { AR5K_RF_GAIN(2), { 0x00000087, 0x00000087 } },
106 { AR5K_RF_GAIN(3), { 0x000001a0, 0x000001a0 } },
107 { AR5K_RF_GAIN(4), { 0x000001e0, 0x000001e0 } },
108 { AR5K_RF_GAIN(5), { 0x00000020, 0x00000020 } },
109 { AR5K_RF_GAIN(6), { 0x00000060, 0x00000060 } },
110 { AR5K_RF_GAIN(7), { 0x000001a1, 0x000001a1 } },
111 { AR5K_RF_GAIN(8), { 0x000001e1, 0x000001e1 } },
112 { AR5K_RF_GAIN(9), { 0x00000021, 0x00000021 } },
113 { AR5K_RF_GAIN(10), { 0x00000061, 0x00000061 } },
114 { AR5K_RF_GAIN(11), { 0x00000162, 0x00000162 } },
115 { AR5K_RF_GAIN(12), { 0x000001a2, 0x000001a2 } },
116 { AR5K_RF_GAIN(13), { 0x000001e2, 0x000001e2 } },
117 { AR5K_RF_GAIN(14), { 0x00000022, 0x00000022 } },
118 { AR5K_RF_GAIN(15), { 0x00000062, 0x00000062 } },
119 { AR5K_RF_GAIN(16), { 0x00000163, 0x00000163 } },
120 { AR5K_RF_GAIN(17), { 0x000001a3, 0x000001a3 } },
121 { AR5K_RF_GAIN(18), { 0x000001e3, 0x000001e3 } },
122 { AR5K_RF_GAIN(19), { 0x00000023, 0x00000023 } },
123 { AR5K_RF_GAIN(20), { 0x00000063, 0x00000063 } },
124 { AR5K_RF_GAIN(21), { 0x00000184, 0x00000184 } },
125 { AR5K_RF_GAIN(22), { 0x000001c4, 0x000001c4 } },
126 { AR5K_RF_GAIN(23), { 0x00000004, 0x00000004 } },
127 { AR5K_RF_GAIN(24), { 0x000001ea, 0x0000000b } },
128 { AR5K_RF_GAIN(25), { 0x0000002a, 0x0000004b } },
129 { AR5K_RF_GAIN(26), { 0x0000006a, 0x0000008b } },
130 { AR5K_RF_GAIN(27), { 0x000000aa, 0x000001ac } },
131 { AR5K_RF_GAIN(28), { 0x000001ab, 0x000001ec } },
132 { AR5K_RF_GAIN(29), { 0x000001eb, 0x0000002c } },
133 { AR5K_RF_GAIN(30), { 0x0000002b, 0x00000012 } },
134 { AR5K_RF_GAIN(31), { 0x0000006b, 0x00000052 } },
135 { AR5K_RF_GAIN(32), { 0x000000ab, 0x00000092 } },
136 { AR5K_RF_GAIN(33), { 0x000001ac, 0x00000193 } },
137 { AR5K_RF_GAIN(34), { 0x000001ec, 0x000001d3 } },
138 { AR5K_RF_GAIN(35), { 0x0000002c, 0x00000013 } },
139 { AR5K_RF_GAIN(36), { 0x0000003a, 0x00000053 } },
140 { AR5K_RF_GAIN(37), { 0x0000007a, 0x00000093 } },
141 { AR5K_RF_GAIN(38), { 0x000000ba, 0x00000194 } },
142 { AR5K_RF_GAIN(39), { 0x000001bb, 0x000001d4 } },
143 { AR5K_RF_GAIN(40), { 0x000001fb, 0x00000014 } },
144 { AR5K_RF_GAIN(41), { 0x0000003b, 0x0000003a } },
145 { AR5K_RF_GAIN(42), { 0x0000007b, 0x0000007a } },
146 { AR5K_RF_GAIN(43), { 0x000000bb, 0x000000ba } },
147 { AR5K_RF_GAIN(44), { 0x000001bc, 0x000001bb } },
148 { AR5K_RF_GAIN(45), { 0x000001fc, 0x000001fb } },
149 { AR5K_RF_GAIN(46), { 0x0000003c, 0x0000003b } },
150 { AR5K_RF_GAIN(47), { 0x0000007c, 0x0000007b } },
151 { AR5K_RF_GAIN(48), { 0x000000bc, 0x000000bb } },
152 { AR5K_RF_GAIN(49), { 0x000000fc, 0x000001bc } },
153 { AR5K_RF_GAIN(50), { 0x000000fc, 0x000001fc } },
154 { AR5K_RF_GAIN(51), { 0x000000fc, 0x0000003c } },
155 { AR5K_RF_GAIN(52), { 0x000000fc, 0x0000007c } },
156 { AR5K_RF_GAIN(53), { 0x000000fc, 0x000000bc } },
157 { AR5K_RF_GAIN(54), { 0x000000fc, 0x000000fc } },
158 { AR5K_RF_GAIN(55), { 0x000000fc, 0x000000fc } },
159 { AR5K_RF_GAIN(56), { 0x000000fc, 0x000000fc } },
160 { AR5K_RF_GAIN(57), { 0x000000fc, 0x000000fc } },
161 { AR5K_RF_GAIN(58), { 0x000000fc, 0x000000fc } },
162 { AR5K_RF_GAIN(59), { 0x000000fc, 0x000000fc } },
163 { AR5K_RF_GAIN(60), { 0x000000fc, 0x000000fc } },
164 { AR5K_RF_GAIN(61), { 0x000000fc, 0x000000fc } },
165 { AR5K_RF_GAIN(62), { 0x000000fc, 0x000000fc } },
166 { AR5K_RF_GAIN(63), { 0x000000fc, 0x000000fc } },
167};
168
169/* Initial RF Gain settings for RF2413 */
170static const struct ath5k_ini_rfgain rfgain_2413[] = {
171 { AR5K_RF_GAIN(0), { 0x00000000, 0x00000000 } },
172 { AR5K_RF_GAIN(1), { 0x00000000, 0x00000040 } },
173 { AR5K_RF_GAIN(2), { 0x00000000, 0x00000080 } },
174 { AR5K_RF_GAIN(3), { 0x00000000, 0x00000181 } },
175 { AR5K_RF_GAIN(4), { 0x00000000, 0x000001c1 } },
176 { AR5K_RF_GAIN(5), { 0x00000000, 0x00000001 } },
177 { AR5K_RF_GAIN(6), { 0x00000000, 0x00000041 } },
178 { AR5K_RF_GAIN(7), { 0x00000000, 0x00000081 } },
179 { AR5K_RF_GAIN(8), { 0x00000000, 0x00000168 } },
180 { AR5K_RF_GAIN(9), { 0x00000000, 0x000001a8 } },
181 { AR5K_RF_GAIN(10), { 0x00000000, 0x000001e8 } },
182 { AR5K_RF_GAIN(11), { 0x00000000, 0x00000028 } },
183 { AR5K_RF_GAIN(12), { 0x00000000, 0x00000068 } },
184 { AR5K_RF_GAIN(13), { 0x00000000, 0x00000189 } },
185 { AR5K_RF_GAIN(14), { 0x00000000, 0x000001c9 } },
186 { AR5K_RF_GAIN(15), { 0x00000000, 0x00000009 } },
187 { AR5K_RF_GAIN(16), { 0x00000000, 0x00000049 } },
188 { AR5K_RF_GAIN(17), { 0x00000000, 0x00000089 } },
189 { AR5K_RF_GAIN(18), { 0x00000000, 0x00000190 } },
190 { AR5K_RF_GAIN(19), { 0x00000000, 0x000001d0 } },
191 { AR5K_RF_GAIN(20), { 0x00000000, 0x00000010 } },
192 { AR5K_RF_GAIN(21), { 0x00000000, 0x00000050 } },
193 { AR5K_RF_GAIN(22), { 0x00000000, 0x00000090 } },
194 { AR5K_RF_GAIN(23), { 0x00000000, 0x00000191 } },
195 { AR5K_RF_GAIN(24), { 0x00000000, 0x000001d1 } },
196 { AR5K_RF_GAIN(25), { 0x00000000, 0x00000011 } },
197 { AR5K_RF_GAIN(26), { 0x00000000, 0x00000051 } },
198 { AR5K_RF_GAIN(27), { 0x00000000, 0x00000091 } },
199 { AR5K_RF_GAIN(28), { 0x00000000, 0x00000178 } },
200 { AR5K_RF_GAIN(29), { 0x00000000, 0x000001b8 } },
201 { AR5K_RF_GAIN(30), { 0x00000000, 0x000001f8 } },
202 { AR5K_RF_GAIN(31), { 0x00000000, 0x00000038 } },
203 { AR5K_RF_GAIN(32), { 0x00000000, 0x00000078 } },
204 { AR5K_RF_GAIN(33), { 0x00000000, 0x00000199 } },
205 { AR5K_RF_GAIN(34), { 0x00000000, 0x000001d9 } },
206 { AR5K_RF_GAIN(35), { 0x00000000, 0x00000019 } },
207 { AR5K_RF_GAIN(36), { 0x00000000, 0x00000059 } },
208 { AR5K_RF_GAIN(37), { 0x00000000, 0x00000099 } },
209 { AR5K_RF_GAIN(38), { 0x00000000, 0x000000d9 } },
210 { AR5K_RF_GAIN(39), { 0x00000000, 0x000000f9 } },
211 { AR5K_RF_GAIN(40), { 0x00000000, 0x000000f9 } },
212 { AR5K_RF_GAIN(41), { 0x00000000, 0x000000f9 } },
213 { AR5K_RF_GAIN(42), { 0x00000000, 0x000000f9 } },
214 { AR5K_RF_GAIN(43), { 0x00000000, 0x000000f9 } },
215 { AR5K_RF_GAIN(44), { 0x00000000, 0x000000f9 } },
216 { AR5K_RF_GAIN(45), { 0x00000000, 0x000000f9 } },
217 { AR5K_RF_GAIN(46), { 0x00000000, 0x000000f9 } },
218 { AR5K_RF_GAIN(47), { 0x00000000, 0x000000f9 } },
219 { AR5K_RF_GAIN(48), { 0x00000000, 0x000000f9 } },
220 { AR5K_RF_GAIN(49), { 0x00000000, 0x000000f9 } },
221 { AR5K_RF_GAIN(50), { 0x00000000, 0x000000f9 } },
222 { AR5K_RF_GAIN(51), { 0x00000000, 0x000000f9 } },
223 { AR5K_RF_GAIN(52), { 0x00000000, 0x000000f9 } },
224 { AR5K_RF_GAIN(53), { 0x00000000, 0x000000f9 } },
225 { AR5K_RF_GAIN(54), { 0x00000000, 0x000000f9 } },
226 { AR5K_RF_GAIN(55), { 0x00000000, 0x000000f9 } },
227 { AR5K_RF_GAIN(56), { 0x00000000, 0x000000f9 } },
228 { AR5K_RF_GAIN(57), { 0x00000000, 0x000000f9 } },
229 { AR5K_RF_GAIN(58), { 0x00000000, 0x000000f9 } },
230 { AR5K_RF_GAIN(59), { 0x00000000, 0x000000f9 } },
231 { AR5K_RF_GAIN(60), { 0x00000000, 0x000000f9 } },
232 { AR5K_RF_GAIN(61), { 0x00000000, 0x000000f9 } },
233 { AR5K_RF_GAIN(62), { 0x00000000, 0x000000f9 } },
234 { AR5K_RF_GAIN(63), { 0x00000000, 0x000000f9 } },
235};
236
237/* Initial RF Gain settings for AR2316 */
238static const struct ath5k_ini_rfgain rfgain_2316[] = {
239 { AR5K_RF_GAIN(0), { 0x00000000, 0x00000000 } },
240 { AR5K_RF_GAIN(1), { 0x00000000, 0x00000040 } },
241 { AR5K_RF_GAIN(2), { 0x00000000, 0x00000080 } },
242 { AR5K_RF_GAIN(3), { 0x00000000, 0x000000c0 } },
243 { AR5K_RF_GAIN(4), { 0x00000000, 0x000000e0 } },
244 { AR5K_RF_GAIN(5), { 0x00000000, 0x000000e0 } },
245 { AR5K_RF_GAIN(6), { 0x00000000, 0x00000128 } },
246 { AR5K_RF_GAIN(7), { 0x00000000, 0x00000128 } },
247 { AR5K_RF_GAIN(8), { 0x00000000, 0x00000128 } },
248 { AR5K_RF_GAIN(9), { 0x00000000, 0x00000168 } },
249 { AR5K_RF_GAIN(10), { 0x00000000, 0x000001a8 } },
250 { AR5K_RF_GAIN(11), { 0x00000000, 0x000001e8 } },
251 { AR5K_RF_GAIN(12), { 0x00000000, 0x00000028 } },
252 { AR5K_RF_GAIN(13), { 0x00000000, 0x00000068 } },
253 { AR5K_RF_GAIN(14), { 0x00000000, 0x000000a8 } },
254 { AR5K_RF_GAIN(15), { 0x00000000, 0x000000e8 } },
255 { AR5K_RF_GAIN(16), { 0x00000000, 0x000000e8 } },
256 { AR5K_RF_GAIN(17), { 0x00000000, 0x00000130 } },
257 { AR5K_RF_GAIN(18), { 0x00000000, 0x00000130 } },
258 { AR5K_RF_GAIN(19), { 0x00000000, 0x00000170 } },
259 { AR5K_RF_GAIN(20), { 0x00000000, 0x000001b0 } },
260 { AR5K_RF_GAIN(21), { 0x00000000, 0x000001f0 } },
261 { AR5K_RF_GAIN(22), { 0x00000000, 0x00000030 } },
262 { AR5K_RF_GAIN(23), { 0x00000000, 0x00000070 } },
263 { AR5K_RF_GAIN(24), { 0x00000000, 0x000000b0 } },
264 { AR5K_RF_GAIN(25), { 0x00000000, 0x000000f0 } },
265 { AR5K_RF_GAIN(26), { 0x00000000, 0x000000f0 } },
266 { AR5K_RF_GAIN(27), { 0x00000000, 0x000000f0 } },
267 { AR5K_RF_GAIN(28), { 0x00000000, 0x000000f0 } },
268 { AR5K_RF_GAIN(29), { 0x00000000, 0x000000f0 } },
269 { AR5K_RF_GAIN(30), { 0x00000000, 0x000000f0 } },
270 { AR5K_RF_GAIN(31), { 0x00000000, 0x000000f0 } },
271 { AR5K_RF_GAIN(32), { 0x00000000, 0x000000f0 } },
272 { AR5K_RF_GAIN(33), { 0x00000000, 0x000000f0 } },
273 { AR5K_RF_GAIN(34), { 0x00000000, 0x000000f0 } },
274 { AR5K_RF_GAIN(35), { 0x00000000, 0x000000f0 } },
275 { AR5K_RF_GAIN(36), { 0x00000000, 0x000000f0 } },
276 { AR5K_RF_GAIN(37), { 0x00000000, 0x000000f0 } },
277 { AR5K_RF_GAIN(38), { 0x00000000, 0x000000f0 } },
278 { AR5K_RF_GAIN(39), { 0x00000000, 0x000000f0 } },
279 { AR5K_RF_GAIN(40), { 0x00000000, 0x000000f0 } },
280 { AR5K_RF_GAIN(41), { 0x00000000, 0x000000f0 } },
281 { AR5K_RF_GAIN(42), { 0x00000000, 0x000000f0 } },
282 { AR5K_RF_GAIN(43), { 0x00000000, 0x000000f0 } },
283 { AR5K_RF_GAIN(44), { 0x00000000, 0x000000f0 } },
284 { AR5K_RF_GAIN(45), { 0x00000000, 0x000000f0 } },
285 { AR5K_RF_GAIN(46), { 0x00000000, 0x000000f0 } },
286 { AR5K_RF_GAIN(47), { 0x00000000, 0x000000f0 } },
287 { AR5K_RF_GAIN(48), { 0x00000000, 0x000000f0 } },
288 { AR5K_RF_GAIN(49), { 0x00000000, 0x000000f0 } },
289 { AR5K_RF_GAIN(50), { 0x00000000, 0x000000f0 } },
290 { AR5K_RF_GAIN(51), { 0x00000000, 0x000000f0 } },
291 { AR5K_RF_GAIN(52), { 0x00000000, 0x000000f0 } },
292 { AR5K_RF_GAIN(53), { 0x00000000, 0x000000f0 } },
293 { AR5K_RF_GAIN(54), { 0x00000000, 0x000000f0 } },
294 { AR5K_RF_GAIN(55), { 0x00000000, 0x000000f0 } },
295 { AR5K_RF_GAIN(56), { 0x00000000, 0x000000f0 } },
296 { AR5K_RF_GAIN(57), { 0x00000000, 0x000000f0 } },
297 { AR5K_RF_GAIN(58), { 0x00000000, 0x000000f0 } },
298 { AR5K_RF_GAIN(59), { 0x00000000, 0x000000f0 } },
299 { AR5K_RF_GAIN(60), { 0x00000000, 0x000000f0 } },
300 { AR5K_RF_GAIN(61), { 0x00000000, 0x000000f0 } },
301 { AR5K_RF_GAIN(62), { 0x00000000, 0x000000f0 } },
302 { AR5K_RF_GAIN(63), { 0x00000000, 0x000000f0 } },
303};
304
305
306/* Initial RF Gain settings for RF5413 */
307static const struct ath5k_ini_rfgain rfgain_5413[] = {
308 /* 5Ghz 2Ghz */
309 { AR5K_RF_GAIN(0), { 0x00000000, 0x00000000 } },
310 { AR5K_RF_GAIN(1), { 0x00000040, 0x00000040 } },
311 { AR5K_RF_GAIN(2), { 0x00000080, 0x00000080 } },
312 { AR5K_RF_GAIN(3), { 0x000001a1, 0x00000161 } },
313 { AR5K_RF_GAIN(4), { 0x000001e1, 0x000001a1 } },
314 { AR5K_RF_GAIN(5), { 0x00000021, 0x000001e1 } },
315 { AR5K_RF_GAIN(6), { 0x00000061, 0x00000021 } },
316 { AR5K_RF_GAIN(7), { 0x00000188, 0x00000061 } },
317 { AR5K_RF_GAIN(8), { 0x000001c8, 0x00000188 } },
318 { AR5K_RF_GAIN(9), { 0x00000008, 0x000001c8 } },
319 { AR5K_RF_GAIN(10), { 0x00000048, 0x00000008 } },
320 { AR5K_RF_GAIN(11), { 0x00000088, 0x00000048 } },
321 { AR5K_RF_GAIN(12), { 0x000001a9, 0x00000088 } },
322 { AR5K_RF_GAIN(13), { 0x000001e9, 0x00000169 } },
323 { AR5K_RF_GAIN(14), { 0x00000029, 0x000001a9 } },
324 { AR5K_RF_GAIN(15), { 0x00000069, 0x000001e9 } },
325 { AR5K_RF_GAIN(16), { 0x000001d0, 0x00000029 } },
326 { AR5K_RF_GAIN(17), { 0x00000010, 0x00000069 } },
327 { AR5K_RF_GAIN(18), { 0x00000050, 0x00000190 } },
328 { AR5K_RF_GAIN(19), { 0x00000090, 0x000001d0 } },
329 { AR5K_RF_GAIN(20), { 0x000001b1, 0x00000010 } },
330 { AR5K_RF_GAIN(21), { 0x000001f1, 0x00000050 } },
331 { AR5K_RF_GAIN(22), { 0x00000031, 0x00000090 } },
332 { AR5K_RF_GAIN(23), { 0x00000071, 0x00000171 } },
333 { AR5K_RF_GAIN(24), { 0x000001b8, 0x000001b1 } },
334 { AR5K_RF_GAIN(25), { 0x000001f8, 0x000001f1 } },
335 { AR5K_RF_GAIN(26), { 0x00000038, 0x00000031 } },
336 { AR5K_RF_GAIN(27), { 0x00000078, 0x00000071 } },
337 { AR5K_RF_GAIN(28), { 0x00000199, 0x00000198 } },
338 { AR5K_RF_GAIN(29), { 0x000001d9, 0x000001d8 } },
339 { AR5K_RF_GAIN(30), { 0x00000019, 0x00000018 } },
340 { AR5K_RF_GAIN(31), { 0x00000059, 0x00000058 } },
341 { AR5K_RF_GAIN(32), { 0x00000099, 0x00000098 } },
342 { AR5K_RF_GAIN(33), { 0x000000d9, 0x00000179 } },
343 { AR5K_RF_GAIN(34), { 0x000000f9, 0x000001b9 } },
344 { AR5K_RF_GAIN(35), { 0x000000f9, 0x000001f9 } },
345 { AR5K_RF_GAIN(36), { 0x000000f9, 0x00000039 } },
346 { AR5K_RF_GAIN(37), { 0x000000f9, 0x00000079 } },
347 { AR5K_RF_GAIN(38), { 0x000000f9, 0x000000b9 } },
348 { AR5K_RF_GAIN(39), { 0x000000f9, 0x000000f9 } },
349 { AR5K_RF_GAIN(40), { 0x000000f9, 0x000000f9 } },
350 { AR5K_RF_GAIN(41), { 0x000000f9, 0x000000f9 } },
351 { AR5K_RF_GAIN(42), { 0x000000f9, 0x000000f9 } },
352 { AR5K_RF_GAIN(43), { 0x000000f9, 0x000000f9 } },
353 { AR5K_RF_GAIN(44), { 0x000000f9, 0x000000f9 } },
354 { AR5K_RF_GAIN(45), { 0x000000f9, 0x000000f9 } },
355 { AR5K_RF_GAIN(46), { 0x000000f9, 0x000000f9 } },
356 { AR5K_RF_GAIN(47), { 0x000000f9, 0x000000f9 } },
357 { AR5K_RF_GAIN(48), { 0x000000f9, 0x000000f9 } },
358 { AR5K_RF_GAIN(49), { 0x000000f9, 0x000000f9 } },
359 { AR5K_RF_GAIN(50), { 0x000000f9, 0x000000f9 } },
360 { AR5K_RF_GAIN(51), { 0x000000f9, 0x000000f9 } },
361 { AR5K_RF_GAIN(52), { 0x000000f9, 0x000000f9 } },
362 { AR5K_RF_GAIN(53), { 0x000000f9, 0x000000f9 } },
363 { AR5K_RF_GAIN(54), { 0x000000f9, 0x000000f9 } },
364 { AR5K_RF_GAIN(55), { 0x000000f9, 0x000000f9 } },
365 { AR5K_RF_GAIN(56), { 0x000000f9, 0x000000f9 } },
366 { AR5K_RF_GAIN(57), { 0x000000f9, 0x000000f9 } },
367 { AR5K_RF_GAIN(58), { 0x000000f9, 0x000000f9 } },
368 { AR5K_RF_GAIN(59), { 0x000000f9, 0x000000f9 } },
369 { AR5K_RF_GAIN(60), { 0x000000f9, 0x000000f9 } },
370 { AR5K_RF_GAIN(61), { 0x000000f9, 0x000000f9 } },
371 { AR5K_RF_GAIN(62), { 0x000000f9, 0x000000f9 } },
372 { AR5K_RF_GAIN(63), { 0x000000f9, 0x000000f9 } },
373};
374
375
376/* Initial RF Gain settings for RF2425 */
377static const struct ath5k_ini_rfgain rfgain_2425[] = {
378 { AR5K_RF_GAIN(0), { 0x00000000, 0x00000000 } },
379 { AR5K_RF_GAIN(1), { 0x00000000, 0x00000040 } },
380 { AR5K_RF_GAIN(2), { 0x00000000, 0x00000080 } },
381 { AR5K_RF_GAIN(3), { 0x00000000, 0x00000181 } },
382 { AR5K_RF_GAIN(4), { 0x00000000, 0x000001c1 } },
383 { AR5K_RF_GAIN(5), { 0x00000000, 0x00000001 } },
384 { AR5K_RF_GAIN(6), { 0x00000000, 0x00000041 } },
385 { AR5K_RF_GAIN(7), { 0x00000000, 0x00000081 } },
386 { AR5K_RF_GAIN(8), { 0x00000000, 0x00000188 } },
387 { AR5K_RF_GAIN(9), { 0x00000000, 0x000001c8 } },
388 { AR5K_RF_GAIN(10), { 0x00000000, 0x00000008 } },
389 { AR5K_RF_GAIN(11), { 0x00000000, 0x00000048 } },
390 { AR5K_RF_GAIN(12), { 0x00000000, 0x00000088 } },
391 { AR5K_RF_GAIN(13), { 0x00000000, 0x00000189 } },
392 { AR5K_RF_GAIN(14), { 0x00000000, 0x000001c9 } },
393 { AR5K_RF_GAIN(15), { 0x00000000, 0x00000009 } },
394 { AR5K_RF_GAIN(16), { 0x00000000, 0x00000049 } },
395 { AR5K_RF_GAIN(17), { 0x00000000, 0x00000089 } },
396 { AR5K_RF_GAIN(18), { 0x00000000, 0x000001b0 } },
397 { AR5K_RF_GAIN(19), { 0x00000000, 0x000001f0 } },
398 { AR5K_RF_GAIN(20), { 0x00000000, 0x00000030 } },
399 { AR5K_RF_GAIN(21), { 0x00000000, 0x00000070 } },
400 { AR5K_RF_GAIN(22), { 0x00000000, 0x00000171 } },
401 { AR5K_RF_GAIN(23), { 0x00000000, 0x000001b1 } },
402 { AR5K_RF_GAIN(24), { 0x00000000, 0x000001f1 } },
403 { AR5K_RF_GAIN(25), { 0x00000000, 0x00000031 } },
404 { AR5K_RF_GAIN(26), { 0x00000000, 0x00000071 } },
405 { AR5K_RF_GAIN(27), { 0x00000000, 0x000001b8 } },
406 { AR5K_RF_GAIN(28), { 0x00000000, 0x000001f8 } },
407 { AR5K_RF_GAIN(29), { 0x00000000, 0x00000038 } },
408 { AR5K_RF_GAIN(30), { 0x00000000, 0x00000078 } },
409 { AR5K_RF_GAIN(31), { 0x00000000, 0x000000b8 } },
410 { AR5K_RF_GAIN(32), { 0x00000000, 0x000001b9 } },
411 { AR5K_RF_GAIN(33), { 0x00000000, 0x000001f9 } },
412 { AR5K_RF_GAIN(34), { 0x00000000, 0x00000039 } },
413 { AR5K_RF_GAIN(35), { 0x00000000, 0x00000079 } },
414 { AR5K_RF_GAIN(36), { 0x00000000, 0x000000b9 } },
415 { AR5K_RF_GAIN(37), { 0x00000000, 0x000000f9 } },
416 { AR5K_RF_GAIN(38), { 0x00000000, 0x000000f9 } },
417 { AR5K_RF_GAIN(39), { 0x00000000, 0x000000f9 } },
418 { AR5K_RF_GAIN(40), { 0x00000000, 0x000000f9 } },
419 { AR5K_RF_GAIN(41), { 0x00000000, 0x000000f9 } },
420 { AR5K_RF_GAIN(42), { 0x00000000, 0x000000f9 } },
421 { AR5K_RF_GAIN(43), { 0x00000000, 0x000000f9 } },
422 { AR5K_RF_GAIN(44), { 0x00000000, 0x000000f9 } },
423 { AR5K_RF_GAIN(45), { 0x00000000, 0x000000f9 } },
424 { AR5K_RF_GAIN(46), { 0x00000000, 0x000000f9 } },
425 { AR5K_RF_GAIN(47), { 0x00000000, 0x000000f9 } },
426 { AR5K_RF_GAIN(48), { 0x00000000, 0x000000f9 } },
427 { AR5K_RF_GAIN(49), { 0x00000000, 0x000000f9 } },
428 { AR5K_RF_GAIN(50), { 0x00000000, 0x000000f9 } },
429 { AR5K_RF_GAIN(51), { 0x00000000, 0x000000f9 } },
430 { AR5K_RF_GAIN(52), { 0x00000000, 0x000000f9 } },
431 { AR5K_RF_GAIN(53), { 0x00000000, 0x000000f9 } },
432 { AR5K_RF_GAIN(54), { 0x00000000, 0x000000f9 } },
433 { AR5K_RF_GAIN(55), { 0x00000000, 0x000000f9 } },
434 { AR5K_RF_GAIN(56), { 0x00000000, 0x000000f9 } },
435 { AR5K_RF_GAIN(57), { 0x00000000, 0x000000f9 } },
436 { AR5K_RF_GAIN(58), { 0x00000000, 0x000000f9 } },
437 { AR5K_RF_GAIN(59), { 0x00000000, 0x000000f9 } },
438 { AR5K_RF_GAIN(60), { 0x00000000, 0x000000f9 } },
439 { AR5K_RF_GAIN(61), { 0x00000000, 0x000000f9 } },
440 { AR5K_RF_GAIN(62), { 0x00000000, 0x000000f9 } },
441 { AR5K_RF_GAIN(63), { 0x00000000, 0x000000f9 } },
442};
443
444struct ath5k_gain_opt {
445 u32 go_default;
446 u32 go_steps_count;
447 const struct ath5k_gain_opt_step go_step[AR5K_GAIN_STEP_COUNT];
448};
449
450static const struct ath5k_gain_opt rfgain_opt_5111 = {
451 4,
452 9,
453 {
454 { { 4, 1, 1, 1 }, 6 },
455 { { 4, 0, 1, 1 }, 4 },
456 { { 3, 1, 1, 1 }, 3 },
457 { { 4, 0, 0, 1 }, 1 },
458 { { 4, 1, 1, 0 }, 0 },
459 { { 4, 0, 1, 0 }, -2 },
460 { { 3, 1, 1, 0 }, -3 },
461 { { 4, 0, 0, 0 }, -4 },
462 { { 2, 1, 1, 0 }, -6 }
463 }
464};
465
466static const struct ath5k_gain_opt rfgain_opt_5112 = {
467 1,
468 8,
469 {
470 { { 3, 0, 0, 0, 0, 0, 0 }, 6 },
471 { { 2, 0, 0, 0, 0, 0, 0 }, 0 },
472 { { 1, 0, 0, 0, 0, 0, 0 }, -3 },
473 { { 0, 0, 0, 0, 0, 0, 0 }, -6 },
474 { { 0, 1, 1, 0, 0, 0, 0 }, -8 },
475 { { 0, 1, 1, 0, 1, 1, 0 }, -10 },
476 { { 0, 1, 0, 1, 1, 1, 0 }, -13 },
477 { { 0, 1, 0, 1, 1, 0, 1 }, -16 },
478 }
479};
480