source: mainline/uspace/drv/nic/ar9271/ar9271.h@ a35b458

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since a35b458 was a35b458, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 7 years ago

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

  • Property mode set to 100644
File size: 24.9 KB
Line 
1/*
2 * Copyright (c) 2014 Jan Kolarik
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @file ar9271.h
30 *
31 * Header file for AR9271 USB WiFi dongle.
32 *
33 */
34
35#ifndef AR9271_H_
36#define AR9271_H_
37
38#include <fibril_synch.h>
39#include <usb/dev/driver.h>
40#include "htc.h"
41
42/** Number of transmission queues */
43#define AR9271_QUEUES_COUNT 10
44
45/** Number of GPIO pin used for handling led light */
46#define AR9271_LED_PIN 15
47
48/** Nominal value for AR9271 noise floor calibration. */
49#define AR9271_CALIB_NOMINAL_VALUE_2GHZ -118
50
51/** RX errors values. */
52#define AR9271_RX_ERROR_CRC 0x01
53#define AR9271_RX_ERROR_PHY 0x02
54
55/** Key index used for device in station mode. */
56#define AR9271_STA_KEY_INDEX 4
57
58/* HW encryption key indicator. */
59enum ath9k_key_type {
60 AR9271_KEY_TYPE_CLEAR,
61 AR9271_KEY_TYPE_WEP,
62 AR9271_KEY_TYPE_AES,
63 AR9271_KEY_TYPE_TKIP,
64};
65
66/** AR9271 Registers */
67typedef enum {
68 /* ATH command register */
69 AR9271_COMMAND = 0x0008,
70 AR9271_COMMAND_RX_ENABLE = 0x00000004,
71
72 /* ATH config register */
73 AR9271_CONFIG = 0x0014,
74 AR9271_CONFIG_ADHOC = 0x00000020,
75
76 AR9271_QUEUE_BASE_MASK = 0x1000,
77
78 /* EEPROM Addresses */
79 AR9271_EEPROM_BASE = 0x2100,
80 AR9271_EEPROM_MAC_ADDR_START = 0x2118,
81
82 /* Reset MAC interface */
83 AR9271_RC = 0x4000,
84 AR9271_RC_AHB = 0x00000001,
85
86 /* GPIO registers */
87 AR9271_GPIO_IN_OUT = 0x4048, /**< GPIO value read/set */
88 AR9271_GPIO_OE_OUT = 0x404C, /**< GPIO set to output */
89 AR9271_GPIO_OE_OUT_ALWAYS = 0x3, /**< GPIO always drive output */
90 AR9271_GPIO_OUT_MUX1 = 0x4060,
91 AR9271_GPIO_OUT_MUX2 = 0x4064,
92 AR9271_GPIO_OUT_MUX3 = 0x4068,
93 AR9271_GPIO_OUT_MUX_AS_OUT = 0x0, /**< GPIO set mux as output */
94
95 /* RTC related registers */
96 AR9271_RTC_RC = 0x7000,
97 AR9271_RTC_RC_MAC_WARM = 0x00000001,
98 AR9271_RTC_RC_MAC_COLD = 0x00000002,
99 AR9271_RTC_RC_MASK = 0x00000003,
100 AR9271_RTC_PLL_CONTROL = 0x7014,
101 AR9271_RTC_RESET = 0x7040,
102 AR9271_RTC_STATUS = 0x7044,
103 AR9271_RTC_STATUS_MASK = 0x0000000F,
104 AR9271_RTC_STATUS_SHUTDOWN = 0x00000001,
105 AR9271_RTC_STATUS_ON = 0x00000002,
106 AR9271_RTC_SLEEP_CLOCK = 0x7048,
107 AR9271_RTC_SLEEP_CLOCK_FORCE_DERIVED = 0x2,
108 AR9271_RTC_FORCE_WAKE = 0x704C,
109 AR9271_RTC_FORCE_WAKE_ENABLE = 0x00000001,
110 AR9271_RTC_FORCE_WAKE_ON_INT = 0x00000002,
111
112 /* MAC Registers */
113 AR9271_STATION_ID0 = 0x8000, /**< STA Address Lower 32 Bits */
114 AR9271_STATION_ID1 = 0x8004, /**< STA Address Upper 16 Bits */
115 AR9271_BSSID0 = 0x8008, /**< BSSID Lower 32 Bits */
116 AR9271_BSSID1 = 0x800C, /**< BSSID Upper 16 Bits */
117 AR9271_BSSID_MASK0 = 0x80E0, /**< BSSID Mask Lower 32 Bits */
118 AR9271_BSSID_MASK1 = 0x80E4, /**< BSSID Mask Upper 16 Bits */
119 AR9271_STATION_ID1_MASK = 0x0000FFFF,
120 AR9271_STATION_ID1_POWER_SAVING = 0x00040000,
121 AR9271_MULTICAST_FILTER1 = 0x8040,
122 AR9271_MULTICAST_FILTER2 = 0x8044,
123 AR9271_DIAG = 0x8048,
124
125 /* RX filtering register */
126 AR9271_RX_FILTER = 0x803C,
127 AR9271_RX_FILTER_UNI = 0x00000001,
128 AR9271_RX_FILTER_MULTI = 0x00000002,
129 AR9271_RX_FILTER_BROAD = 0x00000004,
130 AR9271_RX_FILTER_CONTROL = 0x00000008,
131 AR9271_RX_FILTER_BEACON = 0x00000010,
132 AR9271_RX_FILTER_PROMISCUOUS = 0x00000020,
133 AR9271_RX_FILTER_PROBEREQ = 0x00000080,
134 AR9271_RX_FILTER_MYBEACON = 0x00000200,
135 AR9271_RX_FILTER_MCAST_BCAST_ALL = 0x00008000,
136
137 /* Key related registers */
138 AR9271_KEY_TABLE_BASE = 0x8800,
139 AR9271_KEY_TABLE_TYPE_WEP40 = 0x0,
140 AR9271_KEY_TABLE_TYPE_WEP104 = 0x1,
141 AR9271_KEY_TABLE_TYPE_TKIP = 0x4,
142 AR9271_KEY_TABLE_TYPE_CCMP = 0x6,
143 AR9271_KEY_TABLE_TYPE_CLR = 0x7,
144
145 /* Physical layer registers */
146 AR9271_PHY_ACTIVE = 0x981C,
147 AR9271_ADC_CONTROL = 0x982C,
148 AR9271_AGC_CONTROL = 0x9860,
149 AR9271_PHY_CAL = 0x9864,
150 AR9271_PHY_SYNTH_CONTROL = 0x9874,
151 AR9271_PHY_SPECTRAL_SCAN = 0x9910,
152 AR9271_PHY_RADAR0 = 0x9954,
153 AR9271_PHY_RADAR0_FFT_ENABLED = 0x80000000,
154 AR9271_PHY_RFBUS_KILL = 0x997C,
155 AR9271_PHY_RFBUS_GRANT = 0x9C20,
156 AR9271_PHY_MODE = 0xA200,
157 AR9271_PHY_CCK_TX_CTRL = 0xA204,
158 AR9271_PHY_TPCRG1 = 0xA258,
159 AR9271_CARRIER_LEAK_CONTROL = 0xA358,
160 AR9271_ADC_CONTROL_OFF_PWDADC = 0x00008000,
161 AR9271_AGC_CONTROL_CALIB = 0x00000001,
162 AR9271_AGC_CONTROL_NF_CALIB = 0x00000002,
163 AR9271_AGC_CONTROL_NF_CALIB_EN = 0x00008000,
164 AR9271_AGC_CONTROL_TX_CALIB = 0x00010000,
165 AR9271_AGC_CONTROL_NF_NOT_UPDATE = 0x00020000,
166 AR9271_PHY_MODE_DYNAMIC = 0x04,
167 AR9271_PHY_CCK_TX_CTRL_JAPAN = 0x00000010,
168 AR9271_PHY_TPCRG1_PD_CALIB = 0x00400000,
169 AR9271_CARRIER_LEAK_CALIB = 0x00000002,
170
171 AR9271_OPMODE_STATION_AP_MASK = 0x00010000,
172 AR9271_OPMODE_ADHOC_MASK = 0x00020000,
173
174 AR9271_CLOCK_CONTROL = 0x50040,
175 AR9271_MAX_CPU_CLOCK = 0x304,
176
177 AR9271_RESET_POWER_DOWN_CONTROL = 0x50044,
178 AR9271_RADIO_RF_RESET = 0x20,
179 AR9271_GATE_MAC_CONTROL = 0x4000,
180
181 /* FW Addresses */
182 AR9271_FW_ADDRESS = 0x501000,
183 AR9271_FW_OFFSET = 0x903000,
184} ar9271_registers_t;
185
186/** Compute key table base position for key by its id. */
187#define AR9271_KEY_TABLE(id) (AR9271_KEY_TABLE_BASE + (id) * 32)
188
189/** AR9271 Requests */
190typedef enum {
191 AR9271_FW_DOWNLOAD = 0x30,
192 AR9271_FW_DOWNLOAD_COMP = 0x31,
193} ar9271_requests_t;
194
195/** AR9271 device data */
196typedef struct {
197 /** Lock for access. */
198 fibril_mutex_t ar9271_lock;
199
200 /** Whether device is starting up. */
201 bool starting_up;
202
203 /** Backing DDF device */
204 ddf_dev_t *ddf_dev;
205
206 /** USB device data */
207 usb_device_t *usb_device;
208
209 /** IEEE 802.11 device data */
210 ieee80211_dev_t *ieee80211_dev;
211
212 /** ATH device data */
213 ath_t *ath_device;
214
215 /** HTC device data */
216 htc_device_t *htc_device;
217} ar9271_t;
218
219/** AR9271 init values for 2GHz mode operation.
220 *
221 * Including settings of noise floor limits.
222 *
223 * Taken from the Linux driver (drivers/net/wireless/ath/ath9k/)
224 * Copyright (c) 2008-2011 Atheros Communications Inc.
225 * Licensed under the terms of ISC
226 *
227 */
228static const uint32_t ar9271_2g_mode_array[][2] = {
229 {0x00001030, 0x00000160},
230 {0x00001070, 0x0000018c},
231 {0x000010b0, 0x00003e38},
232 {0x000010f0, 0x00000000},
233 {0x00008014, 0x08400b00},
234 {0x0000801c, 0x12e0002b},
235 {0x00008318, 0x00003440},
236 {0x00009804, 0x000003c0}, /*< Note: overridden */
237 {0x00009820, 0x02020200},
238 {0x00009824, 0x01000e0e},
239 {0x00009828, 0x0a020001}, /*< Note: overridden */
240 {0x00009834, 0x00000e0e},
241 {0x00009838, 0x00000007},
242 {0x00009840, 0x206a012e},
243 {0x00009844, 0x03721620},
244 {0x00009848, 0x00001053},
245 {0x0000a848, 0x00001053},
246 {0x00009850, 0x6d4000e2},
247 {0x00009858, 0x7ec84d2e},
248 {0x0000985c, 0x3137605e},
249 {0x00009860, 0x00058d18},
250 {0x00009864, 0x0001ce00},
251 {0x00009868, 0x5ac640d0},
252 {0x0000986c, 0x06903881},
253 {0x00009910, 0x30002310},
254 {0x00009914, 0x00000898},
255 {0x00009918, 0x0000000b},
256 {0x00009924, 0xd00a800d},
257 {0x00009944, 0xffbc1020},
258 {0x00009960, 0x00000000},
259 {0x00009964, 0x00000000},
260 {0x000099b8, 0x0000421c},
261 {0x000099bc, 0x00000c00},
262 {0x000099c0, 0x05eea6d4},
263 {0x000099c4, 0x06336f77},
264 {0x000099c8, 0x6af6532f},
265 {0x000099cc, 0x08f186c8},
266 {0x000099d0, 0x00046384},
267 {0x000099d4, 0x00000000},
268 {0x000099d8, 0x00000000},
269 {0x00009a00, 0x00058084},
270 {0x00009a04, 0x00058088},
271 {0x00009a08, 0x0005808c},
272 {0x00009a0c, 0x00058100},
273 {0x00009a10, 0x00058104},
274 {0x00009a14, 0x00058108},
275 {0x00009a18, 0x0005810c},
276 {0x00009a1c, 0x00058110},
277 {0x00009a20, 0x00058114},
278 {0x00009a24, 0x00058180},
279 {0x00009a28, 0x00058184},
280 {0x00009a2c, 0x00058188},
281 {0x00009a30, 0x0005818c},
282 {0x00009a34, 0x00058190},
283 {0x00009a38, 0x00058194},
284 {0x00009a3c, 0x000581a0},
285 {0x00009a40, 0x0005820c},
286 {0x00009a44, 0x000581a8},
287 {0x00009a48, 0x00058284},
288 {0x00009a4c, 0x00058288},
289 {0x00009a50, 0x00058224},
290 {0x00009a54, 0x00058290},
291 {0x00009a58, 0x00058300},
292 {0x00009a5c, 0x00058304},
293 {0x00009a60, 0x00058308},
294 {0x00009a64, 0x0005830c},
295 {0x00009a68, 0x00058380},
296 {0x00009a6c, 0x00058384},
297 {0x00009a70, 0x00068700},
298 {0x00009a74, 0x00068704},
299 {0x00009a78, 0x00068708},
300 {0x00009a7c, 0x0006870c},
301 {0x00009a80, 0x00068780},
302 {0x00009a84, 0x00068784},
303 {0x00009a88, 0x00078b00},
304 {0x00009a8c, 0x00078b04},
305 {0x00009a90, 0x00078b08},
306 {0x00009a94, 0x00078b0c},
307 {0x00009a98, 0x00078b80},
308 {0x00009a9c, 0x00078b84},
309 {0x00009aa0, 0x00078b88},
310 {0x00009aa4, 0x00078b8c},
311 {0x00009aa8, 0x00078b90},
312 {0x00009aac, 0x000caf80},
313 {0x00009ab0, 0x000caf84},
314 {0x00009ab4, 0x000caf88},
315 {0x00009ab8, 0x000caf8c},
316 {0x00009abc, 0x000caf90},
317 {0x00009ac0, 0x000db30c},
318 {0x00009ac4, 0x000db310},
319 {0x00009ac8, 0x000db384},
320 {0x00009acc, 0x000db388},
321 {0x00009ad0, 0x000db324},
322 {0x00009ad4, 0x000eb704},
323 {0x00009ad8, 0x000eb6a4},
324 {0x00009adc, 0x000eb6a8},
325 {0x00009ae0, 0x000eb710},
326 {0x00009ae4, 0x000eb714},
327 {0x00009ae8, 0x000eb720},
328 {0x00009aec, 0x000eb724},
329 {0x00009af0, 0x000eb728},
330 {0x00009af4, 0x000eb72c},
331 {0x00009af8, 0x000eb7a0},
332 {0x00009afc, 0x000eb7a4},
333 {0x00009b00, 0x000eb7a8},
334 {0x00009b04, 0x000eb7b0},
335 {0x00009b08, 0x000eb7b4},
336 {0x00009b0c, 0x000eb7b8},
337 {0x00009b10, 0x000eb7a5},
338 {0x00009b14, 0x000eb7a9},
339 {0x00009b18, 0x000eb7ad},
340 {0x00009b1c, 0x000eb7b1},
341 {0x00009b20, 0x000eb7b5},
342 {0x00009b24, 0x000eb7b9},
343 {0x00009b28, 0x000eb7c5},
344 {0x00009b2c, 0x000eb7c9},
345 {0x00009b30, 0x000eb7d1},
346 {0x00009b34, 0x000eb7d5},
347 {0x00009b38, 0x000eb7d9},
348 {0x00009b3c, 0x000eb7c6},
349 {0x00009b40, 0x000eb7ca},
350 {0x00009b44, 0x000eb7ce},
351 {0x00009b48, 0x000eb7d2},
352 {0x00009b4c, 0x000eb7d6},
353 {0x00009b50, 0x000eb7c3},
354 {0x00009b54, 0x000eb7c7},
355 {0x00009b58, 0x000eb7cb},
356 {0x00009b5c, 0x000eb7cf},
357 {0x00009b60, 0x000eb7d7},
358 {0x00009b64, 0x000eb7db},
359 {0x00009b68, 0x000eb7db},
360 {0x00009b6c, 0x000eb7db},
361 {0x00009b70, 0x000eb7db},
362 {0x00009b74, 0x000eb7db},
363 {0x00009b78, 0x000eb7db},
364 {0x00009b7c, 0x000eb7db},
365 {0x00009b80, 0x000eb7db},
366 {0x00009b84, 0x000eb7db},
367 {0x00009b88, 0x000eb7db},
368 {0x00009b8c, 0x000eb7db},
369 {0x00009b90, 0x000eb7db},
370 {0x00009b94, 0x000eb7db},
371 {0x00009b98, 0x000eb7db},
372 {0x00009b9c, 0x000eb7db},
373 {0x00009ba0, 0x000eb7db},
374 {0x00009ba4, 0x000eb7db},
375 {0x00009ba8, 0x000eb7db},
376 {0x00009bac, 0x000eb7db},
377 {0x00009bb0, 0x000eb7db},
378 {0x00009bb4, 0x000eb7db},
379 {0x00009bb8, 0x000eb7db},
380 {0x00009bbc, 0x000eb7db},
381 {0x00009bc0, 0x000eb7db},
382 {0x00009bc4, 0x000eb7db},
383 {0x00009bc8, 0x000eb7db},
384 {0x00009bcc, 0x000eb7db},
385 {0x00009bd0, 0x000eb7db},
386 {0x00009bd4, 0x000eb7db},
387 {0x00009bd8, 0x000eb7db},
388 {0x00009bdc, 0x000eb7db},
389 {0x00009be0, 0x000eb7db},
390 {0x00009be4, 0x000eb7db},
391 {0x00009be8, 0x000eb7db},
392 {0x00009bec, 0x000eb7db},
393 {0x00009bf0, 0x000eb7db},
394 {0x00009bf4, 0x000eb7db},
395 {0x00009bf8, 0x000eb7db},
396 {0x00009bfc, 0x000eb7db},
397 {0x0000aa00, 0x00058084},
398 {0x0000aa04, 0x00058088},
399 {0x0000aa08, 0x0005808c},
400 {0x0000aa0c, 0x00058100},
401 {0x0000aa10, 0x00058104},
402 {0x0000aa14, 0x00058108},
403 {0x0000aa18, 0x0005810c},
404 {0x0000aa1c, 0x00058110},
405 {0x0000aa20, 0x00058114},
406 {0x0000aa24, 0x00058180},
407 {0x0000aa28, 0x00058184},
408 {0x0000aa2c, 0x00058188},
409 {0x0000aa30, 0x0005818c},
410 {0x0000aa34, 0x00058190},
411 {0x0000aa38, 0x00058194},
412 {0x0000aa3c, 0x000581a0},
413 {0x0000aa40, 0x0005820c},
414 {0x0000aa44, 0x000581a8},
415 {0x0000aa48, 0x00058284},
416 {0x0000aa4c, 0x00058288},
417 {0x0000aa50, 0x00058224},
418 {0x0000aa54, 0x00058290},
419 {0x0000aa58, 0x00058300},
420 {0x0000aa5c, 0x00058304},
421 {0x0000aa60, 0x00058308},
422 {0x0000aa64, 0x0005830c},
423 {0x0000aa68, 0x00058380},
424 {0x0000aa6c, 0x00058384},
425 {0x0000aa70, 0x00068700},
426 {0x0000aa74, 0x00068704},
427 {0x0000aa78, 0x00068708},
428 {0x0000aa7c, 0x0006870c},
429 {0x0000aa80, 0x00068780},
430 {0x0000aa84, 0x00068784},
431 {0x0000aa88, 0x00078b00},
432 {0x0000aa8c, 0x00078b04},
433 {0x0000aa90, 0x00078b08},
434 {0x0000aa94, 0x00078b0c},
435 {0x0000aa98, 0x00078b80},
436 {0x0000aa9c, 0x00078b84},
437 {0x0000aaa0, 0x00078b88},
438 {0x0000aaa4, 0x00078b8c},
439 {0x0000aaa8, 0x00078b90},
440 {0x0000aaac, 0x000caf80},
441 {0x0000aab0, 0x000caf84},
442 {0x0000aab4, 0x000caf88},
443 {0x0000aab8, 0x000caf8c},
444 {0x0000aabc, 0x000caf90},
445 {0x0000aac0, 0x000db30c},
446 {0x0000aac4, 0x000db310},
447 {0x0000aac8, 0x000db384},
448 {0x0000aacc, 0x000db388},
449 {0x0000aad0, 0x000db324},
450 {0x0000aad4, 0x000eb704},
451 {0x0000aad8, 0x000eb6a4},
452 {0x0000aadc, 0x000eb6a8},
453 {0x0000aae0, 0x000eb710},
454 {0x0000aae4, 0x000eb714},
455 {0x0000aae8, 0x000eb720},
456 {0x0000aaec, 0x000eb724},
457 {0x0000aaf0, 0x000eb728},
458 {0x0000aaf4, 0x000eb72c},
459 {0x0000aaf8, 0x000eb7a0},
460 {0x0000aafc, 0x000eb7a4},
461 {0x0000ab00, 0x000eb7a8},
462 {0x0000ab04, 0x000eb7b0},
463 {0x0000ab08, 0x000eb7b4},
464 {0x0000ab0c, 0x000eb7b8},
465 {0x0000ab10, 0x000eb7a5},
466 {0x0000ab14, 0x000eb7a9},
467 {0x0000ab18, 0x000eb7ad},
468 {0x0000ab1c, 0x000eb7b1},
469 {0x0000ab20, 0x000eb7b5},
470 {0x0000ab24, 0x000eb7b9},
471 {0x0000ab28, 0x000eb7c5},
472 {0x0000ab2c, 0x000eb7c9},
473 {0x0000ab30, 0x000eb7d1},
474 {0x0000ab34, 0x000eb7d5},
475 {0x0000ab38, 0x000eb7d9},
476 {0x0000ab3c, 0x000eb7c6},
477 {0x0000ab40, 0x000eb7ca},
478 {0x0000ab44, 0x000eb7ce},
479 {0x0000ab48, 0x000eb7d2},
480 {0x0000ab4c, 0x000eb7d6},
481 {0x0000ab50, 0x000eb7c3},
482 {0x0000ab54, 0x000eb7c7},
483 {0x0000ab58, 0x000eb7cb},
484 {0x0000ab5c, 0x000eb7cf},
485 {0x0000ab60, 0x000eb7d7},
486 {0x0000ab64, 0x000eb7db},
487 {0x0000ab68, 0x000eb7db},
488 {0x0000ab6c, 0x000eb7db},
489 {0x0000ab70, 0x000eb7db},
490 {0x0000ab74, 0x000eb7db},
491 {0x0000ab78, 0x000eb7db},
492 {0x0000ab7c, 0x000eb7db},
493 {0x0000ab80, 0x000eb7db},
494 {0x0000ab84, 0x000eb7db},
495 {0x0000ab88, 0x000eb7db},
496 {0x0000ab8c, 0x000eb7db},
497 {0x0000ab90, 0x000eb7db},
498 {0x0000ab94, 0x000eb7db},
499 {0x0000ab98, 0x000eb7db},
500 {0x0000ab9c, 0x000eb7db},
501 {0x0000aba0, 0x000eb7db},
502 {0x0000aba4, 0x000eb7db},
503 {0x0000aba8, 0x000eb7db},
504 {0x0000abac, 0x000eb7db},
505 {0x0000abb0, 0x000eb7db},
506 {0x0000abb4, 0x000eb7db},
507 {0x0000abb8, 0x000eb7db},
508 {0x0000abbc, 0x000eb7db},
509 {0x0000abc0, 0x000eb7db},
510 {0x0000abc4, 0x000eb7db},
511 {0x0000abc8, 0x000eb7db},
512 {0x0000abcc, 0x000eb7db},
513 {0x0000abd0, 0x000eb7db},
514 {0x0000abd4, 0x000eb7db},
515 {0x0000abd8, 0x000eb7db},
516 {0x0000abdc, 0x000eb7db},
517 {0x0000abe0, 0x000eb7db},
518 {0x0000abe4, 0x000eb7db},
519 {0x0000abe8, 0x000eb7db},
520 {0x0000abec, 0x000eb7db},
521 {0x0000abf0, 0x000eb7db},
522 {0x0000abf4, 0x000eb7db},
523 {0x0000abf8, 0x000eb7db},
524 {0x0000abfc, 0x000eb7db},
525 {0x0000a204, 0x00000004},
526 {0x0000a20c, 0x0001f000},
527 {0x0000b20c, 0x0001f000},
528 {0x0000a21c, 0x1883800a},
529 {0x0000a230, 0x00000108},
530 {0x0000a250, 0x0004a000},
531 {0x0000a358, 0x7999aa0e}
532};
533
534/** AR9271 TX init values for 2GHz mode operation.
535 *
536 * Taken from the Linux driver (drivers/net/wireless/ath/ath9k/)
537 * Copyright (c) 2008-2011 Atheros Communications Inc.
538 * Licensed under the terms of ISC
539 *
540 */
541static const uint32_t ar9271_2g_tx_array[][2] = {
542 {0x0000a300, 0x00010000},
543 {0x0000a304, 0x00016200},
544 {0x0000a308, 0x00018201},
545 {0x0000a30c, 0x0001b240},
546 {0x0000a310, 0x0001d241},
547 {0x0000a314, 0x0001f600},
548 {0x0000a318, 0x00022800},
549 {0x0000a31c, 0x00026802},
550 {0x0000a320, 0x0002b805},
551 {0x0000a324, 0x0002ea41},
552 {0x0000a328, 0x00038b00},
553 {0x0000a32c, 0x0003ab40},
554 {0x0000a330, 0x0003cd80},
555 {0x0000a334, 0x000368de},
556 {0x0000a338, 0x0003891e},
557 {0x0000a33c, 0x0003a95e},
558 {0x0000a340, 0x0003e9df},
559 {0x0000a344, 0x0003e9df},
560 {0x0000a348, 0x0003e9df},
561 {0x0000a34c, 0x0003e9df},
562 {0x0000a350, 0x0003e9df},
563 {0x0000a354, 0x0003e9df},
564 {0x00007838, 0x0000002b},
565 {0x00007824, 0x00d8a7ff},
566 {0x0000786c, 0x08609eba},
567 {0x00007820, 0x00000c00},
568 {0x0000a274, 0x0a214652},
569 {0x0000a278, 0x0e739ce7},
570 {0x0000a27c, 0x05018063},
571 {0x0000a394, 0x06318c63},
572 {0x0000a398, 0x00000063},
573 {0x0000a3dc, 0x06318c63},
574 {0x0000a3e0, 0x00000063}
575};
576
577/** AR9271 hardware init values.
578 *
579 * Taken from the Linux driver (drivers/net/wireless/ath/ath9k/)
580 * Copyright (c) 2008-2011 Atheros Communications Inc.
581 * Licensed under the terms of ISC
582 *
583 */
584static const uint32_t ar9271_init_array[][2] = {
585 {0x0000000c, 0x00000000},
586 {0x00000030, 0x00020045},
587 {0x00000034, 0x00000005},
588 {0x00000040, 0x00000000},
589 {0x00000044, 0x00000008},
590 {0x00000048, 0x00000008},
591 {0x0000004c, 0x00000010},
592 {0x00000050, 0x00000000},
593 {0x00000054, 0x0000001f},
594 {0x00000800, 0x00000000},
595 {0x00000804, 0x00000000},
596 {0x00000808, 0x00000000},
597 {0x0000080c, 0x00000000},
598 {0x00000810, 0x00000000},
599 {0x00000814, 0x00000000},
600 {0x00000818, 0x00000000},
601 {0x0000081c, 0x00000000},
602 {0x00000820, 0x00000000},
603 {0x00000824, 0x00000000},
604 {0x00001040, 0x002ffc0f},
605 {0x00001044, 0x002ffc0f},
606 {0x00001048, 0x002ffc0f},
607 {0x0000104c, 0x002ffc0f},
608 {0x00001050, 0x002ffc0f},
609 {0x00001054, 0x002ffc0f},
610 {0x00001058, 0x002ffc0f},
611 {0x0000105c, 0x002ffc0f},
612 {0x00001060, 0x002ffc0f},
613 {0x00001064, 0x002ffc0f},
614 {0x00001230, 0x00000000},
615 {0x00001270, 0x00000000},
616 {0x00001038, 0x00000000},
617 {0x00001078, 0x00000000},
618 {0x000010b8, 0x00000000},
619 {0x000010f8, 0x00000000},
620 {0x00001138, 0x00000000},
621 {0x00001178, 0x00000000},
622 {0x000011b8, 0x00000000},
623 {0x000011f8, 0x00000000},
624 {0x00001238, 0x00000000},
625 {0x00001278, 0x00000000},
626 {0x000012b8, 0x00000000},
627 {0x000012f8, 0x00000000},
628 {0x00001338, 0x00000000},
629 {0x00001378, 0x00000000},
630 {0x000013b8, 0x00000000},
631 {0x000013f8, 0x00000000},
632 {0x00001438, 0x00000000},
633 {0x00001478, 0x00000000},
634 {0x000014b8, 0x00000000},
635 {0x000014f8, 0x00000000},
636 {0x00001538, 0x00000000},
637 {0x00001578, 0x00000000},
638 {0x000015b8, 0x00000000},
639 {0x000015f8, 0x00000000},
640 {0x00001638, 0x00000000},
641 {0x00001678, 0x00000000},
642 {0x000016b8, 0x00000000},
643 {0x000016f8, 0x00000000},
644 {0x00001738, 0x00000000},
645 {0x00001778, 0x00000000},
646 {0x000017b8, 0x00000000},
647 {0x000017f8, 0x00000000},
648 {0x0000103c, 0x00000000},
649 {0x0000107c, 0x00000000},
650 {0x000010bc, 0x00000000},
651 {0x000010fc, 0x00000000},
652 {0x0000113c, 0x00000000},
653 {0x0000117c, 0x00000000},
654 {0x000011bc, 0x00000000},
655 {0x000011fc, 0x00000000},
656 {0x0000123c, 0x00000000},
657 {0x0000127c, 0x00000000},
658 {0x000012bc, 0x00000000},
659 {0x000012fc, 0x00000000},
660 {0x0000133c, 0x00000000},
661 {0x0000137c, 0x00000000},
662 {0x000013bc, 0x00000000},
663 {0x000013fc, 0x00000000},
664 {0x0000143c, 0x00000000},
665 {0x0000147c, 0x00000000},
666 {0x00004030, 0x00000002},
667 {0x0000403c, 0x00000002},
668 {0x00004024, 0x0000001f},
669 {0x00004060, 0x00000000},
670 {0x00004064, 0x00000000},
671 {0x00008018, 0x00000700},
672 {0x00008020, 0x00000000},
673 {0x00008038, 0x00000000},
674 {0x00008048, 0x00000000},
675 {0x00008054, 0x00000000},
676 {0x00008058, 0x00000000},
677 {0x0000805c, 0x000fc78f},
678 {0x00008060, 0xc7ff000f},
679 {0x00008064, 0x00000000},
680 {0x00008070, 0x00000000},
681 {0x000080b0, 0x00000000},
682 {0x000080b4, 0x00000000},
683 {0x000080b8, 0x00000000},
684 {0x000080bc, 0x00000000},
685 {0x000080c0, 0x2a80001a},
686 {0x000080c4, 0x05dc01e0},
687 {0x000080c8, 0x1f402710},
688 {0x000080cc, 0x01f40000},
689 {0x000080d0, 0x00001e00},
690 {0x000080d4, 0x00000000},
691 {0x000080d8, 0x00400000},
692 {0x000080e0, 0xffffffff},
693 {0x000080e4, 0x0000ffff},
694 {0x000080e8, 0x003f3f3f},
695 {0x000080ec, 0x00000000},
696 {0x000080f0, 0x00000000},
697 {0x000080f4, 0x00000000},
698 {0x000080f8, 0x00000000},
699 {0x000080fc, 0x00020000},
700 {0x00008100, 0x00020000},
701 {0x00008104, 0x00000001},
702 {0x00008108, 0x00000052},
703 {0x0000810c, 0x00000000},
704 {0x00008110, 0x00000168},
705 {0x00008118, 0x000100aa},
706 {0x0000811c, 0x00003210},
707 {0x00008120, 0x08f04810},
708 {0x00008124, 0x00000000},
709 {0x00008128, 0x00000000},
710 {0x0000812c, 0x00000000},
711 {0x00008130, 0x00000000},
712 {0x00008134, 0x00000000},
713 {0x00008138, 0x00000000},
714 {0x0000813c, 0x00000000},
715 {0x00008144, 0xffffffff},
716 {0x00008168, 0x00000000},
717 {0x0000816c, 0x00000000},
718 {0x00008170, 0x32143320},
719 {0x00008174, 0xfaa4fa50},
720 {0x00008178, 0x00000100},
721 {0x0000817c, 0x00000000},
722 {0x000081c0, 0x00000000},
723 {0x000081d0, 0x0000320a},
724 {0x000081ec, 0x00000000},
725 {0x000081f0, 0x00000000},
726 {0x000081f4, 0x00000000},
727 {0x000081f8, 0x00000000},
728 {0x000081fc, 0x00000000},
729 {0x00008200, 0x00000000},
730 {0x00008204, 0x00000000},
731 {0x00008208, 0x00000000},
732 {0x0000820c, 0x00000000},
733 {0x00008210, 0x00000000},
734 {0x00008214, 0x00000000},
735 {0x00008218, 0x00000000},
736 {0x0000821c, 0x00000000},
737 {0x00008220, 0x00000000},
738 {0x00008224, 0x00000000},
739 {0x00008228, 0x00000000},
740 {0x0000822c, 0x00000000},
741 {0x00008230, 0x00000000},
742 {0x00008234, 0x00000000},
743 {0x00008238, 0x00000000},
744 {0x0000823c, 0x00000000},
745 {0x00008240, 0x00100000},
746 {0x00008244, 0x0010f400},
747 {0x00008248, 0x00000100},
748 {0x0000824c, 0x0001e800},
749 {0x00008250, 0x00000000},
750 {0x00008254, 0x00000000},
751 {0x00008258, 0x00000000},
752 {0x0000825c, 0x400000ff},
753 {0x00008260, 0x00080922},
754 {0x00008264, 0x88a00010},
755 {0x00008270, 0x00000000},
756 {0x00008274, 0x40000000},
757 {0x00008278, 0x003e4180},
758 {0x0000827c, 0x00000000},
759 {0x00008284, 0x0000002c},
760 {0x00008288, 0x0000002c},
761 {0x0000828c, 0x00000000},
762 {0x00008294, 0x00000000},
763 {0x00008298, 0x00000000},
764 {0x0000829c, 0x00000000},
765 {0x00008300, 0x00000040},
766 {0x00008314, 0x00000000},
767 {0x00008328, 0x00000000},
768 {0x0000832c, 0x00000001},
769 {0x00008330, 0x00000302},
770 {0x00008334, 0x00000e00},
771 {0x00008338, 0x00ff0000},
772 {0x0000833c, 0x00000000},
773 {0x00008340, 0x00010380},
774 {0x00008344, 0x00481083}, /**< Note: disabled ADHOC_MCAST_KEYID feature */
775 {0x00007010, 0x00000030},
776 {0x00007034, 0x00000002},
777 {0x00007038, 0x000004c2},
778 {0x00007800, 0x00140000},
779 {0x00007804, 0x0e4548d8},
780 {0x00007808, 0x54214514},
781 {0x0000780c, 0x02025820},
782 {0x00007810, 0x71c0d388},
783 {0x00007814, 0x924934a8},
784 {0x0000781c, 0x00000000},
785 {0x00007828, 0x66964300},
786 {0x0000782c, 0x8db6d961},
787 {0x00007830, 0x8db6d96c},
788 {0x00007834, 0x6140008b},
789 {0x0000783c, 0x72ee0a72},
790 {0x00007840, 0xbbfffffc},
791 {0x00007844, 0x000c0db6},
792 {0x00007848, 0x6db6246f},
793 {0x0000784c, 0x6d9b66db},
794 {0x00007850, 0x6d8c6dba},
795 {0x00007854, 0x00040000},
796 {0x00007858, 0xdb003012},
797 {0x0000785c, 0x04924914},
798 {0x00007860, 0x21084210},
799 {0x00007864, 0xf7d7ffde},
800 {0x00007868, 0xc2034080},
801 {0x00007870, 0x10142c00},
802 {0x00009808, 0x00000000},
803 {0x0000980c, 0xafe68e30},
804 {0x00009810, 0xfd14e000},
805 {0x00009814, 0x9c0a9f6b},
806 {0x0000981c, 0x00000000},
807 {0x0000982c, 0x0000a000},
808 {0x00009830, 0x00000000},
809 {0x0000983c, 0x00200400},
810 {0x0000984c, 0x0040233c},
811 {0x00009854, 0x00000044},
812 {0x00009900, 0x00000000},
813 {0x00009904, 0x00000000},
814 {0x00009908, 0x00000000},
815 {0x0000990c, 0x00000000},
816 {0x0000991c, 0x10000fff},
817 {0x00009920, 0x04900000},
818 {0x00009928, 0x00000001},
819 {0x0000992c, 0x00000004},
820 {0x00009934, 0x1e1f2022},
821 {0x00009938, 0x0a0b0c0d},
822 {0x0000993c, 0x00000000},
823 {0x00009940, 0x14750604},
824 {0x00009948, 0x9280c00a},
825 {0x0000994c, 0x00020028},
826 {0x00009954, 0x5f3ca3de},
827 {0x00009958, 0x0108ecff},
828 {0x00009968, 0x000003ce},
829 {0x00009970, 0x192bb514},
830 {0x00009974, 0x00000000},
831 {0x00009978, 0x00000001},
832 {0x0000997c, 0x00000000},
833 {0x00009980, 0x00000000},
834 {0x00009984, 0x00000000},
835 {0x00009988, 0x00000000},
836 {0x0000998c, 0x00000000},
837 {0x00009990, 0x00000000},
838 {0x00009994, 0x00000000},
839 {0x00009998, 0x00000000},
840 {0x0000999c, 0x00000000},
841 {0x000099a0, 0x00000000},
842 {0x000099a4, 0x00000001},
843 {0x000099a8, 0x201fff00},
844 {0x000099ac, 0x2def0400},
845 {0x000099b0, 0x03051000},
846 {0x000099b4, 0x00000820},
847 {0x000099dc, 0x00000000},
848 {0x000099e0, 0x00000000},
849 {0x000099e4, 0xaaaaaaaa},
850 {0x000099e8, 0x3c466478},
851 {0x000099ec, 0x0cc80caa},
852 {0x000099f0, 0x00000000},
853 {0x0000a208, 0x803e68c8},
854 {0x0000a210, 0x4080a333},
855 {0x0000a214, 0x00206c10},
856 {0x0000a218, 0x009c4060},
857 {0x0000a220, 0x01834061},
858 {0x0000a224, 0x00000400},
859 {0x0000a228, 0x000003b5},
860 {0x0000a22c, 0x00000000},
861 {0x0000a234, 0x20202020},
862 {0x0000a238, 0x20202020},
863 {0x0000a244, 0x00000000},
864 {0x0000a248, 0xfffffffc},
865 {0x0000a24c, 0x00000000},
866 {0x0000a254, 0x00000000},
867 {0x0000a258, 0x0ccb5380},
868 {0x0000a25c, 0x15151501},
869 {0x0000a260, 0xdfa90f01},
870 {0x0000a268, 0x00000000},
871 {0x0000a26c, 0x0ebae9e6},
872 {0x0000a388, 0x0c000000},
873 {0x0000a38c, 0x20202020},
874 {0x0000a390, 0x20202020},
875 {0x0000a39c, 0x00000001},
876 {0x0000a3a0, 0x00000000},
877 {0x0000a3a4, 0x00000000},
878 {0x0000a3a8, 0x00000000},
879 {0x0000a3ac, 0x00000000},
880 {0x0000a3b0, 0x00000000},
881 {0x0000a3b4, 0x00000000},
882 {0x0000a3b8, 0x00000000},
883 {0x0000a3bc, 0x00000000},
884 {0x0000a3c0, 0x00000000},
885 {0x0000a3c4, 0x00000000},
886 {0x0000a3cc, 0x20202020},
887 {0x0000a3d0, 0x20202020},
888 {0x0000a3d4, 0x20202020},
889 {0x0000a3e4, 0x00000000},
890 {0x0000a3e8, 0x18c43433},
891 {0x0000a3ec, 0x00f70081},
892 {0x0000a3f0, 0x01036a2f},
893 {0x0000a3f4, 0x00000000},
894 {0x0000d270, 0x0d820820},
895 {0x0000d35c, 0x07ffffef},
896 {0x0000d360, 0x0fffffe7},
897 {0x0000d364, 0x17ffffe5},
898 {0x0000d368, 0x1fffffe4},
899 {0x0000d36c, 0x37ffffe3},
900 {0x0000d370, 0x3fffffe3},
901 {0x0000d374, 0x57ffffe3},
902 {0x0000d378, 0x5fffffe2},
903 {0x0000d37c, 0x7fffffe2},
904 {0x0000d380, 0x7f3c7bba},
905 {0x0000d384, 0xf3307ff0}
906};
907
908#endif
Note: See TracBrowser for help on using the repository browser.