xref: /illumos-gate/usr/src/uts/common/io/arn/arn_ath9k.h (revision c0c93480)
1dd1de374Slin wang - Sun Microsystems - Beijing China /*
2*c0c93480Slin wang - Sun Microsystems - Beijing China  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
3dd1de374Slin wang - Sun Microsystems - Beijing China  * Use is subject to license terms.
4dd1de374Slin wang - Sun Microsystems - Beijing China  */
5dd1de374Slin wang - Sun Microsystems - Beijing China 
6dd1de374Slin wang - Sun Microsystems - Beijing China /*
7dd1de374Slin wang - Sun Microsystems - Beijing China  * Copyright (c) 2008 Atheros Communications Inc.
8dd1de374Slin wang - Sun Microsystems - Beijing China  *
9dd1de374Slin wang - Sun Microsystems - Beijing China  * Permission to use, copy, modify, and/or distribute this software for any
10dd1de374Slin wang - Sun Microsystems - Beijing China  * purpose with or without fee is hereby granted, provided that the above
11dd1de374Slin wang - Sun Microsystems - Beijing China  * copyright notice and this permission notice appear in all copies.
12dd1de374Slin wang - Sun Microsystems - Beijing China  *
13dd1de374Slin wang - Sun Microsystems - Beijing China  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14dd1de374Slin wang - Sun Microsystems - Beijing China  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15dd1de374Slin wang - Sun Microsystems - Beijing China  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16dd1de374Slin wang - Sun Microsystems - Beijing China  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17dd1de374Slin wang - Sun Microsystems - Beijing China  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18dd1de374Slin wang - Sun Microsystems - Beijing China  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19dd1de374Slin wang - Sun Microsystems - Beijing China  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20dd1de374Slin wang - Sun Microsystems - Beijing China  */
21dd1de374Slin wang - Sun Microsystems - Beijing China 
22dd1de374Slin wang - Sun Microsystems - Beijing China #ifndef	_ARN_ATH9K_H
23dd1de374Slin wang - Sun Microsystems - Beijing China #define	_ARN_ATH9K_H
24dd1de374Slin wang - Sun Microsystems - Beijing China 
25dd1de374Slin wang - Sun Microsystems - Beijing China #ifdef __cplusplus
26dd1de374Slin wang - Sun Microsystems - Beijing China extern "C" {
27dd1de374Slin wang - Sun Microsystems - Beijing China #endif
28dd1de374Slin wang - Sun Microsystems - Beijing China 
293ae945c3Slin wang - Sun Microsystems - Beijing China #define	FUDGE	2
303ae945c3Slin wang - Sun Microsystems - Beijing China 
31dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_band {
32dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_BAND_2GHZ,
33dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_BAND_5GHZ,
34dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_NUM_BANDS
35dd1de374Slin wang - Sun Microsystems - Beijing China };
36dd1de374Slin wang - Sun Microsystems - Beijing China 
37dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATHEROS_VENDOR_ID	0x168c
38dd1de374Slin wang - Sun Microsystems - Beijing China 
39dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR5416_DEVID_PCI	0x0023
40dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR5416_DEVID_PCIE	0x0024
41dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR9160_DEVID_PCI	0x0027
42dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR9280_DEVID_PCI	0x0029
43dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR9280_DEVID_PCIE	0x002a
44dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR9285_DEVID_PCIE	0x002b
45dd1de374Slin wang - Sun Microsystems - Beijing China 
46dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR5416_AR9100_DEVID	0x000b
47dd1de374Slin wang - Sun Microsystems - Beijing China 
48dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_SUBVENDOR_ID_NOG	0x0e11
49dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_SUBVENDOR_ID_NEW_A	0x7065
50dd1de374Slin wang - Sun Microsystems - Beijing China 
51dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXERR_XRETRY		0x01
52dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXERR_FILT		0x02
53dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXERR_FIFO		0x04
54dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXERR_XTXOP		0x08
55dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXERR_TIMER_EXPIRED	0x10
56dd1de374Slin wang - Sun Microsystems - Beijing China 
57dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TX_BA		0x01
58dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TX_PWRMGMT	0x02
59dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TX_DESC_CFG_ERR	0x04
60dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TX_DATA_UNDERRUN	0x08
61dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TX_DELIM_UNDERRUN	0x10
62dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TX_SW_ABORTED	0x40
63dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TX_SW_FILTERED	0x80
64dd1de374Slin wang - Sun Microsystems - Beijing China 
65dd1de374Slin wang - Sun Microsystems - Beijing China /* should be changed later */
66dd1de374Slin wang - Sun Microsystems - Beijing China #define	BIT(n)	(1UL << (n))
67dd1de374Slin wang - Sun Microsystems - Beijing China 
68dd1de374Slin wang - Sun Microsystems - Beijing China struct ath_tx_status {
69dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ts_tstamp;
70dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ts_seqnum;
71dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t ts_status;
72dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t ts_ratecode;
73dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t ts_rateindex;
74dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t ts_rssi;
75dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t ts_shortretry;
76dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t ts_longretry;
77dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t ts_virtcol;
78dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t ts_antenna;
79dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t ts_flags;
80dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t ts_rssi_ctl0;
81dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t ts_rssi_ctl1;
82dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t ts_rssi_ctl2;
83dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t ts_rssi_ext0;
84dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t ts_rssi_ext1;
85dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t ts_rssi_ext2;
86dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t pad[3];
87dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ba_low;
88dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ba_high;
89dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t evm0;
90dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t evm1;
91dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t evm2;
92dd1de374Slin wang - Sun Microsystems - Beijing China };
93dd1de374Slin wang - Sun Microsystems - Beijing China 
94dd1de374Slin wang - Sun Microsystems - Beijing China struct ath_rx_status {
95dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t rs_tstamp;
96dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t rs_datalen;
97dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t rs_status;
98dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t rs_phyerr;
99dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t rs_rssi;
100dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t rs_keyix;
101dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t rs_rate;
102dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t rs_antenna;
103dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t rs_more;
104dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t rs_rssi_ctl0;
105dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t rs_rssi_ctl1;
106dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t rs_rssi_ctl2;
107dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t rs_rssi_ext0;
108dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t rs_rssi_ext1;
109dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t rs_rssi_ext2;
110dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t rs_isaggr;
111dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t rs_moreaggr;
112dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t rs_num_delims;
113dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t rs_flags;
114dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t evm0;
115dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t evm1;
116dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t evm2;
117dd1de374Slin wang - Sun Microsystems - Beijing China };
118dd1de374Slin wang - Sun Microsystems - Beijing China 
119dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RXERR_CRC		0x01
120dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RXERR_PHY		0x02
121dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RXERR_FIFO	0x04
122dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RXERR_DECRYPT	0x08
123dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RXERR_MIC		0x10
124dd1de374Slin wang - Sun Microsystems - Beijing China 
125dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RX_MORE		0x01
126dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RX_MORE_AGGR	0x02
127dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RX_GI		0x04
128dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RX_2040		0x08
129dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RX_DELIM_CRC_PRE	0x10
130dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RX_DELIM_CRC_POST	0x20
131dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RX_DECRYPT_BUSY	0x40
132dd1de374Slin wang - Sun Microsystems - Beijing China 
133dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RXKEYIX_INVALID	((uint8_t)-1)
134dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXKEYIX_INVALID	((uint32_t)-1)
135dd1de374Slin wang - Sun Microsystems - Beijing China 
136dd1de374Slin wang - Sun Microsystems - Beijing China #pragma pack(1)
137dd1de374Slin wang - Sun Microsystems - Beijing China struct ath_desc {
138dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ds_link;
139dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ds_data;
140dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ds_ctl0;
141dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ds_ctl1;
142dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ds_hw[20];
143dd1de374Slin wang - Sun Microsystems - Beijing China 	union {
144dd1de374Slin wang - Sun Microsystems - Beijing China 		struct ath_tx_status tx;
145dd1de374Slin wang - Sun Microsystems - Beijing China 		struct ath_rx_status rx;
146dd1de374Slin wang - Sun Microsystems - Beijing China 		void *stats;
147dd1de374Slin wang - Sun Microsystems - Beijing China 	} ds_us;
148dd1de374Slin wang - Sun Microsystems - Beijing China 	void *ds_vdata;
149dd1de374Slin wang - Sun Microsystems - Beijing China };
150dd1de374Slin wang - Sun Microsystems - Beijing China #pragma pack()
151dd1de374Slin wang - Sun Microsystems - Beijing China 
152dd1de374Slin wang - Sun Microsystems - Beijing China #define	ds_txstat	ds_us.tx
153dd1de374Slin wang - Sun Microsystems - Beijing China #define	ds_rxstat	ds_us.rx
154dd1de374Slin wang - Sun Microsystems - Beijing China #define	ds_stat		ds_us.stats
155dd1de374Slin wang - Sun Microsystems - Beijing China 
156dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXDESC_CLRDMASK		0x0001
157dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXDESC_NOACK		0x0002
158dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXDESC_RTSENA		0x0004
159dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXDESC_CTSENA		0x0008
160dd1de374Slin wang - Sun Microsystems - Beijing China /*
161dd1de374Slin wang - Sun Microsystems - Beijing China  * ATH9K_TXDESC_INTREQ forces a tx interrupt to be generated for
162dd1de374Slin wang - Sun Microsystems - Beijing China  * the descriptor its marked on.  We take a tx interrupt to reap
163dd1de374Slin wang - Sun Microsystems - Beijing China  * descriptors when the h/w hits an EOL condition or
164dd1de374Slin wang - Sun Microsystems - Beijing China  * when the descriptor is specifically marked to generate
165dd1de374Slin wang - Sun Microsystems - Beijing China  * an interrupt with this flag. Descriptors should be
166dd1de374Slin wang - Sun Microsystems - Beijing China  * marked periodically to insure timely replenishing of the
167dd1de374Slin wang - Sun Microsystems - Beijing China  * supply needed for sending frames. Defering interrupts
168dd1de374Slin wang - Sun Microsystems - Beijing China  * reduces system load and potentially allows more concurrent
169dd1de374Slin wang - Sun Microsystems - Beijing China  * work to be done but if done to aggressively can cause
170dd1de374Slin wang - Sun Microsystems - Beijing China  * senders to backup. When the hardware queue is left too
171dd1de374Slin wang - Sun Microsystems - Beijing China  * large rate control information may also be too out of
172dd1de374Slin wang - Sun Microsystems - Beijing China  * date. An Alternative for this is TX interrupt mitigation
173dd1de374Slin wang - Sun Microsystems - Beijing China  * but this needs more testing.
174dd1de374Slin wang - Sun Microsystems - Beijing China  */
175dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXDESC_INTREQ		0x0010
176dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXDESC_VEOL		0x0020
177dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXDESC_EXT_ONLY		0x0040
178dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXDESC_EXT_AND_CTL	0x0080
179dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXDESC_VMF		0x0100
180dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXDESC_FRAG_IS_ON 	0x0200
181dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXDESC_CAB		0x0400
182dd1de374Slin wang - Sun Microsystems - Beijing China 
183dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RXDESC_INTREQ		0x0020
184dd1de374Slin wang - Sun Microsystems - Beijing China 
185dd1de374Slin wang - Sun Microsystems - Beijing China enum wireless_mode {
186dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_MODE_11A = 0,
187dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_MODE_11B = 2,
188dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_MODE_11G = 3,
189dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_MODE_11NA_HT20 = 6,
190dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_MODE_11NG_HT20 = 7,
191dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_MODE_11NA_HT40PLUS = 8,
192dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_MODE_11NA_HT40MINUS = 9,
193dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_MODE_11NG_HT40PLUS = 10,
194dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_MODE_11NG_HT40MINUS = 11,
195dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_MODE_MAX
196dd1de374Slin wang - Sun Microsystems - Beijing China };
197dd1de374Slin wang - Sun Microsystems - Beijing China 
198dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_hw_caps {
199dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_CHAN_SPREAD		= BIT(0),
200dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_MIC_AESCCM			= BIT(1),
201dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_MIC_CKIP			= BIT(2),
202dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_MIC_TKIP			= BIT(3),
203dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_CIPHER_AESCCM		= BIT(4),
204dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_CIPHER_CKIP		= BIT(5),
205dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_CIPHER_TKIP		= BIT(6),
206dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_VEOL			= BIT(7),
207dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_BSSIDMASK			= BIT(8),
208dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_MCAST_KEYSEARCH		= BIT(9),
209dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_CHAN_HALFRATE		= BIT(10),
210dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_CHAN_QUARTERRATE		= BIT(11),
211dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_HT				= BIT(12),
212dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_GTT			= BIT(13),
213dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_FASTCC			= BIT(14),
214dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_RFSILENT			= BIT(15),
215dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_WOW			= BIT(16),
216dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_CST			= BIT(17),
217dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_ENHANCEDPM			= BIT(18),
218dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_AUTOSLEEP			= BIT(19),
219dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_4KB_SPLITTRANS		= BIT(20),
220dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HW_CAP_WOW_MATCHPATTERN_EXACT	= BIT(21),
221dd1de374Slin wang - Sun Microsystems - Beijing China };
222dd1de374Slin wang - Sun Microsystems - Beijing China 
223dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_capability_type {
224dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_CIPHER = 0,
225dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_TKIP_MIC,
226dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_TKIP_SPLIT,
227dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_PHYCOUNTERS,
228dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_DIVERSITY,
229dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_TXPOW,
230dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_PHYDIAG,
231dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_MCAST_KEYSRCH,
232dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_TSF_ADJUST,
233dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_WME_TKIPMIC,
234dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_RFSILENT,
235dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_ANT_CFG_2GHZ,
236dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CAP_ANT_CFG_5GHZ
237dd1de374Slin wang - Sun Microsystems - Beijing China };
238dd1de374Slin wang - Sun Microsystems - Beijing China 
239dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_hw_capabilities {
240dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t hw_caps; /* ATH9K_HW_CAP_* from ath9k_hw_caps */
241dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t	 wireless_modes[4]; /* ATH9K_MODE_* */
242dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t total_queues;
243dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t keycache_size;
244dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t low_5ghz_chan, high_5ghz_chan;
245dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t low_2ghz_chan, high_2ghz_chan;
246dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t num_mr_retries;
247dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t rts_aggr_limit;
248dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t tx_chainmask;
249dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t rx_chainmask;
250dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t tx_triglevel_max;
251dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t reg_cap;
252dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t num_gpio_pins;
253dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t num_antcfg_2ghz;
254dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t num_antcfg_5ghz;
255dd1de374Slin wang - Sun Microsystems - Beijing China };
256dd1de374Slin wang - Sun Microsystems - Beijing China 
257dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_ops_config {
258dd1de374Slin wang - Sun Microsystems - Beijing China 	int dma_beacon_response_time;
259dd1de374Slin wang - Sun Microsystems - Beijing China 	int sw_beacon_response_time;
260dd1de374Slin wang - Sun Microsystems - Beijing China 	int additional_swba_backoff;
261dd1de374Slin wang - Sun Microsystems - Beijing China 	int ack_6mb;
262dd1de374Slin wang - Sun Microsystems - Beijing China 	int cwm_ignore_extcca;
263dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t pcie_powersave_enable;
264dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t pcie_l1skp_enable;
265dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t pcie_clock_req;
266dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t pcie_waen;
267dd1de374Slin wang - Sun Microsystems - Beijing China 	int pcie_power_reset;
268dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t pcie_restore;
269dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t analog_shiftreg;
270dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t ht_enable;
271dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ofdm_trig_low;
272dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ofdm_trig_high;
273dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t cck_trig_high;
274dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t cck_trig_low;
275dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t enable_ani;
276dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t noise_immunity_level;
277dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ofdm_weaksignal_det;
278dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t cck_weaksignal_thr;
279dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t spur_immunity_level;
280dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t firstep_level;
281dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t rssi_thr_high;
282dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t rssi_thr_low;
283dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t diversity_control;
284dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t antenna_switch_swap;
285dd1de374Slin wang - Sun Microsystems - Beijing China 	int serialize_regmode;
286dd1de374Slin wang - Sun Microsystems - Beijing China 	int intr_mitigation;
287dd1de374Slin wang - Sun Microsystems - Beijing China #define	SPUR_DISABLE		0
288dd1de374Slin wang - Sun Microsystems - Beijing China #define	SPUR_ENABLE_IOCTL	1
289dd1de374Slin wang - Sun Microsystems - Beijing China #define	SPUR_ENABLE_EEPROM	2
290dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_MODAL_SPURS	5
291dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_SPUR_5413_1		1640
292dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_SPUR_5413_2		1200
293dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_NO_SPUR		0x8000
294dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_BASE_FREQ_2GHZ	2300
295dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_BASE_FREQ_5GHZ	4900
296dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_SPUR_FEEQ_BOUND_HT40	19
297dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_SPUR_FEEQ_BOUND_HT20	10
298dd1de374Slin wang - Sun Microsystems - Beijing China 	int spurmode;
299dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t spurchans[AR_EEPROM_MODAL_SPURS][2];
300dd1de374Slin wang - Sun Microsystems - Beijing China };
301dd1de374Slin wang - Sun Microsystems - Beijing China 
302dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_tx_queue {
303dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_TX_QUEUE_INACTIVE = 0,
304dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_TX_QUEUE_DATA,
305dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_TX_QUEUE_BEACON,
306dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_TX_QUEUE_CAB,
307dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_TX_QUEUE_UAPSD,
308dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_TX_QUEUE_PSPOLL
309dd1de374Slin wang - Sun Microsystems - Beijing China };
310dd1de374Slin wang - Sun Microsystems - Beijing China 
311dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_NUM_TX_QUEUES 10
312dd1de374Slin wang - Sun Microsystems - Beijing China 
313dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_tx_queue_subtype {
314dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_WME_AC_BK = 0,
315dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_WME_AC_BE,
316dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_WME_AC_VI,
317dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_WME_AC_VO,
318dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_WME_UPSD
319dd1de374Slin wang - Sun Microsystems - Beijing China };
320dd1de374Slin wang - Sun Microsystems - Beijing China 
321dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_tx_queue_flags {
322dd1de374Slin wang - Sun Microsystems - Beijing China 	TXQ_FLAG_TXOKINT_ENABLE = 0x0001,
323dd1de374Slin wang - Sun Microsystems - Beijing China 	TXQ_FLAG_TXERRINT_ENABLE = 0x0001,
324dd1de374Slin wang - Sun Microsystems - Beijing China 	TXQ_FLAG_TXDESCINT_ENABLE = 0x0002,
325dd1de374Slin wang - Sun Microsystems - Beijing China 	TXQ_FLAG_TXEOLINT_ENABLE = 0x0004,
326dd1de374Slin wang - Sun Microsystems - Beijing China 	TXQ_FLAG_TXURNINT_ENABLE = 0x0008,
327dd1de374Slin wang - Sun Microsystems - Beijing China 	TXQ_FLAG_BACKOFF_DISABLE = 0x0010,
328dd1de374Slin wang - Sun Microsystems - Beijing China 	TXQ_FLAG_COMPRESSION_ENABLE = 0x0020,
329dd1de374Slin wang - Sun Microsystems - Beijing China 	TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE = 0x0040,
330dd1de374Slin wang - Sun Microsystems - Beijing China 	TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE = 0x0080,
331dd1de374Slin wang - Sun Microsystems - Beijing China };
332dd1de374Slin wang - Sun Microsystems - Beijing China 
333dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXQ_USEDEFAULT	((uint32_t)(-1))
334dd1de374Slin wang - Sun Microsystems - Beijing China 
335dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_DECOMP_MASK_SIZE		128
336dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_READY_TIME_LO_BOUND	50
337dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_READY_TIME_HI_BOUND	96
338dd1de374Slin wang - Sun Microsystems - Beijing China 
339dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_pkt_type {
340dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_PKT_TYPE_NORMAL = 0,
341dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_PKT_TYPE_ATIM,
342dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_PKT_TYPE_PSPOLL,
343dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_PKT_TYPE_BEACON,
344dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_PKT_TYPE_PROBE_RESP,
345dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_PKT_TYPE_CHIRP,
346dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_PKT_TYPE_GRP_POLL,
347dd1de374Slin wang - Sun Microsystems - Beijing China };
348dd1de374Slin wang - Sun Microsystems - Beijing China 
349dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_tx_queue_info {
350dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t tqi_ver;
351dd1de374Slin wang - Sun Microsystems - Beijing China 	enum ath9k_tx_queue tqi_type;
352dd1de374Slin wang - Sun Microsystems - Beijing China 	enum ath9k_tx_queue_subtype tqi_subtype;
353dd1de374Slin wang - Sun Microsystems - Beijing China 	enum ath9k_tx_queue_flags tqi_qflags;
354dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t tqi_priority;
355dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t tqi_aifs;
356dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t tqi_cwmin;
357dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t tqi_cwmax;
358dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t tqi_shretry;
359dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t tqi_lgretry;
360dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t tqi_cbrPeriod;
361dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t tqi_cbrOverflowLimit;
362dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t tqi_burstTime;
363dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t tqi_readyTime;
364dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t tqi_physCompBuf;
365dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t tqi_intFlags;
366dd1de374Slin wang - Sun Microsystems - Beijing China };
367dd1de374Slin wang - Sun Microsystems - Beijing China 
368dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_rx_filter {
369dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RX_FILTER_UCAST = 0x00000001,
370dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RX_FILTER_MCAST = 0x00000002,
371dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RX_FILTER_BCAST = 0x00000004,
372dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RX_FILTER_CONTROL = 0x00000008,
373dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RX_FILTER_BEACON = 0x00000010,
374dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RX_FILTER_PROM = 0x00000020,
375dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RX_FILTER_PROBEREQ = 0x00000080,
376dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RX_FILTER_PSPOLL = 0x00004000,
377dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RX_FILTER_PHYERR = 0x00000100,
378dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RX_FILTER_PHYRADAR = 0x00002000,
379dd1de374Slin wang - Sun Microsystems - Beijing China };
380dd1de374Slin wang - Sun Microsystems - Beijing China 
381dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_int {
382dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_RX = 0x00000001,
383dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_RXDESC = 0x00000002,
384dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_RXNOFRM = 0x00000008,
385dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_RXEOL = 0x00000010,
386dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_RXORN = 0x00000020,
387dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_TX = 0x00000040,
388dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_TXDESC = 0x00000080,
389dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_TIM_TIMER = 0x00000100,
390dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_TXURN = 0x00000800,
391dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_MIB = 0x00001000,
392dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_RXPHY = 0x00004000,
393dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_RXKCM = 0x00008000,
394dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_SWBA = 0x00010000,
395dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_BMISS = 0x00040000,
396dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_BNR = 0x00100000,
397dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_TIM = 0x00200000,
398dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_DTIM = 0x00400000,
399dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_DTIMSYNC = 0x00800000,
400dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_GPIO = 0x01000000,
401dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_CABEND = 0x02000000,
402dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_CST = 0x10000000,
403dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_GTT = 0x20000000,
404dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_FATAL = 0x40000000,
405dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_GLOBAL = INT_MIN,
406dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_BMISC = ATH9K_INT_TIM |
407dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_DTIM |
408dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_DTIMSYNC |
409dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_CABEND,
410dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_COMMON = ATH9K_INT_RXNOFRM |
411dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_RXDESC |
412dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_RXEOL |
413dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_RXORN |
414dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_TXURN |
415dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_TXDESC |
416dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_MIB |
417dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_RXPHY |
418dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_RXKCM |
419dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_SWBA |
420dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_BMISS |
421dd1de374Slin wang - Sun Microsystems - Beijing China 		ATH9K_INT_GPIO,
422dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_INT_NOCARD = -1
423dd1de374Slin wang - Sun Microsystems - Beijing China };
424dd1de374Slin wang - Sun Microsystems - Beijing China 
425dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RATESERIES_RTS_CTS	0x0001
426dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RATESERIES_2040		0x0002
427dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RATESERIES_HALFGI		0x0004
428dd1de374Slin wang - Sun Microsystems - Beijing China 
429dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_11n_rate_series {
430dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t Tries;
431dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t Rate;
432dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t PktDuration;
433dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ChSel;
434dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t RateFlags;
435dd1de374Slin wang - Sun Microsystems - Beijing China };
436dd1de374Slin wang - Sun Microsystems - Beijing China 
437dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_CW_INT		0x00002
438dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_CCK		0x00020
439dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_OFDM		0x00040
440dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_2GHZ		0x00080
441dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_5GHZ		0x00100
442dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_PASSIVE		0x00200
443dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_DYN		0x00400
444dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_HALF		0x04000
445dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_QUARTER		0x08000
446dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_HT20		0x10000
447dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_HT40PLUS	0x20000
448dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_HT40MINUS	0x40000
449dd1de374Slin wang - Sun Microsystems - Beijing China 
450dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_INTERFERENCE	0x01
451dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_DFS		0x02
452dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_4MS_LIMIT	0x04
453dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_DFS_CLEAR	0x08
454dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_DISALLOW_ADHOC	0x10
455dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_PER_11D_ADHOC	0x20
456dd1de374Slin wang - Sun Microsystems - Beijing China 
457dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_A		(CHANNEL_5GHZ|CHANNEL_OFDM)
458dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_B		(CHANNEL_2GHZ|CHANNEL_CCK)
459dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_G		(CHANNEL_2GHZ|CHANNEL_OFDM)
460dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_G_HT20		(CHANNEL_2GHZ|CHANNEL_HT20)
461dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_A_HT20		(CHANNEL_5GHZ|CHANNEL_HT20)
462dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_G_HT40PLUS	(CHANNEL_2GHZ|CHANNEL_HT40PLUS)
463dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_G_HT40MINUS	(CHANNEL_2GHZ|CHANNEL_HT40MINUS)
464dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_A_HT40PLUS	(CHANNEL_5GHZ|CHANNEL_HT40PLUS)
465dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_A_HT40MINUS	(CHANNEL_5GHZ|CHANNEL_HT40MINUS)
466dd1de374Slin wang - Sun Microsystems - Beijing China #define	CHANNEL_ALL		\
467dd1de374Slin wang - Sun Microsystems - Beijing China 	(CHANNEL_OFDM|		\
468dd1de374Slin wang - Sun Microsystems - Beijing China 	CHANNEL_CCK|		\
469dd1de374Slin wang - Sun Microsystems - Beijing China 	CHANNEL_2GHZ |		\
470dd1de374Slin wang - Sun Microsystems - Beijing China 	CHANNEL_5GHZ |		\
471dd1de374Slin wang - Sun Microsystems - Beijing China 	CHANNEL_HT20 |		\
472dd1de374Slin wang - Sun Microsystems - Beijing China 	CHANNEL_HT40PLUS |	\
473dd1de374Slin wang - Sun Microsystems - Beijing China 	CHANNEL_HT40MINUS)
474dd1de374Slin wang - Sun Microsystems - Beijing China 
475dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_channel {
476dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t channel;
477dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t channelFlags;
478dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t privFlags;
479dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t maxRegTxPower;
480dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t maxTxPower;
481dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t minTxPower;
482dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t chanmode;
483dd1de374Slin wang - Sun Microsystems - Beijing China 	int32_t CalValid;
484dd1de374Slin wang - Sun Microsystems - Beijing China 	boolean_t oneTimeCalsDone;
485dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t iCoff;
486dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t qCoff;
487dd1de374Slin wang - Sun Microsystems - Beijing China 	int16_t rawNoiseFloor;
488dd1de374Slin wang - Sun Microsystems - Beijing China 	int8_t antennaMax;
489dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t regDmnFlags;
490dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t conformanceTestLimit[3]; /* 0:11a, 1: 11b, 2:11g */
491dd1de374Slin wang - Sun Microsystems - Beijing China #ifdef ARN_NF_PER_CHAN
492dd1de374Slin wang - Sun Microsystems - Beijing China 	struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
493dd1de374Slin wang - Sun Microsystems - Beijing China #endif
494dd1de374Slin wang - Sun Microsystems - Beijing China };
495dd1de374Slin wang - Sun Microsystems - Beijing China 
496dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_A(_c) ((((_c)->channelFlags & CHANNEL_A) == CHANNEL_A) || \
497dd1de374Slin wang - Sun Microsystems - Beijing China 	(((_c)->channelFlags & CHANNEL_A_HT20) == CHANNEL_A_HT20) || \
498dd1de374Slin wang - Sun Microsystems - Beijing China 	(((_c)->channelFlags & CHANNEL_A_HT40PLUS) == CHANNEL_A_HT40PLUS) || \
499dd1de374Slin wang - Sun Microsystems - Beijing China 	(((_c)->channelFlags & CHANNEL_A_HT40MINUS) == CHANNEL_A_HT40MINUS))
500dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_G(_c) ((((_c)->channelFlags & (CHANNEL_G)) == CHANNEL_G) || \
501dd1de374Slin wang - Sun Microsystems - Beijing China 	(((_c)->channelFlags & CHANNEL_G_HT20) == CHANNEL_G_HT20) || \
502dd1de374Slin wang - Sun Microsystems - Beijing China 	(((_c)->channelFlags & CHANNEL_G_HT40PLUS) == CHANNEL_G_HT40PLUS) || \
503dd1de374Slin wang - Sun Microsystems - Beijing China 	(((_c)->channelFlags & CHANNEL_G_HT40MINUS) == CHANNEL_G_HT40MINUS))
504dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_OFDM(_c)	(((_c)->channelFlags & CHANNEL_OFDM) != 0)
505dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_5GHZ(_c)	(((_c)->channelFlags & CHANNEL_5GHZ) != 0)
506dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_2GHZ(_c)	(((_c)->channelFlags & CHANNEL_2GHZ) != 0)
507dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_PASSIVE(_c)	(((_c)->channelFlags & CHANNEL_PASSIVE) != 0)
508dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_HALF_RATE(_c)	(((_c)->channelFlags & CHANNEL_HALF) != 0)
509dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_QUARTER_RATE(_c) \
510dd1de374Slin wang - Sun Microsystems - Beijing China 	(((_c)->channelFlags & CHANNEL_QUARTER) != 0)
511dd1de374Slin wang - Sun Microsystems - Beijing China 
512dd1de374Slin wang - Sun Microsystems - Beijing China /* These macros check chanmode and not channelFlags */
513dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_B(_c)	((_c)->chanmode == CHANNEL_B)
514dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_HT20(_c)	(((_c)->chanmode == CHANNEL_A_HT20) ||	\
515dd1de374Slin wang - Sun Microsystems - Beijing China 	((_c)->chanmode == CHANNEL_G_HT20))
516dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_HT40(_c) (((_c)->chanmode == CHANNEL_A_HT40PLUS) ||	\
517dd1de374Slin wang - Sun Microsystems - Beijing China 	((_c)->chanmode == CHANNEL_A_HT40MINUS) ||	\
518dd1de374Slin wang - Sun Microsystems - Beijing China 	((_c)->chanmode == CHANNEL_G_HT40PLUS) ||	\
519dd1de374Slin wang - Sun Microsystems - Beijing China 	((_c)->chanmode == CHANNEL_G_HT40MINUS))
520dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_HT(_c)	(IS_CHAN_HT20((_c)) || IS_CHAN_HT40((_c)))
521dd1de374Slin wang - Sun Microsystems - Beijing China 
522dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_IN_PUBLIC_SAFETY_BAND(_c)	((_c) > 4940 && (_c) < 4990)
523dd1de374Slin wang - Sun Microsystems - Beijing China #define	IS_CHAN_A_5MHZ_SPACED(_c)			\
524dd1de374Slin wang - Sun Microsystems - Beijing China 	((((_c)->channelFlags & CHANNEL_5GHZ) != 0) &&	\
525dd1de374Slin wang - Sun Microsystems - Beijing China 	(((_c)->channel % 20) != 0) &&			\
526dd1de374Slin wang - Sun Microsystems - Beijing China 	(((_c)->channel % 10) != 0))
527dd1de374Slin wang - Sun Microsystems - Beijing China 
528dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_keyval {
529dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t kv_type;
530dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t kv_pad;
531dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t kv_len;
532dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t kv_val[16];
533dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t kv_mic[8];
534dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t kv_txmic[8];
535dd1de374Slin wang - Sun Microsystems - Beijing China };
536dd1de374Slin wang - Sun Microsystems - Beijing China 
537dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_key_type {
538dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_KEY_TYPE_CLEAR,
539dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_KEY_TYPE_WEP,
540dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_KEY_TYPE_AES,
541dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_KEY_TYPE_TKIP,
542dd1de374Slin wang - Sun Microsystems - Beijing China };
543dd1de374Slin wang - Sun Microsystems - Beijing China 
544dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_cipher {
545dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CIPHER_WEP = 0,
546dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CIPHER_AES_OCB = 1,
547dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CIPHER_AES_CCM = 2,
548dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CIPHER_CKIP = 3,
549dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CIPHER_TKIP = 4,
550dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CIPHER_CLR = 5,
551dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_CIPHER_MIC = 127
552dd1de374Slin wang - Sun Microsystems - Beijing China };
553dd1de374Slin wang - Sun Microsystems - Beijing China 
554dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEPCAP_COMPRESS_DIS	0x0001
555dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEPCAP_AES_DIS	0x0002
556dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEPCAP_FASTFRAME_DIS	0x0004
557dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEPCAP_BURST_DIS	0x0008
558dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEPCAP_MAXQCU		0x01F0
559dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEPCAP_MAXQCU_S	4
560dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEPCAP_HEAVY_CLIP_EN	0x0200
561dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEPCAP_KC_ENTRIES	0xF000
562dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEPCAP_KC_ENTRIES_S	12
563dd1de374Slin wang - Sun Microsystems - Beijing China 
564dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND	0x0040
565dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN	0x0080
566dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEREGCAP_EN_KK_U2		0x0100
567dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEREGCAP_EN_KK_MIDBAND	0x0200
568dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEREGCAP_EN_KK_U1_ODD		0x0400
569dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEREGCAP_EN_KK_NEW_11A	0x0800
570dd1de374Slin wang - Sun Microsystems - Beijing China 
571dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEREGCAP_EN_KK_U1_ODD_PRE4_0 	0x4000
572dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_EEREGCAP_EN_KK_NEW_11A_PRE4_0	0x8000
573dd1de374Slin wang - Sun Microsystems - Beijing China 
574dd1de374Slin wang - Sun Microsystems - Beijing China #define	SD_NO_CTL	0xE0
575dd1de374Slin wang - Sun Microsystems - Beijing China #define	NO_CTL		0xff
576dd1de374Slin wang - Sun Microsystems - Beijing China #define	CTL_MODE_M	7
577dd1de374Slin wang - Sun Microsystems - Beijing China #define	CTL_11A		0
578dd1de374Slin wang - Sun Microsystems - Beijing China #define	CTL_11B		1
579dd1de374Slin wang - Sun Microsystems - Beijing China #define	CTL_11G		2
580dd1de374Slin wang - Sun Microsystems - Beijing China #define	CTL_2GHT20	5
581dd1de374Slin wang - Sun Microsystems - Beijing China #define	CTL_5GHT20	6
582dd1de374Slin wang - Sun Microsystems - Beijing China #define	CTL_2GHT40	7
583dd1de374Slin wang - Sun Microsystems - Beijing China #define	CTL_5GHT40	8
584dd1de374Slin wang - Sun Microsystems - Beijing China 
585dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_MAC(i)	(0x1d+(i))
586dd1de374Slin wang - Sun Microsystems - Beijing China 
587dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_RFSILENT_GPIO_SEL	0x001c
588dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_RFSILENT_GPIO_SEL_S	2
589dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_RFSILENT_POLARITY	0x0002
590dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_EEPROM_RFSILENT_POLARITY_S	1
591dd1de374Slin wang - Sun Microsystems - Beijing China 
592dd1de374Slin wang - Sun Microsystems - Beijing China #define	CTRY_DEBUG	0x1ff
593dd1de374Slin wang - Sun Microsystems - Beijing China #define	CTRY_DEFAULT	0
594dd1de374Slin wang - Sun Microsystems - Beijing China 
595dd1de374Slin wang - Sun Microsystems - Beijing China enum reg_ext_bitmap {
596dd1de374Slin wang - Sun Microsystems - Beijing China 	REG_EXT_JAPAN_MIDBAND = 1,
597dd1de374Slin wang - Sun Microsystems - Beijing China 	REG_EXT_FCC_DFS_HT40 = 2,
598dd1de374Slin wang - Sun Microsystems - Beijing China 	REG_EXT_JAPAN_NONDFS_HT40 = 3,
599dd1de374Slin wang - Sun Microsystems - Beijing China 	REG_EXT_JAPAN_DFS_HT40 = 4
600dd1de374Slin wang - Sun Microsystems - Beijing China };
601dd1de374Slin wang - Sun Microsystems - Beijing China 
602dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_country_entry {
603dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t countryCode;
604dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t regDmnEnum;
605dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t regDmn5G;
606dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t regDmn2G;
607dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t isMultidomain;
608dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t iso[3];
609dd1de374Slin wang - Sun Microsystems - Beijing China };
610dd1de374Slin wang - Sun Microsystems - Beijing China 
611dd1de374Slin wang - Sun Microsystems - Beijing China /* Register read/write primitives */
612dd1de374Slin wang - Sun Microsystems - Beijing China #define	REG_WRITE(_ah, _reg, _val)	arn_iowrite32((_ah), (_reg), (_val))
613dd1de374Slin wang - Sun Microsystems - Beijing China #define	REG_READ(_ah, _reg)	arn_ioread32((_ah), (_reg))
614dd1de374Slin wang - Sun Microsystems - Beijing China #define	FLASH_READ(_ah, _reg)					\
615dd1de374Slin wang - Sun Microsystems - Beijing China 	ddi_get16((_ah->ah_sc)->sc_io_handle,			\
616dd1de374Slin wang - Sun Microsystems - Beijing China 	    (uint16_t *)((uintptr_t)(_ah)->ah_sh + (_reg)))
617dd1de374Slin wang - Sun Microsystems - Beijing China 
618dd1de374Slin wang - Sun Microsystems - Beijing China #define	SM(_v, _f)	(((_v) << _f##_S) & _f)
619dd1de374Slin wang - Sun Microsystems - Beijing China #define	MS(_v, _f)	(((_v) & _f) >> _f##_S)
620dd1de374Slin wang - Sun Microsystems - Beijing China #define	REG_RMW(_a, _r, _set, _clr)	\
621dd1de374Slin wang - Sun Microsystems - Beijing China 	REG_WRITE(_a, _r, (REG_READ(_a, _r) & ~(_clr)) | (_set))
622dd1de374Slin wang - Sun Microsystems - Beijing China #define	REG_RMW_FIELD(_a, _r, _f, _v) \
623dd1de374Slin wang - Sun Microsystems - Beijing China 	REG_WRITE(_a, _r, \
624dd1de374Slin wang - Sun Microsystems - Beijing China 	(REG_READ(_a, _r) & ~_f) | (((_v) << _f##_S) & _f))
625dd1de374Slin wang - Sun Microsystems - Beijing China #define	REG_SET_BIT(_a, _r, _f) \
626dd1de374Slin wang - Sun Microsystems - Beijing China 	REG_WRITE(_a, _r, REG_READ(_a, _r) | _f)
627dd1de374Slin wang - Sun Microsystems - Beijing China #define	REG_CLR_BIT(_a, _r, _f) \
628dd1de374Slin wang - Sun Microsystems - Beijing China 	REG_WRITE(_a, _r, REG_READ(_a, _r) & ~_f)
629dd1de374Slin wang - Sun Microsystems - Beijing China 
630dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TXQ_USE_LOCKOUT_BKOFF_DIS	0x00000001
631dd1de374Slin wang - Sun Microsystems - Beijing China 
632dd1de374Slin wang - Sun Microsystems - Beijing China #define	INIT_AIFS	2
633dd1de374Slin wang - Sun Microsystems - Beijing China #define	INIT_CWMIN	15
634dd1de374Slin wang - Sun Microsystems - Beijing China #define	INIT_CWMIN_11B	31
635dd1de374Slin wang - Sun Microsystems - Beijing China #define	INIT_CWMAX	1023
636dd1de374Slin wang - Sun Microsystems - Beijing China #define	INIT_SH_RETRY	10
637dd1de374Slin wang - Sun Microsystems - Beijing China #define	INIT_LG_RETRY	10
638dd1de374Slin wang - Sun Microsystems - Beijing China #define	INIT_SSH_RETRY	32
639dd1de374Slin wang - Sun Microsystems - Beijing China #define	INIT_SLG_RETRY	32
640dd1de374Slin wang - Sun Microsystems - Beijing China 
641dd1de374Slin wang - Sun Microsystems - Beijing China #define	WLAN_CTRL_FRAME_SIZE	(2+2+6+4)
642dd1de374Slin wang - Sun Microsystems - Beijing China 
643dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH_AMPDU_LIMIT_MAX	(64 * 1024 - 1)
644dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH_AMPDU_LIMIT_DEFAULT	ATH_AMPDU_LIMIT_MAX
645dd1de374Slin wang - Sun Microsystems - Beijing China 
646*c0c93480Slin wang - Sun Microsystems - Beijing China #define	FCS_LEN	4
647dd1de374Slin wang - Sun Microsystems - Beijing China #define	IEEE80211_WEP_IVLEN	3
648dd1de374Slin wang - Sun Microsystems - Beijing China #define	IEEE80211_WEP_KIDLEN	1
649dd1de374Slin wang - Sun Microsystems - Beijing China #define	IEEE80211_WEP_CRCLEN	4
650dd1de374Slin wang - Sun Microsystems - Beijing China #define	IEEE80211_MAX_MPDU_LEN	(3840 + FCS_LEN +	\
651dd1de374Slin wang - Sun Microsystems - Beijing China 	(IEEE80211_WEP_IVLEN +	\
652dd1de374Slin wang - Sun Microsystems - Beijing China 	IEEE80211_WEP_KIDLEN +	\
653dd1de374Slin wang - Sun Microsystems - Beijing China 	IEEE80211_WEP_CRCLEN))
654dd1de374Slin wang - Sun Microsystems - Beijing China #define	MAX_RATE_POWER	63
655dd1de374Slin wang - Sun Microsystems - Beijing China 
656dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_power_mode {
657dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_PM_AWAKE = 0,
658dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_PM_FULL_SLEEP,
659dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_PM_NETWORK_SLEEP,
660dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_PM_UNDEFINED
661dd1de374Slin wang - Sun Microsystems - Beijing China };
662dd1de374Slin wang - Sun Microsystems - Beijing China 
663dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_mib_stats {
664dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ackrcv_bad;
665dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t rts_bad;
666dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t rts_good;
667dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t fcs_bad;
668dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t beacons;
669dd1de374Slin wang - Sun Microsystems - Beijing China };
670dd1de374Slin wang - Sun Microsystems - Beijing China 
671dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_ant_setting {
672dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANT_VARIABLE = 0,
673dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANT_FIXED_A,
674dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANT_FIXED_B
675dd1de374Slin wang - Sun Microsystems - Beijing China };
676dd1de374Slin wang - Sun Microsystems - Beijing China 
677dd1de374Slin wang - Sun Microsystems - Beijing China 
678dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_opmode {
679dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_M_STA = 1,
680dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_M_IBSS = 0,
681dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_M_HOSTAP = 6,
682dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_M_MONITOR = 8
683dd1de374Slin wang - Sun Microsystems - Beijing China };
684dd1de374Slin wang - Sun Microsystems - Beijing China 
685dd1de374Slin wang - Sun Microsystems - Beijing China 
686dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_SLOT_TIME_6	6
687dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_SLOT_TIME_9	9
688dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_SLOT_TIME_20	20
689dd1de374Slin wang - Sun Microsystems - Beijing China 
690dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_ht_macmode {
691dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HT_MACMODE_20 = 0,
692dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HT_MACMODE_2040 = 1,
693dd1de374Slin wang - Sun Microsystems - Beijing China };
694dd1de374Slin wang - Sun Microsystems - Beijing China 
695dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_ht_extprotspacing {
696dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HT_EXTPROTSPACING_20 = 0,
697dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_HT_EXTPROTSPACING_25 = 1,
698dd1de374Slin wang - Sun Microsystems - Beijing China };
699dd1de374Slin wang - Sun Microsystems - Beijing China 
700dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_ht_cwm {
701dd1de374Slin wang - Sun Microsystems - Beijing China 	enum ath9k_ht_macmode ht_macmode;
702dd1de374Slin wang - Sun Microsystems - Beijing China 	enum ath9k_ht_extprotspacing ht_extprotspacing;
703dd1de374Slin wang - Sun Microsystems - Beijing China };
704dd1de374Slin wang - Sun Microsystems - Beijing China 
705dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_ani_cmd {
706dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANI_PRESENT = 0x1,
707dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANI_NOISE_IMMUNITY_LEVEL = 0x2,
708dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION = 0x4,
709dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANI_CCK_WEAK_SIGNAL_THR = 0x8,
710dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANI_FIRSTEP_LEVEL = 0x10,
711dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANI_SPUR_IMMUNITY_LEVEL = 0x20,
712dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANI_MODE = 0x40,
713dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANI_PHYERR_RESET = 0x80,
714dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_ANI_ALL = 0xff
715dd1de374Slin wang - Sun Microsystems - Beijing China };
716dd1de374Slin wang - Sun Microsystems - Beijing China 
717dd1de374Slin wang - Sun Microsystems - Beijing China enum ath9k_tp_scale {
718dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_TP_SCALE_MAX = 0,
719dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_TP_SCALE_50,
720dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_TP_SCALE_25,
721dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_TP_SCALE_12,
722dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_TP_SCALE_MIN
723dd1de374Slin wang - Sun Microsystems - Beijing China };
724dd1de374Slin wang - Sun Microsystems - Beijing China 
725dd1de374Slin wang - Sun Microsystems - Beijing China enum ser_reg_mode {
726dd1de374Slin wang - Sun Microsystems - Beijing China 	SER_REG_MODE_OFF = 0,
727dd1de374Slin wang - Sun Microsystems - Beijing China 	SER_REG_MODE_ON = 1,
728dd1de374Slin wang - Sun Microsystems - Beijing China 	SER_REG_MODE_AUTO = 2,
729dd1de374Slin wang - Sun Microsystems - Beijing China };
730dd1de374Slin wang - Sun Microsystems - Beijing China 
731dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_PHY_CCA_MAX_GOOD_VALUE		-85
732dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_PHY_CCA_MAX_HIGH_VALUE		-62
733dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_PHY_CCA_MIN_BAD_VALUE		-121
734dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_PHY_CCA_FILTERWINDOW_LENGTH_INIT	3
735dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_PHY_CCA_FILTERWINDOW_LENGTH		5
736dd1de374Slin wang - Sun Microsystems - Beijing China 
737dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_NF_CAL_HIST_MAX		5
738dd1de374Slin wang - Sun Microsystems - Beijing China #define	NUM_NF_READINGS			6
739dd1de374Slin wang - Sun Microsystems - Beijing China 
740dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_nfcal_hist {
741dd1de374Slin wang - Sun Microsystems - Beijing China 	int16_t nfCalBuffer[ATH9K_NF_CAL_HIST_MAX];
742dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t currIndex;
743dd1de374Slin wang - Sun Microsystems - Beijing China 	int16_t privNF;
744dd1de374Slin wang - Sun Microsystems - Beijing China 	uint8_t invalidNFcount;
745dd1de374Slin wang - Sun Microsystems - Beijing China };
746dd1de374Slin wang - Sun Microsystems - Beijing China 
747dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_beacon_state {
748dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t bs_nexttbtt;
749dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t bs_nextdtim;
750dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t bs_intval;
751dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_BEACON_PERIOD	0x0000ffff
752dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_BEACON_ENA	0x00800000
753dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_BEACON_RESET_TSF	0x01000000
7543ae945c3Slin wang - Sun Microsystems - Beijing China #define	ATH9K_TSFOOR_THRESHOLD	0x00004240 /* 16k us */
755dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t bs_dtimperiod;
756dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t bs_cfpperiod;
757dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t bs_cfpmaxduration;
758dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t bs_cfpnext;
759dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t bs_timoffset;
760dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t bs_bmissthreshold;
761dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t bs_sleepduration;
7623ae945c3Slin wang - Sun Microsystems - Beijing China 	uint32_t bs_tsfoor_threshold;
763dd1de374Slin wang - Sun Microsystems - Beijing China };
764dd1de374Slin wang - Sun Microsystems - Beijing China 
765dd1de374Slin wang - Sun Microsystems - Beijing China struct ath9k_node_stats {
766dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ns_avgbrssi;
767dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ns_avgrssi;
768dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ns_avgtxrssi;
769dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ns_avgtxrate;
770dd1de374Slin wang - Sun Microsystems - Beijing China };
771dd1de374Slin wang - Sun Microsystems - Beijing China 
772dd1de374Slin wang - Sun Microsystems - Beijing China #define	ATH9K_RSSI_EP_MULTIPLIER			(1<<7)
773dd1de374Slin wang - Sun Microsystems - Beijing China 
774dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_GPIO_OUTPUT_MUX_AS_OUTPUT			0
775dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED	1
776dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED		2
777dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED		5
778dd1de374Slin wang - Sun Microsystems - Beijing China #define	AR_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED		6
779dd1de374Slin wang - Sun Microsystems - Beijing China 
780dd1de374Slin wang - Sun Microsystems - Beijing China enum {
781dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RESET_POWER_ON,
782dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RESET_WARM,
783dd1de374Slin wang - Sun Microsystems - Beijing China 	ATH9K_RESET_COLD,
784dd1de374Slin wang - Sun Microsystems - Beijing China };
785dd1de374Slin wang - Sun Microsystems - Beijing China 
786dd1de374Slin wang - Sun Microsystems - Beijing China #define	AH_USE_EEPROM	0x1
787dd1de374Slin wang - Sun Microsystems - Beijing China 
788dd1de374Slin wang - Sun Microsystems - Beijing China struct ath_hal {
789dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ah_magic;
790dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_devid;
791dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_subvendorid;
792dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ah_macVersion;
793dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_macRev;
794dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_phyRev;
795dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_analog5GhzRev;
796dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_analog2GhzRev;
797dd1de374Slin wang - Sun Microsystems - Beijing China 
798dd1de374Slin wang - Sun Microsystems - Beijing China 	caddr_t	 ah_sh;
799dd1de374Slin wang - Sun Microsystems - Beijing China 	struct arn_softc *ah_sc;
800dd1de374Slin wang - Sun Microsystems - Beijing China 	enum ath9k_opmode ah_opmode;
801dd1de374Slin wang - Sun Microsystems - Beijing China 	struct ath9k_ops_config ah_config;
802dd1de374Slin wang - Sun Microsystems - Beijing China 	struct ath9k_hw_capabilities ah_caps;
803dd1de374Slin wang - Sun Microsystems - Beijing China 
804dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_countryCode;
805dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ah_flags;
806dd1de374Slin wang - Sun Microsystems - Beijing China 	int16_t ah_powerLimit;
807dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_maxPowerLevel;
808dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ah_tpScale;
809dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_currentRD;
810dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_currentRDExt;
811dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_currentRDInUse;
812dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_currentRD5G;
813dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_currentRD2G;
814dd1de374Slin wang - Sun Microsystems - Beijing China 	char ah_iso[4];
815dd1de374Slin wang - Sun Microsystems - Beijing China 
816dd1de374Slin wang - Sun Microsystems - Beijing China 	struct ath9k_channel ah_channels[150];
817dd1de374Slin wang - Sun Microsystems - Beijing China 	struct ath9k_channel *ah_curchan;
818dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ah_nchan;
819dd1de374Slin wang - Sun Microsystems - Beijing China 
820dd1de374Slin wang - Sun Microsystems - Beijing China 	boolean_t ah_isPciExpress;
821dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_txTrigLevel;
822dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ah_rfsilent;
823dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ah_rfkill_gpio;
824dd1de374Slin wang - Sun Microsystems - Beijing China 	uint32_t ah_rfkill_polarity;
825dd1de374Slin wang - Sun Microsystems - Beijing China 
826dd1de374Slin wang - Sun Microsystems - Beijing China 	struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
827dd1de374Slin wang - Sun Microsystems - Beijing China };
828dd1de374Slin wang - Sun Microsystems - Beijing China 
829dd1de374Slin wang - Sun Microsystems - Beijing China struct chan_centers {
830dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t synth_center;
831dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ctl_center;
832dd1de374Slin wang - Sun Microsystems - Beijing China 	uint16_t ext_center;
833dd1de374Slin wang - Sun Microsystems - Beijing China };
834dd1de374Slin wang - Sun Microsystems - Beijing China 
835dd1de374Slin wang - Sun Microsystems - Beijing China struct ath_rate_table;
836dd1de374Slin wang - Sun Microsystems - Beijing China 
837dd1de374Slin wang - Sun Microsystems - Beijing China /* Helpers */
838dd1de374Slin wang - Sun Microsystems - Beijing China 
839dd1de374Slin wang - Sun Microsystems - Beijing China enum wireless_mode ath9k_hw_chan2wmode(struct ath_hal *ah,
840dd1de374Slin wang - Sun Microsystems - Beijing China     const struct ath9k_channel *chan);
841dd1de374Slin wang - Sun Microsystems - Beijing China boolean_t ath9k_hw_wait(struct ath_hal *ah, uint32_t reg, uint32_t mask,
842dd1de374Slin wang - Sun Microsystems - Beijing China     uint32_t val);
843dd1de374Slin wang - Sun Microsystems - Beijing China uint32_t ath9k_hw_reverse_bits(uint32_t val, uint32_t n);
844dd1de374Slin wang - Sun Microsystems - Beijing China boolean_t ath9k_get_channel_edges(struct ath_hal *ah,
845dd1de374Slin wang - Sun Microsystems - Beijing China     uint16_t flags, uint16_t *low, uint16_t *high);
846dd1de374Slin wang - Sun Microsystems - Beijing China uint16_t ath9k_hw_computetxtime(struct ath_hal *ah,
847dd1de374Slin wang - Sun Microsystems - Beijing China     struct ath_rate_table *rates,
848dd1de374Slin wang - Sun Microsystems - Beijing China     uint32_t frameLen, uint16_t rateix,
849dd1de374Slin wang - Sun Microsystems - Beijing China     boolean_t shortPreamble);
850dd1de374Slin wang - Sun Microsystems - Beijing China uint32_t ath9k_hw_mhz2ieee(struct ath_hal *ah, uint32_t freq, uint32_t flags);
851dd1de374Slin wang - Sun Microsystems - Beijing China void ath9k_hw_get_channel_centers(struct ath_hal *ah,
852dd1de374Slin wang - Sun Microsystems - Beijing China     struct ath9k_channel *chan,
853dd1de374Slin wang - Sun Microsystems - Beijing China     struct chan_centers *centers);
854dd1de374Slin wang - Sun Microsystems - Beijing China 
855dd1de374Slin wang - Sun Microsystems - Beijing China /* Attach, Detach */
856dd1de374Slin wang - Sun Microsystems - Beijing China 
857dd1de374Slin wang - Sun Microsystems - Beijing China const char *ath9k_hw_probe(uint16_t vendorid, uint16_t devid);
858dd1de374Slin wang - Sun Microsystems - Beijing China void ath9k_hw_detach(struct ath_hal *ah);
859dd1de374Slin wang - Sun Microsystems - Beijing China struct ath_hal *ath9k_hw_attach(uint16_t devid, struct arn_softc *sc,
860dd1de374Slin wang - Sun Microsystems - Beijing China     caddr_t mem, int *error);
861dd1de374Slin wang - Sun Microsystems - Beijing China void ath9k_hw_rfdetach(struct ath_hal *ah);
862dd1de374Slin wang - Sun Microsystems - Beijing China 
863dd1de374Slin wang - Sun Microsystems - Beijing China 
864dd1de374Slin wang - Sun Microsystems - Beijing China /* HW Reset */
865dd1de374Slin wang - Sun Microsystems - Beijing China 
866dd1de374Slin wang - Sun Microsystems - Beijing China boolean_t ath9k_hw_reset(struct ath_hal *ah, struct ath9k_channel *chan,
867dd1de374Slin wang - Sun Microsystems - Beijing China     enum ath9k_ht_macmode macmode,
868dd1de374Slin wang - Sun Microsystems - Beijing China     uint8_t txchainmask, uint8_t rxchainmask,
869dd1de374Slin wang - Sun Microsystems - Beijing China     enum ath9k_ht_extprotspacing extprotspacing,
870dd1de374Slin wang - Sun Microsystems - Beijing China     boolean_t bChannelChange, int *status);
871dd1de374Slin wang - Sun Microsystems - Beijing China 
872