aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800.h568
1 files changed, 474 insertions, 94 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index ed4ebcdde7c9..f67bc9b31b28 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -1,5 +1,6 @@
1/* 1/*
2 Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com> 2 Copyright (C) 2004 - 2010 Ivo van Doorn <IvDoorn@gmail.com>
3 Copyright (C) 2010 Willow Garage <http://www.willowgarage.com>
3 Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com> 4 Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com>
4 Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org> 5 Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
5 Copyright (C) 2009 Luis Correia <luis.f.correia@gmail.com> 6 Copyright (C) 2009 Luis Correia <luis.f.correia@gmail.com>
@@ -45,7 +46,13 @@
45 * RF2020 2.4G B/G 46 * RF2020 2.4G B/G
46 * RF3021 2.4G 1T2R 47 * RF3021 2.4G 1T2R
47 * RF3022 2.4G 2T2R 48 * RF3022 2.4G 2T2R
48 * RF3052 2.4G 2T2R 49 * RF3052 2.4G/5G 2T2R
50 * RF2853 2.4G/5G 3T3R
51 * RF3320 2.4G 1T1R(RT3350/RT3370/RT3390)
52 * RF3322 2.4G 2T2R(RT3352/RT3371/RT3372/RT3391/RT3392)
53 * RF3853 2.4G/5G 3T3R(RT3883/RT3563/RT3573/RT3593/RT3662)
54 * RF5370 2.4G 1T1R
55 * RF5390 2.4G 1T1R
49 */ 56 */
50#define RF2820 0x0001 57#define RF2820 0x0001
51#define RF2850 0x0002 58#define RF2850 0x0002
@@ -56,7 +63,12 @@
56#define RF3021 0x0007 63#define RF3021 0x0007
57#define RF3022 0x0008 64#define RF3022 0x0008
58#define RF3052 0x0009 65#define RF3052 0x0009
66#define RF2853 0x000a
59#define RF3320 0x000b 67#define RF3320 0x000b
68#define RF3322 0x000c
69#define RF3853 0x000d
70#define RF5370 0x5370
71#define RF5390 0x5390
60 72
61/* 73/*
62 * Chipset revisions. 74 * Chipset revisions.
@@ -69,6 +81,7 @@
69#define REV_RT3071E 0x0211 81#define REV_RT3071E 0x0211
70#define REV_RT3090E 0x0211 82#define REV_RT3090E 0x0211
71#define REV_RT3390E 0x0211 83#define REV_RT3390E 0x0211
84#define REV_RT5390F 0x0502
72 85
73/* 86/*
74 * Signal information. 87 * Signal information.
@@ -113,6 +126,13 @@
113#define E2PROM_CSR_RELOAD FIELD32(0x00000080) 126#define E2PROM_CSR_RELOAD FIELD32(0x00000080)
114 127
115/* 128/*
129 * AUX_CTRL: Aux/PCI-E related configuration
130 */
131#define AUX_CTRL 0x10c
132#define AUX_CTRL_WAKE_PCIE_EN FIELD32(0x00000002)
133#define AUX_CTRL_FORCE_PCIE_CLK FIELD32(0x00000400)
134
135/*
116 * OPT_14: Unknown register used by rt3xxx devices. 136 * OPT_14: Unknown register used by rt3xxx devices.
117 */ 137 */
118#define OPT_14_CSR 0x0114 138#define OPT_14_CSR 0x0114
@@ -205,10 +225,10 @@
205 225
206/* 226/*
207 * WMM_AIFSN_CFG: Aifsn for each EDCA AC 227 * WMM_AIFSN_CFG: Aifsn for each EDCA AC
208 * AIFSN0: AC_BE 228 * AIFSN0: AC_VO
209 * AIFSN1: AC_BK 229 * AIFSN1: AC_VI
210 * AIFSN2: AC_VI 230 * AIFSN2: AC_BE
211 * AIFSN3: AC_VO 231 * AIFSN3: AC_BK
212 */ 232 */
213#define WMM_AIFSN_CFG 0x0214 233#define WMM_AIFSN_CFG 0x0214
214#define WMM_AIFSN_CFG_AIFSN0 FIELD32(0x0000000f) 234#define WMM_AIFSN_CFG_AIFSN0 FIELD32(0x0000000f)
@@ -218,10 +238,10 @@
218 238
219/* 239/*
220 * WMM_CWMIN_CSR: CWmin for each EDCA AC 240 * WMM_CWMIN_CSR: CWmin for each EDCA AC
221 * CWMIN0: AC_BE 241 * CWMIN0: AC_VO
222 * CWMIN1: AC_BK 242 * CWMIN1: AC_VI
223 * CWMIN2: AC_VI 243 * CWMIN2: AC_BE
224 * CWMIN3: AC_VO 244 * CWMIN3: AC_BK
225 */ 245 */
226#define WMM_CWMIN_CFG 0x0218 246#define WMM_CWMIN_CFG 0x0218
227#define WMM_CWMIN_CFG_CWMIN0 FIELD32(0x0000000f) 247#define WMM_CWMIN_CFG_CWMIN0 FIELD32(0x0000000f)
@@ -231,10 +251,10 @@
231 251
232/* 252/*
233 * WMM_CWMAX_CSR: CWmax for each EDCA AC 253 * WMM_CWMAX_CSR: CWmax for each EDCA AC
234 * CWMAX0: AC_BE 254 * CWMAX0: AC_VO
235 * CWMAX1: AC_BK 255 * CWMAX1: AC_VI
236 * CWMAX2: AC_VI 256 * CWMAX2: AC_BE
237 * CWMAX3: AC_VO 257 * CWMAX3: AC_BK
238 */ 258 */
239#define WMM_CWMAX_CFG 0x021c 259#define WMM_CWMAX_CFG 0x021c
240#define WMM_CWMAX_CFG_CWMAX0 FIELD32(0x0000000f) 260#define WMM_CWMAX_CFG_CWMAX0 FIELD32(0x0000000f)
@@ -243,18 +263,18 @@
243#define WMM_CWMAX_CFG_CWMAX3 FIELD32(0x0000f000) 263#define WMM_CWMAX_CFG_CWMAX3 FIELD32(0x0000f000)
244 264
245/* 265/*
246 * AC_TXOP0: AC_BK/AC_BE TXOP register 266 * AC_TXOP0: AC_VO/AC_VI TXOP register
247 * AC0TXOP: AC_BK in unit of 32us 267 * AC0TXOP: AC_VO in unit of 32us
248 * AC1TXOP: AC_BE in unit of 32us 268 * AC1TXOP: AC_VI in unit of 32us
249 */ 269 */
250#define WMM_TXOP0_CFG 0x0220 270#define WMM_TXOP0_CFG 0x0220
251#define WMM_TXOP0_CFG_AC0TXOP FIELD32(0x0000ffff) 271#define WMM_TXOP0_CFG_AC0TXOP FIELD32(0x0000ffff)
252#define WMM_TXOP0_CFG_AC1TXOP FIELD32(0xffff0000) 272#define WMM_TXOP0_CFG_AC1TXOP FIELD32(0xffff0000)
253 273
254/* 274/*
255 * AC_TXOP1: AC_VO/AC_VI TXOP register 275 * AC_TXOP1: AC_BE/AC_BK TXOP register
256 * AC2TXOP: AC_VI in unit of 32us 276 * AC2TXOP: AC_BE in unit of 32us
257 * AC3TXOP: AC_VO in unit of 32us 277 * AC3TXOP: AC_BK in unit of 32us
258 */ 278 */
259#define WMM_TXOP1_CFG 0x0224 279#define WMM_TXOP1_CFG 0x0224
260#define WMM_TXOP1_CFG_AC2TXOP FIELD32(0x0000ffff) 280#define WMM_TXOP1_CFG_AC2TXOP FIELD32(0x0000ffff)
@@ -262,6 +282,7 @@
262 282
263/* 283/*
264 * GPIO_CTRL_CFG: 284 * GPIO_CTRL_CFG:
285 * GPIOD: GPIO direction, 0: Output, 1: Input
265 */ 286 */
266#define GPIO_CTRL_CFG 0x0228 287#define GPIO_CTRL_CFG 0x0228
267#define GPIO_CTRL_CFG_BIT0 FIELD32(0x00000001) 288#define GPIO_CTRL_CFG_BIT0 FIELD32(0x00000001)
@@ -272,7 +293,14 @@
272#define GPIO_CTRL_CFG_BIT5 FIELD32(0x00000020) 293#define GPIO_CTRL_CFG_BIT5 FIELD32(0x00000020)
273#define GPIO_CTRL_CFG_BIT6 FIELD32(0x00000040) 294#define GPIO_CTRL_CFG_BIT6 FIELD32(0x00000040)
274#define GPIO_CTRL_CFG_BIT7 FIELD32(0x00000080) 295#define GPIO_CTRL_CFG_BIT7 FIELD32(0x00000080)
275#define GPIO_CTRL_CFG_BIT8 FIELD32(0x00000100) 296#define GPIO_CTRL_CFG_GPIOD_BIT0 FIELD32(0x00000100)
297#define GPIO_CTRL_CFG_GPIOD_BIT1 FIELD32(0x00000200)
298#define GPIO_CTRL_CFG_GPIOD_BIT2 FIELD32(0x00000400)
299#define GPIO_CTRL_CFG_GPIOD_BIT3 FIELD32(0x00000800)
300#define GPIO_CTRL_CFG_GPIOD_BIT4 FIELD32(0x00001000)
301#define GPIO_CTRL_CFG_GPIOD_BIT5 FIELD32(0x00002000)
302#define GPIO_CTRL_CFG_GPIOD_BIT6 FIELD32(0x00004000)
303#define GPIO_CTRL_CFG_GPIOD_BIT7 FIELD32(0x00008000)
276 304
277/* 305/*
278 * MCU_CMD_CFG 306 * MCU_CMD_CFG
@@ -280,7 +308,7 @@
280#define MCU_CMD_CFG 0x022c 308#define MCU_CMD_CFG 0x022c
281 309
282/* 310/*
283 * AC_BK register offsets 311 * AC_VO register offsets
284 */ 312 */
285#define TX_BASE_PTR0 0x0230 313#define TX_BASE_PTR0 0x0230
286#define TX_MAX_CNT0 0x0234 314#define TX_MAX_CNT0 0x0234
@@ -288,7 +316,7 @@
288#define TX_DTX_IDX0 0x023c 316#define TX_DTX_IDX0 0x023c
289 317
290/* 318/*
291 * AC_BE register offsets 319 * AC_VI register offsets
292 */ 320 */
293#define TX_BASE_PTR1 0x0240 321#define TX_BASE_PTR1 0x0240
294#define TX_MAX_CNT1 0x0244 322#define TX_MAX_CNT1 0x0244
@@ -296,7 +324,7 @@
296#define TX_DTX_IDX1 0x024c 324#define TX_DTX_IDX1 0x024c
297 325
298/* 326/*
299 * AC_VI register offsets 327 * AC_BE register offsets
300 */ 328 */
301#define TX_BASE_PTR2 0x0250 329#define TX_BASE_PTR2 0x0250
302#define TX_MAX_CNT2 0x0254 330#define TX_MAX_CNT2 0x0254
@@ -304,7 +332,7 @@
304#define TX_DTX_IDX2 0x025c 332#define TX_DTX_IDX2 0x025c
305 333
306/* 334/*
307 * AC_VO register offsets 335 * AC_BK register offsets
308 */ 336 */
309#define TX_BASE_PTR3 0x0260 337#define TX_BASE_PTR3 0x0260
310#define TX_MAX_CNT3 0x0264 338#define TX_MAX_CNT3 0x0264
@@ -364,8 +392,12 @@
364 392
365/* 393/*
366 * US_CYC_CNT 394 * US_CYC_CNT
395 * BT_MODE_EN: Bluetooth mode enable
396 * CLOCK CYCLE: Clock cycle count in 1us.
397 * PCI:0x21, PCIE:0x7d, USB:0x1e
367 */ 398 */
368#define US_CYC_CNT 0x02a4 399#define US_CYC_CNT 0x02a4
400#define US_CYC_CNT_BT_MODE_EN FIELD32(0x00000100)
369#define US_CYC_CNT_CLOCK_CYCLE FIELD32(0x000000ff) 401#define US_CYC_CNT_CLOCK_CYCLE FIELD32(0x000000ff)
370 402
371/* 403/*
@@ -411,10 +443,22 @@
411#define BCN_OFFSET1_BCN7 FIELD32(0xff000000) 443#define BCN_OFFSET1_BCN7 FIELD32(0xff000000)
412 444
413/* 445/*
414 * PBF registers 446 * TXRXQ_PCNT: PBF register
415 * Most are for debug. Driver doesn't touch PBF register. 447 * PCNT_TX0Q: Page count for TX hardware queue 0
448 * PCNT_TX1Q: Page count for TX hardware queue 1
449 * PCNT_TX2Q: Page count for TX hardware queue 2
450 * PCNT_RX0Q: Page count for RX hardware queue
416 */ 451 */
417#define TXRXQ_PCNT 0x0438 452#define TXRXQ_PCNT 0x0438
453#define TXRXQ_PCNT_TX0Q FIELD32(0x000000ff)
454#define TXRXQ_PCNT_TX1Q FIELD32(0x0000ff00)
455#define TXRXQ_PCNT_TX2Q FIELD32(0x00ff0000)
456#define TXRXQ_PCNT_RX0Q FIELD32(0xff000000)
457
458/*
459 * PBF register
460 * Debug. Driver doesn't touch PBF register.
461 */
418#define PBF_DBG 0x043c 462#define PBF_DBG 0x043c
419 463
420/* 464/*
@@ -422,7 +466,7 @@
422 */ 466 */
423#define RF_CSR_CFG 0x0500 467#define RF_CSR_CFG 0x0500
424#define RF_CSR_CFG_DATA FIELD32(0x000000ff) 468#define RF_CSR_CFG_DATA FIELD32(0x000000ff)
425#define RF_CSR_CFG_REGNUM FIELD32(0x00001f00) 469#define RF_CSR_CFG_REGNUM FIELD32(0x00003f00)
426#define RF_CSR_CFG_WRITE FIELD32(0x00010000) 470#define RF_CSR_CFG_WRITE FIELD32(0x00010000)
427#define RF_CSR_CFG_BUSY FIELD32(0x00020000) 471#define RF_CSR_CFG_BUSY FIELD32(0x00020000)
428 472
@@ -574,7 +618,7 @@
574 * READ_CONTROL: 0 write BBP, 1 read BBP 618 * READ_CONTROL: 0 write BBP, 1 read BBP
575 * BUSY: ASIC is busy executing BBP commands 619 * BUSY: ASIC is busy executing BBP commands
576 * BBP_PAR_DUR: 0 4 MAC clocks, 1 8 MAC clocks 620 * BBP_PAR_DUR: 0 4 MAC clocks, 1 8 MAC clocks
577 * BBP_RW_MODE: 0 serial, 1 paralell 621 * BBP_RW_MODE: 0 serial, 1 parallel
578 */ 622 */
579#define BBP_CSR_CFG 0x101c 623#define BBP_CSR_CFG 0x101c
580#define BBP_CSR_CFG_VALUE FIELD32(0x000000ff) 624#define BBP_CSR_CFG_VALUE FIELD32(0x000000ff)
@@ -639,6 +683,18 @@
639#define LED_CFG_LED_POLAR FIELD32(0x40000000) 683#define LED_CFG_LED_POLAR FIELD32(0x40000000)
640 684
641/* 685/*
686 * AMPDU_BA_WINSIZE: Force BlockAck window size
687 * FORCE_WINSIZE_ENABLE:
688 * 0: Disable forcing of BlockAck window size
689 * 1: Enable forcing of BlockAck window size, overwrites values BlockAck
690 * window size values in the TXWI
691 * FORCE_WINSIZE: BlockAck window size
692 */
693#define AMPDU_BA_WINSIZE 0x1040
694#define AMPDU_BA_WINSIZE_FORCE_WINSIZE_ENABLE FIELD32(0x00000020)
695#define AMPDU_BA_WINSIZE_FORCE_WINSIZE FIELD32(0x0000001f)
696
697/*
642 * XIFS_TIME_CFG: MAC timing 698 * XIFS_TIME_CFG: MAC timing
643 * CCKM_SIFS_TIME: unit 1us. Applied after CCK RX/TX 699 * CCKM_SIFS_TIME: unit 1us. Applied after CCK RX/TX
644 * OFDM_SIFS_TIME: unit 1us. Applied after OFDM RX/TX 700 * OFDM_SIFS_TIME: unit 1us. Applied after OFDM RX/TX
@@ -673,8 +729,18 @@
673 729
674/* 730/*
675 * CH_TIME_CFG: count as channel busy 731 * CH_TIME_CFG: count as channel busy
732 * EIFS_BUSY: Count EIFS as channel busy
733 * NAV_BUSY: Count NAS as channel busy
734 * RX_BUSY: Count RX as channel busy
735 * TX_BUSY: Count TX as channel busy
736 * TMR_EN: Enable channel statistics timer
676 */ 737 */
677#define CH_TIME_CFG 0x110c 738#define CH_TIME_CFG 0x110c
739#define CH_TIME_CFG_EIFS_BUSY FIELD32(0x00000010)
740#define CH_TIME_CFG_NAV_BUSY FIELD32(0x00000008)
741#define CH_TIME_CFG_RX_BUSY FIELD32(0x00000004)
742#define CH_TIME_CFG_TX_BUSY FIELD32(0x00000002)
743#define CH_TIME_CFG_TMR_EN FIELD32(0x00000001)
678 744
679/* 745/*
680 * PBF_LIFE_TIMER: TX/RX MPDU timestamp timer (free run) Unit: 1us 746 * PBF_LIFE_TIMER: TX/RX MPDU timestamp timer (free run) Unit: 1us
@@ -698,8 +764,14 @@
698 764
699/* 765/*
700 * TBTT_SYNC_CFG: 766 * TBTT_SYNC_CFG:
767 * BCN_AIFSN: Beacon AIFSN after TBTT interrupt in slots
768 * BCN_CWMIN: Beacon CWMin after TBTT interrupt in slots
701 */ 769 */
702#define TBTT_SYNC_CFG 0x1118 770#define TBTT_SYNC_CFG 0x1118
771#define TBTT_SYNC_CFG_TBTT_ADJUST FIELD32(0x000000ff)
772#define TBTT_SYNC_CFG_BCN_EXP_WIN FIELD32(0x0000ff00)
773#define TBTT_SYNC_CFG_BCN_AIFSN FIELD32(0x000f0000)
774#define TBTT_SYNC_CFG_BCN_CWMIN FIELD32(0x00f00000)
703 775
704/* 776/*
705 * TSF_TIMER_DW0: Local lsb TSF timer, read-only 777 * TSF_TIMER_DW0: Local lsb TSF timer, read-only
@@ -735,16 +807,21 @@
735#define INT_TIMER_EN_GP_TIMER FIELD32(0x00000002) 807#define INT_TIMER_EN_GP_TIMER FIELD32(0x00000002)
736 808
737/* 809/*
738 * CH_IDLE_STA: channel idle time 810 * CH_IDLE_STA: channel idle time (in us)
739 */ 811 */
740#define CH_IDLE_STA 0x1130 812#define CH_IDLE_STA 0x1130
741 813
742/* 814/*
743 * CH_BUSY_STA: channel busy time 815 * CH_BUSY_STA: channel busy time on primary channel (in us)
744 */ 816 */
745#define CH_BUSY_STA 0x1134 817#define CH_BUSY_STA 0x1134
746 818
747/* 819/*
820 * CH_BUSY_STA_SEC: channel busy time on secondary channel in HT40 mode (in us)
821 */
822#define CH_BUSY_STA_SEC 0x1138
823
824/*
748 * MAC_STATUS_CFG: 825 * MAC_STATUS_CFG:
749 * BBP_RF_BUSY: When set to 0, BBP and RF are stable. 826 * BBP_RF_BUSY: When set to 0, BBP and RF are stable.
750 * if 1 or higher one of the 2 registers is busy. 827 * if 1 or higher one of the 2 registers is busy.
@@ -936,8 +1013,31 @@
936 1013
937/* 1014/*
938 * TXOP_CTRL_CFG: 1015 * TXOP_CTRL_CFG:
1016 * TIMEOUT_TRUN_EN: Enable/Disable TXOP timeout truncation
1017 * AC_TRUN_EN: Enable/Disable truncation for AC change
1018 * TXRATEGRP_TRUN_EN: Enable/Disable truncation for TX rate group change
1019 * USER_MODE_TRUN_EN: Enable/Disable truncation for user TXOP mode
1020 * MIMO_PS_TRUN_EN: Enable/Disable truncation for MIMO PS RTS/CTS
1021 * RESERVED_TRUN_EN: Reserved
1022 * LSIG_TXOP_EN: Enable/Disable L-SIG TXOP protection
1023 * EXT_CCA_EN: Enable/Disable extension channel CCA reference (Defer 40Mhz
1024 * transmissions if extension CCA is clear).
1025 * EXT_CCA_DLY: Extension CCA signal delay time (unit: us)
1026 * EXT_CWMIN: CwMin for extension channel backoff
1027 * 0: Disabled
1028 *
939 */ 1029 */
940#define TXOP_CTRL_CFG 0x1340 1030#define TXOP_CTRL_CFG 0x1340
1031#define TXOP_CTRL_CFG_TIMEOUT_TRUN_EN FIELD32(0x00000001)
1032#define TXOP_CTRL_CFG_AC_TRUN_EN FIELD32(0x00000002)
1033#define TXOP_CTRL_CFG_TXRATEGRP_TRUN_EN FIELD32(0x00000004)
1034#define TXOP_CTRL_CFG_USER_MODE_TRUN_EN FIELD32(0x00000008)
1035#define TXOP_CTRL_CFG_MIMO_PS_TRUN_EN FIELD32(0x00000010)
1036#define TXOP_CTRL_CFG_RESERVED_TRUN_EN FIELD32(0x00000020)
1037#define TXOP_CTRL_CFG_LSIG_TXOP_EN FIELD32(0x00000040)
1038#define TXOP_CTRL_CFG_EXT_CCA_EN FIELD32(0x00000080)
1039#define TXOP_CTRL_CFG_EXT_CCA_DLY FIELD32(0x0000ff00)
1040#define TXOP_CTRL_CFG_EXT_CWMIN FIELD32(0x000f0000)
941 1041
942/* 1042/*
943 * TX_RTS_CFG: 1043 * TX_RTS_CFG:
@@ -1056,8 +1156,8 @@
1056 * PROTECT_RATE: Protection control frame rate for CCK TX(RTS/CTS/CFEnd) 1156 * PROTECT_RATE: Protection control frame rate for CCK TX(RTS/CTS/CFEnd)
1057 * PROTECT_CTRL: Protection control frame type for CCK TX 1157 * PROTECT_CTRL: Protection control frame type for CCK TX
1058 * 0:none, 1:RTS/CTS, 2:CTS-to-self 1158 * 0:none, 1:RTS/CTS, 2:CTS-to-self
1059 * PROTECT_NAV: TXOP protection type for CCK TX 1159 * PROTECT_NAV_SHORT: TXOP protection type for CCK TX with short NAV
1060 * 0:none, 1:ShortNAVprotect, 2:LongNAVProtect 1160 * PROTECT_NAV_LONG: TXOP protection type for CCK TX with long NAV
1061 * TX_OP_ALLOW_CCK: CCK TXOP allowance, 0:disallow 1161 * TX_OP_ALLOW_CCK: CCK TXOP allowance, 0:disallow
1062 * TX_OP_ALLOW_OFDM: CCK TXOP allowance, 0:disallow 1162 * TX_OP_ALLOW_OFDM: CCK TXOP allowance, 0:disallow
1063 * TX_OP_ALLOW_MM20: CCK TXOP allowance, 0:disallow 1163 * TX_OP_ALLOW_MM20: CCK TXOP allowance, 0:disallow
@@ -1069,7 +1169,8 @@
1069#define CCK_PROT_CFG 0x1364 1169#define CCK_PROT_CFG 0x1364
1070#define CCK_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 1170#define CCK_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1071#define CCK_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 1171#define CCK_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1072#define CCK_PROT_CFG_PROTECT_NAV FIELD32(0x000c0000) 1172#define CCK_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1173#define CCK_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1073#define CCK_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 1174#define CCK_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1074#define CCK_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 1175#define CCK_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1075#define CCK_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 1176#define CCK_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
@@ -1084,7 +1185,8 @@
1084#define OFDM_PROT_CFG 0x1368 1185#define OFDM_PROT_CFG 0x1368
1085#define OFDM_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 1186#define OFDM_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1086#define OFDM_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 1187#define OFDM_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1087#define OFDM_PROT_CFG_PROTECT_NAV FIELD32(0x000c0000) 1188#define OFDM_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1189#define OFDM_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1088#define OFDM_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 1190#define OFDM_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1089#define OFDM_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 1191#define OFDM_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1090#define OFDM_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 1192#define OFDM_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
@@ -1099,7 +1201,8 @@
1099#define MM20_PROT_CFG 0x136c 1201#define MM20_PROT_CFG 0x136c
1100#define MM20_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 1202#define MM20_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1101#define MM20_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 1203#define MM20_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1102#define MM20_PROT_CFG_PROTECT_NAV FIELD32(0x000c0000) 1204#define MM20_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1205#define MM20_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1103#define MM20_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 1206#define MM20_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1104#define MM20_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 1207#define MM20_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1105#define MM20_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 1208#define MM20_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
@@ -1114,7 +1217,8 @@
1114#define MM40_PROT_CFG 0x1370 1217#define MM40_PROT_CFG 0x1370
1115#define MM40_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 1218#define MM40_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1116#define MM40_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 1219#define MM40_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1117#define MM40_PROT_CFG_PROTECT_NAV FIELD32(0x000c0000) 1220#define MM40_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1221#define MM40_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1118#define MM40_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 1222#define MM40_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1119#define MM40_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 1223#define MM40_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1120#define MM40_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 1224#define MM40_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
@@ -1129,7 +1233,8 @@
1129#define GF20_PROT_CFG 0x1374 1233#define GF20_PROT_CFG 0x1374
1130#define GF20_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 1234#define GF20_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1131#define GF20_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 1235#define GF20_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1132#define GF20_PROT_CFG_PROTECT_NAV FIELD32(0x000c0000) 1236#define GF20_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1237#define GF20_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1133#define GF20_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 1238#define GF20_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1134#define GF20_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 1239#define GF20_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1135#define GF20_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 1240#define GF20_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
@@ -1144,7 +1249,8 @@
1144#define GF40_PROT_CFG 0x1378 1249#define GF40_PROT_CFG 0x1378
1145#define GF40_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff) 1250#define GF40_PROT_CFG_PROTECT_RATE FIELD32(0x0000ffff)
1146#define GF40_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000) 1251#define GF40_PROT_CFG_PROTECT_CTRL FIELD32(0x00030000)
1147#define GF40_PROT_CFG_PROTECT_NAV FIELD32(0x000c0000) 1252#define GF40_PROT_CFG_PROTECT_NAV_SHORT FIELD32(0x00040000)
1253#define GF40_PROT_CFG_PROTECT_NAV_LONG FIELD32(0x00080000)
1148#define GF40_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000) 1254#define GF40_PROT_CFG_TX_OP_ALLOW_CCK FIELD32(0x00100000)
1149#define GF40_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000) 1255#define GF40_PROT_CFG_TX_OP_ALLOW_OFDM FIELD32(0x00200000)
1150#define GF40_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000) 1256#define GF40_PROT_CFG_TX_OP_ALLOW_MM20 FIELD32(0x00400000)
@@ -1318,11 +1424,34 @@
1318#define TX_STA_CNT2_TX_UNDER_FLOW_COUNT FIELD32(0xffff0000) 1424#define TX_STA_CNT2_TX_UNDER_FLOW_COUNT FIELD32(0xffff0000)
1319 1425
1320/* 1426/*
1321 * TX_STA_FIFO: TX Result for specific PID status fifo register 1427 * TX_STA_FIFO: TX Result for specific PID status fifo register.
1428 *
1429 * This register is implemented as FIFO with 16 entries in the HW. Each
1430 * register read fetches the next tx result. If the FIFO is full because
1431 * it wasn't read fast enough after the according interrupt (TX_FIFO_STATUS)
1432 * triggered, the hw seems to simply drop further tx results.
1433 *
1434 * VALID: 1: this tx result is valid
1435 * 0: no valid tx result -> driver should stop reading
1436 * PID_TYPE: The PID latched from the PID field in the TXWI, can be used
1437 * to match a frame with its tx result (even though the PID is
1438 * only 4 bits wide).
1439 * PID_QUEUE: Part of PID_TYPE, this is the queue index number (0-3)
1440 * PID_ENTRY: Part of PID_TYPE, this is the queue entry index number (1-3)
1441 * This identification number is calculated by ((idx % 3) + 1).
1442 * TX_SUCCESS: Indicates tx success (1) or failure (0)
1443 * TX_AGGRE: Indicates if the frame was part of an aggregate (1) or not (0)
1444 * TX_ACK_REQUIRED: Indicates if the frame needed to get ack'ed (1) or not (0)
1445 * WCID: The wireless client ID.
1446 * MCS: The tx rate used during the last transmission of this frame, be it
1447 * successful or not.
1448 * PHYMODE: The phymode used for the transmission.
1322 */ 1449 */
1323#define TX_STA_FIFO 0x1718 1450#define TX_STA_FIFO 0x1718
1324#define TX_STA_FIFO_VALID FIELD32(0x00000001) 1451#define TX_STA_FIFO_VALID FIELD32(0x00000001)
1325#define TX_STA_FIFO_PID_TYPE FIELD32(0x0000001e) 1452#define TX_STA_FIFO_PID_TYPE FIELD32(0x0000001e)
1453#define TX_STA_FIFO_PID_QUEUE FIELD32(0x00000006)
1454#define TX_STA_FIFO_PID_ENTRY FIELD32(0x00000018)
1326#define TX_STA_FIFO_TX_SUCCESS FIELD32(0x00000020) 1455#define TX_STA_FIFO_TX_SUCCESS FIELD32(0x00000020)
1327#define TX_STA_FIFO_TX_AGGRE FIELD32(0x00000040) 1456#define TX_STA_FIFO_TX_AGGRE FIELD32(0x00000040)
1328#define TX_STA_FIFO_TX_ACK_REQUIRED FIELD32(0x00000080) 1457#define TX_STA_FIFO_TX_ACK_REQUIRED FIELD32(0x00000080)
@@ -1405,6 +1534,24 @@
1405 1534
1406/* 1535/*
1407 * Security key table memory. 1536 * Security key table memory.
1537 *
1538 * The pairwise key table shares some memory with the beacon frame
1539 * buffers 6 and 7. That basically means that when beacon 6 & 7
1540 * are used we should only use the reduced pairwise key table which
1541 * has a maximum of 222 entries.
1542 *
1543 * ---------------------------------------------
1544 * |0x4000 | Pairwise Key | Reduced Pairwise |
1545 * | | Table | Key Table |
1546 * | | Size: 256 * 32 | Size: 222 * 32 |
1547 * |0x5BC0 | |-------------------
1548 * | | | Beacon 6 |
1549 * |0x5DC0 | |-------------------
1550 * | | | Beacon 7 |
1551 * |0x5FC0 | |-------------------
1552 * |0x5FFF | |
1553 * --------------------------
1554 *
1408 * MAC_WCID_BASE: 8-bytes (use only 6 bytes) * 256 entry 1555 * MAC_WCID_BASE: 8-bytes (use only 6 bytes) * 256 entry
1409 * PAIRWISE_KEY_TABLE_BASE: 32-byte * 256 entry 1556 * PAIRWISE_KEY_TABLE_BASE: 32-byte * 256 entry
1410 * MAC_IVEIV_TABLE_BASE: 8-byte * 256-entry 1557 * MAC_IVEIV_TABLE_BASE: 8-byte * 256-entry
@@ -1420,17 +1567,17 @@
1420#define SHARED_KEY_MODE_BASE 0x7000 1567#define SHARED_KEY_MODE_BASE 0x7000
1421 1568
1422#define MAC_WCID_ENTRY(__idx) \ 1569#define MAC_WCID_ENTRY(__idx) \
1423 ( MAC_WCID_BASE + ((__idx) * sizeof(struct mac_wcid_entry)) ) 1570 (MAC_WCID_BASE + ((__idx) * sizeof(struct mac_wcid_entry)))
1424#define PAIRWISE_KEY_ENTRY(__idx) \ 1571#define PAIRWISE_KEY_ENTRY(__idx) \
1425 ( PAIRWISE_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry)) ) 1572 (PAIRWISE_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry)))
1426#define MAC_IVEIV_ENTRY(__idx) \ 1573#define MAC_IVEIV_ENTRY(__idx) \
1427 ( MAC_IVEIV_TABLE_BASE + ((__idx) * sizeof(struct mac_iveiv_entry)) ) 1574 (MAC_IVEIV_TABLE_BASE + ((__idx) * sizeof(struct mac_iveiv_entry)))
1428#define MAC_WCID_ATTR_ENTRY(__idx) \ 1575#define MAC_WCID_ATTR_ENTRY(__idx) \
1429 ( MAC_WCID_ATTRIBUTE_BASE + ((__idx) * sizeof(u32)) ) 1576 (MAC_WCID_ATTRIBUTE_BASE + ((__idx) * sizeof(u32)))
1430#define SHARED_KEY_ENTRY(__idx) \ 1577#define SHARED_KEY_ENTRY(__idx) \
1431 ( SHARED_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry)) ) 1578 (SHARED_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry)))
1432#define SHARED_KEY_MODE_ENTRY(__idx) \ 1579#define SHARED_KEY_MODE_ENTRY(__idx) \
1433 ( SHARED_KEY_MODE_BASE + ((__idx) * sizeof(u32)) ) 1580 (SHARED_KEY_MODE_BASE + ((__idx) * sizeof(u32)))
1434 1581
1435struct mac_wcid_entry { 1582struct mac_wcid_entry {
1436 u8 mac[6]; 1583 u8 mac[6];
@@ -1554,7 +1701,8 @@ struct mac_iveiv_entry {
1554 * 2. Extract memory from FCE table for BCN 4~5 1701 * 2. Extract memory from FCE table for BCN 4~5
1555 * 3. Extract memory from Pair-wise key table for BCN 6~7 1702 * 3. Extract memory from Pair-wise key table for BCN 6~7
1556 * It occupied those memory of wcid 238~253 for BCN 6 1703 * It occupied those memory of wcid 238~253 for BCN 6
1557 * and wcid 222~237 for BCN 7 1704 * and wcid 222~237 for BCN 7 (see Security key table memory
1705 * for more info).
1558 * 1706 *
1559 * IMPORTANT NOTE: Not sure why legacy driver does this, 1707 * IMPORTANT NOTE: Not sure why legacy driver does this,
1560 * but HW_BEACON_BASE7 is 0x0200 bytes below HW_BEACON_BASE6. 1708 * but HW_BEACON_BASE7 is 0x0200 bytes below HW_BEACON_BASE6.
@@ -1569,9 +1717,9 @@ struct mac_iveiv_entry {
1569#define HW_BEACON_BASE7 0x5bc0 1717#define HW_BEACON_BASE7 0x5bc0
1570 1718
1571#define HW_BEACON_OFFSET(__index) \ 1719#define HW_BEACON_OFFSET(__index) \
1572 ( ((__index) < 4) ? ( HW_BEACON_BASE0 + (__index * 0x0200) ) : \ 1720 (((__index) < 4) ? (HW_BEACON_BASE0 + (__index * 0x0200)) : \
1573 (((__index) < 6) ? ( HW_BEACON_BASE4 + ((__index - 4) * 0x0200) ) : \ 1721 (((__index) < 6) ? (HW_BEACON_BASE4 + ((__index - 4) * 0x0200)) : \
1574 (HW_BEACON_BASE6 - ((__index - 6) * 0x0200))) ) 1722 (HW_BEACON_BASE6 - ((__index - 6) * 0x0200))))
1575 1723
1576/* 1724/*
1577 * BBP registers. 1725 * BBP registers.
@@ -1579,11 +1727,14 @@ struct mac_iveiv_entry {
1579 */ 1727 */
1580 1728
1581/* 1729/*
1582 * BBP 1: TX Antenna & Power 1730 * BBP 1: TX Antenna & Power Control
1583 * POWER: 0 - normal, 1 - drop tx power by 6dBm, 2 - drop tx power by 12dBm, 1731 * POWER_CTRL:
1584 * 3 - increase tx power by 6dBm 1732 * 0 - normal,
1733 * 1 - drop tx power by 6dBm,
1734 * 2 - drop tx power by 12dBm,
1735 * 3 - increase tx power by 6dBm
1585 */ 1736 */
1586#define BBP1_TX_POWER FIELD8(0x07) 1737#define BBP1_TX_POWER_CTRL FIELD8(0x07)
1587#define BBP1_TX_ANTENNA FIELD8(0x18) 1738#define BBP1_TX_ANTENNA FIELD8(0x18)
1588 1739
1589/* 1740/*
@@ -1597,6 +1748,13 @@ struct mac_iveiv_entry {
1597 */ 1748 */
1598#define BBP4_TX_BF FIELD8(0x01) 1749#define BBP4_TX_BF FIELD8(0x01)
1599#define BBP4_BANDWIDTH FIELD8(0x18) 1750#define BBP4_BANDWIDTH FIELD8(0x18)
1751#define BBP4_MAC_IF_CTRL FIELD8(0x40)
1752
1753/*
1754 * BBP 109
1755 */
1756#define BBP109_TX0_POWER FIELD8(0x0f)
1757#define BBP109_TX1_POWER FIELD8(0xf0)
1600 1758
1601/* 1759/*
1602 * BBP 138: Unknown 1760 * BBP 138: Unknown
@@ -1607,6 +1765,11 @@ struct mac_iveiv_entry {
1607#define BBP138_TX_DAC2 FIELD8(0x40) 1765#define BBP138_TX_DAC2 FIELD8(0x40)
1608 1766
1609/* 1767/*
1768 * BBP 152: Rx Ant
1769 */
1770#define BBP152_RX_DEFAULT_ANT FIELD8(0x80)
1771
1772/*
1610 * RFCSR registers 1773 * RFCSR registers
1611 * The wordsize of the RFCSR is 8 bits. 1774 * The wordsize of the RFCSR is 8 bits.
1612 */ 1775 */
@@ -1615,12 +1778,18 @@ struct mac_iveiv_entry {
1615 * RFCSR 1: 1778 * RFCSR 1:
1616 */ 1779 */
1617#define RFCSR1_RF_BLOCK_EN FIELD8(0x01) 1780#define RFCSR1_RF_BLOCK_EN FIELD8(0x01)
1781#define RFCSR1_PLL_PD FIELD8(0x02)
1618#define RFCSR1_RX0_PD FIELD8(0x04) 1782#define RFCSR1_RX0_PD FIELD8(0x04)
1619#define RFCSR1_TX0_PD FIELD8(0x08) 1783#define RFCSR1_TX0_PD FIELD8(0x08)
1620#define RFCSR1_RX1_PD FIELD8(0x10) 1784#define RFCSR1_RX1_PD FIELD8(0x10)
1621#define RFCSR1_TX1_PD FIELD8(0x20) 1785#define RFCSR1_TX1_PD FIELD8(0x20)
1622 1786
1623/* 1787/*
1788 * RFCSR 2:
1789 */
1790#define RFCSR2_RESCAL_EN FIELD8(0x80)
1791
1792/*
1624 * RFCSR 6: 1793 * RFCSR 6:
1625 */ 1794 */
1626#define RFCSR6_R1 FIELD8(0x03) 1795#define RFCSR6_R1 FIELD8(0x03)
@@ -1632,6 +1801,11 @@ struct mac_iveiv_entry {
1632#define RFCSR7_RF_TUNING FIELD8(0x01) 1801#define RFCSR7_RF_TUNING FIELD8(0x01)
1633 1802
1634/* 1803/*
1804 * RFCSR 11:
1805 */
1806#define RFCSR11_R FIELD8(0x03)
1807
1808/*
1635 * RFCSR 12: 1809 * RFCSR 12:
1636 */ 1810 */
1637#define RFCSR12_TX_POWER FIELD8(0x1f) 1811#define RFCSR12_TX_POWER FIELD8(0x1f)
@@ -1652,6 +1826,7 @@ struct mac_iveiv_entry {
1652#define RFCSR17_TXMIXER_GAIN FIELD8(0x07) 1826#define RFCSR17_TXMIXER_GAIN FIELD8(0x07)
1653#define RFCSR17_TX_LO1_EN FIELD8(0x08) 1827#define RFCSR17_TX_LO1_EN FIELD8(0x08)
1654#define RFCSR17_R FIELD8(0x20) 1828#define RFCSR17_R FIELD8(0x20)
1829#define RFCSR17_CODE FIELD8(0x7f)
1655 1830
1656/* 1831/*
1657 * RFCSR 20: 1832 * RFCSR 20:
@@ -1684,9 +1859,33 @@ struct mac_iveiv_entry {
1684/* 1859/*
1685 * RFCSR 30: 1860 * RFCSR 30:
1686 */ 1861 */
1862#define RFCSR30_TX_H20M FIELD8(0x02)
1863#define RFCSR30_RX_H20M FIELD8(0x04)
1864#define RFCSR30_RX_VCM FIELD8(0x18)
1687#define RFCSR30_RF_CALIBRATION FIELD8(0x80) 1865#define RFCSR30_RF_CALIBRATION FIELD8(0x80)
1688 1866
1689/* 1867/*
1868 * RFCSR 31:
1869 */
1870#define RFCSR31_RX_AGC_FC FIELD8(0x1f)
1871#define RFCSR31_RX_H20M FIELD8(0x20)
1872
1873/*
1874 * RFCSR 38:
1875 */
1876#define RFCSR38_RX_LO1_EN FIELD8(0x20)
1877
1878/*
1879 * RFCSR 39:
1880 */
1881#define RFCSR39_RX_LO2_EN FIELD8(0x80)
1882
1883/*
1884 * RFCSR 49:
1885 */
1886#define RFCSR49_TX FIELD8(0x3f)
1887
1888/*
1690 * RF registers 1889 * RF registers
1691 */ 1890 */
1692 1891
@@ -1719,6 +1918,11 @@ struct mac_iveiv_entry {
1719 */ 1918 */
1720 1919
1721/* 1920/*
1921 * Chip ID
1922 */
1923#define EEPROM_CHIP_ID 0x0000
1924
1925/*
1722 * EEPROM Version 1926 * EEPROM Version
1723 */ 1927 */
1724#define EEPROM_VERSION 0x0001 1928#define EEPROM_VERSION 0x0001
@@ -1739,32 +1943,51 @@ struct mac_iveiv_entry {
1739#define EEPROM_MAC_ADDR_BYTE5 FIELD16(0xff00) 1943#define EEPROM_MAC_ADDR_BYTE5 FIELD16(0xff00)
1740 1944
1741/* 1945/*
1742 * EEPROM ANTENNA config 1946 * EEPROM NIC Configuration 0
1743 * RXPATH: 1: 1R, 2: 2R, 3: 3R 1947 * RXPATH: 1: 1R, 2: 2R, 3: 3R
1744 * TXPATH: 1: 1T, 2: 2T 1948 * TXPATH: 1: 1T, 2: 2T, 3: 3T
1745 */ 1949 * RF_TYPE: RFIC type
1746#define EEPROM_ANTENNA 0x001a 1950 */
1747#define EEPROM_ANTENNA_RXPATH FIELD16(0x000f) 1951#define EEPROM_NIC_CONF0 0x001a
1748#define EEPROM_ANTENNA_TXPATH FIELD16(0x00f0) 1952#define EEPROM_NIC_CONF0_RXPATH FIELD16(0x000f)
1749#define EEPROM_ANTENNA_RF_TYPE FIELD16(0x0f00) 1953#define EEPROM_NIC_CONF0_TXPATH FIELD16(0x00f0)
1750 1954#define EEPROM_NIC_CONF0_RF_TYPE FIELD16(0x0f00)
1751/* 1955
1752 * EEPROM NIC config 1956/*
1753 * CARDBUS_ACCEL: 0 - enable, 1 - disable 1957 * EEPROM NIC Configuration 1
1754 */ 1958 * HW_RADIO: 0: disable, 1: enable
1755#define EEPROM_NIC 0x001b 1959 * EXTERNAL_TX_ALC: 0: disable, 1: enable
1756#define EEPROM_NIC_HW_RADIO FIELD16(0x0001) 1960 * EXTERNAL_LNA_2G: 0: disable, 1: enable
1757#define EEPROM_NIC_DYNAMIC_TX_AGC FIELD16(0x0002) 1961 * EXTERNAL_LNA_5G: 0: disable, 1: enable
1758#define EEPROM_NIC_EXTERNAL_LNA_BG FIELD16(0x0004) 1962 * CARDBUS_ACCEL: 0: enable, 1: disable
1759#define EEPROM_NIC_EXTERNAL_LNA_A FIELD16(0x0008) 1963 * BW40M_SB_2G: 0: disable, 1: enable
1760#define EEPROM_NIC_CARDBUS_ACCEL FIELD16(0x0010) 1964 * BW40M_SB_5G: 0: disable, 1: enable
1761#define EEPROM_NIC_BW40M_SB_BG FIELD16(0x0020) 1965 * WPS_PBC: 0: disable, 1: enable
1762#define EEPROM_NIC_BW40M_SB_A FIELD16(0x0040) 1966 * BW40M_2G: 0: enable, 1: disable
1763#define EEPROM_NIC_WPS_PBC FIELD16(0x0080) 1967 * BW40M_5G: 0: enable, 1: disable
1764#define EEPROM_NIC_BW40M_BG FIELD16(0x0100) 1968 * BROADBAND_EXT_LNA: 0: disable, 1: enable
1765#define EEPROM_NIC_BW40M_A FIELD16(0x0200) 1969 * ANT_DIVERSITY: 00: Disable, 01: Diversity,
1766#define EEPROM_NIC_ANT_DIVERSITY FIELD16(0x0800) 1970 * 10: Main antenna, 11: Aux antenna
1767#define EEPROM_NIC_DAC_TEST FIELD16(0x8000) 1971 * INTERNAL_TX_ALC: 0: disable, 1: enable
1972 * BT_COEXIST: 0: disable, 1: enable
1973 * DAC_TEST: 0: disable, 1: enable
1974 */
1975#define EEPROM_NIC_CONF1 0x001b
1976#define EEPROM_NIC_CONF1_HW_RADIO FIELD16(0x0001)
1977#define EEPROM_NIC_CONF1_EXTERNAL_TX_ALC FIELD16(0x0002)
1978#define EEPROM_NIC_CONF1_EXTERNAL_LNA_2G FIELD16(0x0004)
1979#define EEPROM_NIC_CONF1_EXTERNAL_LNA_5G FIELD16(0x0008)
1980#define EEPROM_NIC_CONF1_CARDBUS_ACCEL FIELD16(0x0010)
1981#define EEPROM_NIC_CONF1_BW40M_SB_2G FIELD16(0x0020)
1982#define EEPROM_NIC_CONF1_BW40M_SB_5G FIELD16(0x0040)
1983#define EEPROM_NIC_CONF1_WPS_PBC FIELD16(0x0080)
1984#define EEPROM_NIC_CONF1_BW40M_2G FIELD16(0x0100)
1985#define EEPROM_NIC_CONF1_BW40M_5G FIELD16(0x0200)
1986#define EEPROM_NIC_CONF1_BROADBAND_EXT_LNA FIELD16(0x400)
1987#define EEPROM_NIC_CONF1_ANT_DIVERSITY FIELD16(0x1800)
1988#define EEPROM_NIC_CONF1_INTERNAL_TX_ALC FIELD16(0x2000)
1989#define EEPROM_NIC_CONF1_BT_COEXIST FIELD16(0x4000)
1990#define EEPROM_NIC_CONF1_DAC_TEST FIELD16(0x8000)
1768 1991
1769/* 1992/*
1770 * EEPROM frequency 1993 * EEPROM frequency
@@ -1786,9 +2009,9 @@ struct mac_iveiv_entry {
1786 * POLARITY_GPIO_4: Polarity GPIO4 setting. 2009 * POLARITY_GPIO_4: Polarity GPIO4 setting.
1787 * LED_MODE: Led mode. 2010 * LED_MODE: Led mode.
1788 */ 2011 */
1789#define EEPROM_LED1 0x001e 2012#define EEPROM_LED_AG_CONF 0x001e
1790#define EEPROM_LED2 0x001f 2013#define EEPROM_LED_ACT_CONF 0x001f
1791#define EEPROM_LED3 0x0020 2014#define EEPROM_LED_POLARITY 0x0020
1792#define EEPROM_LED_POLARITY_RDY_BG FIELD16(0x0001) 2015#define EEPROM_LED_POLARITY_RDY_BG FIELD16(0x0001)
1793#define EEPROM_LED_POLARITY_RDY_A FIELD16(0x0002) 2016#define EEPROM_LED_POLARITY_RDY_A FIELD16(0x0002)
1794#define EEPROM_LED_POLARITY_ACT FIELD16(0x0004) 2017#define EEPROM_LED_POLARITY_ACT FIELD16(0x0004)
@@ -1800,6 +2023,17 @@ struct mac_iveiv_entry {
1800#define EEPROM_LED_LED_MODE FIELD16(0x1f00) 2023#define EEPROM_LED_LED_MODE FIELD16(0x1f00)
1801 2024
1802/* 2025/*
2026 * EEPROM NIC Configuration 2
2027 * RX_STREAM: 0: Reserved, 1: 1 Stream, 2: 2 Stream
2028 * TX_STREAM: 0: Reserved, 1: 1 Stream, 2: 2 Stream
2029 * CRYSTAL: 00: Reserved, 01: One crystal, 10: Two crystal, 11: Reserved
2030 */
2031#define EEPROM_NIC_CONF2 0x0021
2032#define EEPROM_NIC_CONF2_RX_STREAM FIELD16(0x000f)
2033#define EEPROM_NIC_CONF2_TX_STREAM FIELD16(0x00f0)
2034#define EEPROM_NIC_CONF2_CRYSTAL FIELD16(0x0600)
2035
2036/*
1803 * EEPROM LNA 2037 * EEPROM LNA
1804 */ 2038 */
1805#define EEPROM_LNA 0x0022 2039#define EEPROM_LNA 0x0022
@@ -1841,16 +2075,26 @@ struct mac_iveiv_entry {
1841#define EEPROM_RSSI_A2_LNA_A2 FIELD16(0xff00) 2075#define EEPROM_RSSI_A2_LNA_A2 FIELD16(0xff00)
1842 2076
1843/* 2077/*
2078 * EEPROM EIRP Maximum TX power values(unit: dbm)
2079 */
2080#define EEPROM_EIRP_MAX_TX_POWER 0x0027
2081#define EEPROM_EIRP_MAX_TX_POWER_2GHZ FIELD16(0x00ff)
2082#define EEPROM_EIRP_MAX_TX_POWER_5GHZ FIELD16(0xff00)
2083
2084/*
1844 * EEPROM TXpower delta: 20MHZ AND 40 MHZ use different power. 2085 * EEPROM TXpower delta: 20MHZ AND 40 MHZ use different power.
1845 * This is delta in 40MHZ. 2086 * This is delta in 40MHZ.
1846 * VALUE: Tx Power dalta value (MAX=4) 2087 * VALUE: Tx Power dalta value, MAX=4(unit: dbm)
1847 * TYPE: 1: Plus the delta value, 0: minus the delta value 2088 * TYPE: 1: Plus the delta value, 0: minus the delta value
1848 * TXPOWER: Enable: 2089 * ENABLE: enable tx power compensation for 40BW
1849 */ 2090 */
1850#define EEPROM_TXPOWER_DELTA 0x0028 2091#define EEPROM_TXPOWER_DELTA 0x0028
1851#define EEPROM_TXPOWER_DELTA_VALUE FIELD16(0x003f) 2092#define EEPROM_TXPOWER_DELTA_VALUE_2G FIELD16(0x003f)
1852#define EEPROM_TXPOWER_DELTA_TYPE FIELD16(0x0040) 2093#define EEPROM_TXPOWER_DELTA_TYPE_2G FIELD16(0x0040)
1853#define EEPROM_TXPOWER_DELTA_TXPOWER FIELD16(0x0080) 2094#define EEPROM_TXPOWER_DELTA_ENABLE_2G FIELD16(0x0080)
2095#define EEPROM_TXPOWER_DELTA_VALUE_5G FIELD16(0x3f00)
2096#define EEPROM_TXPOWER_DELTA_TYPE_5G FIELD16(0x4000)
2097#define EEPROM_TXPOWER_DELTA_ENABLE_5G FIELD16(0x8000)
1854 2098
1855/* 2099/*
1856 * EEPROM TXPOWER 802.11BG 2100 * EEPROM TXPOWER 802.11BG
@@ -1862,6 +2106,59 @@ struct mac_iveiv_entry {
1862#define EEPROM_TXPOWER_BG_2 FIELD16(0xff00) 2106#define EEPROM_TXPOWER_BG_2 FIELD16(0xff00)
1863 2107
1864/* 2108/*
2109 * EEPROM temperature compensation boundaries 802.11BG
2110 * MINUS4: If the actual TSSI is below this boundary, tx power needs to be
2111 * reduced by (agc_step * -4)
2112 * MINUS3: If the actual TSSI is below this boundary, tx power needs to be
2113 * reduced by (agc_step * -3)
2114 */
2115#define EEPROM_TSSI_BOUND_BG1 0x0037
2116#define EEPROM_TSSI_BOUND_BG1_MINUS4 FIELD16(0x00ff)
2117#define EEPROM_TSSI_BOUND_BG1_MINUS3 FIELD16(0xff00)
2118
2119/*
2120 * EEPROM temperature compensation boundaries 802.11BG
2121 * MINUS2: If the actual TSSI is below this boundary, tx power needs to be
2122 * reduced by (agc_step * -2)
2123 * MINUS1: If the actual TSSI is below this boundary, tx power needs to be
2124 * reduced by (agc_step * -1)
2125 */
2126#define EEPROM_TSSI_BOUND_BG2 0x0038
2127#define EEPROM_TSSI_BOUND_BG2_MINUS2 FIELD16(0x00ff)
2128#define EEPROM_TSSI_BOUND_BG2_MINUS1 FIELD16(0xff00)
2129
2130/*
2131 * EEPROM temperature compensation boundaries 802.11BG
2132 * REF: Reference TSSI value, no tx power changes needed
2133 * PLUS1: If the actual TSSI is above this boundary, tx power needs to be
2134 * increased by (agc_step * 1)
2135 */
2136#define EEPROM_TSSI_BOUND_BG3 0x0039
2137#define EEPROM_TSSI_BOUND_BG3_REF FIELD16(0x00ff)
2138#define EEPROM_TSSI_BOUND_BG3_PLUS1 FIELD16(0xff00)
2139
2140/*
2141 * EEPROM temperature compensation boundaries 802.11BG
2142 * PLUS2: If the actual TSSI is above this boundary, tx power needs to be
2143 * increased by (agc_step * 2)
2144 * PLUS3: If the actual TSSI is above this boundary, tx power needs to be
2145 * increased by (agc_step * 3)
2146 */
2147#define EEPROM_TSSI_BOUND_BG4 0x003a
2148#define EEPROM_TSSI_BOUND_BG4_PLUS2 FIELD16(0x00ff)
2149#define EEPROM_TSSI_BOUND_BG4_PLUS3 FIELD16(0xff00)
2150
2151/*
2152 * EEPROM temperature compensation boundaries 802.11BG
2153 * PLUS4: If the actual TSSI is above this boundary, tx power needs to be
2154 * increased by (agc_step * 4)
2155 * AGC_STEP: Temperature compensation step.
2156 */
2157#define EEPROM_TSSI_BOUND_BG5 0x003b
2158#define EEPROM_TSSI_BOUND_BG5_PLUS4 FIELD16(0x00ff)
2159#define EEPROM_TSSI_BOUND_BG5_AGC_STEP FIELD16(0xff00)
2160
2161/*
1865 * EEPROM TXPOWER 802.11A 2162 * EEPROM TXPOWER 802.11A
1866 */ 2163 */
1867#define EEPROM_TXPOWER_A1 0x003c 2164#define EEPROM_TXPOWER_A1 0x003c
@@ -1871,6 +2168,59 @@ struct mac_iveiv_entry {
1871#define EEPROM_TXPOWER_A_2 FIELD16(0xff00) 2168#define EEPROM_TXPOWER_A_2 FIELD16(0xff00)
1872 2169
1873/* 2170/*
2171 * EEPROM temperature compensation boundaries 802.11A
2172 * MINUS4: If the actual TSSI is below this boundary, tx power needs to be
2173 * reduced by (agc_step * -4)
2174 * MINUS3: If the actual TSSI is below this boundary, tx power needs to be
2175 * reduced by (agc_step * -3)
2176 */
2177#define EEPROM_TSSI_BOUND_A1 0x006a
2178#define EEPROM_TSSI_BOUND_A1_MINUS4 FIELD16(0x00ff)
2179#define EEPROM_TSSI_BOUND_A1_MINUS3 FIELD16(0xff00)
2180
2181/*
2182 * EEPROM temperature compensation boundaries 802.11A
2183 * MINUS2: If the actual TSSI is below this boundary, tx power needs to be
2184 * reduced by (agc_step * -2)
2185 * MINUS1: If the actual TSSI is below this boundary, tx power needs to be
2186 * reduced by (agc_step * -1)
2187 */
2188#define EEPROM_TSSI_BOUND_A2 0x006b
2189#define EEPROM_TSSI_BOUND_A2_MINUS2 FIELD16(0x00ff)
2190#define EEPROM_TSSI_BOUND_A2_MINUS1 FIELD16(0xff00)
2191
2192/*
2193 * EEPROM temperature compensation boundaries 802.11A
2194 * REF: Reference TSSI value, no tx power changes needed
2195 * PLUS1: If the actual TSSI is above this boundary, tx power needs to be
2196 * increased by (agc_step * 1)
2197 */
2198#define EEPROM_TSSI_BOUND_A3 0x006c
2199#define EEPROM_TSSI_BOUND_A3_REF FIELD16(0x00ff)
2200#define EEPROM_TSSI_BOUND_A3_PLUS1 FIELD16(0xff00)
2201
2202/*
2203 * EEPROM temperature compensation boundaries 802.11A
2204 * PLUS2: If the actual TSSI is above this boundary, tx power needs to be
2205 * increased by (agc_step * 2)
2206 * PLUS3: If the actual TSSI is above this boundary, tx power needs to be
2207 * increased by (agc_step * 3)
2208 */
2209#define EEPROM_TSSI_BOUND_A4 0x006d
2210#define EEPROM_TSSI_BOUND_A4_PLUS2 FIELD16(0x00ff)
2211#define EEPROM_TSSI_BOUND_A4_PLUS3 FIELD16(0xff00)
2212
2213/*
2214 * EEPROM temperature compensation boundaries 802.11A
2215 * PLUS4: If the actual TSSI is above this boundary, tx power needs to be
2216 * increased by (agc_step * 4)
2217 * AGC_STEP: Temperature compensation step.
2218 */
2219#define EEPROM_TSSI_BOUND_A5 0x006e
2220#define EEPROM_TSSI_BOUND_A5_PLUS4 FIELD16(0x00ff)
2221#define EEPROM_TSSI_BOUND_A5_AGC_STEP FIELD16(0xff00)
2222
2223/*
1874 * EEPROM TXPOWER by rate: tx power per tx rate for HT20 mode 2224 * EEPROM TXPOWER by rate: tx power per tx rate for HT20 mode
1875 */ 2225 */
1876#define EEPROM_TXPOWER_BYRATE 0x006f 2226#define EEPROM_TXPOWER_BYRATE 0x006f
@@ -1898,11 +2248,12 @@ struct mac_iveiv_entry {
1898#define MCU_CURRENT 0x36 2248#define MCU_CURRENT 0x36
1899#define MCU_LED 0x50 2249#define MCU_LED 0x50
1900#define MCU_LED_STRENGTH 0x51 2250#define MCU_LED_STRENGTH 0x51
1901#define MCU_LED_1 0x52 2251#define MCU_LED_AG_CONF 0x52
1902#define MCU_LED_2 0x53 2252#define MCU_LED_ACT_CONF 0x53
1903#define MCU_LED_3 0x54 2253#define MCU_LED_LED_POLARITY 0x54
1904#define MCU_RADAR 0x60 2254#define MCU_RADAR 0x60
1905#define MCU_BOOT_SIGNAL 0x72 2255#define MCU_BOOT_SIGNAL 0x72
2256#define MCU_ANT_SELECT 0X73
1906#define MCU_BBP_SIGNAL 0x80 2257#define MCU_BBP_SIGNAL 0x80
1907#define MCU_POWER_SAVE 0x83 2258#define MCU_POWER_SAVE 0x83
1908 2259
@@ -1914,8 +2265,8 @@ struct mac_iveiv_entry {
1914/* 2265/*
1915 * DMA descriptor defines. 2266 * DMA descriptor defines.
1916 */ 2267 */
1917#define TXWI_DESC_SIZE ( 4 * sizeof(__le32) ) 2268#define TXWI_DESC_SIZE (4 * sizeof(__le32))
1918#define RXWI_DESC_SIZE ( 4 * sizeof(__le32) ) 2269#define RXWI_DESC_SIZE (4 * sizeof(__le32))
1919 2270
1920/* 2271/*
1921 * TX WI structure 2272 * TX WI structure
@@ -1926,8 +2277,17 @@ struct mac_iveiv_entry {
1926 * FRAG: 1 To inform TKIP engine this is a fragment. 2277 * FRAG: 1 To inform TKIP engine this is a fragment.
1927 * MIMO_PS: The remote peer is in dynamic MIMO-PS mode 2278 * MIMO_PS: The remote peer is in dynamic MIMO-PS mode
1928 * TX_OP: 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs 2279 * TX_OP: 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs
1929 * BW: Channel bandwidth 20MHz or 40 MHz 2280 * BW: Channel bandwidth 0:20MHz, 1:40 MHz (for legacy rates this will
2281 * duplicate the frame to both channels).
1930 * STBC: 1: STBC support MCS =0-7, 2,3 : RESERVED 2282 * STBC: 1: STBC support MCS =0-7, 2,3 : RESERVED
2283 * AMPDU: 1: this frame is eligible for AMPDU aggregation, the hw will
2284 * aggregate consecutive frames with the same RA and QoS TID. If
2285 * a frame A with the same RA and QoS TID but AMPDU=0 is queued
2286 * directly after a frame B with AMPDU=1, frame A might still
2287 * get aggregated into the AMPDU started by frame B. So, setting
2288 * AMPDU to 0 does _not_ necessarily mean the frame is sent as
2289 * MPDU, it can still end up in an AMPDU if the previous frame
2290 * was tagged as AMPDU.
1931 */ 2291 */
1932#define TXWI_W0_FRAG FIELD32(0x00000001) 2292#define TXWI_W0_FRAG FIELD32(0x00000001)
1933#define TXWI_W0_MIMO_PS FIELD32(0x00000002) 2293#define TXWI_W0_MIMO_PS FIELD32(0x00000002)
@@ -1945,6 +2305,19 @@ struct mac_iveiv_entry {
1945 2305
1946/* 2306/*
1947 * Word1 2307 * Word1
2308 * ACK: 0: No Ack needed, 1: Ack needed
2309 * NSEQ: 0: Don't assign hw sequence number, 1: Assign hw sequence number
2310 * BW_WIN_SIZE: BA windows size of the recipient
2311 * WIRELESS_CLI_ID: Client ID for WCID table access
2312 * MPDU_TOTAL_BYTE_COUNT: Length of 802.11 frame
2313 * PACKETID: Will be latched into the TX_STA_FIFO register once the according
2314 * frame was processed. If multiple frames are aggregated together
2315 * (AMPDU==1) the reported tx status will always contain the packet
2316 * id of the first frame. 0: Don't report tx status for this frame.
2317 * PACKETID_QUEUE: Part of PACKETID, This is the queue index (0-3)
2318 * PACKETID_ENTRY: Part of PACKETID, THis is the queue entry index (1-3)
2319 * This identification number is calculated by ((idx % 3) + 1).
2320 * The (+1) is required to prevent PACKETID to become 0.
1948 */ 2321 */
1949#define TXWI_W1_ACK FIELD32(0x00000001) 2322#define TXWI_W1_ACK FIELD32(0x00000001)
1950#define TXWI_W1_NSEQ FIELD32(0x00000002) 2323#define TXWI_W1_NSEQ FIELD32(0x00000002)
@@ -1952,6 +2325,8 @@ struct mac_iveiv_entry {
1952#define TXWI_W1_WIRELESS_CLI_ID FIELD32(0x0000ff00) 2325#define TXWI_W1_WIRELESS_CLI_ID FIELD32(0x0000ff00)
1953#define TXWI_W1_MPDU_TOTAL_BYTE_COUNT FIELD32(0x0fff0000) 2326#define TXWI_W1_MPDU_TOTAL_BYTE_COUNT FIELD32(0x0fff0000)
1954#define TXWI_W1_PACKETID FIELD32(0xf0000000) 2327#define TXWI_W1_PACKETID FIELD32(0xf0000000)
2328#define TXWI_W1_PACKETID_QUEUE FIELD32(0x30000000)
2329#define TXWI_W1_PACKETID_ENTRY FIELD32(0xc0000000)
1955 2330
1956/* 2331/*
1957 * Word2 2332 * Word2
@@ -2023,4 +2398,9 @@ struct mac_iveiv_entry {
2023#define TXPOWER_A_TO_DEV(__txpower) \ 2398#define TXPOWER_A_TO_DEV(__txpower) \
2024 clamp_t(char, __txpower, MIN_A_TXPOWER, MAX_A_TXPOWER) 2399 clamp_t(char, __txpower, MIN_A_TXPOWER, MAX_A_TXPOWER)
2025 2400
2401/*
2402 * Board's maximun TX power limitation
2403 */
2404#define EIRP_MAX_TX_POWER_LIMIT 0x50
2405
2026#endif /* RT2800_H */ 2406#endif /* RT2800_H */