2 Copyright (C) 2004 - 2010 Ivo van Doorn <IvDoorn@gmail.com>
3 Copyright (C) 2010 Willow Garage <http://www.willowgarage.com>
4 Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com>
5 Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
6 Copyright (C) 2009 Luis Correia <luis.f.correia@gmail.com>
7 Copyright (C) 2009 Mattias Nissler <mattias.nissler@gmx.de>
8 Copyright (C) 2009 Mark Asselstine <asselsm@gmail.com>
9 Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com>
10 Copyright (C) 2009 Bart Zolnierkiewicz <bzolnier@gmail.com>
11 <http://rt2x00.serialmonkey.com>
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the
25 Free Software Foundation, Inc.,
26 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 Abstract: Data structures and registers for the rt2800 modules.
32 Supported chipsets: RT2800E, RT2800ED & RT2800U.
51 * RF3320 2.4G 1T1R(RT3350/RT3370/RT3390)
52 * RF3322 2.4G 2T2R(RT3352/RT3371/RT3372/RT3391/RT3392)
53 * RF3053 2.4G/5G 3T3R(RT3883/RT3563/RT3573/RT3593/RT3662)
81 #define REV_RT2860C 0x0100
82 #define REV_RT2860D 0x0101
83 #define REV_RT2872E 0x0200
84 #define REV_RT3070E 0x0200
85 #define REV_RT3070F 0x0201
86 #define REV_RT3071E 0x0211
87 #define REV_RT3090E 0x0211
88 #define REV_RT3390E 0x0211
89 #define REV_RT5390F 0x0502
90 #define REV_RT5390R 0x1502
94 * Default offset is required for RSSI <-> dBm conversion.
96 #define DEFAULT_RSSI_OFFSET 120
99 * Register layout information.
101 #define CSR_REG_BASE 0x1000
102 #define CSR_REG_SIZE 0x0800
103 #define EEPROM_BASE 0x0000
104 #define EEPROM_SIZE 0x0110
105 #define BBP_BASE 0x0000
106 #define BBP_SIZE 0x00ff
107 #define RF_BASE 0x0004
108 #define RF_SIZE 0x0010
109 #define RFCSR_BASE 0x0000
110 #define RFCSR_SIZE 0x0040
113 * Number of TX queues.
115 #define NUM_TX_QUEUES 4
123 * MAC_CSR0_3290: MAC_CSR0 for RT3290 to identity MAC version number.
125 #define MAC_CSR0_3290 0x0000
128 * E2PROM_CSR: PCI EEPROM control register.
129 * RELOAD: Write 1 to reload eeprom content.
130 * TYPE: 0: 93c46, 1:93c66.
131 * LOAD_STATUS: 1:loading, 0:done.
133 #define E2PROM_CSR 0x0004
134 #define E2PROM_CSR_DATA_CLOCK FIELD32(0x00000001)
135 #define E2PROM_CSR_CHIP_SELECT FIELD32(0x00000002)
136 #define E2PROM_CSR_DATA_IN FIELD32(0x00000004)
137 #define E2PROM_CSR_DATA_OUT FIELD32(0x00000008)
138 #define E2PROM_CSR_TYPE FIELD32(0x00000030)
139 #define E2PROM_CSR_LOAD_STATUS FIELD32(0x00000040)
140 #define E2PROM_CSR_RELOAD FIELD32(0x00000080)
145 #define CMB_CTRL 0x0020
146 #define AUX_OPT_BIT0 FIELD32(0x00000001)
147 #define AUX_OPT_BIT1 FIELD32(0x00000002)
148 #define AUX_OPT_BIT2 FIELD32(0x00000004)
149 #define AUX_OPT_BIT3 FIELD32(0x00000008)
150 #define AUX_OPT_BIT4 FIELD32(0x00000010)
151 #define AUX_OPT_BIT5 FIELD32(0x00000020)
152 #define AUX_OPT_BIT6 FIELD32(0x00000040)
153 #define AUX_OPT_BIT7 FIELD32(0x00000080)
154 #define AUX_OPT_BIT8 FIELD32(0x00000100)
155 #define AUX_OPT_BIT9 FIELD32(0x00000200)
156 #define AUX_OPT_BIT10 FIELD32(0x00000400)
157 #define AUX_OPT_BIT11 FIELD32(0x00000800)
158 #define AUX_OPT_BIT12 FIELD32(0x00001000)
159 #define AUX_OPT_BIT13 FIELD32(0x00002000)
160 #define AUX_OPT_BIT14 FIELD32(0x00004000)
161 #define AUX_OPT_BIT15 FIELD32(0x00008000)
162 #define LDO25_LEVEL FIELD32(0x00030000)
163 #define LDO25_LARGEA FIELD32(0x00040000)
164 #define LDO25_FRC_ON FIELD32(0x00080000)
165 #define CMB_RSV FIELD32(0x00300000)
166 #define XTAL_RDY FIELD32(0x00400000)
167 #define PLL_LD FIELD32(0x00800000)
168 #define LDO_CORE_LEVEL FIELD32(0x0F000000)
169 #define LDO_BGSEL FIELD32(0x30000000)
170 #define LDO3_EN FIELD32(0x40000000)
171 #define LDO0_EN FIELD32(0x80000000)
174 * EFUSE_CSR_3290: RT3290 EEPROM
176 #define EFUSE_CTRL_3290 0x0024
179 * EFUSE_DATA3 of 3290
181 #define EFUSE_DATA3_3290 0x0028
184 * EFUSE_DATA2 of 3290
186 #define EFUSE_DATA2_3290 0x002c
189 * EFUSE_DATA1 of 3290
191 #define EFUSE_DATA1_3290 0x0030
194 * EFUSE_DATA0 of 3290
196 #define EFUSE_DATA0_3290 0x0034
200 * Ring oscillator configuration
202 #define OSC_CTRL 0x0038
203 #define OSC_REF_CYCLE FIELD32(0x00001fff)
204 #define OSC_RSV FIELD32(0x0000e000)
205 #define OSC_CAL_CNT FIELD32(0x0fff0000)
206 #define OSC_CAL_ACK FIELD32(0x10000000)
207 #define OSC_CLK_32K_VLD FIELD32(0x20000000)
208 #define OSC_CAL_REQ FIELD32(0x40000000)
209 #define OSC_ROSC_EN FIELD32(0x80000000)
214 #define COEX_CFG0 0x0040
215 #define COEX_CFG_ANT FIELD32(0xff000000)
219 #define COEX_CFG1 0x0044
224 #define COEX_CFG2 0x0048
225 #define BT_COEX_CFG1 FIELD32(0xff000000)
226 #define BT_COEX_CFG0 FIELD32(0x00ff0000)
227 #define WL_COEX_CFG1 FIELD32(0x0000ff00)
228 #define WL_COEX_CFG0 FIELD32(0x000000ff)
231 * PLL configuration register
233 #define PLL_CTRL 0x0050
234 #define PLL_RESERVED_INPUT1 FIELD32(0x000000ff)
235 #define PLL_RESERVED_INPUT2 FIELD32(0x0000ff00)
236 #define PLL_CONTROL FIELD32(0x00070000)
237 #define PLL_LPF_R1 FIELD32(0x00080000)
238 #define PLL_LPF_C1_CTRL FIELD32(0x00300000)
239 #define PLL_LPF_C2_CTRL FIELD32(0x00c00000)
240 #define PLL_CP_CURRENT_CTRL FIELD32(0x03000000)
241 #define PLL_PFD_DELAY_CTRL FIELD32(0x0c000000)
242 #define PLL_LOCK_CTRL FIELD32(0x70000000)
243 #define PLL_VBGBK_EN FIELD32(0x80000000)
248 * RT3290 wlan configuration
250 #define WLAN_FUN_CTRL 0x0080
251 #define WLAN_EN FIELD32(0x00000001)
252 #define WLAN_CLK_EN FIELD32(0x00000002)
253 #define WLAN_RSV1 FIELD32(0x00000004)
254 #define WLAN_RESET FIELD32(0x00000008)
255 #define PCIE_APP0_CLK_REQ FIELD32(0x00000010)
256 #define FRC_WL_ANT_SET FIELD32(0x00000020)
257 #define INV_TR_SW0 FIELD32(0x00000040)
258 #define WLAN_GPIO_IN_BIT0 FIELD32(0x00000100)
259 #define WLAN_GPIO_IN_BIT1 FIELD32(0x00000200)
260 #define WLAN_GPIO_IN_BIT2 FIELD32(0x00000400)
261 #define WLAN_GPIO_IN_BIT3 FIELD32(0x00000800)
262 #define WLAN_GPIO_IN_BIT4 FIELD32(0x00001000)
263 #define WLAN_GPIO_IN_BIT5 FIELD32(0x00002000)
264 #define WLAN_GPIO_IN_BIT6 FIELD32(0x00004000)
265 #define WLAN_GPIO_IN_BIT7 FIELD32(0x00008000)
266 #define WLAN_GPIO_IN_BIT_ALL FIELD32(0x0000ff00)
267 #define WLAN_GPIO_OUT_BIT0 FIELD32(0x00010000)
268 #define WLAN_GPIO_OUT_BIT1 FIELD32(0x00020000)
269 #define WLAN_GPIO_OUT_BIT2 FIELD32(0x00040000)
270 #define WLAN_GPIO_OUT_BIT3 FIELD32(0x00050000)
271 #define WLAN_GPIO_OUT_BIT4 FIELD32(0x00100000)
272 #define WLAN_GPIO_OUT_BIT5 FIELD32(0x00200000)
273 #define WLAN_GPIO_OUT_BIT6 FIELD32(0x00400000)
274 #define WLAN_GPIO_OUT_BIT7 FIELD32(0x00800000)
275 #define WLAN_GPIO_OUT_BIT_ALL FIELD32(0x00ff0000)
276 #define WLAN_GPIO_OUT_OE_BIT0 FIELD32(0x01000000)
277 #define WLAN_GPIO_OUT_OE_BIT1 FIELD32(0x02000000)
278 #define WLAN_GPIO_OUT_OE_BIT2 FIELD32(0x04000000)
279 #define WLAN_GPIO_OUT_OE_BIT3 FIELD32(0x08000000)
280 #define WLAN_GPIO_OUT_OE_BIT4 FIELD32(0x10000000)
281 #define WLAN_GPIO_OUT_OE_BIT5 FIELD32(0x20000000)
282 #define WLAN_GPIO_OUT_OE_BIT6 FIELD32(0x40000000)
283 #define WLAN_GPIO_OUT_OE_BIT7 FIELD32(0x80000000)
284 #define WLAN_GPIO_OUT_OE_BIT_ALL FIELD32(0xff000000)
287 * AUX_CTRL: Aux/PCI-E related configuration
289 #define AUX_CTRL 0x10c
290 #define AUX_CTRL_WAKE_PCIE_EN FIELD32(0x00000002)
291 #define AUX_CTRL_FORCE_PCIE_CLK FIELD32(0x00000400)
294 * OPT_14: Unknown register used by rt3xxx devices.
296 #define OPT_14_CSR 0x0114
297 #define OPT_14_CSR_BIT0 FIELD32(0x00000001)
300 * INT_SOURCE_CSR: Interrupt source register.
301 * Write one to clear corresponding bit.
302 * TX_FIFO_STATUS: FIFO Statistics is full, sw should read TX_STA_FIFO
304 #define INT_SOURCE_CSR 0x0200
305 #define INT_SOURCE_CSR_RXDELAYINT FIELD32(0x00000001)
306 #define INT_SOURCE_CSR_TXDELAYINT FIELD32(0x00000002)
307 #define INT_SOURCE_CSR_RX_DONE FIELD32(0x00000004)
308 #define INT_SOURCE_CSR_AC0_DMA_DONE FIELD32(0x00000008)
309 #define INT_SOURCE_CSR_AC1_DMA_DONE FIELD32(0x00000010)
310 #define INT_SOURCE_CSR_AC2_DMA_DONE FIELD32(0x00000020)
311 #define INT_SOURCE_CSR_AC3_DMA_DONE FIELD32(0x00000040)
312 #define INT_SOURCE_CSR_HCCA_DMA_DONE FIELD32(0x00000080)
313 #define INT_SOURCE_CSR_MGMT_DMA_DONE FIELD32(0x00000100)
314 #define INT_SOURCE_CSR_MCU_COMMAND FIELD32(0x00000200)
315 #define INT_SOURCE_CSR_RXTX_COHERENT FIELD32(0x00000400)
316 #define INT_SOURCE_CSR_TBTT FIELD32(0x00000800)
317 #define INT_SOURCE_CSR_PRE_TBTT FIELD32(0x00001000)
318 #define INT_SOURCE_CSR_TX_FIFO_STATUS FIELD32(0x00002000)
319 #define INT_SOURCE_CSR_AUTO_WAKEUP FIELD32(0x00004000)
320 #define INT_SOURCE_CSR_GPTIMER FIELD32(0x00008000)
321 #define INT_SOURCE_CSR_RX_COHERENT FIELD32(0x00010000)
322 #define INT_SOURCE_CSR_TX_COHERENT FIELD32(0x00020000)
325 * INT_MASK_CSR: Interrupt MASK register. 1: the interrupt is mask OFF.
327 #define INT_MASK_CSR 0x0204
328 #define INT_MASK_CSR_RXDELAYINT FIELD32(0x00000001)
329 #define INT_MASK_CSR_TXDELAYINT FIELD32(0x00000002)
330 #define INT_MASK_CSR_RX_DONE FIELD32(0x00000004)
331 #define INT_MASK_CSR_AC0_DMA_DONE FIELD32(0x00000008)
332 #define INT_MASK_CSR_AC1_DMA_DONE FIELD32(0x00000010)
333 #define INT_MASK_CSR_AC2_DMA_DONE FIELD32(0x00000020)
334 #define INT_MASK_CSR_AC3_DMA_DONE FIELD32(0x00000040)
335 #define INT_MASK_CSR_HCCA_DMA_DONE FIELD32(0x00000080)
336 #define INT_MASK_CSR_MGMT_DMA_DONE FIELD32(0x00000100)
337 #define INT_MASK_CSR_MCU_COMMAND FIELD32(0x00000200)
338 #define INT_MASK_CSR_RXTX_COHERENT FIELD32(0x00000400)
339 #define INT_MASK_CSR_TBTT FIELD32(0x00000800)
340 #define INT_MASK_CSR_PRE_TBTT FIELD32(0x00001000)
341 #define INT_MASK_CSR_TX_FIFO_STATUS FIELD32(0x00002000)
342 #define INT_MASK_CSR_AUTO_WAKEUP FIELD32(0x00004000)
343 #define INT_MASK_CSR_GPTIMER FIELD32(0x00008000)
344 #define INT_MASK_CSR_RX_COHERENT FIELD32(0x00010000)
345 #define INT_MASK_CSR_TX_COHERENT FIELD32(0x00020000)
350 #define WPDMA_GLO_CFG 0x0208
351 #define WPDMA_GLO_CFG_ENABLE_TX_DMA FIELD32(0x00000001)
352 #define WPDMA_GLO_CFG_TX_DMA_BUSY FIELD32(0x00000002)
353 #define WPDMA_GLO_CFG_ENABLE_RX_DMA FIELD32(0x00000004)
354 #define WPDMA_GLO_CFG_RX_DMA_BUSY FIELD32(0x00000008)
355 #define WPDMA_GLO_CFG_WP_DMA_BURST_SIZE FIELD32(0x00000030)
356 #define WPDMA_GLO_CFG_TX_WRITEBACK_DONE FIELD32(0x00000040)
357 #define WPDMA_GLO_CFG_BIG_ENDIAN FIELD32(0x00000080)
358 #define WPDMA_GLO_CFG_RX_HDR_SCATTER FIELD32(0x0000ff00)
359 #define WPDMA_GLO_CFG_HDR_SEG_LEN FIELD32(0xffff0000)
364 #define WPDMA_RST_IDX 0x020c
365 #define WPDMA_RST_IDX_DTX_IDX0 FIELD32(0x00000001)
366 #define WPDMA_RST_IDX_DTX_IDX1 FIELD32(0x00000002)
367 #define WPDMA_RST_IDX_DTX_IDX2 FIELD32(0x00000004)
368 #define WPDMA_RST_IDX_DTX_IDX3 FIELD32(0x00000008)
369 #define WPDMA_RST_IDX_DTX_IDX4 FIELD32(0x00000010)
370 #define WPDMA_RST_IDX_DTX_IDX5 FIELD32(0x00000020)
371 #define WPDMA_RST_IDX_DRX_IDX0 FIELD32(0x00010000)
376 #define DELAY_INT_CFG 0x0210
377 #define DELAY_INT_CFG_RXMAX_PTIME FIELD32(0x000000ff)
378 #define DELAY_INT_CFG_RXMAX_PINT FIELD32(0x00007f00)
379 #define DELAY_INT_CFG_RXDLY_INT_EN FIELD32(0x00008000)
380 #define DELAY_INT_CFG_TXMAX_PTIME FIELD32(0x00ff0000)
381 #define DELAY_INT_CFG_TXMAX_PINT FIELD32(0x7f000000)
382 #define DELAY_INT_CFG_TXDLY_INT_EN FIELD32(0x80000000)
385 * WMM_AIFSN_CFG: Aifsn for each EDCA AC
391 #define WMM_AIFSN_CFG 0x0214
392 #define WMM_AIFSN_CFG_AIFSN0 FIELD32(0x0000000f)
393 #define WMM_AIFSN_CFG_AIFSN1 FIELD32(0x000000f0)
394 #define WMM_AIFSN_CFG_AIFSN2 FIELD32(0x00000f00)
395 #define WMM_AIFSN_CFG_AIFSN3 FIELD32(0x0000f000)
398 * WMM_CWMIN_CSR: CWmin for each EDCA AC
404 #define WMM_CWMIN_CFG 0x0218
405 #define WMM_CWMIN_CFG_CWMIN0 FIELD32(0x0000000f)
406 #define WMM_CWMIN_CFG_CWMIN1 FIELD32(0x000000f0)
407 #define WMM_CWMIN_CFG_CWMIN2 FIELD32(0x00000f00)
408 #define WMM_CWMIN_CFG_CWMIN3 FIELD32(0x0000f000)
411 * WMM_CWMAX_CSR: CWmax for each EDCA AC
417 #define WMM_CWMAX_CFG 0x021c
418 #define WMM_CWMAX_CFG_CWMAX0 FIELD32(0x0000000f)
419 #define WMM_CWMAX_CFG_CWMAX1 FIELD32(0x000000f0)
420 #define WMM_CWMAX_CFG_CWMAX2 FIELD32(0x00000f00)
421 #define WMM_CWMAX_CFG_CWMAX3 FIELD32(0x0000f000)
424 * AC_TXOP0: AC_VO/AC_VI TXOP register
425 * AC0TXOP: AC_VO in unit of 32us
426 * AC1TXOP: AC_VI in unit of 32us
428 #define WMM_TXOP0_CFG 0x0220
429 #define WMM_TXOP0_CFG_AC0TXOP FIELD32(0x0000ffff)
430 #define WMM_TXOP0_CFG_AC1TXOP FIELD32(0xffff0000)
433 * AC_TXOP1: AC_BE/AC_BK TXOP register
434 * AC2TXOP: AC_BE in unit of 32us
435 * AC3TXOP: AC_BK in unit of 32us
437 #define WMM_TXOP1_CFG 0x0224
438 #define WMM_TXOP1_CFG_AC2TXOP FIELD32(0x0000ffff)
439 #define WMM_TXOP1_CFG_AC3TXOP FIELD32(0xffff0000)
443 * GPIOD: GPIO direction, 0: Output, 1: Input
445 #define GPIO_CTRL_CFG 0x0228
446 #define GPIO_CTRL_CFG_BIT0 FIELD32(0x00000001)
447 #define GPIO_CTRL_CFG_BIT1 FIELD32(0x00000002)
448 #define GPIO_CTRL_CFG_BIT2 FIELD32(0x00000004)
449 #define GPIO_CTRL_CFG_BIT3 FIELD32(0x00000008)
450 #define GPIO_CTRL_CFG_BIT4 FIELD32(0x00000010)
451 #define GPIO_CTRL_CFG_BIT5 FIELD32(0x00000020)
452 #define GPIO_CTRL_CFG_BIT6 FIELD32(0x00000040)
453 #define GPIO_CTRL_CFG_BIT7 FIELD32(0x00000080)
454 #define GPIO_CTRL_CFG_GPIOD_BIT0 FIELD32(0x00000100)
455 #define GPIO_CTRL_CFG_GPIOD_BIT1 FIELD32(0x00000200)
456 #define GPIO_CTRL_CFG_GPIOD_BIT2 FIELD32(0x00000400)
457 #define GPIO_CTRL_CFG_GPIOD_BIT3 FIELD32(0x00000800)
458 #define GPIO_CTRL_CFG_GPIOD_BIT4 FIELD32(0x00001000)
459 #define GPIO_CTRL_CFG_GPIOD_BIT5 FIELD32(0x00002000)
460 #define GPIO_CTRL_CFG_GPIOD_BIT6 FIELD32(0x00004000)
461 #define GPIO_CTRL_CFG_GPIOD_BIT7 FIELD32(0x00008000)
462 #define GPIO_CTRL_CFG_BIT8 FIELD32(0x00010000)
463 #define GPIO_CTRL_CFG_BIT9 FIELD32(0x00020000)
464 #define GPIO_CTRL_CFG_BIT10 FIELD32(0x00040000)
465 #define GPIO_CTRL_CFG_GPIOD_BIT8 FIELD32(0x01000000)
466 #define GPIO_CTRL_CFG_GPIOD_BIT9 FIELD32(0x02000000)
467 #define GPIO_CTRL_CFG_GPIOD_BIT10 FIELD32(0x04000000)
472 #define MCU_CMD_CFG 0x022c
475 * AC_VO register offsets
477 #define TX_BASE_PTR0 0x0230
478 #define TX_MAX_CNT0 0x0234
479 #define TX_CTX_IDX0 0x0238
480 #define TX_DTX_IDX0 0x023c
483 * AC_VI register offsets
485 #define TX_BASE_PTR1 0x0240
486 #define TX_MAX_CNT1 0x0244
487 #define TX_CTX_IDX1 0x0248
488 #define TX_DTX_IDX1 0x024c
491 * AC_BE register offsets
493 #define TX_BASE_PTR2 0x0250
494 #define TX_MAX_CNT2 0x0254
495 #define TX_CTX_IDX2 0x0258
496 #define TX_DTX_IDX2 0x025c
499 * AC_BK register offsets
501 #define TX_BASE_PTR3 0x0260
502 #define TX_MAX_CNT3 0x0264
503 #define TX_CTX_IDX3 0x0268
504 #define TX_DTX_IDX3 0x026c
507 * HCCA register offsets
509 #define TX_BASE_PTR4 0x0270
510 #define TX_MAX_CNT4 0x0274
511 #define TX_CTX_IDX4 0x0278
512 #define TX_DTX_IDX4 0x027c
515 * MGMT register offsets
517 #define TX_BASE_PTR5 0x0280
518 #define TX_MAX_CNT5 0x0284
519 #define TX_CTX_IDX5 0x0288
520 #define TX_DTX_IDX5 0x028c
523 * RX register offsets
525 #define RX_BASE_PTR 0x0290
526 #define RX_MAX_CNT 0x0294
527 #define RX_CRX_IDX 0x0298
528 #define RX_DRX_IDX 0x029c
532 * RX_BULK_AGG_TIMEOUT: Rx Bulk Aggregation TimeOut in unit of 33ns.
533 * RX_BULK_AGG_LIMIT: Rx Bulk Aggregation Limit in unit of 256 bytes.
534 * PHY_CLEAR: phy watch dog enable.
535 * TX_CLEAR: Clear USB DMA TX path.
536 * TXOP_HALT: Halt TXOP count down when TX buffer is full.
537 * RX_BULK_AGG_EN: Enable Rx Bulk Aggregation.
538 * RX_BULK_EN: Enable USB DMA Rx.
539 * TX_BULK_EN: Enable USB DMA Tx.
540 * EP_OUT_VALID: OUT endpoint data valid.
541 * RX_BUSY: USB DMA RX FSM busy.
542 * TX_BUSY: USB DMA TX FSM busy.
544 #define USB_DMA_CFG 0x02a0
545 #define USB_DMA_CFG_RX_BULK_AGG_TIMEOUT FIELD32(0x000000ff)
546 #define USB_DMA_CFG_RX_BULK_AGG_LIMIT FIELD32(0x0000ff00)
547 #define USB_DMA_CFG_PHY_CLEAR FIELD32(0x00010000)
548 #define USB_DMA_CFG_TX_CLEAR FIELD32(0x00080000)
549 #define USB_DMA_CFG_TXOP_HALT FIELD32(0x00100000)
550 #define USB_DMA_CFG_RX_BULK_AGG_EN FIELD32(0x00200000)
551 #define USB_DMA_CFG_RX_BULK_EN FIELD32(0x00400000)
552 #define USB_DMA_CFG_TX_BULK_EN FIELD32(0x00800000)
553 #define USB_DMA_CFG_EP_OUT_VALID FIELD32(0x3f000000)
554 #define USB_DMA_CFG_RX_BUSY FIELD32(0x40000000)
555 #define USB_DMA_CFG_TX_BUSY FIELD32(0x80000000)
559 * BT_MODE_EN: Bluetooth mode enable
560 * CLOCK CYCLE: Clock cycle count in 1us.
561 * PCI:0x21, PCIE:0x7d, USB:0x1e
563 #define US_CYC_CNT 0x02a4
564 #define US_CYC_CNT_BT_MODE_EN FIELD32(0x00000100)
565 #define US_CYC_CNT_CLOCK_CYCLE FIELD32(0x000000ff)
569 * HOST_RAM_WRITE: enable Host program ram write selection
571 #define PBF_SYS_CTRL 0x0400
572 #define PBF_SYS_CTRL_READY FIELD32(0x00000080)
573 #define PBF_SYS_CTRL_HOST_RAM_WRITE FIELD32(0x00010000)
576 * HOST-MCU shared memory
578 #define HOST_CMD_CSR 0x0404
579 #define HOST_CMD_CSR_HOST_COMMAND FIELD32(0x000000ff)
583 * Most are for debug. Driver doesn't touch PBF register.
585 #define PBF_CFG 0x0408
586 #define PBF_MAX_PCNT 0x040c
587 #define PBF_CTRL 0x0410
588 #define PBF_INT_STA 0x0414
589 #define PBF_INT_ENA 0x0418
594 #define BCN_OFFSET0 0x042c
595 #define BCN_OFFSET0_BCN0 FIELD32(0x000000ff)
596 #define BCN_OFFSET0_BCN1 FIELD32(0x0000ff00)
597 #define BCN_OFFSET0_BCN2 FIELD32(0x00ff0000)
598 #define BCN_OFFSET0_BCN3 FIELD32(0xff000000)
603 #define BCN_OFFSET1 0x0430
604 #define BCN_OFFSET1_BCN4 FIELD32(0x000000ff)
605 #define BCN_OFFSET1_BCN5 FIELD32(0x0000ff00)
606 #define BCN_OFFSET1_BCN6 FIELD32(0x00ff0000)
607 #define BCN_OFFSET1_BCN7 FIELD32(0xff000000)
610 * TXRXQ_PCNT: PBF register
611 * PCNT_TX0Q: Page count for TX hardware queue 0
612 * PCNT_TX1Q: Page count for TX hardware queue 1
613 * PCNT_TX2Q: Page count for TX hardware queue 2
614 * PCNT_RX0Q: Page count for RX hardware queue
616 #define TXRXQ_PCNT 0x0438
617 #define TXRXQ_PCNT_TX0Q FIELD32(0x000000ff)
618 #define TXRXQ_PCNT_TX1Q FIELD32(0x0000ff00)
619 #define TXRXQ_PCNT_TX2Q FIELD32(0x00ff0000)
620 #define TXRXQ_PCNT_RX0Q FIELD32(0xff000000)
624 * Debug. Driver doesn't touch PBF register.
626 #define PBF_DBG 0x043c
631 #define RF_CSR_CFG 0x0500
632 #define RF_CSR_CFG_DATA FIELD32(0x000000ff)
633 #define RF_CSR_CFG_REGNUM FIELD32(0x00003f00)
634 #define RF_CSR_CFG_WRITE FIELD32(0x00010000)
635 #define RF_CSR_CFG_BUSY FIELD32(0x00020000)
638 * EFUSE_CSR: RT30x0 EEPROM
640 #define EFUSE_CTRL 0x0580
641 #define EFUSE_CTRL_ADDRESS_IN FIELD32(0x03fe0000)
642 #define EFUSE_CTRL_MODE FIELD32(0x000000c0)
643 #define EFUSE_CTRL_KICK FIELD32(0x40000000)
644 #define EFUSE_CTRL_PRESENT FIELD32(0x80000000)
649 #define EFUSE_DATA0 0x0590
654 #define EFUSE_DATA1 0x0594
659 #define EFUSE_DATA2 0x0598
664 #define EFUSE_DATA3 0x059c
669 #define LDO_CFG0 0x05d4
670 #define LDO_CFG0_DELAY3 FIELD32(0x000000ff)
671 #define LDO_CFG0_DELAY2 FIELD32(0x0000ff00)
672 #define LDO_CFG0_DELAY1 FIELD32(0x00ff0000)
673 #define LDO_CFG0_BGSEL FIELD32(0x03000000)
674 #define LDO_CFG0_LDO_CORE_VLEVEL FIELD32(0x1c000000)
675 #define LD0_CFG0_LDO25_LEVEL FIELD32(0x60000000)
676 #define LDO_CFG0_LDO25_LARGEA FIELD32(0x80000000)
681 #define GPIO_SWITCH 0x05dc
682 #define GPIO_SWITCH_0 FIELD32(0x00000001)
683 #define GPIO_SWITCH_1 FIELD32(0x00000002)
684 #define GPIO_SWITCH_2 FIELD32(0x00000004)
685 #define GPIO_SWITCH_3 FIELD32(0x00000008)
686 #define GPIO_SWITCH_4 FIELD32(0x00000010)
687 #define GPIO_SWITCH_5 FIELD32(0x00000020)
688 #define GPIO_SWITCH_6 FIELD32(0x00000040)
689 #define GPIO_SWITCH_7 FIELD32(0x00000080)
692 * MAC Control/Status Registers(CSR).
693 * Some values are set in TU, whereas 1 TU == 1024 us.
697 * MAC_CSR0: ASIC revision number.
699 * ASIC_VER: 2860 or 2870
701 #define MAC_CSR0 0x1000
702 #define MAC_CSR0_REVISION FIELD32(0x0000ffff)
703 #define MAC_CSR0_CHIPSET FIELD32(0xffff0000)
708 #define MAC_SYS_CTRL 0x1004
709 #define MAC_SYS_CTRL_RESET_CSR FIELD32(0x00000001)
710 #define MAC_SYS_CTRL_RESET_BBP FIELD32(0x00000002)
711 #define MAC_SYS_CTRL_ENABLE_TX FIELD32(0x00000004)
712 #define MAC_SYS_CTRL_ENABLE_RX FIELD32(0x00000008)
713 #define MAC_SYS_CTRL_CONTINUOUS_TX FIELD32(0x00000010)
714 #define MAC_SYS_CTRL_LOOPBACK FIELD32(0x00000020)
715 #define MAC_SYS_CTRL_WLAN_HALT FIELD32(0x00000040)
716 #define MAC_SYS_CTRL_RX_TIMESTAMP FIELD32(0x00000080)
719 * MAC_ADDR_DW0: STA MAC register 0
721 #define MAC_ADDR_DW0 0x1008
722 #define MAC_ADDR_DW0_BYTE0 FIELD32(0x000000ff)
723 #define MAC_ADDR_DW0_BYTE1 FIELD32(0x0000ff00)
724 #define MAC_ADDR_DW0_BYTE2 FIELD32(0x00ff0000)
725 #define MAC_ADDR_DW0_BYTE3 FIELD32(0xff000000)
728 * MAC_ADDR_DW1: STA MAC register 1
729 * UNICAST_TO_ME_MASK:
730 * Used to mask off bits from byte 5 of the MAC address
731 * to determine the UNICAST_TO_ME bit for RX frames.
732 * The full mask is complemented by BSS_ID_MASK:
733 * MASK = BSS_ID_MASK & UNICAST_TO_ME_MASK
735 #define MAC_ADDR_DW1 0x100c
736 #define MAC_ADDR_DW1_BYTE4 FIELD32(0x000000ff)
737 #define MAC_ADDR_DW1_BYTE5 FIELD32(0x0000ff00)
738 #define MAC_ADDR_DW1_UNICAST_TO_ME_MASK FIELD32(0x00ff0000)
741 * MAC_BSSID_DW0: BSSID register 0
743 #define MAC_BSSID_DW0 0x1010
744 #define MAC_BSSID_DW0_BYTE0 FIELD32(0x000000ff)
745 #define MAC_BSSID_DW0_BYTE1 FIELD32(0x0000ff00)
746 #define MAC_BSSID_DW0_BYTE2 FIELD32(0x00ff0000)
747 #define MAC_BSSID_DW0_BYTE3 FIELD32(0xff000000)
750 * MAC_BSSID_DW1: BSSID register 1
752 * 0: 1-BSSID mode (BSS index = 0)
753 * 1: 2-BSSID mode (BSS index: Byte5, bit 0)
754 * 2: 4-BSSID mode (BSS index: byte5, bit 0 - 1)
755 * 3: 8-BSSID mode (BSS index: byte5, bit 0 - 2)
756 * This mask is used to mask off bits 0, 1 and 2 of byte 5 of the
757 * BSSID. This will make sure that those bits will be ignored
758 * when determining the MY_BSS of RX frames.
760 #define MAC_BSSID_DW1 0x1014
761 #define MAC_BSSID_DW1_BYTE4 FIELD32(0x000000ff)
762 #define MAC_BSSID_DW1_BYTE5 FIELD32(0x0000ff00)
763 #define MAC_BSSID_DW1_BSS_ID_MASK FIELD32(0x00030000)
764 #define MAC_BSSID_DW1_BSS_BCN_NUM FIELD32(0x001c0000)
767 * MAX_LEN_CFG: Maximum frame length register.
768 * MAX_MPDU: rt2860b max 16k bytes
769 * MAX_PSDU: Maximum PSDU length
770 * (power factor) 0:2^13, 1:2^14, 2:2^15, 3:2^16
772 #define MAX_LEN_CFG 0x1018
773 #define MAX_LEN_CFG_MAX_MPDU FIELD32(0x00000fff)
774 #define MAX_LEN_CFG_MAX_PSDU FIELD32(0x00003000)
775 #define MAX_LEN_CFG_MIN_PSDU FIELD32(0x0000c000)
776 #define MAX_LEN_CFG_MIN_MPDU FIELD32(0x000f0000)
779 * BBP_CSR_CFG: BBP serial control register
780 * VALUE: Register value to program into BBP
781 * REG_NUM: Selected BBP register
782 * READ_CONTROL: 0 write BBP, 1 read BBP
783 * BUSY: ASIC is busy executing BBP commands
784 * BBP_PAR_DUR: 0 4 MAC clocks, 1 8 MAC clocks
785 * BBP_RW_MODE: 0 serial, 1 parallel
787 #define BBP_CSR_CFG 0x101c
788 #define BBP_CSR_CFG_VALUE FIELD32(0x000000ff)
789 #define BBP_CSR_CFG_REGNUM FIELD32(0x0000ff00)
790 #define BBP_CSR_CFG_READ_CONTROL FIELD32(0x00010000)
791 #define BBP_CSR_CFG_BUSY FIELD32(0x00020000)
792 #define BBP_CSR_CFG_BBP_PAR_DUR FIELD32(0x00040000)
793 #define BBP_CSR_CFG_BBP_RW_MODE FIELD32(0x00080000)
796 * RF_CSR_CFG0: RF control register
797 * REGID_AND_VALUE: Register value to program into RF
798 * BITWIDTH: Selected RF register
799 * STANDBYMODE: 0 high when standby, 1 low when standby
800 * SEL: 0 RF_LE0 activate, 1 RF_LE1 activate
801 * BUSY: ASIC is busy executing RF commands
803 #define RF_CSR_CFG0 0x1020
804 #define RF_CSR_CFG0_REGID_AND_VALUE FIELD32(0x00ffffff)
805 #define RF_CSR_CFG0_BITWIDTH FIELD32(0x1f000000)
806 #define RF_CSR_CFG0_REG_VALUE_BW FIELD32(0x1fffffff)
807 #define RF_CSR_CFG0_STANDBYMODE FIELD32(0x20000000)
808 #define RF_CSR_CFG0_SEL FIELD32(0x40000000)
809 #define RF_CSR_CFG0_BUSY FIELD32(0x80000000)
812 * RF_CSR_CFG1: RF control register
813 * REGID_AND_VALUE: Register value to program into RF
814 * RFGAP: Gap between BB_CONTROL_RF and RF_LE
815 * 0: 3 system clock cycle (37.5usec)
816 * 1: 5 system clock cycle (62.5usec)
818 #define RF_CSR_CFG1 0x1024
819 #define RF_CSR_CFG1_REGID_AND_VALUE FIELD32(0x00ffffff)
820 #define RF_CSR_CFG1_RFGAP FIELD32(0x1f000000)
823 * RF_CSR_CFG2: RF control register
824 * VALUE: Register value to program into RF
826 #define RF_CSR_CFG2 0x1028
827 #define RF_CSR_CFG2_VALUE FIELD32(0x00ffffff)
830 * LED_CFG: LED control
831 * ON_PERIOD: LED active time (ms) during TX (only used for LED mode 1)
832 * OFF_PERIOD: LED inactive time (ms) during TX (only used for LED mode 1)
833 * SLOW_BLINK_PERIOD: LED blink interval in seconds (only used for LED mode 2)
836 * 1: blinking upon TX2
837 * 2: periodic slow blinking
843 #define LED_CFG 0x102c
844 #define LED_CFG_ON_PERIOD FIELD32(0x000000ff)
845 #define LED_CFG_OFF_PERIOD FIELD32(0x0000ff00)
846 #define LED_CFG_SLOW_BLINK_PERIOD FIELD32(0x003f0000)
847 #define LED_CFG_R_LED_MODE FIELD32(0x03000000)
848 #define LED_CFG_G_LED_MODE FIELD32(0x0c000000)
849 #define LED_CFG_Y_LED_MODE FIELD32(0x30000000)
850 #define LED_CFG_LED_POLAR FIELD32(0x40000000)
853 * AMPDU_BA_WINSIZE: Force BlockAck window size
854 * FORCE_WINSIZE_ENABLE:
855 * 0: Disable forcing of BlockAck window size
856 * 1: Enable forcing of BlockAck window size, overwrites values BlockAck
857 * window size values in the TXWI
858 * FORCE_WINSIZE: BlockAck window size
860 #define AMPDU_BA_WINSIZE 0x1040
861 #define AMPDU_BA_WINSIZE_FORCE_WINSIZE_ENABLE FIELD32(0x00000020)
862 #define AMPDU_BA_WINSIZE_FORCE_WINSIZE FIELD32(0x0000001f)
865 * XIFS_TIME_CFG: MAC timing
866 * CCKM_SIFS_TIME: unit 1us. Applied after CCK RX/TX
867 * OFDM_SIFS_TIME: unit 1us. Applied after OFDM RX/TX
868 * OFDM_XIFS_TIME: unit 1us. Applied after OFDM RX
869 * when MAC doesn't reference BBP signal BBRXEND
871 * BB_RXEND_ENABLE: reference RXEND signal to begin XIFS defer
874 #define XIFS_TIME_CFG 0x1100
875 #define XIFS_TIME_CFG_CCKM_SIFS_TIME FIELD32(0x000000ff)
876 #define XIFS_TIME_CFG_OFDM_SIFS_TIME FIELD32(0x0000ff00)
877 #define XIFS_TIME_CFG_OFDM_XIFS_TIME FIELD32(0x000f0000)
878 #define XIFS_TIME_CFG_EIFS FIELD32(0x1ff00000)
879 #define XIFS_TIME_CFG_BB_RXEND_ENABLE FIELD32(0x20000000)
884 #define BKOFF_SLOT_CFG 0x1104
885 #define BKOFF_SLOT_CFG_SLOT_TIME FIELD32(0x000000ff)
886 #define BKOFF_SLOT_CFG_CC_DELAY_TIME FIELD32(0x0000ff00)
891 #define NAV_TIME_CFG 0x1108
892 #define NAV_TIME_CFG_SIFS FIELD32(0x000000ff)
893 #define NAV_TIME_CFG_SLOT_TIME FIELD32(0x0000ff00)
894 #define NAV_TIME_CFG_EIFS FIELD32(0x01ff0000)
895 #define NAV_TIME_ZERO_SIFS FIELD32(0x02000000)
898 * CH_TIME_CFG: count as channel busy
899 * EIFS_BUSY: Count EIFS as channel busy
900 * NAV_BUSY: Count NAS as channel busy
901 * RX_BUSY: Count RX as channel busy
902 * TX_BUSY: Count TX as channel busy
903 * TMR_EN: Enable channel statistics timer
905 #define CH_TIME_CFG 0x110c
906 #define CH_TIME_CFG_EIFS_BUSY FIELD32(0x00000010)
907 #define CH_TIME_CFG_NAV_BUSY FIELD32(0x00000008)
908 #define CH_TIME_CFG_RX_BUSY FIELD32(0x00000004)
909 #define CH_TIME_CFG_TX_BUSY FIELD32(0x00000002)
910 #define CH_TIME_CFG_TMR_EN FIELD32(0x00000001)
913 * PBF_LIFE_TIMER: TX/RX MPDU timestamp timer (free run) Unit: 1us
915 #define PBF_LIFE_TIMER 0x1110
919 * BEACON_INTERVAL: in unit of 1/16 TU
920 * TSF_TICKING: Enable TSF auto counting
921 * TSF_SYNC: Enable TSF sync, 00: disable, 01: infra mode, 10: ad-hoc mode
922 * BEACON_GEN: Enable beacon generator
924 #define BCN_TIME_CFG 0x1114
925 #define BCN_TIME_CFG_BEACON_INTERVAL FIELD32(0x0000ffff)
926 #define BCN_TIME_CFG_TSF_TICKING FIELD32(0x00010000)
927 #define BCN_TIME_CFG_TSF_SYNC FIELD32(0x00060000)
928 #define BCN_TIME_CFG_TBTT_ENABLE FIELD32(0x00080000)
929 #define BCN_TIME_CFG_BEACON_GEN FIELD32(0x00100000)
930 #define BCN_TIME_CFG_TX_TIME_COMPENSATE FIELD32(0xf0000000)
934 * BCN_AIFSN: Beacon AIFSN after TBTT interrupt in slots
935 * BCN_CWMIN: Beacon CWMin after TBTT interrupt in slots
937 #define TBTT_SYNC_CFG 0x1118
938 #define TBTT_SYNC_CFG_TBTT_ADJUST FIELD32(0x000000ff)
939 #define TBTT_SYNC_CFG_BCN_EXP_WIN FIELD32(0x0000ff00)
940 #define TBTT_SYNC_CFG_BCN_AIFSN FIELD32(0x000f0000)
941 #define TBTT_SYNC_CFG_BCN_CWMIN FIELD32(0x00f00000)
944 * TSF_TIMER_DW0: Local lsb TSF timer, read-only
946 #define TSF_TIMER_DW0 0x111c
947 #define TSF_TIMER_DW0_LOW_WORD FIELD32(0xffffffff)
950 * TSF_TIMER_DW1: Local msb TSF timer, read-only
952 #define TSF_TIMER_DW1 0x1120
953 #define TSF_TIMER_DW1_HIGH_WORD FIELD32(0xffffffff)
956 * TBTT_TIMER: TImer remains till next TBTT, read-only
958 #define TBTT_TIMER 0x1124
961 * INT_TIMER_CFG: timer configuration
962 * PRE_TBTT_TIMER: leadtime to tbtt for pretbtt interrupt in units of 1/16 TU
963 * GP_TIMER: period of general purpose timer in units of 1/16 TU
965 #define INT_TIMER_CFG 0x1128
966 #define INT_TIMER_CFG_PRE_TBTT_TIMER FIELD32(0x0000ffff)
967 #define INT_TIMER_CFG_GP_TIMER FIELD32(0xffff0000)
970 * INT_TIMER_EN: GP-timer and pre-tbtt Int enable
972 #define INT_TIMER_EN 0x112c
973 #define INT_TIMER_EN_PRE_TBTT_TIMER FIELD32(0x00000001)
974 #define INT_TIMER_EN_GP_TIMER FIELD32(0x00000002)
977 * CH_IDLE_STA: channel idle time (in us)
979 #define CH_IDLE_STA 0x1130
982 * CH_BUSY_STA: channel busy time on primary channel (in us)
984 #define CH_BUSY_STA 0x1134
987 * CH_BUSY_STA_SEC: channel busy time on secondary channel in HT40 mode (in us)
989 #define CH_BUSY_STA_SEC 0x1138
993 * BBP_RF_BUSY: When set to 0, BBP and RF are stable.
994 * if 1 or higher one of the 2 registers is busy.
996 #define MAC_STATUS_CFG 0x1200
997 #define MAC_STATUS_CFG_BBP_RF_BUSY FIELD32(0x00000003)
1002 #define PWR_PIN_CFG 0x1204
1005 * AUTOWAKEUP_CFG: Manual power control / status register
1006 * TBCN_BEFORE_WAKE: ForceWake has high privilege than PutToSleep when both set
1007 * AUTOWAKE: 0:sleep, 1:awake
1009 #define AUTOWAKEUP_CFG 0x1208
1010 #define AUTOWAKEUP_CFG_AUTO_LEAD_TIME FIELD32(0x000000ff)
1011 #define AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE FIELD32(0x00007f00)
1012 #define AUTOWAKEUP_CFG_AUTOWAKE FIELD32(0x00008000)
1017 #define EDCA_AC0_CFG 0x1300
1018 #define EDCA_AC0_CFG_TX_OP FIELD32(0x000000ff)
1019 #define EDCA_AC0_CFG_AIFSN FIELD32(0x00000f00)
1020 #define EDCA_AC0_CFG_CWMIN FIELD32(0x0000f000)
1021 #define EDCA_AC0_CFG_CWMAX FIELD32(0x000f0000)
1026 #define EDCA_AC1_CFG 0x1304
1027 #define EDCA_AC1_CFG_TX_OP FIELD32(0x000000ff)
1028 #define EDCA_AC1_CFG_AIFSN FIELD32(0x00000f00)
1029 #define EDCA_AC1_CFG_CWMIN FIELD32(0x0000f000)
1030 #define EDCA_AC1_CFG_CWMAX FIELD32(0x000f0000)
1035 #define EDCA_AC2_CFG 0x1308
1036 #define EDCA_AC2_CFG_TX_OP FIELD32(0x000000ff)
1037 #define EDCA_AC2_CFG_AIFSN FIELD32(0x00000f00)
1038 #define EDCA_AC2_CFG_CWMIN FIELD32(0x0000f000)
1039 #define EDCA_AC2_CFG_CWMAX FIELD32(0x000f0000)
1044 #define EDCA_AC3_CFG 0x130c
1045 #define EDCA_AC3_CFG_TX_OP FIELD32(0x000000ff)
1046 #define EDCA_AC3_CFG_AIFSN FIELD32(0x00000f00)
1047 #define EDCA_AC3_CFG_CWMIN FIELD32(0x0000f000)
1048 #define EDCA_AC3_CFG_CWMAX FIELD32(0x000f0000)
1053 #define EDCA_TID_AC_MAP 0x1310
1058 #define TX_PWR_CFG_RATE0 FIELD32(0x0000000f)
1059 #define TX_PWR_CFG_RATE1 FIELD32(0x000000f0)
1060 #define TX_PWR_CFG_RATE2 FIELD32(0x00000f00)
1061 #define TX_PWR_CFG_RATE3 FIELD32(0x0000f000)
1062 #define TX_PWR_CFG_RATE4 FIELD32(0x000f0000)
1063 #define TX_PWR_CFG_RATE5 FIELD32(0x00f00000)
1064 #define TX_PWR_CFG_RATE6 FIELD32(0x0f000000)
1065 #define TX_PWR_CFG_RATE7 FIELD32(0xf0000000)
1070 #define TX_PWR_CFG_0 0x1314
1071 #define TX_PWR_CFG_0_1MBS FIELD32(0x0000000f)
1072 #define TX_PWR_CFG_0_2MBS FIELD32(0x000000f0)
1073 #define TX_PWR_CFG_0_55MBS FIELD32(0x00000f00)
1074 #define TX_PWR_CFG_0_11MBS FIELD32(0x0000f000)
1075 #define TX_PWR_CFG_0_6MBS FIELD32(0x000f0000)
1076 #define TX_PWR_CFG_0_9MBS FIELD32(0x00f00000)
1077 #define TX_PWR_CFG_0_12MBS FIELD32(0x0f000000)
1078 #define TX_PWR_CFG_0_18MBS FIELD32(0xf0000000)
1083 #define TX_PWR_CFG_1 0x1318
1084 #define TX_PWR_CFG_1_24MBS FIELD32(0x0000000f)
1085 #define TX_PWR_CFG_1_36MBS FIELD32(0x000000f0)
1086 #define TX_PWR_CFG_1_48MBS FIELD32(0x00000f00)
1087 #define TX_PWR_CFG_1_54MBS FIELD32(0x0000f000)
1088 #define TX_PWR_CFG_1_MCS0 FIELD32(0x000f0000)
1089 #define TX_PWR_CFG_1_MCS1 FIELD32(0x00f00000)
1090 #define TX_PWR_CFG_1_MCS2 FIELD32(0x0f000000)
1091 #define TX_PWR_CFG_1_MCS3 FIELD32(0xf0000000)
1096 #define TX_PWR_CFG_2 0x131c
1097 #define TX_PWR_CFG_2_MCS4 FIELD32(0x0000000f)
1098 #define TX_PWR_CFG_2_MCS5 FIELD32(0x000000f0)
1099 #define TX_PWR_CFG_2_MCS6 FIELD32(0x00000f00)
1100 #define TX_PWR_CFG_2_MCS7 FIELD32(0x0000f000)
1101 #define TX_PWR_CFG_2_MCS8 FIELD32(0x000f0000)
1102 #define TX_PWR_CFG_2_MCS9 FIELD32(0x00f00000)
1103 #define TX_PWR_CFG_2_MCS10 FIELD32(0x0f000000)
1104 #define TX_PWR_CFG_2_MCS11 FIELD32(0xf0000000)
1109 #define TX_PWR_CFG_3 0x1320
1110 #define TX_PWR_CFG_3_MCS12 FIELD32(0x0000000f)
1111 #define TX_PWR_CFG_3_MCS13 FIELD32(0x000000f0)
1112 #define TX_PWR_CFG_3_MCS14 FIELD32(0x00000f00)
1113 #define TX_PWR_CFG_3_MCS15 FIELD32(0x0000f000)
1114 #define TX_PWR_CFG_3_UKNOWN1 FIELD32(0x000f0000)
1115 #define TX_PWR_CFG_3_UKNOWN2 FIELD32(0x00f00000)
1116 #define TX_PWR_CFG_3_UKNOWN3 FIELD32(0x0f000000)
1117 #define TX_PWR_CFG_3_UKNOWN4 FIELD32(0xf0000000)
1122 #define TX_PWR_CFG_4 0x1324
1123 #define TX_PWR_CFG_4_UKNOWN5 FIELD32(0x0000000f)
1124 #define TX_PWR_CFG_4_UKNOWN6 FIELD32(0x000000f0)
1125 #define TX_PWR_CFG_4_UKNOWN7 FIELD32(0x00000f00)
1126 #define TX_PWR_CFG_4_UKNOWN8 FIELD32(0x0000f000)
1131 #define TX_PIN_CFG 0x1328
1132 #define TX_PIN_CFG_PA_PE_DISABLE 0xfcfffff0
1133 #define TX_PIN_CFG_PA_PE_A0_EN FIELD32(0x00000001)
1134 #define TX_PIN_CFG_PA_PE_G0_EN FIELD32(0x00000002)
1135 #define TX_PIN_CFG_PA_PE_A1_EN FIELD32(0x00000004)
1136 #define TX_PIN_CFG_PA_PE_G1_EN FIELD32(0x00000008)
1137 #define TX_PIN_CFG_PA_PE_A0_POL FIELD32(0x00000010)
1138 #define TX_PIN_CFG_PA_PE_G0_POL FIELD32(0x00000020)
1139 #define TX_PIN_CFG_PA_PE_A1_POL FIELD32(0x00000040)
1140 #define TX_PIN_CFG_PA_PE_G1_POL FIELD32(0x00000080)
1141 #define TX_PIN_CFG_LNA_PE_A0_EN FIELD32(0x00000100)
1142 #define TX_PIN_CFG_LNA_PE_G0_EN FIELD32(0x00000200)
1143 #define TX_PIN_CFG_LNA_PE_A1_EN FIELD32(0x00000400)
1144 #define TX_PIN_CFG_LNA_PE_G1_EN FIELD32(0x00000800)
1145 #define TX_PIN_CFG_LNA_PE_A0_POL FIELD32(0x00001000)
1146 #define TX_PIN_CFG_LNA_PE_G0_POL FIELD32(0x00002000)
1147 #define TX_PIN_CFG_LNA_PE_A1_POL FIELD32(0x00004000)
1148 #define TX_PIN_CFG_LNA_PE_G1_POL FIELD32(0x00008000)
1149 #define TX_PIN_CFG_RFTR_EN FIELD32(0x00010000)
1150 #define TX_PIN_CFG_RFTR_POL FIELD32(0x00020000)
1151 #define TX_PIN_CFG_TRSW_EN FIELD32(0x00040000)
1152 #define TX_PIN_CFG_TRSW_POL FIELD32(0x00080000)
1153 #define TX_PIN_CFG_PA_PE_A2_EN FIELD32(0x01000000)
1154 #define TX_PIN_CFG_PA_PE_G2_EN FIELD32(0x02000000)
1155 #define TX_PIN_CFG_PA_PE_A2_POL FIELD32(0x04000000)
1156 #define TX_PIN_CFG_PA_PE_G2_POL FIELD32(0x08000000)
1157 #define TX_PIN_CFG_LNA_PE_A2_EN FIELD32(0x10000000)
1158 #define TX_PIN_CFG_LNA_PE_G2_EN FIELD32(0x20000000)
1159 #define TX_PIN_CFG_LNA_PE_A2_POL FIELD32(0x40000000)
1160 #define TX_PIN_CFG_LNA_PE_G2_POL FIELD32(0x80000000)
1163 * TX_BAND_CFG: 0x1 use upper 20MHz, 0x0 use lower 20MHz
1165 #define TX_BAND_CFG 0x132c
1166 #define TX_BAND_CFG_HT40_MINUS FIELD32(0x00000001)
1167 #define TX_BAND_CFG_A FIELD32(0x00000002)
1168 #define TX_BAND_CFG_BG FIELD32(0x00000004)
1173 #define TX_SW_CFG0 0x1330
1178 #define TX_SW_CFG1 0x1334
1183 #define TX_SW_CFG2 0x1338
1188 #define TXOP_THRES_CFG 0x133c
1192 * TIMEOUT_TRUN_EN: Enable/Disable TXOP timeout truncation
1193 * AC_TRUN_EN: Enable/Disable truncation for AC change
1194 * TXRATEGRP_TRUN_EN: Enable/Disable truncation for TX rate group change
1195 * USER_MODE_TRUN_EN: Enable/Disable truncation for user TXOP mode
1196 * MIMO_PS_TRUN_EN: Enable/Disable truncation for MIMO PS RTS/CTS
1197 * RESERVED_TRUN_EN: Reserved
1198 * LSIG_TXOP_EN: Enable/Disable L-SIG TXOP protection
1199 * EXT_CCA_EN: Enable/Disable extension channel CCA reference (Defer 40Mhz
1200 * transmissions if extension CCA is clear).
1201 * EXT_CCA_DLY: Extension CCA signal delay time (unit: us)
1202 * EXT_CWMIN: CwMin for extension channel backoff
1206 #define TXOP_CTRL_CFG 0x1340
1207 #define TXOP_CTRL_CFG_TIMEOUT_TRUN_EN FIELD32(0x00000001)
1208 #define TXOP_CTRL_CFG_AC_TRUN_EN FIELD32(0x00000002)
1209 #define TXOP_CTRL_CFG_TXRATEGRP_TRUN_EN FIELD32(0x00000004)
1210 #define TXOP_CTRL_CFG_USER_MODE_TRUN_EN FIELD32(0x00000008)
1211 #define TXOP_CTRL_CFG_MIMO_PS_TRUN_EN FIELD32(0x00000010)
1212 #define TXOP_CTRL_CFG_RESERVED_TRUN_EN FIELD32(0x00000020)
1213 #define TXOP_CTRL_CFG_LSIG_TXOP_EN FIELD32(0x00000040)
1214 #define TXOP_CTRL_CFG_EXT_CCA_EN FIELD32(0x00000080)
1215 #define TXOP_CTRL_CFG_EXT_CCA_DLY FIELD32(0x0000ff00)
1216 #define TXOP_CTRL_CFG_EXT_CWMIN FIELD32(0x000f0000)
1220 * RTS_THRES: unit:byte
1221 * RTS_FBK_EN: enable rts rate fallback
1223 #define TX_RTS_CFG 0x1344
1224 #define TX_RTS_CFG_AUTO_RTS_RETRY_LIMIT FIELD32(0x000000ff)
1225 #define TX_RTS_CFG_RTS_THRES FIELD32(0x00ffff00)
1226 #define TX_RTS_CFG_RTS_FBK_EN FIELD32(0x01000000)
1230 * MPDU_LIFETIME: expiration time = 2^(9+MPDU LIFE TIME) us
1231 * RX_ACK_TIMEOUT: unit:slot. Used for TX procedure
1232 * TX_OP_TIMEOUT: TXOP timeout value for TXOP truncation.
1233 * it is recommended that:
1234 * (SLOT_TIME) > (TX_OP_TIMEOUT) > (RX_ACK_TIMEOUT)
1236 #define TX_TIMEOUT_CFG 0x1348
1237 #define TX_TIMEOUT_CFG_MPDU_LIFETIME FIELD32(0x000000f0)
1238 #define TX_TIMEOUT_CFG_RX_ACK_TIMEOUT FIELD32(0x0000ff00)
1239 #define TX_TIMEOUT_CFG_TX_OP_TIMEOUT FIELD32(0x00ff0000)
1243 * SHORT_RTY_LIMIT: short retry limit
1244 * LONG_RTY_LIMIT: long retry limit
1245 * LONG_RTY_THRE: Long retry threshoold
1246 * NON_AGG_RTY_MODE: Non-Aggregate MPDU retry mode
1247 * 0:expired by retry limit, 1: expired by mpdu life timer
1248 * AGG_RTY_MODE: Aggregate MPDU retry mode
1249 * 0:expired by retry limit, 1: expired by mpdu life timer
1250 * TX_AUTO_FB_ENABLE: Tx retry PHY rate auto fallback enable
1252 #define TX_RTY_CFG 0x134c
1253 #define TX_RTY_CFG_SHORT_RTY_LIMIT FIELD32(0x000000ff)
1254 #define TX_RTY_CFG_LONG_RTY_LIMIT FIELD32(0x0000ff00)
1255 #define TX_RTY_CFG_LONG_RTY_THRE FIELD32(0x0fff0000)
1256 #define TX_RTY_CFG_NON_AGG_RTY_MODE FIELD32(0x10000000)
1257 #define TX_RTY_CFG_AGG_RTY_MODE FIELD32(0x20000000)
1258 #define TX_RTY_CFG_TX_AUTO_FB_ENABLE FIELD32(0x40000000)
1262 * REMOTE_MFB_LIFETIME: remote MFB life time. unit: 32us
1263 * MFB_ENABLE: TX apply remote MFB 1:enable
1264 * REMOTE_UMFS_ENABLE: remote unsolicit MFB enable
1265 * 0: not apply remote remote unsolicit (MFS=7)
1266 * TX_MRQ_EN: MCS request TX enable
1267 * TX_RDG_EN: RDG TX enable
1268 * TX_CF_ACK_EN: Piggyback CF-ACK enable
1269 * REMOTE_MFB: remote MCS feedback
1270 * REMOTE_MFS: remote MCS feedback sequence number
1272 #define TX_LINK_CFG 0x1350
1273 #define TX_LINK_CFG_REMOTE_MFB_LIFETIME FIELD32(0x000000ff)
1274 #define TX_LINK_CFG_MFB_ENABLE FIELD32(0x00000100)
1275 #define TX_LINK_CFG_REMOTE_UMFS_ENABLE FIELD32(0x00000200)
1276 #define TX_LINK_CFG_TX_MRQ_EN FIELD32(0x00000400)
1277 #define TX_LINK_CFG_TX_RDG_EN FIELD32(0x00000800)
1278 #define TX_LINK_CFG_TX_CF_ACK_EN FIELD32(0x00001000)
1279 #define TX_LINK_CFG_REMOTE_MFB FIELD32(0x00ff0000)
1280 #define TX_LINK_CFG_REMOTE_MFS FIELD32(0xff000000)
1285 #define HT_FBK_CFG0 0x1354
1286 #define HT_FBK_CFG0_HTMCS0FBK FIELD32(0x0000000f)
1287 #define HT_FBK_CFG0_HTMCS1FBK FIELD32(0x000000f0)
1288 #define HT_FBK_CFG0_HTMCS2FBK FIELD32(0x00000f00)
1289 #define HT_FBK_CFG0_HTMCS3FBK FIELD32(0x0000f000)
1290 #define HT_FBK_CFG0_HTMCS4FBK FIELD32(0x000f0000)
1291 #define HT_FBK_CFG0_HTMCS5FBK FIELD32(0x00f00000)
1292 #define HT_FBK_CFG0_HTMCS6FBK FIELD32(0x0f000000)
1293 #define HT_FBK_CFG0_HTMCS7FBK FIELD32(0xf0000000)
1298 #define HT_FBK_CFG1 0x1358
1299 #define HT_FBK_CFG1_HTMCS8FBK FIELD32(0x0000000f)
1300 #define HT_FBK_CFG1_HTMCS9FBK FIELD32(0x000000f0)
1301 #define HT_FBK_CFG1_HTMCS10FBK FIELD32(0x00000f00)
1302 #define HT_FBK_CFG1_HTMCS11FBK FIELD32(0x0000f000)
1303 #define HT_FBK_CFG1_HTMCS12FBK FIELD32(0x000f0000)
1304 #define HT_FBK_CFG1_HTMCS13FBK FIELD32(0x00f00000)
1305 #define HT_FBK_CFG1_HTMCS14FBK FIELD32(0x0f000000)
1306 #define HT_FBK_CFG1_HTMCS15FBK FIELD32(0xf0000000)
1311 #define LG_FBK_CFG0 0x135c
1312 #define LG_FBK_CFG0_OFDMMCS0FBK FIELD32(0x0000000f)
1313 #define LG_FBK_CFG0_OFDMMCS1FBK FIELD32(0x000000f0)
1314 #define LG_FBK_CFG0_OFDMMCS2FBK FIELD32(0x00000f00)
1315 #define LG_FBK_CFG0_OFDMMCS3FBK FIELD32(0x0000f000)
1316 #define LG_FBK_CFG0_OFDMMCS4FBK FIELD32(0x000f0000)
1317 #define LG_FBK_CFG0_OFDMMCS5FBK FIELD32(0x00f00000)
1318 #define LG_FBK_CFG0_OFDMMCS6FBK FIELD32(0x0f000000)
1319 #define LG_FBK_CFG0_OFDMMCS7FBK FIELD32(0xf0000000)
1324 #define LG_FBK_CFG1 0x1360
1325 #define LG_FBK_CFG0_CCKMCS0FBK FIELD32(0x0000000f)
1326 #define LG_FBK_CFG0_CCKMCS1FBK FIELD32(0x000000f0)
1327 #define LG_FBK_CFG0_CCKMCS2FBK FIELD32(0x00000f00)
1328 #define LG_FBK_CFG0_CCKMCS3FBK FIELD32(0x0000f000)
1331 * CCK_PROT_CFG: CCK Protection
1332 * PROTECT_RATE: Protection control frame rate for CCK TX(RTS/CTS/CFEnd)
1333 * PROTECT_CTRL: Protection control frame type for CCK TX
1334 * 0:none, 1:RTS/CTS, 2:CTS-to-self
1335 * PROTECT_NAV_SHORT: TXOP protection type for CCK TX with short NAV
1336 * PROTECT_NAV_LONG: TXOP protection type for CCK TX with long NAV
1337 * TX_OP_ALLOW_CCK: CCK TXOP allowance, 0:disallow
1338 * TX_OP_ALLOW_OFDM: CCK TXOP allowance, 0:disallow
1339 * TX_OP_ALLOW_MM20: CCK TXOP allowance, 0:disallow
1340 * TX_OP_ALLOW_MM40: CCK TXOP allowance, 0:disallow
1341 * TX_OP_ALLOW_GF20: CCK TXOP allowance, 0:disallow
1342 * TX_OP_ALLOW_GF40: CCK TXOP allowance, 0:disallow
1343 * RTS_TH_EN: RTS threshold enable on CCK TX
1345 #define CCK_PROT_CFG 0x1364
1346 #define CCK_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1347 #define CCK_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1348 #define CCK_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1349 #define CCK_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1350 #define CCK_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1351 #define CCK_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1352 #define CCK_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
1353 #define CCK_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000)
1354 #define CCK_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000)
1355 #define CCK_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000)
1356 #define CCK_PROT_CFG_RTS_TH_EN FIELD32(0x04000000)
1359 * OFDM_PROT_CFG: OFDM Protection
1361 #define OFDM_PROT_CFG 0x1368
1362 #define OFDM_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1363 #define OFDM_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1364 #define OFDM_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1365 #define OFDM_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1366 #define OFDM_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1367 #define OFDM_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1368 #define OFDM_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
1369 #define OFDM_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000)
1370 #define OFDM_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000)
1371 #define OFDM_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000)
1372 #define OFDM_PROT_CFG_RTS_TH_EN FIELD32(0x04000000)
1375 * MM20_PROT_CFG: MM20 Protection
1377 #define MM20_PROT_CFG 0x136c
1378 #define MM20_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1379 #define MM20_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1380 #define MM20_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1381 #define MM20_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1382 #define MM20_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1383 #define MM20_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1384 #define MM20_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
1385 #define MM20_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000)
1386 #define MM20_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000)
1387 #define MM20_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000)
1388 #define MM20_PROT_CFG_RTS_TH_EN FIELD32(0x04000000)
1391 * MM40_PROT_CFG: MM40 Protection
1393 #define MM40_PROT_CFG 0x1370
1394 #define MM40_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1395 #define MM40_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1396 #define MM40_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1397 #define MM40_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1398 #define MM40_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1399 #define MM40_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1400 #define MM40_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
1401 #define MM40_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000)
1402 #define MM40_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000)
1403 #define MM40_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000)
1404 #define MM40_PROT_CFG_RTS_TH_EN FIELD32(0x04000000)
1407 * GF20_PROT_CFG: GF20 Protection
1409 #define GF20_PROT_CFG 0x1374
1410 #define GF20_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1411 #define GF20_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1412 #define GF20_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1413 #define GF20_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1414 #define GF20_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1415 #define GF20_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1416 #define GF20_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
1417 #define GF20_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000)
1418 #define GF20_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000)
1419 #define GF20_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000)
1420 #define GF20_PROT_CFG_RTS_TH_EN FIELD32(0x04000000)
1423 * GF40_PROT_CFG: GF40 Protection
1425 #define GF40_PROT_CFG 0x1378
1426 #define GF40_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1427 #define GF40_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1428 #define GF40_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1429 #define GF40_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1430 #define GF40_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1431 #define GF40_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1432 #define GF40_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
1433 #define GF40_PROT_CFG_TX_OP_ALLOW_MM40 FIELD32(0x00800000)
1434 #define GF40_PROT_CFG_TX_OP_ALLOW_GF20 FIELD32(0x01000000)
1435 #define GF40_PROT_CFG_TX_OP_ALLOW_GF40 FIELD32(0x02000000)
1436 #define GF40_PROT_CFG_RTS_TH_EN FIELD32(0x04000000)
1441 #define EXP_CTS_TIME 0x137c
1446 #define EXP_ACK_TIME 0x1380
1449 * RX_FILTER_CFG: RX configuration register.
1451 #define RX_FILTER_CFG 0x1400
1452 #define RX_FILTER_CFG_DROP_CRC_ERROR FIELD32(0x00000001)
1453 #define RX_FILTER_CFG_DROP_PHY_ERROR FIELD32(0x00000002)
1454 #define RX_FILTER_CFG_DROP_NOT_TO_ME FIELD32(0x00000004)
1455 #define RX_FILTER_CFG_DROP_NOT_MY_BSSD FIELD32(0x00000008)
1456 #define RX_FILTER_CFG_DROP_VER_ERROR FIELD32(0x00000010)
1457 #define RX_FILTER_CFG_DROP_MULTICAST FIELD32(0x00000020)
1458 #define RX_FILTER_CFG_DROP_BROADCAST FIELD32(0x00000040)
1459 #define RX_FILTER_CFG_DROP_DUPLICATE FIELD32(0x00000080)
1460 #define RX_FILTER_CFG_DROP_CF_END_ACK FIELD32(0x00000100)
1461 #define RX_FILTER_CFG_DROP_CF_END FIELD32(0x00000200)
1462 #define RX_FILTER_CFG_DROP_ACK FIELD32(0x00000400)
1463 #define RX_FILTER_CFG_DROP_CTS FIELD32(0x00000800)
1464 #define RX_FILTER_CFG_DROP_RTS FIELD32(0x00001000)
1465 #define RX_FILTER_CFG_DROP_PSPOLL FIELD32(0x00002000)
1466 #define RX_FILTER_CFG_DROP_BA FIELD32(0x00004000)
1467 #define RX_FILTER_CFG_DROP_BAR FIELD32(0x00008000)
1468 #define RX_FILTER_CFG_DROP_CNTL FIELD32(0x00010000)
1472 * AUTORESPONDER: 0: disable, 1: enable
1473 * BAC_ACK_POLICY: 0:long, 1:short preamble
1474 * CTS_40_MMODE: Response CTS 40MHz duplicate mode
1475 * CTS_40_MREF: Response CTS 40MHz duplicate mode
1476 * AR_PREAMBLE: Auto responder preamble 0:long, 1:short preamble
1477 * DUAL_CTS_EN: Power bit value in control frame
1478 * ACK_CTS_PSM_BIT:Power bit value in control frame
1480 #define AUTO_RSP_CFG 0x1404
1481 #define AUTO_RSP_CFG_AUTORESPONDER FIELD32(0x00000001)
1482 #define AUTO_RSP_CFG_BAC_ACK_POLICY FIELD32(0x00000002)
1483 #define AUTO_RSP_CFG_CTS_40_MMODE FIELD32(0x00000004)
1484 #define AUTO_RSP_CFG_CTS_40_MREF FIELD32(0x00000008)
1485 #define AUTO_RSP_CFG_AR_PREAMBLE FIELD32(0x00000010)
1486 #define AUTO_RSP_CFG_DUAL_CTS_EN FIELD32(0x00000040)
1487 #define AUTO_RSP_CFG_ACK_CTS_PSM_BIT FIELD32(0x00000080)
1490 * LEGACY_BASIC_RATE:
1492 #define LEGACY_BASIC_RATE 0x1408
1497 #define HT_BASIC_RATE 0x140c
1502 #define HT_CTRL_CFG 0x1410
1507 #define SIFS_COST_CFG 0x1414
1511 * Set NAV for all received frames
1513 #define RX_PARSER_CFG 0x1418
1518 #define TX_SEC_CNT0 0x1500
1523 #define RX_SEC_CNT0 0x1504
1528 #define CCMP_FC_MUTE 0x1508
1533 #define TXOP_HLDR_ADDR0 0x1600
1538 #define TXOP_HLDR_ADDR1 0x1604
1543 #define TXOP_HLDR_ET 0x1608
1546 * QOS_CFPOLL_RA_DW0:
1548 #define QOS_CFPOLL_RA_DW0 0x160c
1551 * QOS_CFPOLL_RA_DW1:
1553 #define QOS_CFPOLL_RA_DW1 0x1610
1558 #define QOS_CFPOLL_QC 0x1614
1561 * RX_STA_CNT0: RX PLCP error count & RX CRC error count
1563 #define RX_STA_CNT0 0x1700
1564 #define RX_STA_CNT0_CRC_ERR FIELD32(0x0000ffff)
1565 #define RX_STA_CNT0_PHY_ERR FIELD32(0xffff0000)
1568 * RX_STA_CNT1: RX False CCA count & RX LONG frame count
1570 #define RX_STA_CNT1 0x1704
1571 #define RX_STA_CNT1_FALSE_CCA FIELD32(0x0000ffff)
1572 #define RX_STA_CNT1_PLCP_ERR FIELD32(0xffff0000)
1577 #define RX_STA_CNT2 0x1708
1578 #define RX_STA_CNT2_RX_DUPLI_COUNT FIELD32(0x0000ffff)
1579 #define RX_STA_CNT2_RX_FIFO_OVERFLOW FIELD32(0xffff0000)
1582 * TX_STA_CNT0: TX Beacon count
1584 #define TX_STA_CNT0 0x170c
1585 #define TX_STA_CNT0_TX_FAIL_COUNT FIELD32(0x0000ffff)
1586 #define TX_STA_CNT0_TX_BEACON_COUNT FIELD32(0xffff0000)
1589 * TX_STA_CNT1: TX tx count
1591 #define TX_STA_CNT1 0x1710
1592 #define TX_STA_CNT1_TX_SUCCESS FIELD32(0x0000ffff)
1593 #define TX_STA_CNT1_TX_RETRANSMIT FIELD32(0xffff0000)
1596 * TX_STA_CNT2: TX tx count
1598 #define TX_STA_CNT2 0x1714
1599 #define TX_STA_CNT2_TX_ZERO_LEN_COUNT FIELD32(0x0000ffff)
1600 #define TX_STA_CNT2_TX_UNDER_FLOW_COUNT FIELD32(0xffff0000)
1603 * TX_STA_FIFO: TX Result for specific PID status fifo register.
1605 * This register is implemented as FIFO with 16 entries in the HW. Each
1606 * register read fetches the next tx result. If the FIFO is full because
1607 * it wasn't read fast enough after the according interrupt (TX_FIFO_STATUS)
1608 * triggered, the hw seems to simply drop further tx results.
1610 * VALID: 1: this tx result is valid
1611 * 0: no valid tx result -> driver should stop reading
1612 * PID_TYPE: The PID latched from the PID field in the TXWI, can be used
1613 * to match a frame with its tx result (even though the PID is
1614 * only 4 bits wide).
1615 * PID_QUEUE: Part of PID_TYPE, this is the queue index number (0-3)
1616 * PID_ENTRY: Part of PID_TYPE, this is the queue entry index number (1-3)
1617 * This identification number is calculated by ((idx % 3) + 1).
1618 * TX_SUCCESS: Indicates tx success (1) or failure (0)
1619 * TX_AGGRE: Indicates if the frame was part of an aggregate (1) or not (0)
1620 * TX_ACK_REQUIRED: Indicates if the frame needed to get ack'ed (1) or not (0)
1621 * WCID: The wireless client ID.
1622 * MCS: The tx rate used during the last transmission of this frame, be it
1623 * successful or not.
1624 * PHYMODE: The phymode used for the transmission.
1626 #define TX_STA_FIFO 0x1718
1627 #define TX_STA_FIFO_VALID FIELD32(0x00000001)
1628 #define TX_STA_FIFO_PID_TYPE FIELD32(0x0000001e)
1629 #define TX_STA_FIFO_PID_QUEUE FIELD32(0x00000006)
1630 #define TX_STA_FIFO_PID_ENTRY FIELD32(0x00000018)
1631 #define TX_STA_FIFO_TX_SUCCESS FIELD32(0x00000020)
1632 #define TX_STA_FIFO_TX_AGGRE FIELD32(0x00000040)
1633 #define TX_STA_FIFO_TX_ACK_REQUIRED FIELD32(0x00000080)
1634 #define TX_STA_FIFO_WCID FIELD32(0x0000ff00)
1635 #define TX_STA_FIFO_SUCCESS_RATE FIELD32(0xffff0000)
1636 #define TX_STA_FIFO_MCS FIELD32(0x007f0000)
1637 #define TX_STA_FIFO_PHYMODE FIELD32(0xc0000000)
1640 * TX_AGG_CNT: Debug counter
1642 #define TX_AGG_CNT 0x171c
1643 #define TX_AGG_CNT_NON_AGG_TX_COUNT FIELD32(0x0000ffff)
1644 #define TX_AGG_CNT_AGG_TX_COUNT FIELD32(0xffff0000)
1649 #define TX_AGG_CNT0 0x1720
1650 #define TX_AGG_CNT0_AGG_SIZE_1_COUNT FIELD32(0x0000ffff)
1651 #define TX_AGG_CNT0_AGG_SIZE_2_COUNT FIELD32(0xffff0000)
1656 #define TX_AGG_CNT1 0x1724
1657 #define TX_AGG_CNT1_AGG_SIZE_3_COUNT FIELD32(0x0000ffff)
1658 #define TX_AGG_CNT1_AGG_SIZE_4_COUNT FIELD32(0xffff0000)
1663 #define TX_AGG_CNT2 0x1728
1664 #define TX_AGG_CNT2_AGG_SIZE_5_COUNT FIELD32(0x0000ffff)
1665 #define TX_AGG_CNT2_AGG_SIZE_6_COUNT FIELD32(0xffff0000)
1670 #define TX_AGG_CNT3 0x172c
1671 #define TX_AGG_CNT3_AGG_SIZE_7_COUNT FIELD32(0x0000ffff)
1672 #define TX_AGG_CNT3_AGG_SIZE_8_COUNT FIELD32(0xffff0000)
1677 #define TX_AGG_CNT4 0x1730
1678 #define TX_AGG_CNT4_AGG_SIZE_9_COUNT FIELD32(0x0000ffff)
1679 #define TX_AGG_CNT4_AGG_SIZE_10_COUNT FIELD32(0xffff0000)
1684 #define TX_AGG_CNT5 0x1734
1685 #define TX_AGG_CNT5_AGG_SIZE_11_COUNT FIELD32(0x0000ffff)
1686 #define TX_AGG_CNT5_AGG_SIZE_12_COUNT FIELD32(0xffff0000)
1691 #define TX_AGG_CNT6 0x1738
1692 #define TX_AGG_CNT6_AGG_SIZE_13_COUNT FIELD32(0x0000ffff)
1693 #define TX_AGG_CNT6_AGG_SIZE_14_COUNT FIELD32(0xffff0000)
1698 #define TX_AGG_CNT7 0x173c
1699 #define TX_AGG_CNT7_AGG_SIZE_15_COUNT FIELD32(0x0000ffff)
1700 #define TX_AGG_CNT7_AGG_SIZE_16_COUNT FIELD32(0xffff0000)
1704 * TX_ZERO_DEL: TX zero length delimiter count
1705 * RX_ZERO_DEL: RX zero length delimiter count
1707 #define MPDU_DENSITY_CNT 0x1740
1708 #define MPDU_DENSITY_CNT_TX_ZERO_DEL FIELD32(0x0000ffff)
1709 #define MPDU_DENSITY_CNT_RX_ZERO_DEL FIELD32(0xffff0000)
1712 * Security key table memory.
1714 * The pairwise key table shares some memory with the beacon frame
1715 * buffers 6 and 7. That basically means that when beacon 6 & 7
1716 * are used we should only use the reduced pairwise key table which
1717 * has a maximum of 222 entries.
1719 * ---------------------------------------------
1720 * |0x4000 | Pairwise Key | Reduced Pairwise |
1721 * | | Table | Key Table |
1722 * | | Size: 256 * 32 | Size: 222 * 32 |
1723 * |0x5BC0 | |-------------------
1725 * |0x5DC0 | |-------------------
1727 * |0x5FC0 | |-------------------
1729 * --------------------------
1731 * MAC_WCID_BASE: 8-bytes (use only 6 bytes) * 256 entry
1732 * PAIRWISE_KEY_TABLE_BASE: 32-byte * 256 entry
1733 * MAC_IVEIV_TABLE_BASE: 8-byte * 256-entry
1734 * MAC_WCID_ATTRIBUTE_BASE: 4-byte * 256-entry
1735 * SHARED_KEY_TABLE_BASE: 32-byte * 16-entry
1736 * SHARED_KEY_MODE_BASE: 4-byte * 16-entry
1738 #define MAC_WCID_BASE 0x1800
1739 #define PAIRWISE_KEY_TABLE_BASE 0x4000
1740 #define MAC_IVEIV_TABLE_BASE 0x6000
1741 #define MAC_WCID_ATTRIBUTE_BASE 0x6800
1742 #define SHARED_KEY_TABLE_BASE 0x6c00
1743 #define SHARED_KEY_MODE_BASE 0x7000
1745 #define MAC_WCID_ENTRY(__idx) \
1746 (MAC_WCID_BASE + ((__idx) * sizeof(struct mac_wcid_entry)))
1747 #define PAIRWISE_KEY_ENTRY(__idx) \
1748 (PAIRWISE_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry)))
1749 #define MAC_IVEIV_ENTRY(__idx) \
1750 (MAC_IVEIV_TABLE_BASE + ((__idx) * sizeof(struct mac_iveiv_entry)))
1751 #define MAC_WCID_ATTR_ENTRY(__idx) \
1752 (MAC_WCID_ATTRIBUTE_BASE + ((__idx) * sizeof(u32)))
1753 #define SHARED_KEY_ENTRY(__idx) \
1754 (SHARED_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry)))
1755 #define SHARED_KEY_MODE_ENTRY(__idx) \
1756 (SHARED_KEY_MODE_BASE + ((__idx) * sizeof(u32)))
1758 struct mac_wcid_entry {
1763 struct hw_key_entry {
1769 struct mac_iveiv_entry {
1774 * MAC_WCID_ATTRIBUTE:
1776 #define MAC_WCID_ATTRIBUTE_KEYTAB FIELD32(0x00000001)
1777 #define MAC_WCID_ATTRIBUTE_CIPHER FIELD32(0x0000000e)
1778 #define MAC_WCID_ATTRIBUTE_BSS_IDX FIELD32(0x00000070)
1779 #define MAC_WCID_ATTRIBUTE_RX_WIUDF FIELD32(0x00000380)
1780 #define MAC_WCID_ATTRIBUTE_CIPHER_EXT FIELD32(0x00000400)
1781 #define MAC_WCID_ATTRIBUTE_BSS_IDX_EXT FIELD32(0x00000800)
1782 #define MAC_WCID_ATTRIBUTE_WAPI_MCBC FIELD32(0x00008000)
1783 #define MAC_WCID_ATTRIBUTE_WAPI_KEY_IDX FIELD32(0xff000000)
1788 #define SHARED_KEY_MODE_BSS0_KEY0 FIELD32(0x00000007)
1789 #define SHARED_KEY_MODE_BSS0_KEY1 FIELD32(0x00000070)
1790 #define SHARED_KEY_MODE_BSS0_KEY2 FIELD32(0x00000700)
1791 #define SHARED_KEY_MODE_BSS0_KEY3 FIELD32(0x00007000)
1792 #define SHARED_KEY_MODE_BSS1_KEY0 FIELD32(0x00070000)
1793 #define SHARED_KEY_MODE_BSS1_KEY1 FIELD32(0x00700000)
1794 #define SHARED_KEY_MODE_BSS1_KEY2 FIELD32(0x07000000)
1795 #define SHARED_KEY_MODE_BSS1_KEY3 FIELD32(0x70000000)
1798 * HOST-MCU communication
1802 * H2M_MAILBOX_CSR: Host-to-MCU Mailbox.
1803 * CMD_TOKEN: Command id, 0xff disable status reporting.
1805 #define H2M_MAILBOX_CSR 0x7010
1806 #define H2M_MAILBOX_CSR_ARG0 FIELD32(0x000000ff)
1807 #define H2M_MAILBOX_CSR_ARG1 FIELD32(0x0000ff00)
1808 #define H2M_MAILBOX_CSR_CMD_TOKEN FIELD32(0x00ff0000)
1809 #define H2M_MAILBOX_CSR_OWNER FIELD32(0xff000000)
1813 * Free slots contain 0xff. MCU will store command's token to lowest free slot.
1814 * If all slots are occupied status will be dropped.
1816 #define H2M_MAILBOX_CID 0x7014
1817 #define H2M_MAILBOX_CID_CMD0 FIELD32(0x000000ff)
1818 #define H2M_MAILBOX_CID_CMD1 FIELD32(0x0000ff00)
1819 #define H2M_MAILBOX_CID_CMD2 FIELD32(0x00ff0000)
1820 #define H2M_MAILBOX_CID_CMD3 FIELD32(0xff000000)
1823 * H2M_MAILBOX_STATUS:
1824 * Command status will be saved to same slot as command id.
1826 #define H2M_MAILBOX_STATUS 0x701c
1831 #define H2M_INT_SRC 0x7024
1836 #define H2M_BBP_AGENT 0x7028
1839 * MCU_LEDCS: LED control for MCU Mailbox.
1841 #define MCU_LEDCS_LED_MODE FIELD8(0x1f)
1842 #define MCU_LEDCS_POLARITY FIELD8(0x01)
1846 * Carrier-sense CTS frame base address.
1847 * It's where mac stores carrier-sense frame for carrier-sense function.
1849 #define HW_CS_CTS_BASE 0x7700
1853 * DFS CTS frame base address. It's where mac stores CTS frame for DFS.
1855 #define HW_DFS_CTS_BASE 0x7780
1858 * TXRX control registers - base address 0x3000
1863 * rt2860b UNKNOWN reg use R/O Reg Addr 0x77d0 first..
1865 #define TXRX_CSR1 0x77d0
1868 * HW_DEBUG_SETTING_BASE:
1869 * since NULL frame won't be that long (256 byte)
1870 * We steal 16 tail bytes to save debugging settings
1872 #define HW_DEBUG_SETTING_BASE 0x77f0
1873 #define HW_DEBUG_SETTING_BASE2 0x7770
1877 * In order to support maximum 8 MBSS and its maximum length
1878 * is 512 bytes for each beacon
1879 * Three section discontinue memory segments will be used.
1880 * 1. The original region for BCN 0~3
1881 * 2. Extract memory from FCE table for BCN 4~5
1882 * 3. Extract memory from Pair-wise key table for BCN 6~7
1883 * It occupied those memory of wcid 238~253 for BCN 6
1884 * and wcid 222~237 for BCN 7 (see Security key table memory
1887 * IMPORTANT NOTE: Not sure why legacy driver does this,
1888 * but HW_BEACON_BASE7 is 0x0200 bytes below HW_BEACON_BASE6.
1890 #define HW_BEACON_BASE0 0x7800
1891 #define HW_BEACON_BASE1 0x7a00
1892 #define HW_BEACON_BASE2 0x7c00
1893 #define HW_BEACON_BASE3 0x7e00
1894 #define HW_BEACON_BASE4 0x7200
1895 #define HW_BEACON_BASE5 0x7400
1896 #define HW_BEACON_BASE6 0x5dc0
1897 #define HW_BEACON_BASE7 0x5bc0
1899 #define HW_BEACON_OFFSET(__index) \
1900 (((__index) < 4) ? (HW_BEACON_BASE0 + (__index * 0x0200)) : \
1901 (((__index) < 6) ? (HW_BEACON_BASE4 + ((__index - 4) * 0x0200)) : \
1902 (HW_BEACON_BASE6 - ((__index - 6) * 0x0200))))
1906 * The wordsize of the BBP is 8 bits.
1910 * BBP 1: TX Antenna & Power Control
1913 * 1 - drop tx power by 6dBm,
1914 * 2 - drop tx power by 12dBm,
1915 * 3 - increase tx power by 6dBm
1917 #define BBP1_TX_POWER_CTRL FIELD8(0x07)
1918 #define BBP1_TX_ANTENNA FIELD8(0x18)
1923 #define BBP3_RX_ADC FIELD8(0x03)
1924 #define BBP3_RX_ANTENNA FIELD8(0x18)
1925 #define BBP3_HT40_MINUS FIELD8(0x20)
1926 #define BBP3_ADC_MODE_SWITCH FIELD8(0x40)
1927 #define BBP3_ADC_INIT_MODE FIELD8(0x80)
1932 #define BBP4_TX_BF FIELD8(0x01)
1933 #define BBP4_BANDWIDTH FIELD8(0x18)
1934 #define BBP4_MAC_IF_CTRL FIELD8(0x40)
1939 #define BBP47_TSSI_REPORT_SEL FIELD8(0x03)
1940 #define BBP47_TSSI_UPDATE_REQ FIELD8(0x04)
1941 #define BBP47_TSSI_TSSI_MODE FIELD8(0x18)
1942 #define BBP47_TSSI_ADC6 FIELD8(0x80)
1947 #define BBP109_TX0_POWER FIELD8(0x0f)
1948 #define BBP109_TX1_POWER FIELD8(0xf0)
1953 #define BBP138_RX_ADC1 FIELD8(0x02)
1954 #define BBP138_RX_ADC2 FIELD8(0x04)
1955 #define BBP138_TX_DAC1 FIELD8(0x20)
1956 #define BBP138_TX_DAC2 FIELD8(0x40)
1961 #define BBP152_RX_DEFAULT_ANT FIELD8(0x80)
1965 * The wordsize of the RFCSR is 8 bits.
1971 #define RFCSR1_RF_BLOCK_EN FIELD8(0x01)
1972 #define RFCSR1_PLL_PD FIELD8(0x02)
1973 #define RFCSR1_RX0_PD FIELD8(0x04)
1974 #define RFCSR1_TX0_PD FIELD8(0x08)
1975 #define RFCSR1_RX1_PD FIELD8(0x10)
1976 #define RFCSR1_TX1_PD FIELD8(0x20)
1977 #define RFCSR1_RX2_PD FIELD8(0x40)
1978 #define RFCSR1_TX2_PD FIELD8(0x80)
1983 #define RFCSR2_RESCAL_EN FIELD8(0x80)
1988 #define RFCSR3_K FIELD8(0x0f)
1989 /* Bits [7-4] for RF3320 (RT3370/RT3390), on other chipsets reserved */
1990 #define RFCSR3_PA1_BIAS_CCK FIELD8(0x70);
1991 #define RFCSR3_PA2_CASCODE_BIAS_CCKK FIELD8(0x80);
1996 #define RFCSR5_R1 FIELD8(0x0c)
2001 #define RFCSR6_R1 FIELD8(0x03)
2002 #define RFCSR6_R2 FIELD8(0x40)
2003 #define RFCSR6_TXDIV FIELD8(0x0c)
2008 #define RFCSR7_RF_TUNING FIELD8(0x01)
2009 #define RFCSR7_BIT1 FIELD8(0x02)
2010 #define RFCSR7_BIT2 FIELD8(0x04)
2011 #define RFCSR7_BIT3 FIELD8(0x08)
2012 #define RFCSR7_BIT4 FIELD8(0x10)
2013 #define RFCSR7_BIT5 FIELD8(0x20)
2014 #define RFCSR7_BITS67 FIELD8(0xc0)
2019 #define RFCSR11_R FIELD8(0x03)
2024 #define RFCSR12_TX_POWER FIELD8(0x1f)
2025 #define RFCSR12_DR0 FIELD8(0xe0)
2030 #define RFCSR13_TX_POWER FIELD8(0x1f)
2031 #define RFCSR13_DR0 FIELD8(0xe0)
2036 #define RFCSR15_TX_LO2_EN FIELD8(0x08)
2041 #define RFCSR16_TXMIXER_GAIN FIELD8(0x07)
2046 #define RFCSR17_TXMIXER_GAIN FIELD8(0x07)
2047 #define RFCSR17_TX_LO1_EN FIELD8(0x08)
2048 #define RFCSR17_R FIELD8(0x20)
2049 #define RFCSR17_CODE FIELD8(0x7f)
2054 #define RFCSR20_RX_LO1_EN FIELD8(0x08)
2059 #define RFCSR21_RX_LO2_EN FIELD8(0x08)
2064 #define RFCSR22_BASEBAND_LOOPBACK FIELD8(0x01)
2069 #define RFCSR23_FREQ_OFFSET FIELD8(0x7f)
2074 #define RFCSR24_TX_AGC_FC FIELD8(0x1f)
2075 #define RFCSR24_TX_H20M FIELD8(0x20)
2076 #define RFCSR24_TX_CALIB FIELD8(0x7f)
2081 #define RFCSR27_R1 FIELD8(0x03)
2082 #define RFCSR27_R2 FIELD8(0x04)
2083 #define RFCSR27_R3 FIELD8(0x30)
2084 #define RFCSR27_R4 FIELD8(0x40)
2089 #define RFCSR29_ADC6_TEST FIELD8(0x01)
2090 #define RFCSR29_ADC6_INT_TEST FIELD8(0x02)
2091 #define RFCSR29_RSSI_RESET FIELD8(0x04)
2092 #define RFCSR29_RSSI_ON FIELD8(0x08)
2093 #define RFCSR29_RSSI_RIP_CTRL FIELD8(0x30)
2094 #define RFCSR29_RSSI_GAIN FIELD8(0xc0)
2099 #define RFCSR30_TX_H20M FIELD8(0x02)
2100 #define RFCSR30_RX_H20M FIELD8(0x04)
2101 #define RFCSR30_RX_VCM FIELD8(0x18)
2102 #define RFCSR30_RF_CALIBRATION FIELD8(0x80)
2107 #define RFCSR31_RX_AGC_FC FIELD8(0x1f)
2108 #define RFCSR31_RX_H20M FIELD8(0x20)
2109 #define RFCSR31_RX_CALIB FIELD8(0x7f)
2114 #define RFCSR38_RX_LO1_EN FIELD8(0x20)
2119 #define RFCSR39_RX_LO2_EN FIELD8(0x80)
2124 #define RFCSR49_TX FIELD8(0x3f)
2129 #define RFCSR50_TX FIELD8(0x3f)
2138 #define RF2_ANTENNA_RX2 FIELD32(0x00000040)
2139 #define RF2_ANTENNA_TX1 FIELD32(0x00004000)
2140 #define RF2_ANTENNA_RX1 FIELD32(0x00020000)
2145 #define RF3_TXPOWER_G FIELD32(0x00003e00)
2146 #define RF3_TXPOWER_A_7DBM_BOOST FIELD32(0x00000200)
2147 #define RF3_TXPOWER_A FIELD32(0x00003c00)
2152 #define RF4_TXPOWER_G FIELD32(0x000007c0)
2153 #define RF4_TXPOWER_A_7DBM_BOOST FIELD32(0x00000040)
2154 #define RF4_TXPOWER_A FIELD32(0x00000780)
2155 #define RF4_FREQ_OFFSET FIELD32(0x001f8000)
2156 #define RF4_HT40 FIELD32(0x00200000)
2160 * The wordsize of the EEPROM is 16 bits.
2166 #define EEPROM_CHIP_ID 0x0000
2171 #define EEPROM_VERSION 0x0001
2172 #define EEPROM_VERSION_FAE FIELD16(0x00ff)
2173 #define EEPROM_VERSION_VERSION FIELD16(0xff00)
2178 #define EEPROM_MAC_ADDR_0 0x0002
2179 #define EEPROM_MAC_ADDR_BYTE0 FIELD16(0x00ff)
2180 #define EEPROM_MAC_ADDR_BYTE1 FIELD16(0xff00)
2181 #define EEPROM_MAC_ADDR_1 0x0003
2182 #define EEPROM_MAC_ADDR_BYTE2 FIELD16(0x00ff)
2183 #define EEPROM_MAC_ADDR_BYTE3 FIELD16(0xff00)
2184 #define EEPROM_MAC_ADDR_2 0x0004
2185 #define EEPROM_MAC_ADDR_BYTE4 FIELD16(0x00ff)
2186 #define EEPROM_MAC_ADDR_BYTE5 FIELD16(0xff00)
2189 * EEPROM NIC Configuration 0
2190 * RXPATH: 1: 1R, 2: 2R, 3: 3R
2191 * TXPATH: 1: 1T, 2: 2T, 3: 3T
2192 * RF_TYPE: RFIC type
2194 #define EEPROM_NIC_CONF0 0x001a
2195 #define EEPROM_NIC_CONF0_RXPATH FIELD16(0x000f)
2196 #define EEPROM_NIC_CONF0_TXPATH FIELD16(0x00f0)
2197 #define EEPROM_NIC_CONF0_RF_TYPE FIELD16(0x0f00)
2200 * EEPROM NIC Configuration 1
2201 * HW_RADIO: 0: disable, 1: enable
2202 * EXTERNAL_TX_ALC: 0: disable, 1: enable
2203 * EXTERNAL_LNA_2G: 0: disable, 1: enable
2204 * EXTERNAL_LNA_5G: 0: disable, 1: enable
2205 * CARDBUS_ACCEL: 0: enable, 1: disable
2206 * BW40M_SB_2G: 0: disable, 1: enable
2207 * BW40M_SB_5G: 0: disable, 1: enable
2208 * WPS_PBC: 0: disable, 1: enable
2209 * BW40M_2G: 0: enable, 1: disable
2210 * BW40M_5G: 0: enable, 1: disable
2211 * BROADBAND_EXT_LNA: 0: disable, 1: enable
2212 * ANT_DIVERSITY: 00: Disable, 01: Diversity,
2213 * 10: Main antenna, 11: Aux antenna
2214 * INTERNAL_TX_ALC: 0: disable, 1: enable
2215 * BT_COEXIST: 0: disable, 1: enable
2216 * DAC_TEST: 0: disable, 1: enable
2218 #define EEPROM_NIC_CONF1 0x001b
2219 #define EEPROM_NIC_CONF1_HW_RADIO FIELD16(0x0001)
2220 #define EEPROM_NIC_CONF1_EXTERNAL_TX_ALC FIELD16(0x0002)
2221 #define EEPROM_NIC_CONF1_EXTERNAL_LNA_2G FIELD16(0x0004)
2222 #define EEPROM_NIC_CONF1_EXTERNAL_LNA_5G FIELD16(0x0008)
2223 #define EEPROM_NIC_CONF1_CARDBUS_ACCEL FIELD16(0x0010)
2224 #define EEPROM_NIC_CONF1_BW40M_SB_2G FIELD16(0x0020)
2225 #define EEPROM_NIC_CONF1_BW40M_SB_5G FIELD16(0x0040)
2226 #define EEPROM_NIC_CONF1_WPS_PBC FIELD16(0x0080)
2227 #define EEPROM_NIC_CONF1_BW40M_2G FIELD16(0x0100)
2228 #define EEPROM_NIC_CONF1_BW40M_5G FIELD16(0x0200)
2229 #define EEPROM_NIC_CONF1_BROADBAND_EXT_LNA FIELD16(0x400)
2230 #define EEPROM_NIC_CONF1_ANT_DIVERSITY FIELD16(0x1800)
2231 #define EEPROM_NIC_CONF1_INTERNAL_TX_ALC FIELD16(0x2000)
2232 #define EEPROM_NIC_CONF1_BT_COEXIST FIELD16(0x4000)
2233 #define EEPROM_NIC_CONF1_DAC_TEST FIELD16(0x8000)
2238 #define EEPROM_FREQ 0x001d
2239 #define EEPROM_FREQ_OFFSET FIELD16(0x00ff)
2240 #define EEPROM_FREQ_LED_MODE FIELD16(0x7f00)
2241 #define EEPROM_FREQ_LED_POLARITY FIELD16(0x1000)
2245 * POLARITY_RDY_G: Polarity RDY_G setting.
2246 * POLARITY_RDY_A: Polarity RDY_A setting.
2247 * POLARITY_ACT: Polarity ACT setting.
2248 * POLARITY_GPIO_0: Polarity GPIO0 setting.
2249 * POLARITY_GPIO_1: Polarity GPIO1 setting.
2250 * POLARITY_GPIO_2: Polarity GPIO2 setting.
2251 * POLARITY_GPIO_3: Polarity GPIO3 setting.
2252 * POLARITY_GPIO_4: Polarity GPIO4 setting.
2253 * LED_MODE: Led mode.
2255 #define EEPROM_LED_AG_CONF 0x001e
2256 #define EEPROM_LED_ACT_CONF 0x001f
2257 #define EEPROM_LED_POLARITY 0x0020
2258 #define EEPROM_LED_POLARITY_RDY_BG FIELD16(0x0001)
2259 #define EEPROM_LED_POLARITY_RDY_A FIELD16(0x0002)
2260 #define EEPROM_LED_POLARITY_ACT FIELD16(0x0004)
2261 #define EEPROM_LED_POLARITY_GPIO_0 FIELD16(0x0008)
2262 #define EEPROM_LED_POLARITY_GPIO_1 FIELD16(0x0010)
2263 #define EEPROM_LED_POLARITY_GPIO_2 FIELD16(0x0020)
2264 #define EEPROM_LED_POLARITY_GPIO_3 FIELD16(0x0040)
2265 #define EEPROM_LED_POLARITY_GPIO_4 FIELD16(0x0080)
2266 #define EEPROM_LED_LED_MODE FIELD16(0x1f00)
2269 * EEPROM NIC Configuration 2
2270 * RX_STREAM: 0: Reserved, 1: 1 Stream, 2: 2 Stream
2271 * TX_STREAM: 0: Reserved, 1: 1 Stream, 2: 2 Stream
2272 * CRYSTAL: 00: Reserved, 01: One crystal, 10: Two crystal, 11: Reserved
2274 #define EEPROM_NIC_CONF2 0x0021
2275 #define EEPROM_NIC_CONF2_RX_STREAM FIELD16(0x000f)
2276 #define EEPROM_NIC_CONF2_TX_STREAM FIELD16(0x00f0)
2277 #define EEPROM_NIC_CONF2_CRYSTAL FIELD16(0x0600)
2282 #define EEPROM_LNA 0x0022
2283 #define EEPROM_LNA_BG FIELD16(0x00ff)
2284 #define EEPROM_LNA_A0 FIELD16(0xff00)
2287 * EEPROM RSSI BG offset
2289 #define EEPROM_RSSI_BG 0x0023
2290 #define EEPROM_RSSI_BG_OFFSET0 FIELD16(0x00ff)
2291 #define EEPROM_RSSI_BG_OFFSET1 FIELD16(0xff00)
2294 * EEPROM RSSI BG2 offset
2296 #define EEPROM_RSSI_BG2 0x0024
2297 #define EEPROM_RSSI_BG2_OFFSET2 FIELD16(0x00ff)
2298 #define EEPROM_RSSI_BG2_LNA_A1 FIELD16(0xff00)
2301 * EEPROM TXMIXER GAIN BG offset (note overlaps with EEPROM RSSI BG2).
2303 #define EEPROM_TXMIXER_GAIN_BG 0x0024
2304 #define EEPROM_TXMIXER_GAIN_BG_VAL FIELD16(0x0007)
2307 * EEPROM RSSI A offset
2309 #define EEPROM_RSSI_A 0x0025
2310 #define EEPROM_RSSI_A_OFFSET0 FIELD16(0x00ff)
2311 #define EEPROM_RSSI_A_OFFSET1 FIELD16(0xff00)
2314 * EEPROM RSSI A2 offset
2316 #define EEPROM_RSSI_A2 0x0026
2317 #define EEPROM_RSSI_A2_OFFSET2 FIELD16(0x00ff)
2318 #define EEPROM_RSSI_A2_LNA_A2 FIELD16(0xff00)
2321 * EEPROM TXMIXER GAIN A offset (note overlaps with EEPROM RSSI A2).
2323 #define EEPROM_TXMIXER_GAIN_A 0x0026
2324 #define EEPROM_TXMIXER_GAIN_A_VAL FIELD16(0x0007)
2327 * EEPROM EIRP Maximum TX power values(unit: dbm)
2329 #define EEPROM_EIRP_MAX_TX_POWER 0x0027
2330 #define EEPROM_EIRP_MAX_TX_POWER_2GHZ FIELD16(0x00ff)
2331 #define EEPROM_EIRP_MAX_TX_POWER_5GHZ FIELD16(0xff00)
2334 * EEPROM TXpower delta: 20MHZ AND 40 MHZ use different power.
2335 * This is delta in 40MHZ.
2336 * VALUE: Tx Power dalta value, MAX=4(unit: dbm)
2337 * TYPE: 1: Plus the delta value, 0: minus the delta value
2338 * ENABLE: enable tx power compensation for 40BW
2340 #define EEPROM_TXPOWER_DELTA 0x0028
2341 #define EEPROM_TXPOWER_DELTA_VALUE_2G FIELD16(0x003f)
2342 #define EEPROM_TXPOWER_DELTA_TYPE_2G FIELD16(0x0040)
2343 #define EEPROM_TXPOWER_DELTA_ENABLE_2G FIELD16(0x0080)
2344 #define EEPROM_TXPOWER_DELTA_VALUE_5G FIELD16(0x3f00)
2345 #define EEPROM_TXPOWER_DELTA_TYPE_5G FIELD16(0x4000)
2346 #define EEPROM_TXPOWER_DELTA_ENABLE_5G FIELD16(0x8000)
2349 * EEPROM TXPOWER 802.11BG
2351 #define EEPROM_TXPOWER_BG1 0x0029
2352 #define EEPROM_TXPOWER_BG2 0x0030
2353 #define EEPROM_TXPOWER_BG_SIZE 7
2354 #define EEPROM_TXPOWER_BG_1 FIELD16(0x00ff)
2355 #define EEPROM_TXPOWER_BG_2 FIELD16(0xff00)
2358 * EEPROM temperature compensation boundaries 802.11BG
2359 * MINUS4: If the actual TSSI is below this boundary, tx power needs to be
2360 * reduced by (agc_step * -4)
2361 * MINUS3: If the actual TSSI is below this boundary, tx power needs to be
2362 * reduced by (agc_step * -3)
2364 #define EEPROM_TSSI_BOUND_BG1 0x0037
2365 #define EEPROM_TSSI_BOUND_BG1_MINUS4 FIELD16(0x00ff)
2366 #define EEPROM_TSSI_BOUND_BG1_MINUS3 FIELD16(0xff00)
2369 * EEPROM temperature compensation boundaries 802.11BG
2370 * MINUS2: If the actual TSSI is below this boundary, tx power needs to be
2371 * reduced by (agc_step * -2)
2372 * MINUS1: If the actual TSSI is below this boundary, tx power needs to be
2373 * reduced by (agc_step * -1)
2375 #define EEPROM_TSSI_BOUND_BG2 0x0038
2376 #define EEPROM_TSSI_BOUND_BG2_MINUS2 FIELD16(0x00ff)
2377 #define EEPROM_TSSI_BOUND_BG2_MINUS1 FIELD16(0xff00)
2380 * EEPROM temperature compensation boundaries 802.11BG
2381 * REF: Reference TSSI value, no tx power changes needed
2382 * PLUS1: If the actual TSSI is above this boundary, tx power needs to be
2383 * increased by (agc_step * 1)
2385 #define EEPROM_TSSI_BOUND_BG3 0x0039
2386 #define EEPROM_TSSI_BOUND_BG3_REF FIELD16(0x00ff)
2387 #define EEPROM_TSSI_BOUND_BG3_PLUS1 FIELD16(0xff00)
2390 * EEPROM temperature compensation boundaries 802.11BG
2391 * PLUS2: If the actual TSSI is above this boundary, tx power needs to be
2392 * increased by (agc_step * 2)
2393 * PLUS3: If the actual TSSI is above this boundary, tx power needs to be
2394 * increased by (agc_step * 3)
2396 #define EEPROM_TSSI_BOUND_BG4 0x003a
2397 #define EEPROM_TSSI_BOUND_BG4_PLUS2 FIELD16(0x00ff)
2398 #define EEPROM_TSSI_BOUND_BG4_PLUS3 FIELD16(0xff00)
2401 * EEPROM temperature compensation boundaries 802.11BG
2402 * PLUS4: If the actual TSSI is above this boundary, tx power needs to be
2403 * increased by (agc_step * 4)
2404 * AGC_STEP: Temperature compensation step.
2406 #define EEPROM_TSSI_BOUND_BG5 0x003b
2407 #define EEPROM_TSSI_BOUND_BG5_PLUS4 FIELD16(0x00ff)
2408 #define EEPROM_TSSI_BOUND_BG5_AGC_STEP FIELD16(0xff00)
2411 * EEPROM TXPOWER 802.11A
2413 #define EEPROM_TXPOWER_A1 0x003c
2414 #define EEPROM_TXPOWER_A2 0x0053
2415 #define EEPROM_TXPOWER_A_SIZE 6
2416 #define EEPROM_TXPOWER_A_1 FIELD16(0x00ff)
2417 #define EEPROM_TXPOWER_A_2 FIELD16(0xff00)
2420 * EEPROM temperature compensation boundaries 802.11A
2421 * MINUS4: If the actual TSSI is below this boundary, tx power needs to be
2422 * reduced by (agc_step * -4)
2423 * MINUS3: If the actual TSSI is below this boundary, tx power needs to be
2424 * reduced by (agc_step * -3)
2426 #define EEPROM_TSSI_BOUND_A1 0x006a
2427 #define EEPROM_TSSI_BOUND_A1_MINUS4 FIELD16(0x00ff)
2428 #define EEPROM_TSSI_BOUND_A1_MINUS3 FIELD16(0xff00)
2431 * EEPROM temperature compensation boundaries 802.11A
2432 * MINUS2: If the actual TSSI is below this boundary, tx power needs to be
2433 * reduced by (agc_step * -2)
2434 * MINUS1: If the actual TSSI is below this boundary, tx power needs to be
2435 * reduced by (agc_step * -1)
2437 #define EEPROM_TSSI_BOUND_A2 0x006b
2438 #define EEPROM_TSSI_BOUND_A2_MINUS2 FIELD16(0x00ff)
2439 #define EEPROM_TSSI_BOUND_A2_MINUS1 FIELD16(0xff00)
2442 * EEPROM temperature compensation boundaries 802.11A
2443 * REF: Reference TSSI value, no tx power changes needed
2444 * PLUS1: If the actual TSSI is above this boundary, tx power needs to be
2445 * increased by (agc_step * 1)
2447 #define EEPROM_TSSI_BOUND_A3 0x006c
2448 #define EEPROM_TSSI_BOUND_A3_REF FIELD16(0x00ff)
2449 #define EEPROM_TSSI_BOUND_A3_PLUS1 FIELD16(0xff00)
2452 * EEPROM temperature compensation boundaries 802.11A
2453 * PLUS2: If the actual TSSI is above this boundary, tx power needs to be
2454 * increased by (agc_step * 2)
2455 * PLUS3: If the actual TSSI is above this boundary, tx power needs to be
2456 * increased by (agc_step * 3)
2458 #define EEPROM_TSSI_BOUND_A4 0x006d
2459 #define EEPROM_TSSI_BOUND_A4_PLUS2 FIELD16(0x00ff)
2460 #define EEPROM_TSSI_BOUND_A4_PLUS3 FIELD16(0xff00)
2463 * EEPROM temperature compensation boundaries 802.11A
2464 * PLUS4: If the actual TSSI is above this boundary, tx power needs to be
2465 * increased by (agc_step * 4)
2466 * AGC_STEP: Temperature compensation step.
2468 #define EEPROM_TSSI_BOUND_A5 0x006e
2469 #define EEPROM_TSSI_BOUND_A5_PLUS4 FIELD16(0x00ff)
2470 #define EEPROM_TSSI_BOUND_A5_AGC_STEP FIELD16(0xff00)
2473 * EEPROM TXPOWER by rate: tx power per tx rate for HT20 mode
2475 #define EEPROM_TXPOWER_BYRATE 0x006f
2476 #define EEPROM_TXPOWER_BYRATE_SIZE 9
2478 #define EEPROM_TXPOWER_BYRATE_RATE0 FIELD16(0x000f)
2479 #define EEPROM_TXPOWER_BYRATE_RATE1 FIELD16(0x00f0)
2480 #define EEPROM_TXPOWER_BYRATE_RATE2 FIELD16(0x0f00)
2481 #define EEPROM_TXPOWER_BYRATE_RATE3 FIELD16(0xf000)
2486 #define EEPROM_BBP_START 0x0078
2487 #define EEPROM_BBP_SIZE 16
2488 #define EEPROM_BBP_VALUE FIELD16(0x00ff)
2489 #define EEPROM_BBP_REG_ID FIELD16(0xff00)
2492 * MCU mailbox commands.
2493 * MCU_SLEEP - go to power-save mode.
2494 * arg1: 1: save as much power as possible, 0: save less power.
2495 * status: 1: success, 2: already asleep,
2496 * 3: maybe MAC is busy so can't finish this task.
2498 * arg0: 0: do power-saving, NOT turn off radio.
2500 #define MCU_SLEEP 0x30
2501 #define MCU_WAKEUP 0x31
2502 #define MCU_RADIO_OFF 0x35
2503 #define MCU_CURRENT 0x36
2504 #define MCU_LED 0x50
2505 #define MCU_LED_STRENGTH 0x51
2506 #define MCU_LED_AG_CONF 0x52
2507 #define MCU_LED_ACT_CONF 0x53
2508 #define MCU_LED_LED_POLARITY 0x54
2509 #define MCU_RADAR 0x60
2510 #define MCU_BOOT_SIGNAL 0x72
2511 #define MCU_ANT_SELECT 0X73
2512 #define MCU_BBP_SIGNAL 0x80
2513 #define MCU_POWER_SAVE 0x83
2514 #define MCU_BAND_SELECT 0x91
2517 * MCU mailbox tokens
2519 #define TOKEN_SLEEP 1
2520 #define TOKEN_RADIO_OFF 2
2521 #define TOKEN_WAKEUP 3
2525 * DMA descriptor defines.
2527 #define TXWI_DESC_SIZE (4 * sizeof(__le32))
2528 #define RXWI_DESC_SIZE (4 * sizeof(__le32))
2536 * FRAG: 1 To inform TKIP engine this is a fragment.
2537 * MIMO_PS: The remote peer is in dynamic MIMO-PS mode
2538 * TX_OP: 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs
2539 * BW: Channel bandwidth 0:20MHz, 1:40 MHz (for legacy rates this will
2540 * duplicate the frame to both channels).
2541 * STBC: 1: STBC support MCS =0-7, 2,3 : RESERVED
2542 * AMPDU: 1: this frame is eligible for AMPDU aggregation, the hw will
2543 * aggregate consecutive frames with the same RA and QoS TID. If
2544 * a frame A with the same RA and QoS TID but AMPDU=0 is queued
2545 * directly after a frame B with AMPDU=1, frame A might still
2546 * get aggregated into the AMPDU started by frame B. So, setting
2547 * AMPDU to 0 does _not_ necessarily mean the frame is sent as
2548 * MPDU, it can still end up in an AMPDU if the previous frame
2549 * was tagged as AMPDU.
2551 #define TXWI_W0_FRAG FIELD32(0x00000001)
2552 #define TXWI_W0_MIMO_PS FIELD32(0x00000002)
2553 #define TXWI_W0_CF_ACK FIELD32(0x00000004)
2554 #define TXWI_W0_TS FIELD32(0x00000008)
2555 #define TXWI_W0_AMPDU FIELD32(0x00000010)
2556 #define TXWI_W0_MPDU_DENSITY FIELD32(0x000000e0)
2557 #define TXWI_W0_TX_OP FIELD32(0x00000300)
2558 #define TXWI_W0_MCS FIELD32(0x007f0000)
2559 #define TXWI_W0_BW FIELD32(0x00800000)
2560 #define TXWI_W0_SHORT_GI FIELD32(0x01000000)
2561 #define TXWI_W0_STBC FIELD32(0x06000000)
2562 #define TXWI_W0_IFS FIELD32(0x08000000)
2563 #define TXWI_W0_PHYMODE FIELD32(0xc0000000)
2567 * ACK: 0: No Ack needed, 1: Ack needed
2568 * NSEQ: 0: Don't assign hw sequence number, 1: Assign hw sequence number
2569 * BW_WIN_SIZE: BA windows size of the recipient
2570 * WIRELESS_CLI_ID: Client ID for WCID table access
2571 * MPDU_TOTAL_BYTE_COUNT: Length of 802.11 frame
2572 * PACKETID: Will be latched into the TX_STA_FIFO register once the according
2573 * frame was processed. If multiple frames are aggregated together
2574 * (AMPDU==1) the reported tx status will always contain the packet
2575 * id of the first frame. 0: Don't report tx status for this frame.
2576 * PACKETID_QUEUE: Part of PACKETID, This is the queue index (0-3)
2577 * PACKETID_ENTRY: Part of PACKETID, THis is the queue entry index (1-3)
2578 * This identification number is calculated by ((idx % 3) + 1).
2579 * The (+1) is required to prevent PACKETID to become 0.
2581 #define TXWI_W1_ACK FIELD32(0x00000001)
2582 #define TXWI_W1_NSEQ FIELD32(0x00000002)
2583 #define TXWI_W1_BW_WIN_SIZE FIELD32(0x000000fc)
2584 #define TXWI_W1_WIRELESS_CLI_ID FIELD32(0x0000ff00)
2585 #define TXWI_W1_MPDU_TOTAL_BYTE_COUNT FIELD32(0x0fff0000)
2586 #define TXWI_W1_PACKETID FIELD32(0xf0000000)
2587 #define TXWI_W1_PACKETID_QUEUE FIELD32(0x30000000)
2588 #define TXWI_W1_PACKETID_ENTRY FIELD32(0xc0000000)
2593 #define TXWI_W2_IV FIELD32(0xffffffff)
2598 #define TXWI_W3_EIV FIELD32(0xffffffff)
2607 #define RXWI_W0_WIRELESS_CLI_ID FIELD32(0x000000ff)
2608 #define RXWI_W0_KEY_INDEX FIELD32(0x00000300)
2609 #define RXWI_W0_BSSID FIELD32(0x00001c00)
2610 #define RXWI_W0_UDF FIELD32(0x0000e000)
2611 #define RXWI_W0_MPDU_TOTAL_BYTE_COUNT FIELD32(0x0fff0000)
2612 #define RXWI_W0_TID FIELD32(0xf0000000)
2617 #define RXWI_W1_FRAG FIELD32(0x0000000f)
2618 #define RXWI_W1_SEQUENCE FIELD32(0x0000fff0)
2619 #define RXWI_W1_MCS FIELD32(0x007f0000)
2620 #define RXWI_W1_BW FIELD32(0x00800000)
2621 #define RXWI_W1_SHORT_GI FIELD32(0x01000000)
2622 #define RXWI_W1_STBC FIELD32(0x06000000)
2623 #define RXWI_W1_PHYMODE FIELD32(0xc0000000)
2628 #define RXWI_W2_RSSI0 FIELD32(0x000000ff)
2629 #define RXWI_W2_RSSI1 FIELD32(0x0000ff00)
2630 #define RXWI_W2_RSSI2 FIELD32(0x00ff0000)
2635 #define RXWI_W3_SNR0 FIELD32(0x000000ff)
2636 #define RXWI_W3_SNR1 FIELD32(0x0000ff00)
2639 * Macros for converting txpower from EEPROM to mac80211 value
2640 * and from mac80211 value to register value.
2642 #define MIN_G_TXPOWER 0
2643 #define MIN_A_TXPOWER -7
2644 #define MAX_G_TXPOWER 31
2645 #define MAX_A_TXPOWER 15
2646 #define DEFAULT_TXPOWER 5
2648 #define TXPOWER_G_FROM_DEV(__txpower) \
2649 ((__txpower) > MAX_G_TXPOWER) ? DEFAULT_TXPOWER : (__txpower)
2651 #define TXPOWER_G_TO_DEV(__txpower) \
2652 clamp_t(char, __txpower, MIN_G_TXPOWER, MAX_G_TXPOWER)
2654 #define TXPOWER_A_FROM_DEV(__txpower) \
2655 ((__txpower) > MAX_A_TXPOWER) ? DEFAULT_TXPOWER : (__txpower)
2657 #define TXPOWER_A_TO_DEV(__txpower) \
2658 clamp_t(char, __txpower, MIN_A_TXPOWER, MAX_A_TXPOWER)
2661 * Board's maximun TX power limitation
2663 #define EIRP_MAX_TX_POWER_LIMIT 0x50
2666 * Number of TBTT intervals after which we have to adjust
2667 * the hw beacon timer.
2669 #define BCN_TBTT_OFFSET 64
2672 * RT2800 driver data structure
2674 struct rt2800_drv_data {
2675 u8 calibration_bw20;
2676 u8 calibration_bw40;
2679 u8 txmixer_gain_24g;
2681 unsigned int tbtt_tick;
2684 #endif /* RT2800_H */