xref: /titanic_51/usr/src/uts/common/io/rwn/rt2860_reg.h (revision 8a3c961b6b8e22607c570d092514b791eb1519e9)
1*8a3c961bSfei feng - Sun Microsystems - Beijing China /*
2*8a3c961bSfei feng - Sun Microsystems - Beijing China  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
3*8a3c961bSfei feng - Sun Microsystems - Beijing China  * Use is subject to license terms.
4*8a3c961bSfei feng - Sun Microsystems - Beijing China  */
5*8a3c961bSfei feng - Sun Microsystems - Beijing China 
6*8a3c961bSfei feng - Sun Microsystems - Beijing China /*
7*8a3c961bSfei feng - Sun Microsystems - Beijing China  * Copyright (c) 2007, 2008
8*8a3c961bSfei feng - Sun Microsystems - Beijing China  *	Damien Bergamini <damien.bergamini@free.fr>
9*8a3c961bSfei feng - Sun Microsystems - Beijing China  *
10*8a3c961bSfei feng - Sun Microsystems - Beijing China  * Permission to use, copy, modify, and distribute this software for any
11*8a3c961bSfei feng - Sun Microsystems - Beijing China  * purpose with or without fee is hereby granted, provided that the above
12*8a3c961bSfei feng - Sun Microsystems - Beijing China  * copyright notice and this permission notice appear in all copies.
13*8a3c961bSfei feng - Sun Microsystems - Beijing China  *
14*8a3c961bSfei feng - Sun Microsystems - Beijing China  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15*8a3c961bSfei feng - Sun Microsystems - Beijing China  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16*8a3c961bSfei feng - Sun Microsystems - Beijing China  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17*8a3c961bSfei feng - Sun Microsystems - Beijing China  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18*8a3c961bSfei feng - Sun Microsystems - Beijing China  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19*8a3c961bSfei feng - Sun Microsystems - Beijing China  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20*8a3c961bSfei feng - Sun Microsystems - Beijing China  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21*8a3c961bSfei feng - Sun Microsystems - Beijing China  */
22*8a3c961bSfei feng - Sun Microsystems - Beijing China 
23*8a3c961bSfei feng - Sun Microsystems - Beijing China #ifndef _RT2860_REG_H
24*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	_RT2860_REG_H
25*8a3c961bSfei feng - Sun Microsystems - Beijing China 
26*8a3c961bSfei feng - Sun Microsystems - Beijing China #ifdef __cplusplus
27*8a3c961bSfei feng - Sun Microsystems - Beijing China extern "C" {
28*8a3c961bSfei feng - Sun Microsystems - Beijing China #endif
29*8a3c961bSfei feng - Sun Microsystems - Beijing China 
30*8a3c961bSfei feng - Sun Microsystems - Beijing China /* Device ID */
31*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	PRODUCT_RALINK_RT2860		0x0601
32*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	PRODUCT_RALINK_RT2890		0x0681
33*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	PRODUCT_RALINK_RT2760		0x0701
34*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	PRODUCT_RALINK_RT2790		0x0781
35*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	PRODUCT_AWT_RT2890		0x1059
36*8a3c961bSfei feng - Sun Microsystems - Beijing China 
37*8a3c961bSfei feng - Sun Microsystems - Beijing China /* PCI registers */
38*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PCI_CFG			0x0000
39*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PCI_EECTRL		0x0004
40*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PCI_MCUCTRL		0x0008
41*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PCI_SYSCTRL		0x000c
42*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PCIE_JTAG		0x0010
43*8a3c961bSfei feng - Sun Microsystems - Beijing China 
44*8a3c961bSfei feng - Sun Microsystems - Beijing China /* SCH/DMA registers */
45*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_INT_STATUS		0x0200
46*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_INT_MASK			0x0204
47*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WPDMA_GLO_CFG		0x0208
48*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WPDMA_RST_IDX		0x020c
49*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DELAY_INT_CFG		0x0210
50*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WMM_AIFSN_CFG		0x0214
51*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WMM_CWMIN_CFG		0x0218
52*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WMM_CWMAX_CFG		0x021c
53*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WMM_TXOP0_CFG		0x0220
54*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WMM_TXOP1_CFG		0x0224
55*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_GPIO_CTRL		0x0228
56*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_REG		0x022c
57*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_BASE_PTR(qid)		(0x0230 + (qid) * 16)
58*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_MAX_CNT(qid)		(0x0234 + (qid) * 16)
59*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_CTX_IDX(qid)		(0x0238 + (qid) * 16)
60*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_DTX_IDX(qid)		(0x023c + (qid) * 16)
61*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_BASE_PTR		0x0290
62*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_MAX_CNT		0x0294
63*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_CALC_IDX		0x0298
64*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_FS_DRX_IDX		0x029c
65*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_US_CYC_CNT		0x02a4
66*8a3c961bSfei feng - Sun Microsystems - Beijing China 
67*8a3c961bSfei feng - Sun Microsystems - Beijing China /* PBF registers */
68*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SYS_CTRL			0x0400
69*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_HOST_CMD			0x0404
70*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PBF_CFG			0x0408
71*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAX_PCNT			0x040c
72*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BUF_CTRL			0x0410
73*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_INT_STA		0x0414
74*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_INT_ENA		0x0418
75*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXQ_IO(qid)		(0x041c + (qid) * 4)
76*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX0Q_IO			0x0424
77*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BCN_OFFSET0		0x042c
78*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BCN_OFFSET1		0x0430
79*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXRXQ_STA		0x0434
80*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXRXQ_PCNT		0x0438
81*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PBF_DBG			0x043c
82*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CAP_CTRL			0x0440
83*8a3c961bSfei feng - Sun Microsystems - Beijing China 
84*8a3c961bSfei feng - Sun Microsystems - Beijing China /* MAC registers */
85*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_ASIC_VER_ID		0x1000
86*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_SYS_CTRL		0x1004
87*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_ADDR_DW0		0x1008
88*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_ADDR_DW1		0x100c
89*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_BSSID_DW0		0x1010
90*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_BSSID_DW1		0x1014
91*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAX_LEN_CFG		0x1018
92*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BBP_CSR_CFG		0x101c
93*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_CSR_CFG0		0x1020
94*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_CSR_CFG1		0x1024
95*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_CSR_CFG2		0x1028
96*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LED_CFG			0x102c
97*8a3c961bSfei feng - Sun Microsystems - Beijing China 
98*8a3c961bSfei feng - Sun Microsystems - Beijing China /* undocumented registers */
99*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DEBUG			0x10f4
100*8a3c961bSfei feng - Sun Microsystems - Beijing China 
101*8a3c961bSfei feng - Sun Microsystems - Beijing China /* MAC Timing control registers */
102*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_XIFS_TIME_CFG		0x1100
103*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BKOFF_SLOT_CFG		0x1104
104*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_NAV_TIME_CFG		0x1108
105*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CH_TIME_CFG		0x110c
106*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PBF_LIFE_TIMER		0x1110
107*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BCN_TIME_CFG		0x1114
108*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TBTT_SYNC_CFG		0x1118
109*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TSF_TIMER_DW0		0x111c
110*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TSF_TIMER_DW1		0x1120
111*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TBTT_TIMER		0x1124
112*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_INT_TIMER_CFG		0x1128
113*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_INT_TIMER_EN		0x112c
114*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CH_IDLE_TIME		0x1130
115*8a3c961bSfei feng - Sun Microsystems - Beijing China 
116*8a3c961bSfei feng - Sun Microsystems - Beijing China /* MAC Power Save configuration registers */
117*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_STATUS_REG		0x1200
118*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PWR_PIN_CFG		0x1204
119*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_AUTO_WAKEUP_CFG		0x1208
120*8a3c961bSfei feng - Sun Microsystems - Beijing China 
121*8a3c961bSfei feng - Sun Microsystems - Beijing China /* MAC TX configuration registers */
122*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EDCA_AC_CFG(aci)		(0x1300 + (aci) * 4)
123*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EDCA_TID_AC_MAP		0x1310
124*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_PWR_CFG(ridx)		(0x1314 + (ridx) * 4)
125*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_PIN_CFG		0x1328
126*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_BAND_CFG		0x132c
127*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_SW_CFG0		0x1330
128*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_SW_CFG1		0x1334
129*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_SW_CFG2		0x1338
130*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_THRES_CFG		0x133c
131*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_CTRL_CFG		0x1340
132*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_RTS_CFG		0x1344
133*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_TIMEOUT_CFG		0x1348
134*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_RTY_CFG		0x134c
135*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_LINK_CFG		0x1350
136*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_HT_FBK_CFG0		0x1354
137*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_HT_FBK_CFG1		0x1358
138*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LG_FBK_CFG0		0x135c
139*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LG_FBK_CFG1		0x1360
140*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CCK_PROT_CFG		0x1364
141*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_OFDM_PROT_CFG		0x1368
142*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MM20_PROT_CFG		0x136c
143*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MM40_PROT_CFG		0x1370
144*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_GF20_PROT_CFG		0x1374
145*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_GF40_PROT_CFG		0x1378
146*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EXP_CTS_TIME		0x137c
147*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EXP_ACK_TIME		0x1380
148*8a3c961bSfei feng - Sun Microsystems - Beijing China 
149*8a3c961bSfei feng - Sun Microsystems - Beijing China /* MAC RX configuration registers */
150*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_FILTR_CFG		0x1400
151*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_AUTO_RSP_CFG		0x1404
152*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LEGACY_BASIC_RATE	0x1408
153*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_HT_BASIC_RATE		0x140c
154*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_HT_CTRL_CFG		0x1410
155*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SIFS_COST_CFG		0x1414
156*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_PARSER_CFG		0x1418
157*8a3c961bSfei feng - Sun Microsystems - Beijing China 
158*8a3c961bSfei feng - Sun Microsystems - Beijing China /* MAC Security configuration registers */
159*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_SEC_CNT0		0x1500
160*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_SEC_CNT0		0x1504
161*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CCMP_FC_MUTE		0x1508
162*8a3c961bSfei feng - Sun Microsystems - Beijing China 
163*8a3c961bSfei feng - Sun Microsystems - Beijing China /* MAC HCCA/PSMP configuration registers */
164*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_HLDR_ADDR0		0x1600
165*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_HLDR_ADDR1		0x1604
166*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_HLDR_ET		0x1608
167*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_QOS_CFPOLL_RA_DW0	0x160c
168*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_QOS_CFPOLL_A1_DW1	0x1610
169*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_QOS_CFPOLL_QC		0x1614
170*8a3c961bSfei feng - Sun Microsystems - Beijing China 
171*8a3c961bSfei feng - Sun Microsystems - Beijing China /* MAC Statistics Counters */
172*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_STA_CNT0		0x1700
173*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_STA_CNT1		0x1704
174*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_STA_CNT2		0x1708
175*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_STA_CNT0		0x170c
176*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_STA_CNT1		0x1710
177*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_STA_CNT2		0x1714
178*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_STAT_FIFO		0x1718
179*8a3c961bSfei feng - Sun Microsystems - Beijing China 
180*8a3c961bSfei feng - Sun Microsystems - Beijing China /* RX WCID search table */
181*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WCID_ENTRY(wcid)		(0x1800 + (wcid) * 8)
182*8a3c961bSfei feng - Sun Microsystems - Beijing China 
183*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_FW_BASE			0x2000
184*8a3c961bSfei feng - Sun Microsystems - Beijing China 
185*8a3c961bSfei feng - Sun Microsystems - Beijing China /* Pair-wise key table */
186*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PKEY(wcid)		(0x4000 + (wcid) * 32)
187*8a3c961bSfei feng - Sun Microsystems - Beijing China 
188*8a3c961bSfei feng - Sun Microsystems - Beijing China /* IV/EIV table */
189*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_IVEIV(wcid)		(0x6000 + (wcid) * 8)
190*8a3c961bSfei feng - Sun Microsystems - Beijing China 
191*8a3c961bSfei feng - Sun Microsystems - Beijing China /* WCID attribute table */
192*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WCID_ATTR(wcid)		(0x6800 + (wcid) * 4)
193*8a3c961bSfei feng - Sun Microsystems - Beijing China 
194*8a3c961bSfei feng - Sun Microsystems - Beijing China /* Shared Key Table */
195*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SKEY(vap, kidx)		(0x6c00 + (vap) * 128 + (kidx) * 32)
196*8a3c961bSfei feng - Sun Microsystems - Beijing China 
197*8a3c961bSfei feng - Sun Microsystems - Beijing China /* Shared Key Mode */
198*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SKEY_MODE_0_7		0x7000
199*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SKEY_MODE_8_15		0x7004
200*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SKEY_MODE_16_23		0x7008
201*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SKEY_MODE_24_31		0x700c
202*8a3c961bSfei feng - Sun Microsystems - Beijing China 
203*8a3c961bSfei feng - Sun Microsystems - Beijing China /* Shared Memory between MCU and host */
204*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_H2M_MAILBOX		0x7010
205*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_H2M_BBPAGENT		0x7028
206*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BCN_BASE(vap)		(0x7800 + (vap) * 512)
207*8a3c961bSfei feng - Sun Microsystems - Beijing China 
208*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register RT2860_PCI_EECTRL */
209*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_C	(1 << 0)
210*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_S	(1 << 1)
211*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_D	(1 << 2)
212*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SHIFT_D	2
213*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_Q	(1 << 3)
214*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SHIFT_Q	3
215*8a3c961bSfei feng - Sun Microsystems - Beijing China 
216*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for registers INT_STATUS/INT_MASK */
217*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_COHERENT	(1 << 17)
218*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_COHERENT	(1 << 16)
219*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_INT_4	(1 << 15)
220*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_INT_3	(1 << 14)
221*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_INT_2	(1 << 13)
222*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_INT_1	(1 << 12)
223*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_INT_0	(1 << 11)
224*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_RX_COHERENT	(1 << 10)
225*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_INT	(1 <<  9)
226*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_DONE_INT5	(1 <<  8)
227*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_DONE_INT4	(1 <<  7)
228*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_DONE_INT3	(1 <<  6)
229*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_DONE_INT2	(1 <<  5)
230*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_DONE_INT1	(1 <<  4)
231*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_DONE_INT0	(1 <<  3)
232*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_DONE_INT	(1 <<  2)
233*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_DLY_INT	(1 <<  1)
234*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_DLY_INT	(1 <<  0)
235*8a3c961bSfei feng - Sun Microsystems - Beijing China 
236*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register WPDMA_GLO_CFG */
237*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_HDR_SEG_LEN_SHIFT	8
238*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BIG_ENDIAN		(1 << 7)
239*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_WB_DDONE		(1 << 6)
240*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WPDMA_BT_SIZE_SHIFT	4
241*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WPDMA_BT_SIZE16		0
242*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WPDMA_BT_SIZE32		1
243*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WPDMA_BT_SIZE64		2
244*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WPDMA_BT_SIZE128		3
245*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_DMA_BUSY		(1 << 3)
246*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_DMA_EN		(1 << 2)
247*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_DMA_BUSY		(1 << 1)
248*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_DMA_EN		(1 << 0)
249*8a3c961bSfei feng - Sun Microsystems - Beijing China 
250*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register DELAY_INT_CFG */
251*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXDLY_INT_EN		(1 << 31)
252*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXMAX_PINT_SHIFT		24
253*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXMAX_PTIME_SHIFT	16
254*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RXDLY_INT_EN		(1 << 15)
255*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RXMAX_PINT_SHIFT		8
256*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RXMAX_PTIME_SHIFT	0
257*8a3c961bSfei feng - Sun Microsystems - Beijing China 
258*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register GPIO_CTRL */
259*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_GPIO_D_SHIFT	8
260*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_GPIO_O_SHIFT	0
261*8a3c961bSfei feng - Sun Microsystems - Beijing China 
262*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register US_CYC_CNT */
263*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TEST_EN		(1 << 24)
264*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TEST_SEL_SHIFT	16
265*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BT_MODE_EN	(1 <<  8)
266*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_US_CYC_CNT_SHIFT	0
267*8a3c961bSfei feng - Sun Microsystems - Beijing China 
268*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register SYS_CTRL */
269*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_HST_PM_SEL	(1 << 16)
270*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CAP_MODE		(1 << 14)
271*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PME_OEN		(1 << 13)
272*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CLKSELECT	(1 << 12)
273*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PBF_CLK_EN	(1 << 11)
274*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_CLK_EN	(1 << 10)
275*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DMA_CLK_EN	(1 <<  9)
276*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_READY	(1 <<  7)
277*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_ASY_RESET	(1 <<  4)
278*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PBF_RESET	(1 <<  3)
279*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_RESET	(1 <<  2)
280*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DMA_RESET	(1 <<  1)
281*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_RESET	(1 <<  0)
282*8a3c961bSfei feng - Sun Microsystems - Beijing China 
283*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible values for register HOST_CMD */
284*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_SLEEP	0x30
285*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_WAKEUP	0x31
286*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_LEDS	0x50
287*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_LED_RSSI	0x51
288*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_LED1	0x52
289*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_LED2	0x53
290*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_LED3	0x54
291*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_BOOT	0x72
292*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_BBP	0x80
293*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_CMD_PSLEVEL	0x83
294*8a3c961bSfei feng - Sun Microsystems - Beijing China 
295*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register PBF_CFG */
296*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX1Q_NUM_SHIFT	21
297*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX2Q_NUM_SHIFT	16
298*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_NULL0_MODE	(1 << 15)
299*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_NULL1_MODE	(1 << 14)
300*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_DROP_MODE	(1 << 13)
301*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX0Q_MANUAL	(1 << 12)
302*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX1Q_MANUAL	(1 << 11)
303*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX2Q_MANUAL	(1 << 10)
304*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX0Q_MANUAL	(1 <<  9)
305*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_HCCA_EN		(1 <<  8)
306*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX0Q_EN		(1 <<  4)
307*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX1Q_EN		(1 <<  3)
308*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX2Q_EN		(1 <<  2)
309*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX0Q_EN		(1 <<  1)
310*8a3c961bSfei feng - Sun Microsystems - Beijing China 
311*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register BUF_CTRL */
312*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WRITE_TXQ(qid)	(1 << (11 - (qid)))
313*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_NULL0_KICK	(1 << 7)
314*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_NULL1_KICK	(1 << 6)
315*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BUF_RESET	(1 << 5)
316*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_READ_TXQ(qid)	(1 << (3 - (qid))
317*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_READ_RX0Q	(1 << 0)
318*8a3c961bSfei feng - Sun Microsystems - Beijing China 
319*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for registers MCU_INT_STA/MCU_INT_ENA */
320*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_MAC_INT_8	(1 << 24)
321*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_MAC_INT_7	(1 << 23)
322*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_MAC_INT_6	(1 << 22)
323*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_MAC_INT_4	(1 << 20)
324*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_MAC_INT_3	(1 << 19)
325*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_MAC_INT_2	(1 << 18)
326*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_MAC_INT_1	(1 << 17)
327*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MCU_MAC_INT_0	(1 << 16)
328*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DTX0_INT		(1 << 11)
329*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DTX1_INT		(1 << 10)
330*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DTX2_INT		(1 <<  9)
331*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DRX0_INT		(1 <<  8)
332*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_HCMD_INT		(1 <<  7)
333*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_N0TX_INT		(1 <<  6)
334*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_N1TX_INT		(1 <<  5)
335*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BCNTX_INT	(1 <<  4)
336*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MTX0_INT		(1 <<  3)
337*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MTX1_INT		(1 <<  2)
338*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MTX2_INT		(1 <<  1)
339*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MRX0_INT		(1 <<  0)
340*8a3c961bSfei feng - Sun Microsystems - Beijing China 
341*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register CAP_CTRL */
342*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CAP_ADC_FEQ		(1 << 31)
343*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CAP_START		(1 << 30)
344*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAN_TRIG			(1 << 29)
345*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TRIG_OFFSET_SHIFT	16
346*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_START_ADDR_SHIFT		0
347*8a3c961bSfei feng - Sun Microsystems - Beijing China 
348*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register MAC_SYS_CTRL */
349*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_TS_EN		(1 << 7)
350*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WLAN_HALT_EN	(1 << 6)
351*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PBF_LOOP_EN	(1 << 5)
352*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CONT_TX_TEST	(1 << 4)
353*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_RX_EN	(1 << 3)
354*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_TX_EN	(1 << 2)
355*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BBP_HRST		(1 << 1)
356*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAC_SRST		(1 << 0)
357*8a3c961bSfei feng - Sun Microsystems - Beijing China 
358*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register MAC_BSSID_DW1 */
359*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MULTI_BCN_NUM_SHIFT	18
360*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MULTI_BSSID_MODE_SHIFT	16
361*8a3c961bSfei feng - Sun Microsystems - Beijing China 
362*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register MAX_LEN_CFG */
363*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MIN_MPDU_LEN_SHIFT	16
364*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAX_PSDU_LEN_SHIFT	12
365*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAX_PSDU_LEN8K		0
366*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAX_PSDU_LEN16K		1
367*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAX_PSDU_LEN32K		2
368*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAX_PSDU_LEN64K		3
369*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MAX_MPDU_LEN_SHIFT	0
370*8a3c961bSfei feng - Sun Microsystems - Beijing China 
371*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for registers BBP_CSR_CFG/H2M_BBPAGENT */
372*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BBP_RW_PARALLEL		(1 << 19)
373*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BBP_PAR_DUR_112_5	(1 << 18)
374*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BBP_CSR_KICK		(1 << 17)
375*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BBP_CSR_READ		(1 << 16)
376*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BBP_ADDR_SHIFT		8
377*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BBP_DATA_SHIFT		0
378*8a3c961bSfei feng - Sun Microsystems - Beijing China 
379*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register RF_CSR_CFG0 */
380*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_REG_CTRL		((uint32_t)1 << 31)
381*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_LE_SEL1		(1 << 30)
382*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_LE_STBY		(1 << 29)
383*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_REG_WIDTH_SHIFT	24
384*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_REG_0_SHIFT		0
385*8a3c961bSfei feng - Sun Microsystems - Beijing China 
386*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register RF_CSR_CFG1 */
387*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_DUR_5		(1 << 24)
388*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_REG_1_SHIFT	0
389*8a3c961bSfei feng - Sun Microsystems - Beijing China 
390*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register LED_CFG */
391*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LED_POL			(1 << 30)
392*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_Y_LED_MODE_SHIFT		28
393*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_G_LED_MODE_SHIFT		26
394*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_R_LED_MODE_SHIFT		24
395*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LED_MODE_OFF		0
396*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LED_MODE_BLINK_TX	1
397*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LED_MODE_SLOW_BLINK	2
398*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LED_MODE_ON		3
399*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SLOW_BLK_TIME_SHIFT	16
400*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LED_OFF_TIME_SHIFT	8
401*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LED_ON_TIME_SHIFT	0
402*8a3c961bSfei feng - Sun Microsystems - Beijing China 
403*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register XIFS_TIME_CFG */
404*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BB_RXEND_EN		(1 << 29)
405*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EIFS_TIME_SHIFT		20
406*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_OFDM_XIFS_TIME_SHIFT	16
407*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_OFDM_SIFS_TIME_SHIFT	8
408*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CCK_SIFS_TIME_SHIFT	0
409*8a3c961bSfei feng - Sun Microsystems - Beijing China 
410*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register BKOFF_SLOT_CFG */
411*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CC_DELAY_TIME_SHIFT	8
412*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SLOT_TIME		0
413*8a3c961bSfei feng - Sun Microsystems - Beijing China 
414*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register NAV_TIME_CFG */
415*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_NAV_UPD			(1 << 31)
416*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_NAV_UPD_VAL_SHIFT	16
417*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_NAV_CLR_EN		(1 << 15)
418*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_NAV_TIMER_SHIFT		0
419*8a3c961bSfei feng - Sun Microsystems - Beijing China 
420*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register CH_TIME_CFG */
421*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EIFS_AS_CH_BUSY	(1 << 4)
422*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_NAV_AS_CH_BUSY	(1 << 3)
423*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_AS_CH_BUSY	(1 << 2)
424*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_AS_CH_BUSY	(1 << 1)
425*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CH_STA_TIMER_EN	(1 << 0)
426*8a3c961bSfei feng - Sun Microsystems - Beijing China 
427*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible values for register BCN_TIME_CFG */
428*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TSF_INS_COMP_SHIFT	24
429*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BCN_TX_EN		(1 << 20)
430*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TBTT_TIMER_EN		(1 << 19)
431*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TSF_SYNC_MODE_SHIFT	17
432*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TSF_SYNC_MODE_DIS	0
433*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TSF_SYNC_MODE_STA	1
434*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TSF_SYNC_MODE_IBSS	2
435*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TSF_SYNC_MODE_HOSTAP	3
436*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TSF_TIMER_EN		(1 << 16)
437*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BCN_INTVAL_SHIFT		0
438*8a3c961bSfei feng - Sun Microsystems - Beijing China 
439*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TBTT_SYNC_CFG */
440*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BCN_CWMIN_SHIFT		20
441*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BCN_AIFSN_SHIFT		16
442*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BCN_EXP_WIN_SHIFT	8
443*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TBTT_ADJUST_SHIFT	0
444*8a3c961bSfei feng - Sun Microsystems - Beijing China 
445*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register INT_TIMER_CFG */
446*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_GP_TIMER_SHIFT		16
447*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PRE_TBTT_TIMER_SHIFT	0
448*8a3c961bSfei feng - Sun Microsystems - Beijing China 
449*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register INT_TIMER_EN */
450*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_GP_TIMER_EN	(1 << 1)
451*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PRE_TBTT_INT_EN	(1 << 0)
452*8a3c961bSfei feng - Sun Microsystems - Beijing China 
453*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register MAC_STATUS_REG */
454*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_STATUS_BUSY	(1 << 1)
455*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_STATUS_BUSY	(1 << 0)
456*8a3c961bSfei feng - Sun Microsystems - Beijing China 
457*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register PWR_PIN_CFG */
458*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_IO_ADDA_PD	(1 << 3)
459*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_IO_PLL_PD	(1 << 2)
460*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_IO_RA_PE		(1 << 1)
461*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_IO_RF_PE		(1 << 0)
462*8a3c961bSfei feng - Sun Microsystems - Beijing China 
463*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register AUTO_WAKEUP_CFG */
464*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_AUTO_WAKEUP_EN		(1 << 15)
465*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SLEEP_TBTT_NUM_SHIFT	8
466*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WAKEUP_LEAD_TIME_SHIFT	0
467*8a3c961bSfei feng - Sun Microsystems - Beijing China 
468*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TX_PIN_CFG */
469*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TRSW_POL		(1 << 19)
470*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TRSW_EN		(1 << 18)
471*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RFTR_POL		(1 << 17)
472*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RFTR_EN		(1 << 16)
473*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LNA_PE_G1_POL	(1 << 15)
474*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LNA_PE_A1_POL	(1 << 14)
475*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LNA_PE_G0_POL	(1 << 13)
476*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LNA_PE_A0_POL	(1 << 12)
477*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LNA_PE_G1_EN	(1 << 11)
478*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LNA_PE_A1_EN	(1 << 10)
479*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LNA_PE_G0_EN	(1 <<  9)
480*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LNA_PE_A0_EN	(1 <<  8)
481*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PA_PE_G1_POL	(1 <<  7)
482*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PA_PE_A1_POL	(1 <<  6)
483*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PA_PE_G0_POL	(1 <<  5)
484*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PA_PE_A0_POL	(1 <<  4)
485*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PA_PE_G1_EN	(1 <<  3)
486*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PA_PE_A1_EN	(1 <<  2)
487*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PA_PE_G0_EN	(1 <<  1)
488*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PA_PE_A0_EN	(1 <<  0)
489*8a3c961bSfei feng - Sun Microsystems - Beijing China 
490*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TX_BAND_CFG */
491*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_5G_BAND_SEL_N	(1 << 2)
492*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_5G_BAND_SEL_P	(1 << 1)
493*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_BAND_SEL	(1 << 0)
494*8a3c961bSfei feng - Sun Microsystems - Beijing China 
495*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TX_SW_CFG0 */
496*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DLY_RFTR_EN_SHIFT	24
497*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DLY_TRSW_EN_SHIFT	16
498*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DLY_PAPE_EN_SHIFT	8
499*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DLY_TXPE_EN_SHIFT	0
500*8a3c961bSfei feng - Sun Microsystems - Beijing China 
501*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TX_SW_CFG1 */
502*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DLY_RFTR_DIS_SHIFT	16
503*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DLY_TRSW_DIS_SHIFT	8
504*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DLY_PAPE_DIS SHIFT	0
505*8a3c961bSfei feng - Sun Microsystems - Beijing China 
506*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TX_SW_CFG2 */
507*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DLY_LNA_EN_SHIFT		24
508*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DLY_LNA_DIS_SHIFT	16
509*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DLY_DAC_EN_SHIFT		8
510*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DLY_DAC_DIS_SHIFT	0
511*8a3c961bSfei feng - Sun Microsystems - Beijing China 
512*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TXOP_THRES_CFG */
513*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_REM_THRES_SHIFT	24
514*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CF_END_THRES_SHIFT	16
515*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RDG_IN_THRES		8
516*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RDG_OUT_THRES		0
517*8a3c961bSfei feng - Sun Microsystems - Beijing China 
518*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TXOP_CTRL_CFG */
519*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EXT_CW_MIN_SHIFT		16
520*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EXT_CCA_DLY_SHIFT	8
521*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EXT_CCA_EN		(1 << 7)
522*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LSIG_TXOP_EN		(1 << 6)
523*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_TRUN_EN_MIMOPS	(1 << 4)
524*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_TRUN_EN_TXOP	(1 << 3)
525*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_TRUN_EN_RATE	(1 << 2)
526*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_TRUN_EN_AC		(1 << 1)
527*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_TRUN_EN_TIMEOUT	(1 << 0)
528*8a3c961bSfei feng - Sun Microsystems - Beijing China 
529*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TX_RTS_CFG */
530*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RTS_FBK_EN		(1 << 24)
531*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RTS_THRES_SHIFT		8
532*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RTS_RTY_LIMIT_SHIFT	0
533*8a3c961bSfei feng - Sun Microsystems - Beijing China 
534*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TX_TIMEOUT_CFG */
535*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_TIMEOUT_SHIFT	16
536*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_ACK_TIMEOUT_SHIFT	8
537*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MPDU_LIFE_TIME_SHIFT	4
538*8a3c961bSfei feng - Sun Microsystems - Beijing China 
539*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TX_RTY_CFG */
540*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_AUTOFB_EN		(1 << 30)
541*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_AGG_RTY_MODE_TIMER	(1 << 29)
542*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_NAG_RTY_MODE_TIMER	(1 << 28)
543*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LONG_RTY_THRES_SHIFT	16
544*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LONG_RTY_LIMIT_SHIFT	8
545*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_SHORT_RTY_LIMIT_SHIFT	0
546*8a3c961bSfei feng - Sun Microsystems - Beijing China 
547*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TX_LINK_CFG */
548*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_REMOTE_MFS_SHIFT		24
549*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_REMOTE_MFB_SHIFT		16
550*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_CFACK_EN		(1 << 12)
551*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_RDG_EN		(1 << 11)
552*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_MRQ_EN		(1 << 10)
553*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_REMOTE_UMFS_EN		(1 <<  9)
554*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_MFB_EN		(1 <<  8)
555*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_REMOTE_MFB_LT_SHIFT	0
556*8a3c961bSfei feng - Sun Microsystems - Beijing China 
557*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for registers *_PROT_CFG */
558*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RTSTH_EN			(1 << 26)
559*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ALLOW_GF40		(1 << 25)
560*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ALLOW_GF20		(1 << 24)
561*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ALLOW_MM40		(1 << 23)
562*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ALLOW_MM20		(1 << 22)
563*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ALLOW_OFDM		(1 << 21)
564*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ALLOW_CCK		(1 << 20)
565*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ALLOW_ALL		(0x3f << 20)
566*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PROT_NAV_SHORT		(1 << 18)
567*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PROT_NAV_LONG		(2 << 18)
568*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PROT_CTRL_RTS_CTS	(1 << 16)
569*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PROT_CTRL_CTS		(2 << 16)
570*8a3c961bSfei feng - Sun Microsystems - Beijing China 
571*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for registers EXP_{CTS,ACK}_TIME */
572*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EXP_OFDM_TIME_SHIFT	16
573*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EXP_CCK_TIME_SHIFT	0
574*8a3c961bSfei feng - Sun Microsystems - Beijing China 
575*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register RX_FILTR_CFG */
576*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_CTRL_RSV	(1 << 16)
577*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_BAR		(1 << 15)
578*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_BA		(1 << 14)
579*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_PSPOLL	(1 << 13)
580*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_RTS		(1 << 12)
581*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_CTS		(1 << 11)
582*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_ACK		(1 << 10)
583*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_CFEND	(1 <<  9)
584*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_CFACK	(1 <<  8)
585*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_DUPL	(1 <<  7)
586*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_BC		(1 <<  6)
587*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_MC		(1 <<  5)
588*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_VER_ERR	(1 <<  4)
589*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_NOT_MYBSS	(1 <<  3)
590*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_UC_NOME	(1 <<  2)
591*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_PHY_ERR	(1 <<  1)
592*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DROP_CRC_ERR	(1 <<  0)
593*8a3c961bSfei feng - Sun Microsystems - Beijing China 
594*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register AUTO_RSP_CFG */
595*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CTRL_PWR_BIT	(1 << 7)
596*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BAC_ACK_POLICY	(1 << 6)
597*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CCK_SHORT_EN	(1 << 4)
598*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CTS_40M_REF_EN	(1 << 3)
599*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CTS_40M_MODE_EN	(1 << 2)
600*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_BAC_ACKPOLICY_EN	(1 << 1)
601*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_AUTO_RSP_EN	(1 << 0)
602*8a3c961bSfei feng - Sun Microsystems - Beijing China 
603*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register SIFS_COST_CFG */
604*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_OFDM_SIFS_COST_SHIFT	8
605*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_CCK_SIFS_COST_SHIFT	0
606*8a3c961bSfei feng - Sun Microsystems - Beijing China 
607*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TXOP_HLDR_ET */
608*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ETM1_EN		(1 << 25)
609*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ETM0_EN		(1 << 24)
610*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ETM_THRES_SHIFT	16
611*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ETO_EN		(1 <<  8)
612*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXOP_ETO_THRES_SHIFT	1
613*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PER_RX_RST_EN		(1 <<  0)
614*8a3c961bSfei feng - Sun Microsystems - Beijing China 
615*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register TX_STAT_FIFO */
616*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXQ_MCS_SHIFT	16
617*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXQ_WCID_SHIFT	8
618*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXQ_ACKREQ	(1 << 7)
619*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXQ_AGG		(1 << 6)
620*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXQ_OK		(1 << 5)
621*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXQ_PID_SHIFT	1
622*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TXQ_VLD		(1 << 0)
623*8a3c961bSfei feng - Sun Microsystems - Beijing China 
624*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register WCID_ATTR */
625*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MODE_NOSEC	0
626*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MODE_WEP40	1
627*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MODE_WEP104	2
628*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MODE_TKIP	3
629*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MODE_AES_CCMP	4
630*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MODE_CKIP40	5
631*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MODE_CKIP104	6
632*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_MODE_CKIP128	7
633*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_PKEY_EN	(1 << 0)
634*8a3c961bSfei feng - Sun Microsystems - Beijing China 
635*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for register H2M_MAILBOX */
636*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_H2M_BUSY		(1 << 24)
637*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TOKEN_NO_INTR	0xff
638*8a3c961bSfei feng - Sun Microsystems - Beijing China 
639*8a3c961bSfei feng - Sun Microsystems - Beijing China /* possible flags for MCU command RT2860_MCU_CMD_LEDS */
640*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LED_RADIO	(1 << 13)
641*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LED_LINK_2GHZ	(1 << 14)
642*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_LED_LINK_5GHZ	(1 << 15)
643*8a3c961bSfei feng - Sun Microsystems - Beijing China 
644*8a3c961bSfei feng - Sun Microsystems - Beijing China #pragma pack(1)
645*8a3c961bSfei feng - Sun Microsystems - Beijing China /* TX descriptor */
646*8a3c961bSfei feng - Sun Microsystems - Beijing China struct rt2860_txd {
647*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint32_t	sdp0;		/* Segment Data Pointer 0 */
648*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint16_t	sdl1;		/* Segment Data Length 1 */
649*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_BURST	(1 << 15)
650*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_LS1	(1 << 14)	/* SDP1 is the last segment */
651*8a3c961bSfei feng - Sun Microsystems - Beijing China 
652*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint16_t	sdl0;		/* Segment Data Length 0 */
653*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_DDONE	(1 << 15)
654*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_LS0	(1 << 14)	/* SDP0 is the last segment */
655*8a3c961bSfei feng - Sun Microsystems - Beijing China 
656*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint32_t	sdp1;		/* Segment Data Pointer 1 */
657*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint8_t		reserved[3];
658*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint8_t		flags;
659*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_QSEL_SHIFT	1
660*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_QSEL_MGMT	(0 << 1)
661*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_QSEL_HCCA	(1 << 1)
662*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_QSEL_EDCA	(2 << 1)
663*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_WIV		(1 << 0)
664*8a3c961bSfei feng - Sun Microsystems - Beijing China };
665*8a3c961bSfei feng - Sun Microsystems - Beijing China #pragma pack()
666*8a3c961bSfei feng - Sun Microsystems - Beijing China 
667*8a3c961bSfei feng - Sun Microsystems - Beijing China #pragma pack(1)
668*8a3c961bSfei feng - Sun Microsystems - Beijing China /* TX Wireless Information */
669*8a3c961bSfei feng - Sun Microsystems - Beijing China struct rt2860_txwi {
670*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint8_t		flags;
671*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_MPDU_DSITY_SHIFT	5
672*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_AMPDU			(1 << 4)
673*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_TS			(1 << 3)
674*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_CFACK			(1 << 2)
675*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_MMPS			(1 << 1)
676*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_FRAG			(1 << 0)
677*8a3c961bSfei feng - Sun Microsystems - Beijing China 
678*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint8_t		txop;
679*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_TXOP_HT	0
680*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_TXOP_PIFS	1
681*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_TXOP_SIFS	2
682*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_TXOP_BACKOFF	3
683*8a3c961bSfei feng - Sun Microsystems - Beijing China 
684*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint16_t	phy;
685*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PHY_MODE		0xc000
686*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PHY_CCK		(0 << 14)
687*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PHY_OFDM		(1 << 14)
688*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PHY_HT		(2 << 14)
689*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PHY_HT_GF	(3 << 14)
690*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PHY_SGI		(1 << 8)
691*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PHY_BW40		(1 << 7)
692*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PHY_MCS		0x7f
693*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_PHY_SHPRE	(1 << 3)
694*8a3c961bSfei feng - Sun Microsystems - Beijing China 
695*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint8_t		xflags;
696*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_BAWINSIZE_SHIFT	2
697*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_NSEQ			(1 << 1)
698*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_ACK			(1 << 0)
699*8a3c961bSfei feng - Sun Microsystems - Beijing China 
700*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint8_t		wcid;	/* Wireless Client ID */
701*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint16_t	len;
702*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_TX_PID_SHIFT	12
703*8a3c961bSfei feng - Sun Microsystems - Beijing China 
704*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint32_t	iv;
705*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint32_t	eiv;
706*8a3c961bSfei feng - Sun Microsystems - Beijing China 
707*8a3c961bSfei feng - Sun Microsystems - Beijing China 	struct		ieee80211_frame wh;
708*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint16_t	pad;
709*8a3c961bSfei feng - Sun Microsystems - Beijing China };
710*8a3c961bSfei feng - Sun Microsystems - Beijing China #pragma pack()
711*8a3c961bSfei feng - Sun Microsystems - Beijing China 
712*8a3c961bSfei feng - Sun Microsystems - Beijing China #pragma pack(1)
713*8a3c961bSfei feng - Sun Microsystems - Beijing China /* RX descriptor */
714*8a3c961bSfei feng - Sun Microsystems - Beijing China struct rt2860_rxd {
715*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint32_t	sdp0;
716*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint16_t	sdl1;	/* unused */
717*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint16_t	sdl0;
718*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_DDONE	(1 << 15)
719*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_LS0	(1 << 14)
720*8a3c961bSfei feng - Sun Microsystems - Beijing China 
721*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint32_t	sdp1;	/* unused */
722*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint32_t	flags;
723*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_DEC		(1 << 16)
724*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_AMPDU		(1 << 15)
725*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_L2PAD		(1 << 14)
726*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_RSSI		(1 << 13)
727*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_HTC		(1 << 12)
728*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_AMSDU		(1 << 11)
729*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_MICERR	(1 << 10)
730*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_ICVERR	(1 <<  9)
731*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_CRCERR	(1 <<  8)
732*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_MYBSS		(1 <<  7)
733*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_BC		(1 <<  6)
734*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_MC		(1 <<  5)
735*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_UC2ME		(1 <<  4)
736*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_FRAG		(1 <<  3)
737*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_NULL		(1 <<  2)
738*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_DATA		(1 <<  1)
739*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_BA		(1 <<  0)
740*8a3c961bSfei feng - Sun Microsystems - Beijing China };
741*8a3c961bSfei feng - Sun Microsystems - Beijing China #pragma pack()
742*8a3c961bSfei feng - Sun Microsystems - Beijing China 
743*8a3c961bSfei feng - Sun Microsystems - Beijing China #pragma pack(1)
744*8a3c961bSfei feng - Sun Microsystems - Beijing China /* RX Wireless Information */
745*8a3c961bSfei feng - Sun Microsystems - Beijing China struct rt2860_rxwi {
746*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint8_t		wcid;
747*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint8_t		keyidx;
748*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_UDF_SHIFT	5
749*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_BSS_IDX_SHIFT	2
750*8a3c961bSfei feng - Sun Microsystems - Beijing China 
751*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint16_t	len;
752*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RX_TID_SHIFT	12
753*8a3c961bSfei feng - Sun Microsystems - Beijing China 
754*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint16_t	seq;
755*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint16_t	phy;
756*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint8_t		rssi[3];
757*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint8_t		reserved1;
758*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint8_t		snr[2];
759*8a3c961bSfei feng - Sun Microsystems - Beijing China 	uint16_t	reserved2;
760*8a3c961bSfei feng - Sun Microsystems - Beijing China };
761*8a3c961bSfei feng - Sun Microsystems - Beijing China #pragma pack()
762*8a3c961bSfei feng - Sun Microsystems - Beijing China 
763*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RAL_RF1	0
764*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RAL_RF2	2
765*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RAL_RF3	1
766*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RAL_RF4	3
767*8a3c961bSfei feng - Sun Microsystems - Beijing China 
768*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_2820			1	/* 2T3R */
769*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_2850			2	/* dual-band 2T3R */
770*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_2720			3	/* 1T2R */
771*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF_2750			4	/* dual-band 1T2R */
772*8a3c961bSfei feng - Sun Microsystems - Beijing China 
773*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_DELAY	1	/* minimum hold time (microsecond) */
774*8a3c961bSfei feng - Sun Microsystems - Beijing China 
775*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_VERSION		0x01
776*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_MAC01		0x02
777*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_MAC23		0x03
778*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_MAC45		0x04
779*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_PCIE_PSLEVEL	0x11
780*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_REV		0x12
781*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_ANTENNA		0x1a
782*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_CONFIG		0x1b
783*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_COUNTRY		0x1c
784*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_FREQ_LEDS		0x1d
785*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_LED1		0x1e
786*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_LED2		0x1f
787*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_LED3		0x20
788*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_LNA		0x22
789*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_RSSI1_2GHZ	0x23
790*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_RSSI2_2GHZ	0x24
791*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_RSSI1_5GHZ	0x25
792*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_RSSI2_5GHZ	0x26
793*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_DELTAPWR		0x28
794*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_PWR2GHZ_BASE1	0x29
795*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_PWR2GHZ_BASE2	0x30
796*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_TSSI1_2GHZ	0x37
797*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_TSSI2_2GHZ	0x38
798*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_TSSI3_2GHZ	0x39
799*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_TSSI4_2GHZ	0x3a
800*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_TSSI5_2GHZ	0x3b
801*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_PWR5GHZ_BASE1	0x3c
802*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_PWR5GHZ_BASE2	0x53
803*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_TSSI1_5GHZ	0x6a
804*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_TSSI2_5GHZ	0x6b
805*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_TSSI3_5GHZ	0x6c
806*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_TSSI4_5GHZ	0x6d
807*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_TSSI5_5GHZ	0x6e
808*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_RPWR		0x6f
809*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_BBP_BASE		0x78
810*8a3c961bSfei feng - Sun Microsystems - Beijing China 
811*8a3c961bSfei feng - Sun Microsystems - Beijing China 
812*8a3c961bSfei feng - Sun Microsystems - Beijing China /*
813*8a3c961bSfei feng - Sun Microsystems - Beijing China  * control and status registers access macros
814*8a3c961bSfei feng - Sun Microsystems - Beijing China  */
815*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_READ(sc, reg)						\
816*8a3c961bSfei feng - Sun Microsystems - Beijing China 	ddi_get32((sc)->sc_io_handle,					\
817*8a3c961bSfei feng - Sun Microsystems - Beijing China 	    (uint32_t *)((uintptr_t)(sc)->sc_io_base + (reg)))
818*8a3c961bSfei feng - Sun Microsystems - Beijing China 
819*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_WRITE(sc, reg, val)					\
820*8a3c961bSfei feng - Sun Microsystems - Beijing China 	ddi_put32((sc)->sc_io_handle,					\
821*8a3c961bSfei feng - Sun Microsystems - Beijing China 	    (uint32_t *)((uintptr_t)(sc)->sc_io_base + (reg)), (val))
822*8a3c961bSfei feng - Sun Microsystems - Beijing China 
823*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	rt2860_mem_write1(sc, reg, val)					\
824*8a3c961bSfei feng - Sun Microsystems - Beijing China 	ddi_put8((sc)->sc_io_handle,					\
825*8a3c961bSfei feng - Sun Microsystems - Beijing China 	    (uint8_t *)((sc)->sc_io_base + (reg)), (val))
826*8a3c961bSfei feng - Sun Microsystems - Beijing China 
827*8a3c961bSfei feng - Sun Microsystems - Beijing China /*
828*8a3c961bSfei feng - Sun Microsystems - Beijing China  * EEPROM access macro
829*8a3c961bSfei feng - Sun Microsystems - Beijing China  */
830*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_EEPROM_CTL(sc, val) {					\
831*8a3c961bSfei feng - Sun Microsystems - Beijing China 	RT2860_WRITE((sc), RT2860_PCI_EECTRL, (val));			\
832*8a3c961bSfei feng - Sun Microsystems - Beijing China 	DELAY(RT2860_EEPROM_DELAY);					\
833*8a3c961bSfei feng - Sun Microsystems - Beijing China }
834*8a3c961bSfei feng - Sun Microsystems - Beijing China 
835*8a3c961bSfei feng - Sun Microsystems - Beijing China /*
836*8a3c961bSfei feng - Sun Microsystems - Beijing China  * Default values for MAC registers; values taken from the reference driver.
837*8a3c961bSfei feng - Sun Microsystems - Beijing China  */
838*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DEF_MAC					\
839*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_BCN_OFFSET0,		0xf8f0e8e0 },	\
840*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_LEGACY_BASIC_RATE,	0x0000013f },	\
841*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_HT_BASIC_RATE,		0x00008003 },	\
842*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_MAC_SYS_CTRL,		0x00000000 },	\
843*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_BKOFF_SLOT_CFG,	0x00000209 },	\
844*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_TX_SW_CFG0,		0x00040a06 },	\
845*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_TX_SW_CFG1,		0x00080606 },	\
846*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_TX_LINK_CFG,		0x00001020 },	\
847*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_TX_TIMEOUT_CFG,	0x000a2090 },	\
848*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_LED_CFG,		0x7f031e46 },	\
849*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_WMM_AIFSN_CFG,		0x00002273 },	\
850*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_WMM_CWMIN_CFG,		0x00002344 },	\
851*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_WMM_CWMAX_CFG,		0x000034aa },	\
852*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_MAX_PCNT,		0x1f3fbf9f },	\
853*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_TX_RTY_CFG,		0x47d01f0f },	\
854*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_AUTO_RSP_CFG,		0x00000013 },	\
855*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_CCK_PROT_CFG,		0x05740003 },	\
856*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_OFDM_PROT_CFG,		0x05740003 },	\
857*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_GF20_PROT_CFG,		0x01744004 },	\
858*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_GF40_PROT_CFG,		0x03f44084 },	\
859*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_MM20_PROT_CFG,		0x01744004 },	\
860*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_MM40_PROT_CFG,		0x03f54084 },	\
861*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_TXOP_CTRL_CFG,		0x0000583f },	\
862*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_TXOP_HLDR_ET,		0x00000002 },	\
863*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_TX_RTS_CFG,		0x00092b20 },	\
864*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_EXP_ACK_TIME,		0x002400ca },	\
865*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_XIFS_TIME_CFG,		0x33a41010 },	\
866*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ RT2860_PWR_PIN_CFG,		0x00000003 }
867*8a3c961bSfei feng - Sun Microsystems - Beijing China 
868*8a3c961bSfei feng - Sun Microsystems - Beijing China /*
869*8a3c961bSfei feng - Sun Microsystems - Beijing China  * Default values for BBP registers; values taken from the reference driver.
870*8a3c961bSfei feng - Sun Microsystems - Beijing China  */
871*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_DEF_BBP	\
872*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  65, 0x2c },	\
873*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  66, 0x38 },	\
874*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  69, 0x12 },	\
875*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  73, 0x10 },	\
876*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  81, 0x37 },	\
877*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  82, 0x62 },	\
878*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  83, 0x6a },	\
879*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  84, 0x19 },	\
880*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  86, 0x00 },	\
881*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  91, 0x04 },	\
882*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  92, 0x00 },	\
883*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 105, 0x01 }
884*8a3c961bSfei feng - Sun Microsystems - Beijing China 
885*8a3c961bSfei feng - Sun Microsystems - Beijing China /*
886*8a3c961bSfei feng - Sun Microsystems - Beijing China  * Default settings for RF registers; values derived from the reference driver.
887*8a3c961bSfei feng - Sun Microsystems - Beijing China  */
888*8a3c961bSfei feng - Sun Microsystems - Beijing China #define	RT2860_RF2850						\
889*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{   1, 0x100bb3, 0x1301e1, 0x05a014, 0x001402 },	\
890*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{   2, 0x100bb3, 0x1301e1, 0x05a014, 0x001407 },	\
891*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{   3, 0x100bb3, 0x1301e2, 0x05a014, 0x001402 },	\
892*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{   4, 0x100bb3, 0x1301e2, 0x05a014, 0x001407 },	\
893*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{   5, 0x100bb3, 0x1301e3, 0x05a014, 0x001402 },	\
894*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{   6, 0x100bb3, 0x1301e3, 0x05a014, 0x001407 },	\
895*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{   7, 0x100bb3, 0x1301e4, 0x05a014, 0x001402 },	\
896*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{   8, 0x100bb3, 0x1301e4, 0x05a014, 0x001407 },	\
897*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{   9, 0x100bb3, 0x1301e5, 0x05a014, 0x001402 },	\
898*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  10, 0x100bb3, 0x1301e5, 0x05a014, 0x001407 },	\
899*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  11, 0x100bb3, 0x1301e6, 0x05a014, 0x001402 },	\
900*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  12, 0x100bb3, 0x1301e6, 0x05a014, 0x001407 },	\
901*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  13, 0x100bb3, 0x1301e7, 0x05a014, 0x001402 },	\
902*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  14, 0x100bb3, 0x1301e8, 0x05a014, 0x001404 },	\
903*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  36, 0x100bb3, 0x130266, 0x056014, 0x001408 },	\
904*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  38, 0x100bb3, 0x130267, 0x056014, 0x001404 },	\
905*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  40, 0x100bb2, 0x1301a0, 0x056014, 0x001400 },	\
906*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  44, 0x100bb2, 0x1301a0, 0x056014, 0x001408 },	\
907*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  46, 0x100bb2, 0x1301a1, 0x056014, 0x001402 },	\
908*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  48, 0x100bb2, 0x1301a1, 0x056014, 0x001406 },	\
909*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  52, 0x100bb2, 0x1301a2, 0x056014, 0x001404 },	\
910*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  54, 0x100bb2, 0x1301a2, 0x056014, 0x001408 },	\
911*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  56, 0x100bb2, 0x1301a3, 0x056014, 0x001402 },	\
912*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  60, 0x100bb2, 0x1301a4, 0x056014, 0x001400 },	\
913*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  62, 0x100bb2, 0x1301a4, 0x056014, 0x001404 },	\
914*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{  64, 0x100bb2, 0x1301a4, 0x056014, 0x001408 },	\
915*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 100, 0x100bb2, 0x1301ac, 0x05e014, 0x001400 },	\
916*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 102, 0x100bb2, 0x1301ac, 0x05e014, 0x001404 },	\
917*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 104, 0x100bb2, 0x1301ac, 0x05e014, 0x001408 },	\
918*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 108, 0x100bb3, 0x13028c, 0x05e014, 0x001404 },	\
919*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 110, 0x100bb3, 0x13028d, 0x05e014, 0x001400 },	\
920*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 112, 0x100bb3, 0x13028d, 0x05e014, 0x001406 },	\
921*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 116, 0x100bb3, 0x13028e, 0x05e014, 0x001408 },	\
922*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 118, 0x100bb3, 0x13028f, 0x05e014, 0x001404 },	\
923*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 120, 0x100bb1, 0x1300e0, 0x05e014, 0x001400 },	\
924*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 124, 0x100bb1, 0x1300e0, 0x05e014, 0x001404 },	\
925*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 126, 0x100bb1, 0x1300e0, 0x05e014, 0x001406 },	\
926*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 128, 0x100bb1, 0x1300e0, 0x05e014, 0x001408 },	\
927*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 132, 0x100bb1, 0x1300e1, 0x05e014, 0x001402 },	\
928*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 134, 0x100bb1, 0x1300e1, 0x05e014, 0x001404 },	\
929*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 136, 0x100bb1, 0x1300e1, 0x05e014, 0x001406 },	\
930*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 140, 0x100bb1, 0x1300e2, 0x05e014, 0x001400 },	\
931*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 149, 0x100bb1, 0x1300e2, 0x05e014, 0x001409 },	\
932*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 151, 0x100bb1, 0x1300e3, 0x05e014, 0x001401 },	\
933*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 153, 0x100bb1, 0x1300e3, 0x05e014, 0x001403 },	\
934*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 157, 0x100bb1, 0x1300e3, 0x05e014, 0x001407 },	\
935*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 159, 0x100bb1, 0x1300e3, 0x05e014, 0x001409 },	\
936*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 161, 0x100bb1, 0x1300e4, 0x05e014, 0x001401 },	\
937*8a3c961bSfei feng - Sun Microsystems - Beijing China 	{ 165, 0x100bb1, 0x1300e4, 0x05e014, 0x001405 }
938*8a3c961bSfei feng - Sun Microsystems - Beijing China 
939*8a3c961bSfei feng - Sun Microsystems - Beijing China 
940*8a3c961bSfei feng - Sun Microsystems - Beijing China #ifdef __cplusplus
941*8a3c961bSfei feng - Sun Microsystems - Beijing China }
942*8a3c961bSfei feng - Sun Microsystems - Beijing China #endif
943*8a3c961bSfei feng - Sun Microsystems - Beijing China 
944*8a3c961bSfei feng - Sun Microsystems - Beijing China #endif /* _RT2860_REG_H */
945