[trunk/include/autotools.mk] disable libtool fixups in trunk globally
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 510-ath9k_ctl_bitfields.patch
1 --- a/drivers/net/wireless/ath/ath9k/eeprom.c
2 +++ b/drivers/net/wireless/ath/ath9k/eeprom.c
3 @@ -240,16 +240,16 @@ u16 ath9k_hw_get_max_edge_power(u16 freq
4 for (i = 0; (i < num_band_edges) &&
5 (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED); i++) {
6 if (freq == ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) {
7 - twiceMaxEdgePower = pRdEdgesPower[i].tPower;
8 + twiceMaxEdgePower = CTL_EDGE_TPOWER(pRdEdgesPower[i].ctl);
9 break;
10 } else if ((i > 0) &&
11 (freq < ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel,
12 is2GHz))) {
13 if (ath9k_hw_fbin2freq(pRdEdgesPower[i - 1].bChannel,
14 is2GHz) < freq &&
15 - pRdEdgesPower[i - 1].flag) {
16 + CTL_EDGE_FLAGS(pRdEdgesPower[i - 1].ctl)) {
17 twiceMaxEdgePower =
18 - pRdEdgesPower[i - 1].tPower;
19 + CTL_EDGE_TPOWER(pRdEdgesPower[i - 1].ctl);
20 }
21 break;
22 }
23 --- a/drivers/net/wireless/ath/ath9k/eeprom.h
24 +++ b/drivers/net/wireless/ath/ath9k/eeprom.h
25 @@ -233,6 +233,9 @@
26
27 #define AR9287_CHECKSUM_LOCATION (AR9287_EEP_START_LOC + 1)
28
29 +#define CTL_EDGE_TPOWER(_ctl) ((_ctl) & 0x3f)
30 +#define CTL_EDGE_FLAGS(_ctl) (((_ctl) >> 6) & 0x03)
31 +
32 enum eeprom_param {
33 EEP_NFTHRESH_5,
34 EEP_NFTHRESH_2,
35 @@ -535,18 +538,10 @@ struct cal_target_power_ht {
36 u8 tPow2x[8];
37 } __packed;
38
39 -
40 -#ifdef __BIG_ENDIAN_BITFIELD
41 -struct cal_ctl_edges {
42 - u8 bChannel;
43 - u8 flag:2, tPower:6;
44 -} __packed;
45 -#else
46 struct cal_ctl_edges {
47 u8 bChannel;
48 - u8 tPower:6, flag:2;
49 + u8 ctl;
50 } __packed;
51 -#endif
52
53 struct cal_data_op_loop_ar9287 {
54 u8 pwrPdg[2][5];
55 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
56 +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
57 @@ -57,6 +57,8 @@
58 #define SUB_NUM_CTL_MODES_AT_5G_40 2 /* excluding HT40, EXT-OFDM */
59 #define SUB_NUM_CTL_MODES_AT_2G_40 3 /* excluding HT40, EXT-OFDM, EXT-CCK */
60
61 +#define CTL(_tpower, _flag) ((_tpower) | ((_flag) << 6))
62 +
63 static int ar9003_hw_power_interpolate(int32_t x,
64 int32_t *px, int32_t *py, u_int16_t np);
65 static const struct ar9300_eeprom ar9300_default = {
66 @@ -296,21 +298,21 @@ static const struct ar9300_eeprom ar9300
67 }
68 },
69 .ctlPowerData_2G = {
70 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
71 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
72 - { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
73 -
74 - { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
75 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
76 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
77 -
78 - { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
79 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
80 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
81 -
82 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
83 - { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
84 - { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
85 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
86 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
87 + { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } },
88 +
89 + { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } },
90 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
91 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
92 +
93 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0) } },
94 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
95 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
96 +
97 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
98 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } },
99 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } },
100 },
101 .modalHeader5G = {
102 /* 4 idle,t1,t2,b (4 bits per setting) */
103 @@ -582,56 +584,56 @@ static const struct ar9300_eeprom ar9300
104 .ctlPowerData_5G = {
105 {
106 {
107 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
108 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
109 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
110 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
111 }
112 },
113 {
114 {
115 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
116 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
117 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
118 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
119 }
120 },
121 {
122 {
123 - {60, 0}, {60, 1}, {60, 0}, {60, 1},
124 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
125 + CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 1),
126 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
127 }
128 },
129 {
130 {
131 - {60, 0}, {60, 1}, {60, 1}, {60, 0},
132 - {60, 1}, {60, 0}, {60, 0}, {60, 0},
133 + CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0),
134 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0),
135 }
136 },
137 {
138 {
139 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
140 - {60, 0}, {60, 0}, {60, 0}, {60, 0},
141 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
142 + CTL(60, 0), CTL(60, 0), CTL(60, 0), CTL(60, 0),
143 }
144 },
145 {
146 {
147 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
148 - {60, 1}, {60, 0}, {60, 0}, {60, 0},
149 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
150 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0),
151 }
152 },
153 {
154 {
155 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
156 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
157 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
158 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
159 }
160 },
161 {
162 {
163 - {60, 1}, {60, 1}, {60, 0}, {60, 1},
164 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
165 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1),
166 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
167 }
168 },
169 {
170 {
171 - {60, 1}, {60, 0}, {60, 1}, {60, 1},
172 - {60, 1}, {60, 1}, {60, 0}, {60, 1},
173 + CTL(60, 1), CTL(60, 0), CTL(60, 1), CTL(60, 1),
174 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1),
175 }
176 },
177 }
178 @@ -873,21 +875,21 @@ static const struct ar9300_eeprom ar9300
179 }
180 },
181 .ctlPowerData_2G = {
182 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
183 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
184 - { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
185 -
186 - { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
187 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
188 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
189 -
190 - { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
191 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
192 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
193 -
194 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
195 - { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
196 - { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
197 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
198 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
199 + { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } },
200 +
201 + { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } },
202 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
203 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
204 +
205 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0) } },
206 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
207 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
208 +
209 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
210 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } },
211 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } },
212 },
213 .modalHeader5G = {
214 /* 4 idle,t1,t2,b (4 bits per setting) */
215 @@ -1159,56 +1161,56 @@ static const struct ar9300_eeprom ar9300
216 .ctlPowerData_5G = {
217 {
218 {
219 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
220 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
221 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
222 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
223 }
224 },
225 {
226 {
227 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
228 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
229 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
230 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
231 }
232 },
233 {
234 {
235 - {60, 0}, {60, 1}, {60, 0}, {60, 1},
236 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
237 + CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 1),
238 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
239 }
240 },
241 {
242 {
243 - {60, 0}, {60, 1}, {60, 1}, {60, 0},
244 - {60, 1}, {60, 0}, {60, 0}, {60, 0},
245 + CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0),
246 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0),
247 }
248 },
249 {
250 {
251 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
252 - {60, 0}, {60, 0}, {60, 0}, {60, 0},
253 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
254 + CTL(60, 0), CTL(60, 0), CTL(60, 0), CTL(60, 0),
255 }
256 },
257 {
258 {
259 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
260 - {60, 1}, {60, 0}, {60, 0}, {60, 0},
261 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
262 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0),
263 }
264 },
265 {
266 {
267 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
268 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
269 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
270 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
271 }
272 },
273 {
274 {
275 - {60, 1}, {60, 1}, {60, 0}, {60, 1},
276 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
277 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1),
278 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
279 }
280 },
281 {
282 {
283 - {60, 1}, {60, 0}, {60, 1}, {60, 1},
284 - {60, 1}, {60, 1}, {60, 0}, {60, 1},
285 + CTL(60, 1), CTL(60, 0), CTL(60, 1), CTL(60, 1),
286 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1),
287 }
288 },
289 }
290 @@ -1451,21 +1453,21 @@ static const struct ar9300_eeprom ar9300
291 }
292 },
293 .ctlPowerData_2G = {
294 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
295 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
296 - { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
297 -
298 - { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
299 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
300 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
301 -
302 - { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
303 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
304 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
305 -
306 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
307 - { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
308 - { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
309 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
310 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
311 + { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } },
312 +
313 + { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } },
314 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
315 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
316 +
317 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0) } },
318 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
319 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
320 +
321 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
322 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } },
323 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } },
324 },
325 .modalHeader5G = {
326 /* 4 idle,t1,t2,b (4 bits per setting) */
327 @@ -1737,56 +1739,56 @@ static const struct ar9300_eeprom ar9300
328 .ctlPowerData_5G = {
329 {
330 {
331 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
332 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
333 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
334 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
335 }
336 },
337 {
338 {
339 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
340 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
341 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
342 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
343 }
344 },
345 {
346 {
347 - {60, 0}, {60, 1}, {60, 0}, {60, 1},
348 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
349 + CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 1),
350 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
351 }
352 },
353 {
354 {
355 - {60, 0}, {60, 1}, {60, 1}, {60, 0},
356 - {60, 1}, {60, 0}, {60, 0}, {60, 0},
357 + CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0),
358 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0),
359 }
360 },
361 {
362 {
363 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
364 - {60, 0}, {60, 0}, {60, 0}, {60, 0},
365 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
366 + CTL(60, 0), CTL(60, 0), CTL(60, 0), CTL(60, 0),
367 }
368 },
369 {
370 {
371 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
372 - {60, 1}, {60, 0}, {60, 0}, {60, 0},
373 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
374 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0),
375 }
376 },
377 {
378 {
379 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
380 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
381 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
382 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
383 }
384 },
385 {
386 {
387 - {60, 1}, {60, 1}, {60, 0}, {60, 1},
388 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
389 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1),
390 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
391 }
392 },
393 {
394 {
395 - {60, 1}, {60, 0}, {60, 1}, {60, 1},
396 - {60, 1}, {60, 1}, {60, 0}, {60, 1},
397 + CTL(60, 1), CTL(60, 0), CTL(60, 1), CTL(60, 1),
398 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1),
399 }
400 },
401 }
402 @@ -2029,21 +2031,21 @@ static const struct ar9300_eeprom ar9300
403 }
404 },
405 .ctlPowerData_2G = {
406 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
407 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
408 - { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
409 -
410 - { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
411 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
412 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
413 -
414 - { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
415 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
416 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
417 -
418 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
419 - { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
420 - { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
421 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
422 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
423 + { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } },
424 +
425 + { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } },
426 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
427 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
428 +
429 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0) } },
430 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
431 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
432 +
433 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
434 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } },
435 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } },
436 },
437 .modalHeader5G = {
438 /* 4 idle,t1,t2,b (4 bits per setting) */
439 @@ -2315,56 +2317,56 @@ static const struct ar9300_eeprom ar9300
440 .ctlPowerData_5G = {
441 {
442 {
443 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
444 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
445 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
446 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
447 }
448 },
449 {
450 {
451 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
452 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
453 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
454 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
455 }
456 },
457 {
458 {
459 - {60, 0}, {60, 1}, {60, 0}, {60, 1},
460 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
461 + CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 1),
462 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
463 }
464 },
465 {
466 {
467 - {60, 0}, {60, 1}, {60, 1}, {60, 0},
468 - {60, 1}, {60, 0}, {60, 0}, {60, 0},
469 + CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0),
470 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0),
471 }
472 },
473 {
474 {
475 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
476 - {60, 0}, {60, 0}, {60, 0}, {60, 0},
477 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
478 + CTL(60, 0), CTL(60, 0), CTL(60, 0), CTL(60, 0),
479 }
480 },
481 {
482 {
483 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
484 - {60, 1}, {60, 0}, {60, 0}, {60, 0},
485 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
486 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0),
487 }
488 },
489 {
490 {
491 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
492 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
493 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
494 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
495 }
496 },
497 {
498 {
499 - {60, 1}, {60, 1}, {60, 0}, {60, 1},
500 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
501 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1),
502 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
503 }
504 },
505 {
506 {
507 - {60, 1}, {60, 0}, {60, 1}, {60, 1},
508 - {60, 1}, {60, 1}, {60, 0}, {60, 1},
509 + CTL(60, 1), CTL(60, 0), CTL(60, 1), CTL(60, 1),
510 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1),
511 }
512 },
513 }
514 @@ -2606,21 +2608,21 @@ static const struct ar9300_eeprom ar9300
515 }
516 },
517 .ctlPowerData_2G = {
518 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
519 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
520 - { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
521 -
522 - { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
523 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
524 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
525 -
526 - { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
527 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
528 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
529 -
530 - { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
531 - { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
532 - { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
533 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
534 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
535 + { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } },
536 +
537 + { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } },
538 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
539 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
540 +
541 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0) } },
542 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
543 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
544 +
545 + { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
546 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } },
547 + { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } },
548 },
549 .modalHeader5G = {
550 /* 4 idle,t1,t2,b (4 bits per setting) */
551 @@ -2892,56 +2894,56 @@ static const struct ar9300_eeprom ar9300
552 .ctlPowerData_5G = {
553 {
554 {
555 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
556 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
557 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
558 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
559 }
560 },
561 {
562 {
563 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
564 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
565 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
566 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
567 }
568 },
569 {
570 {
571 - {60, 0}, {60, 1}, {60, 0}, {60, 1},
572 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
573 + CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 1),
574 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
575 }
576 },
577 {
578 {
579 - {60, 0}, {60, 1}, {60, 1}, {60, 0},
580 - {60, 1}, {60, 0}, {60, 0}, {60, 0},
581 + CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0),
582 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0),
583 }
584 },
585 {
586 {
587 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
588 - {60, 0}, {60, 0}, {60, 0}, {60, 0},
589 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
590 + CTL(60, 0), CTL(60, 0), CTL(60, 0), CTL(60, 0),
591 }
592 },
593 {
594 {
595 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
596 - {60, 1}, {60, 0}, {60, 0}, {60, 0},
597 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
598 + CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0),
599 }
600 },
601 {
602 {
603 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
604 - {60, 1}, {60, 1}, {60, 1}, {60, 1},
605 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
606 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1),
607 }
608 },
609 {
610 {
611 - {60, 1}, {60, 1}, {60, 0}, {60, 1},
612 - {60, 1}, {60, 1}, {60, 1}, {60, 0},
613 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1),
614 + CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0),
615 }
616 },
617 {
618 {
619 - {60, 1}, {60, 0}, {60, 1}, {60, 1},
620 - {60, 1}, {60, 1}, {60, 0}, {60, 1},
621 + CTL(60, 1), CTL(60, 0), CTL(60, 1), CTL(60, 1),
622 + CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1),
623 }
624 },
625 }
626 @@ -4363,9 +4365,9 @@ static u16 ar9003_hw_get_direct_edge_pow
627 struct cal_ctl_data_5g *ctl_5g = eep->ctlPowerData_5G;
628
629 if (is2GHz)
630 - return ctl_2g[idx].ctlEdges[edge].tPower;
631 + return CTL_EDGE_TPOWER(ctl_2g[idx].ctlEdges[edge]);
632 else
633 - return ctl_5g[idx].ctlEdges[edge].tPower;
634 + return CTL_EDGE_TPOWER(ctl_5g[idx].ctlEdges[edge]);
635 }
636
637 static u16 ar9003_hw_get_indirect_edge_power(struct ar9300_eeprom *eep,
638 @@ -4383,12 +4385,12 @@ static u16 ar9003_hw_get_indirect_edge_p
639
640 if (is2GHz) {
641 if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 1) < freq &&
642 - ctl_2g[idx].ctlEdges[edge - 1].flag)
643 - return ctl_2g[idx].ctlEdges[edge - 1].tPower;
644 + CTL_EDGE_FLAGS(ctl_2g[idx].ctlEdges[edge - 1]))
645 + return CTL_EDGE_TPOWER(ctl_2g[idx].ctlEdges[edge - 1]);
646 } else {
647 if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 0) < freq &&
648 - ctl_5g[idx].ctlEdges[edge - 1].flag)
649 - return ctl_5g[idx].ctlEdges[edge - 1].tPower;
650 + CTL_EDGE_FLAGS(ctl_5g[idx].ctlEdges[edge - 1]))
651 + return CTL_EDGE_TPOWER(ctl_5g[idx].ctlEdges[edge - 1]);
652 }
653
654 return AR9300_MAX_RATE_POWER;
655 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
656 +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
657 @@ -270,17 +270,12 @@ struct cal_tgt_pow_ht {
658 u8 tPow2x[14];
659 } __packed;
660
661 -struct cal_ctl_edge_pwr {
662 - u8 tPower:6,
663 - flag:2;
664 -} __packed;
665 -
666 struct cal_ctl_data_2g {
667 - struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_2G];
668 + u8 ctlEdges[AR9300_NUM_BAND_EDGES_2G];
669 } __packed;
670
671 struct cal_ctl_data_5g {
672 - struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_5G];
673 + u8 ctlEdges[AR9300_NUM_BAND_EDGES_5G];
674 } __packed;
675
676 struct ar9300_BaseExtension_1 {