blob: 587c0fed9f8f6f6904c4b0f675d5031802d8ef1f [file] [log] [blame]
Luis R. Rodriguezf078f202008-08-04 00:16:41 -07001/*
2 * Copyright (c) 2008 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef ATH9K_H
18#define ATH9K_H
19
20#include <linux/io.h>
21
22#define ATHEROS_VENDOR_ID 0x168c
23
24#define AR5416_DEVID_PCI 0x0023
25#define AR5416_DEVID_PCIE 0x0024
26#define AR9160_DEVID_PCI 0x0027
27#define AR9280_DEVID_PCI 0x0029
28#define AR9280_DEVID_PCIE 0x002a
29
30#define AR5416_AR9100_DEVID 0x000b
31
32#define AR_SUBVENDOR_ID_NOG 0x0e11
33#define AR_SUBVENDOR_ID_NEW_A 0x7065
34
35#define ATH9K_TXERR_XRETRY 0x01
36#define ATH9K_TXERR_FILT 0x02
37#define ATH9K_TXERR_FIFO 0x04
38#define ATH9K_TXERR_XTXOP 0x08
39#define ATH9K_TXERR_TIMER_EXPIRED 0x10
40
41#define ATH9K_TX_BA 0x01
42#define ATH9K_TX_PWRMGMT 0x02
43#define ATH9K_TX_DESC_CFG_ERR 0x04
44#define ATH9K_TX_DATA_UNDERRUN 0x08
45#define ATH9K_TX_DELIM_UNDERRUN 0x10
46#define ATH9K_TX_SW_ABORTED 0x40
47#define ATH9K_TX_SW_FILTERED 0x80
48
49#define NBBY 8
50
51struct ath_tx_status {
52 u32 ts_tstamp;
53 u16 ts_seqnum;
54 u8 ts_status;
55 u8 ts_ratecode;
56 u8 ts_rateindex;
57 int8_t ts_rssi;
58 u8 ts_shortretry;
59 u8 ts_longretry;
60 u8 ts_virtcol;
61 u8 ts_antenna;
62 u8 ts_flags;
63 int8_t ts_rssi_ctl0;
64 int8_t ts_rssi_ctl1;
65 int8_t ts_rssi_ctl2;
66 int8_t ts_rssi_ext0;
67 int8_t ts_rssi_ext1;
68 int8_t ts_rssi_ext2;
69 u8 pad[3];
70 u32 ba_low;
71 u32 ba_high;
72 u32 evm0;
73 u32 evm1;
74 u32 evm2;
75};
76
77struct ath_rx_status {
78 u32 rs_tstamp;
79 u16 rs_datalen;
80 u8 rs_status;
81 u8 rs_phyerr;
82 int8_t rs_rssi;
83 u8 rs_keyix;
84 u8 rs_rate;
85 u8 rs_antenna;
86 u8 rs_more;
87 int8_t rs_rssi_ctl0;
88 int8_t rs_rssi_ctl1;
89 int8_t rs_rssi_ctl2;
90 int8_t rs_rssi_ext0;
91 int8_t rs_rssi_ext1;
92 int8_t rs_rssi_ext2;
93 u8 rs_isaggr;
94 u8 rs_moreaggr;
95 u8 rs_num_delims;
96 u8 rs_flags;
97 u32 evm0;
98 u32 evm1;
99 u32 evm2;
100};
101
102#define ATH9K_RXERR_CRC 0x01
103#define ATH9K_RXERR_PHY 0x02
104#define ATH9K_RXERR_FIFO 0x04
105#define ATH9K_RXERR_DECRYPT 0x08
106#define ATH9K_RXERR_MIC 0x10
107
108#define ATH9K_RX_MORE 0x01
109#define ATH9K_RX_MORE_AGGR 0x02
110#define ATH9K_RX_GI 0x04
111#define ATH9K_RX_2040 0x08
112#define ATH9K_RX_DELIM_CRC_PRE 0x10
113#define ATH9K_RX_DELIM_CRC_POST 0x20
114#define ATH9K_RX_DECRYPT_BUSY 0x40
115
116#define ATH9K_RXKEYIX_INVALID ((u8)-1)
117#define ATH9K_TXKEYIX_INVALID ((u32)-1)
118
119struct ath_desc {
120 u32 ds_link;
121 u32 ds_data;
122 u32 ds_ctl0;
123 u32 ds_ctl1;
124 u32 ds_hw[20];
125 union {
126 struct ath_tx_status tx;
127 struct ath_rx_status rx;
128 void *stats;
129 } ds_us;
130 void *ds_vdata;
131} __packed;
132
133#define ds_txstat ds_us.tx
134#define ds_rxstat ds_us.rx
135#define ds_stat ds_us.stats
136
137#define ATH9K_TXDESC_CLRDMASK 0x0001
138#define ATH9K_TXDESC_NOACK 0x0002
139#define ATH9K_TXDESC_RTSENA 0x0004
140#define ATH9K_TXDESC_CTSENA 0x0008
141#define ATH9K_TXDESC_INTREQ 0x0010
142#define ATH9K_TXDESC_VEOL 0x0020
143#define ATH9K_TXDESC_EXT_ONLY 0x0040
144#define ATH9K_TXDESC_EXT_AND_CTL 0x0080
145#define ATH9K_TXDESC_VMF 0x0100
146#define ATH9K_TXDESC_FRAG_IS_ON 0x0200
147
148#define ATH9K_RXDESC_INTREQ 0x0020
149
Sujith60b67f52008-08-07 10:52:38 +0530150enum ath9k_hw_caps {
151 ATH9K_HW_CAP_CHAN_SPREAD = BIT(0),
152 ATH9K_HW_CAP_MIC_AESCCM = BIT(1),
153 ATH9K_HW_CAP_MIC_CKIP = BIT(2),
154 ATH9K_HW_CAP_MIC_TKIP = BIT(3),
155 ATH9K_HW_CAP_CIPHER_AESCCM = BIT(4),
156 ATH9K_HW_CAP_CIPHER_CKIP = BIT(5),
157 ATH9K_HW_CAP_CIPHER_TKIP = BIT(6),
158 ATH9K_HW_CAP_VEOL = BIT(7),
159 ATH9K_HW_CAP_BSSIDMASK = BIT(8),
160 ATH9K_HW_CAP_MCAST_KEYSEARCH = BIT(9),
161 ATH9K_HW_CAP_CHAN_HALFRATE = BIT(10),
162 ATH9K_HW_CAP_CHAN_QUARTERRATE = BIT(11),
163 ATH9K_HW_CAP_HT = BIT(12),
164 ATH9K_HW_CAP_GTT = BIT(13),
165 ATH9K_HW_CAP_FASTCC = BIT(14),
166 ATH9K_HW_CAP_RFSILENT = BIT(15),
167 ATH9K_HW_CAP_WOW = BIT(16),
168 ATH9K_HW_CAP_CST = BIT(17),
169 ATH9K_HW_CAP_ENHANCEDPM = BIT(18),
170 ATH9K_HW_CAP_AUTOSLEEP = BIT(19),
171 ATH9K_HW_CAP_4KB_SPLITTRANS = BIT(20),
172 ATH9K_HW_CAP_WOW_MATCHPATTERN_EXACT = BIT(21),
Luis R. Rodriguezf078f202008-08-04 00:16:41 -0700173};
174
Sujith60b67f52008-08-07 10:52:38 +0530175enum ath9k_capability_type {
176 ATH9K_CAP_CIPHER = 0,
177 ATH9K_CAP_TKIP_MIC,
178 ATH9K_CAP_TKIP_SPLIT,
179 ATH9K_CAP_PHYCOUNTERS,
180 ATH9K_CAP_DIVERSITY,
181 ATH9K_CAP_TXPOW,
182 ATH9K_CAP_PHYDIAG,
183 ATH9K_CAP_MCAST_KEYSRCH,
184 ATH9K_CAP_TSF_ADJUST,
185 ATH9K_CAP_WME_TKIPMIC,
186 ATH9K_CAP_RFSILENT,
187 ATH9K_CAP_ANT_CFG_2GHZ,
188 ATH9K_CAP_ANT_CFG_5GHZ
Luis R. Rodriguezf078f202008-08-04 00:16:41 -0700189};
190
Sujith60b67f52008-08-07 10:52:38 +0530191struct ath9k_hw_capabilities {
192 u32 hw_caps; /* ATH9K_HW_CAP_* from ath9k_hw_caps */
193 u32 wireless_modes;
194 u16 total_queues;
195 u16 keycache_size;
196 u16 low_5ghz_chan, high_5ghz_chan;
197 u16 low_2ghz_chan, high_2ghz_chan;
198 u16 num_mr_retries;
199 u16 rts_aggr_limit;
200 u8 tx_chainmask;
201 u8 rx_chainmask;
202 u16 tx_triglevel_max;
203 u16 reg_cap;
204 u8 num_gpio_pins;
205 u8 num_antcfg_2ghz;
206 u8 num_antcfg_5ghz;
207};
208
209struct ath9k_ops_config {
210 int dma_beacon_response_time;
211 int sw_beacon_response_time;
212 int additional_swba_backoff;
213 int ack_6mb;
214 int cwm_ignore_extcca;
215 u8 pcie_powersave_enable;
216 u8 pcie_l1skp_enable;
217 u8 pcie_clock_req;
218 u32 pcie_waen;
219 int pcie_power_reset;
220 u8 pcie_restore;
221 u8 analog_shiftreg;
222 u8 ht_enable;
223 u32 ofdm_trig_low;
224 u32 ofdm_trig_high;
225 u32 cck_trig_high;
226 u32 cck_trig_low;
227 u32 enable_ani;
228 u8 noise_immunity_level;
229 u32 ofdm_weaksignal_det;
230 u32 cck_weaksignal_thr;
231 u8 spur_immunity_level;
232 u8 firstep_level;
233 int8_t rssi_thr_high;
234 int8_t rssi_thr_low;
235 u16 diversity_control;
236 u16 antenna_switch_swap;
237 int serialize_regmode;
238 int intr_mitigation;
Luis R. Rodriguezf078f202008-08-04 00:16:41 -0700239#define SPUR_DISABLE 0
240#define SPUR_ENABLE_IOCTL 1
241#define SPUR_ENABLE_EEPROM 2
242#define AR_EEPROM_MODAL_SPURS 5
243#define AR_SPUR_5413_1 1640
244#define AR_SPUR_5413_2 1200
245#define AR_NO_SPUR 0x8000
246#define AR_BASE_FREQ_2GHZ 2300
247#define AR_BASE_FREQ_5GHZ 4900
248#define AR_SPUR_FEEQ_BOUND_HT40 19
249#define AR_SPUR_FEEQ_BOUND_HT20 10
Sujith60b67f52008-08-07 10:52:38 +0530250 int spurmode;
251 u16 spurchans[AR_EEPROM_MODAL_SPURS][2];
Luis R. Rodriguezf078f202008-08-04 00:16:41 -0700252};
253
254enum ath9k_tx_queue {
255 ATH9K_TX_QUEUE_INACTIVE = 0,
256 ATH9K_TX_QUEUE_DATA,
257 ATH9K_TX_QUEUE_BEACON,
258 ATH9K_TX_QUEUE_CAB,
259 ATH9K_TX_QUEUE_UAPSD,
260 ATH9K_TX_QUEUE_PSPOLL
261};
262
263#define ATH9K_NUM_TX_QUEUES 10
264
265enum ath9k_tx_queue_subtype {
266 ATH9K_WME_AC_BK = 0,
267 ATH9K_WME_AC_BE,
268 ATH9K_WME_AC_VI,
269 ATH9K_WME_AC_VO,
270 ATH9K_WME_UPSD
271};
272
273enum ath9k_tx_queue_flags {
274 TXQ_FLAG_TXOKINT_ENABLE = 0x0001,
275 TXQ_FLAG_TXERRINT_ENABLE = 0x0001,
276 TXQ_FLAG_TXDESCINT_ENABLE = 0x0002,
277 TXQ_FLAG_TXEOLINT_ENABLE = 0x0004,
278 TXQ_FLAG_TXURNINT_ENABLE = 0x0008,
279 TXQ_FLAG_BACKOFF_DISABLE = 0x0010,
280 TXQ_FLAG_COMPRESSION_ENABLE = 0x0020,
281 TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE = 0x0040,
282 TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE = 0x0080,
283};
284
Luis R. Rodriguezf078f202008-08-04 00:16:41 -0700285#define ATH9K_TXQ_USEDEFAULT ((u32) -1)
286
287#define ATH9K_DECOMP_MASK_SIZE 128
288#define ATH9K_READY_TIME_LO_BOUND 50
289#define ATH9K_READY_TIME_HI_BOUND 96
290
291enum ath9k_pkt_type {
292 ATH9K_PKT_TYPE_NORMAL = 0,
293 ATH9K_PKT_TYPE_ATIM,
294 ATH9K_PKT_TYPE_PSPOLL,
295 ATH9K_PKT_TYPE_BEACON,
296 ATH9K_PKT_TYPE_PROBE_RESP,
297 ATH9K_PKT_TYPE_CHIRP,
298 ATH9K_PKT_TYPE_GRP_POLL,
299};
300
301struct ath9k_tx_queue_info {
302 u32 tqi_ver;
303 enum ath9k_tx_queue tqi_type;
304 enum ath9k_tx_queue_subtype tqi_subtype;
305 enum ath9k_tx_queue_flags tqi_qflags;
306 u32 tqi_priority;
307 u32 tqi_aifs;
308 u32 tqi_cwmin;
309 u32 tqi_cwmax;
310 u16 tqi_shretry;
311 u16 tqi_lgretry;
312 u32 tqi_cbrPeriod;
313 u32 tqi_cbrOverflowLimit;
314 u32 tqi_burstTime;
315 u32 tqi_readyTime;
316 u32 tqi_physCompBuf;
317 u32 tqi_intFlags;
318};
319
320enum ath9k_rx_filter {
321 ATH9K_RX_FILTER_UCAST = 0x00000001,
322 ATH9K_RX_FILTER_MCAST = 0x00000002,
323 ATH9K_RX_FILTER_BCAST = 0x00000004,
324 ATH9K_RX_FILTER_CONTROL = 0x00000008,
325 ATH9K_RX_FILTER_BEACON = 0x00000010,
326 ATH9K_RX_FILTER_PROM = 0x00000020,
327 ATH9K_RX_FILTER_PROBEREQ = 0x00000080,
328 ATH9K_RX_FILTER_PSPOLL = 0x00004000,
329 ATH9K_RX_FILTER_PHYERR = 0x00000100,
330 ATH9K_RX_FILTER_PHYRADAR = 0x00002000,
331};
332
333enum ath9k_int {
334 ATH9K_INT_RX = 0x00000001,
335 ATH9K_INT_RXDESC = 0x00000002,
336 ATH9K_INT_RXNOFRM = 0x00000008,
337 ATH9K_INT_RXEOL = 0x00000010,
338 ATH9K_INT_RXORN = 0x00000020,
339 ATH9K_INT_TX = 0x00000040,
340 ATH9K_INT_TXDESC = 0x00000080,
341 ATH9K_INT_TIM_TIMER = 0x00000100,
342 ATH9K_INT_TXURN = 0x00000800,
343 ATH9K_INT_MIB = 0x00001000,
344 ATH9K_INT_RXPHY = 0x00004000,
345 ATH9K_INT_RXKCM = 0x00008000,
346 ATH9K_INT_SWBA = 0x00010000,
347 ATH9K_INT_BMISS = 0x00040000,
348 ATH9K_INT_BNR = 0x00100000,
349 ATH9K_INT_TIM = 0x00200000,
350 ATH9K_INT_DTIM = 0x00400000,
351 ATH9K_INT_DTIMSYNC = 0x00800000,
352 ATH9K_INT_GPIO = 0x01000000,
353 ATH9K_INT_CABEND = 0x02000000,
354 ATH9K_INT_CST = 0x10000000,
355 ATH9K_INT_GTT = 0x20000000,
356 ATH9K_INT_FATAL = 0x40000000,
357 ATH9K_INT_GLOBAL = 0x80000000,
358 ATH9K_INT_BMISC = ATH9K_INT_TIM |
359 ATH9K_INT_DTIM |
360 ATH9K_INT_DTIMSYNC |
361 ATH9K_INT_CABEND,
362 ATH9K_INT_COMMON = ATH9K_INT_RXNOFRM |
363 ATH9K_INT_RXDESC |
364 ATH9K_INT_RXEOL |
365 ATH9K_INT_RXORN |
366 ATH9K_INT_TXURN |
367 ATH9K_INT_TXDESC |
368 ATH9K_INT_MIB |
369 ATH9K_INT_RXPHY |
370 ATH9K_INT_RXKCM |
371 ATH9K_INT_SWBA |
372 ATH9K_INT_BMISS |
373 ATH9K_INT_GPIO,
374 ATH9K_INT_NOCARD = 0xffffffff
375};
376
377struct ath9k_rate_table {
378 int rateCount;
379 u8 rateCodeToIndex[256];
380 struct {
381 u8 valid;
382 u8 phy;
383 u32 rateKbps;
384 u8 rateCode;
385 u8 shortPreamble;
386 u8 dot11Rate;
387 u8 controlRate;
388 u16 lpAckDuration;
389 u16 spAckDuration;
390 } info[32];
391};
392
393#define ATH9K_RATESERIES_RTS_CTS 0x0001
394#define ATH9K_RATESERIES_2040 0x0002
395#define ATH9K_RATESERIES_HALFGI 0x0004
396
397struct ath9k_11n_rate_series {
398 u32 Tries;
399 u32 Rate;
400 u32 PktDuration;
401 u32 ChSel;
402 u32 RateFlags;
403};
404
405#define CHANNEL_CW_INT 0x00002
406#define CHANNEL_CCK 0x00020
407#define CHANNEL_OFDM 0x00040
408#define CHANNEL_2GHZ 0x00080
409#define CHANNEL_5GHZ 0x00100
410#define CHANNEL_PASSIVE 0x00200
411#define CHANNEL_DYN 0x00400
412#define CHANNEL_HALF 0x04000
413#define CHANNEL_QUARTER 0x08000
414#define CHANNEL_HT20 0x10000
415#define CHANNEL_HT40PLUS 0x20000
416#define CHANNEL_HT40MINUS 0x40000
417
418#define CHANNEL_INTERFERENCE 0x01
419#define CHANNEL_DFS 0x02
420#define CHANNEL_4MS_LIMIT 0x04
421#define CHANNEL_DFS_CLEAR 0x08
422#define CHANNEL_DISALLOW_ADHOC 0x10
423#define CHANNEL_PER_11D_ADHOC 0x20
424
425#define CHANNEL_A (CHANNEL_5GHZ|CHANNEL_OFDM)
426#define CHANNEL_B (CHANNEL_2GHZ|CHANNEL_CCK)
427#define CHANNEL_G (CHANNEL_2GHZ|CHANNEL_OFDM)
428#define CHANNEL_G_HT20 (CHANNEL_2GHZ|CHANNEL_HT20)
429#define CHANNEL_A_HT20 (CHANNEL_5GHZ|CHANNEL_HT20)
430#define CHANNEL_G_HT40PLUS (CHANNEL_2GHZ|CHANNEL_HT40PLUS)
431#define CHANNEL_G_HT40MINUS (CHANNEL_2GHZ|CHANNEL_HT40MINUS)
432#define CHANNEL_A_HT40PLUS (CHANNEL_5GHZ|CHANNEL_HT40PLUS)
433#define CHANNEL_A_HT40MINUS (CHANNEL_5GHZ|CHANNEL_HT40MINUS)
434#define CHANNEL_ALL \
435 (CHANNEL_OFDM| \
436 CHANNEL_CCK| \
437 CHANNEL_2GHZ | \
438 CHANNEL_5GHZ | \
439 CHANNEL_HT20 | \
440 CHANNEL_HT40PLUS | \
441 CHANNEL_HT40MINUS)
442
443struct ath9k_channel {
444 u16 channel;
445 u32 channelFlags;
446 u8 privFlags;
447 int8_t maxRegTxPower;
448 int8_t maxTxPower;
449 int8_t minTxPower;
450 u32 chanmode;
451 int32_t CalValid;
452 bool oneTimeCalsDone;
453 int8_t iCoff;
454 int8_t qCoff;
455 int16_t rawNoiseFloor;
456 int8_t antennaMax;
457 u32 regDmnFlags;
458 u32 conformanceTestLimit[3]; /* 0:11a, 1: 11b, 2:11g */
459#ifdef ATH_NF_PER_CHAN
460 struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
461#endif
462};
463
464#define IS_CHAN_A(_c) ((((_c)->channelFlags & CHANNEL_A) == CHANNEL_A) || \
465 (((_c)->channelFlags & CHANNEL_A_HT20) == CHANNEL_A_HT20) || \
466 (((_c)->channelFlags & CHANNEL_A_HT40PLUS) == CHANNEL_A_HT40PLUS) || \
467 (((_c)->channelFlags & CHANNEL_A_HT40MINUS) == CHANNEL_A_HT40MINUS))
468#define IS_CHAN_B(_c) (((_c)->channelFlags & CHANNEL_B) == CHANNEL_B)
469#define IS_CHAN_G(_c) ((((_c)->channelFlags & (CHANNEL_G)) == CHANNEL_G) || \
470 (((_c)->channelFlags & CHANNEL_G_HT20) == CHANNEL_G_HT20) || \
471 (((_c)->channelFlags & CHANNEL_G_HT40PLUS) == CHANNEL_G_HT40PLUS) || \
472 (((_c)->channelFlags & CHANNEL_G_HT40MINUS) == CHANNEL_G_HT40MINUS))
473#define IS_CHAN_CCK(_c) (((_c)->channelFlags & CHANNEL_CCK) != 0)
474#define IS_CHAN_OFDM(_c) (((_c)->channelFlags & CHANNEL_OFDM) != 0)
475#define IS_CHAN_5GHZ(_c) (((_c)->channelFlags & CHANNEL_5GHZ) != 0)
476#define IS_CHAN_2GHZ(_c) (((_c)->channelFlags & CHANNEL_2GHZ) != 0)
477#define IS_CHAN_PASSIVE(_c) (((_c)->channelFlags & CHANNEL_PASSIVE) != 0)
478#define IS_CHAN_HALF_RATE(_c) (((_c)->channelFlags & CHANNEL_HALF) != 0)
479#define IS_CHAN_QUARTER_RATE(_c) (((_c)->channelFlags & CHANNEL_QUARTER) != 0)
480
481/* These macros check chanmode and not channelFlags */
482#define IS_CHAN_HT20(_c) (((_c)->chanmode == CHANNEL_A_HT20) || \
483 ((_c)->chanmode == CHANNEL_G_HT20))
484#define IS_CHAN_HT40(_c) (((_c)->chanmode == CHANNEL_A_HT40PLUS) || \
485 ((_c)->chanmode == CHANNEL_A_HT40MINUS) || \
486 ((_c)->chanmode == CHANNEL_G_HT40PLUS) || \
487 ((_c)->chanmode == CHANNEL_G_HT40MINUS))
488#define IS_CHAN_HT(_c) (IS_CHAN_HT20((_c)) || IS_CHAN_HT40((_c)))
489
490#define IS_CHAN_IN_PUBLIC_SAFETY_BAND(_c) ((_c) > 4940 && (_c) < 4990)
491#define IS_CHAN_A_5MHZ_SPACED(_c) \
492 ((((_c)->channelFlags & CHANNEL_5GHZ) != 0) && \
493 (((_c)->channel % 20) != 0) && \
494 (((_c)->channel % 10) != 0))
495
496struct ath9k_keyval {
497 u8 kv_type;
498 u8 kv_pad;
499 u16 kv_len;
500 u8 kv_val[16];
501 u8 kv_mic[8];
502 u8 kv_txmic[8];
503};
504
505enum ath9k_key_type {
506 ATH9K_KEY_TYPE_CLEAR,
507 ATH9K_KEY_TYPE_WEP,
508 ATH9K_KEY_TYPE_AES,
509 ATH9K_KEY_TYPE_TKIP,
510};
511
512enum ath9k_cipher {
513 ATH9K_CIPHER_WEP = 0,
514 ATH9K_CIPHER_AES_OCB = 1,
515 ATH9K_CIPHER_AES_CCM = 2,
516 ATH9K_CIPHER_CKIP = 3,
517 ATH9K_CIPHER_TKIP = 4,
518 ATH9K_CIPHER_CLR = 5,
519 ATH9K_CIPHER_MIC = 127
520};
521
522#define AR_EEPROM_EEPCAP_COMPRESS_DIS 0x0001
523#define AR_EEPROM_EEPCAP_AES_DIS 0x0002
524#define AR_EEPROM_EEPCAP_FASTFRAME_DIS 0x0004
525#define AR_EEPROM_EEPCAP_BURST_DIS 0x0008
526#define AR_EEPROM_EEPCAP_MAXQCU 0x01F0
527#define AR_EEPROM_EEPCAP_MAXQCU_S 4
528#define AR_EEPROM_EEPCAP_HEAVY_CLIP_EN 0x0200
529#define AR_EEPROM_EEPCAP_KC_ENTRIES 0xF000
530#define AR_EEPROM_EEPCAP_KC_ENTRIES_S 12
531
532#define AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
533#define AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
534#define AR_EEPROM_EEREGCAP_EN_KK_U2 0x0100
535#define AR_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
536#define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
537#define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
538
539#define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD_PRE4_0 0x4000
540#define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A_PRE4_0 0x8000
541
542#define SD_NO_CTL 0xE0
543#define NO_CTL 0xff
544#define CTL_MODE_M 7
545#define CTL_11A 0
546#define CTL_11B 1
547#define CTL_11G 2
548#define CTL_2GHT20 5
549#define CTL_5GHT20 6
550#define CTL_2GHT40 7
551#define CTL_5GHT40 8
552
553#define AR_EEPROM_MAC(i) (0x1d+(i))
554#define EEP_SCALE 100
555#define EEP_DELTA 10
556
557#define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c
558#define AR_EEPROM_RFSILENT_GPIO_SEL_S 2
559#define AR_EEPROM_RFSILENT_POLARITY 0x0002
560#define AR_EEPROM_RFSILENT_POLARITY_S 1
561
562#define CTRY_DEBUG 0x1ff
563#define CTRY_DEFAULT 0
564
565enum reg_ext_bitmap {
566 REG_EXT_JAPAN_MIDBAND = 1,
567 REG_EXT_FCC_DFS_HT40 = 2,
568 REG_EXT_JAPAN_NONDFS_HT40 = 3,
569 REG_EXT_JAPAN_DFS_HT40 = 4
570};
571
572struct ath9k_country_entry {
573 u16 countryCode;
574 u16 regDmnEnum;
575 u16 regDmn5G;
576 u16 regDmn2G;
577 u8 isMultidomain;
578 u8 iso[3];
579};
580
581#define REG_WRITE(_ah, _reg, _val) iowrite32(_val, _ah->ah_sh + _reg)
582#define REG_READ(_ah, _reg) ioread32(_ah->ah_sh + _reg)
583
584#define SM(_v, _f) (((_v) << _f##_S) & _f)
585#define MS(_v, _f) (((_v) & _f) >> _f##_S)
586#define REG_RMW(_a, _r, _set, _clr) \
587 REG_WRITE(_a, _r, (REG_READ(_a, _r) & ~(_clr)) | (_set))
588#define REG_RMW_FIELD(_a, _r, _f, _v) \
589 REG_WRITE(_a, _r, \
590 (REG_READ(_a, _r) & ~_f) | (((_v) << _f##_S) & _f))
591#define REG_SET_BIT(_a, _r, _f) \
592 REG_WRITE(_a, _r, REG_READ(_a, _r) | _f)
593#define REG_CLR_BIT(_a, _r, _f) \
594 REG_WRITE(_a, _r, REG_READ(_a, _r) & ~_f)
595
596#define ATH9K_COMP_BUF_MAX_SIZE 9216
597#define ATH9K_COMP_BUF_ALIGN_SIZE 512
598
599#define ATH9K_TXQ_USE_LOCKOUT_BKOFF_DIS 0x00000001
600
601#define INIT_AIFS 2
602#define INIT_CWMIN 15
603#define INIT_CWMIN_11B 31
604#define INIT_CWMAX 1023
605#define INIT_SH_RETRY 10
606#define INIT_LG_RETRY 10
607#define INIT_SSH_RETRY 32
608#define INIT_SLG_RETRY 32
609
610#define WLAN_CTRL_FRAME_SIZE (2+2+6+4)
611
612#define ATH_AMPDU_LIMIT_MAX (64 * 1024 - 1)
613#define ATH_AMPDU_LIMIT_DEFAULT ATH_AMPDU_LIMIT_MAX
614
615#define IEEE80211_WEP_IVLEN 3
616#define IEEE80211_WEP_KIDLEN 1
617#define IEEE80211_WEP_CRCLEN 4
618#define IEEE80211_MAX_MPDU_LEN (3840 + FCS_LEN + \
619 (IEEE80211_WEP_IVLEN + \
620 IEEE80211_WEP_KIDLEN + \
621 IEEE80211_WEP_CRCLEN))
622#define IEEE80211_MAX_LEN (2300 + FCS_LEN + \
623 (IEEE80211_WEP_IVLEN + \
624 IEEE80211_WEP_KIDLEN + \
625 IEEE80211_WEP_CRCLEN))
626
627#define MAX_REG_ADD_COUNT 129
628#define MAX_RATE_POWER 63
629
630enum ath9k_power_mode {
631 ATH9K_PM_AWAKE = 0,
632 ATH9K_PM_FULL_SLEEP,
633 ATH9K_PM_NETWORK_SLEEP,
634 ATH9K_PM_UNDEFINED
635};
636
637#define HAL_ANTENNA_MIN_MODE 0
638#define HAL_ANTENNA_FIXED_A 1
639#define HAL_ANTENNA_FIXED_B 2
640#define HAL_ANTENNA_MAX_MODE 3
641
642struct ath9k_mib_stats {
643 u32 ackrcv_bad;
644 u32 rts_bad;
645 u32 rts_good;
646 u32 fcs_bad;
647 u32 beacons;
648};
649
650enum ath9k_ant_setting {
651 ATH9K_ANT_VARIABLE = 0,
652 ATH9K_ANT_FIXED_A,
653 ATH9K_ANT_FIXED_B
654};
655
656enum ath9k_opmode {
657 ATH9K_M_STA = 1,
658 ATH9K_M_IBSS = 0,
659 ATH9K_M_HOSTAP = 6,
660 ATH9K_M_MONITOR = 8
661};
662
663#define ATH9K_SLOT_TIME_6 6
664#define ATH9K_SLOT_TIME_9 9
665#define ATH9K_SLOT_TIME_20 20
666
667enum ath9k_ht_macmode {
668 ATH9K_HT_MACMODE_20 = 0,
669 ATH9K_HT_MACMODE_2040 = 1,
670};
671
672enum ath9k_ht_extprotspacing {
673 ATH9K_HT_EXTPROTSPACING_20 = 0,
674 ATH9K_HT_EXTPROTSPACING_25 = 1,
675};
676
677struct ath9k_ht_cwm {
678 enum ath9k_ht_macmode ht_macmode;
679 enum ath9k_ht_extprotspacing ht_extprotspacing;
680};
681
682enum hal_freq_band {
683 HAL_FREQ_BAND_5GHZ = 0,
684 HAL_FREQ_BAND_2GHZ = 1,
685};
686
687enum ath9k_ani_cmd {
688 ATH9K_ANI_PRESENT = 0x1,
689 ATH9K_ANI_NOISE_IMMUNITY_LEVEL = 0x2,
690 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION = 0x4,
691 ATH9K_ANI_CCK_WEAK_SIGNAL_THR = 0x8,
692 ATH9K_ANI_FIRSTEP_LEVEL = 0x10,
693 ATH9K_ANI_SPUR_IMMUNITY_LEVEL = 0x20,
694 ATH9K_ANI_MODE = 0x40,
695 ATH9K_ANI_PHYERR_RESET = 0x80,
696 ATH9K_ANI_ALL = 0xff
697};
698
699enum phytype {
700 PHY_DS,
701 PHY_FH,
702 PHY_OFDM,
703 PHY_HT,
704 PHY_MAX
705};
706#define PHY_CCK PHY_DS
707
708enum start_adhoc_option {
709 START_ADHOC_NO_11A,
710 START_ADHOC_PER_11D,
711 START_ADHOC_IN_11A,
712 START_ADHOC_IN_11B,
713};
714
715enum ath9k_tp_scale {
716 ATH9K_TP_SCALE_MAX = 0,
717 ATH9K_TP_SCALE_50,
718 ATH9K_TP_SCALE_25,
719 ATH9K_TP_SCALE_12,
720 ATH9K_TP_SCALE_MIN
721};
722
723enum ser_reg_mode {
724 SER_REG_MODE_OFF = 0,
725 SER_REG_MODE_ON = 1,
726 SER_REG_MODE_AUTO = 2,
727};
728
729#define AR_PHY_CCA_MAX_GOOD_VALUE -85
730#define AR_PHY_CCA_MAX_HIGH_VALUE -62
731#define AR_PHY_CCA_MIN_BAD_VALUE -121
732#define AR_PHY_CCA_FILTERWINDOW_LENGTH_INIT 3
733#define AR_PHY_CCA_FILTERWINDOW_LENGTH 5
734
735#define ATH9K_NF_CAL_HIST_MAX 5
736#define NUM_NF_READINGS 6
737
738struct ath9k_nfcal_hist {
739 int16_t nfCalBuffer[ATH9K_NF_CAL_HIST_MAX];
740 u8 currIndex;
741 int16_t privNF;
742 u8 invalidNFcount;
743};
744
745struct ath9k_beacon_state {
746 u32 bs_nexttbtt;
747 u32 bs_nextdtim;
748 u32 bs_intval;
749#define ATH9K_BEACON_PERIOD 0x0000ffff
750#define ATH9K_BEACON_ENA 0x00800000
751#define ATH9K_BEACON_RESET_TSF 0x01000000
752 u32 bs_dtimperiod;
753 u16 bs_cfpperiod;
754 u16 bs_cfpmaxduration;
755 u32 bs_cfpnext;
756 u16 bs_timoffset;
757 u16 bs_bmissthreshold;
758 u32 bs_sleepduration;
759};
760
761struct ath9k_node_stats {
762 u32 ns_avgbrssi;
763 u32 ns_avgrssi;
764 u32 ns_avgtxrssi;
765 u32 ns_avgtxrate;
766};
767
768#define ATH9K_RSSI_EP_MULTIPLIER (1<<7)
769
770enum ath9k_gpio_output_mux_type {
771 ATH9K_GPIO_OUTPUT_MUX_AS_OUTPUT,
772 ATH9K_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED,
773 ATH9K_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED,
774 ATH9K_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED,
775 ATH9K_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED,
776 ATH9K_GPIO_OUTPUT_MUX_NUM_ENTRIES
777};
778
779enum {
780 ATH9K_RESET_POWER_ON,
781 ATH9K_RESET_WARM,
782 ATH9K_RESET_COLD,
783};
784
785#define AH_USE_EEPROM 0x1
786
787struct ath_hal {
788 u32 ah_magic;
789 u16 ah_devid;
790 u16 ah_subvendorid;
791 struct ath_softc *ah_sc;
792 void __iomem *ah_sh;
793 u16 ah_countryCode;
794 u32 ah_macVersion;
795 u16 ah_macRev;
796 u16 ah_phyRev;
797 u16 ah_analog5GhzRev;
798 u16 ah_analog2GhzRev;
799 u8 ah_decompMask[ATH9K_DECOMP_MASK_SIZE];
800 u32 ah_flags;
801 enum ath9k_opmode ah_opmode;
Sujith60b67f52008-08-07 10:52:38 +0530802 struct ath9k_ops_config ah_config;
803 struct ath9k_hw_capabilities ah_caps;
Luis R. Rodriguezf078f202008-08-04 00:16:41 -0700804 int16_t ah_powerLimit;
805 u16 ah_maxPowerLevel;
806 u32 ah_tpScale;
807 u16 ah_currentRD;
808 u16 ah_currentRDExt;
809 u16 ah_currentRDInUse;
810 u16 ah_currentRD5G;
811 u16 ah_currentRD2G;
812 char ah_iso[4];
813 enum start_adhoc_option ah_adHocMode;
814 bool ah_commonMode;
815 struct ath9k_channel ah_channels[150];
816 u32 ah_nchan;
817 struct ath9k_channel *ah_curchan;
818 u16 ah_rfsilent;
819 bool ah_rfkillEnabled;
820 bool ah_isPciExpress;
821 u16 ah_txTrigLevel;
822#ifndef ATH_NF_PER_CHAN
823 struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
824#endif
825};
826
827enum wireless_mode {
828 WIRELESS_MODE_11a = 0,
829 WIRELESS_MODE_11b = 2,
830 WIRELESS_MODE_11g = 3,
831 WIRELESS_MODE_11NA_HT20 = 6,
832 WIRELESS_MODE_11NG_HT20 = 7,
833 WIRELESS_MODE_11NA_HT40PLUS = 8,
834 WIRELESS_MODE_11NA_HT40MINUS = 9,
835 WIRELESS_MODE_11NG_HT40PLUS = 10,
836 WIRELESS_MODE_11NG_HT40MINUS = 11,
837 WIRELESS_MODE_MAX
838};
839
840enum {
841 ATH9K_MODE_SEL_11A = 0x00001,
842 ATH9K_MODE_SEL_11B = 0x00002,
843 ATH9K_MODE_SEL_11G = 0x00004,
844 ATH9K_MODE_SEL_11NG_HT20 = 0x00008,
845 ATH9K_MODE_SEL_11NA_HT20 = 0x00010,
846 ATH9K_MODE_SEL_11NG_HT40PLUS = 0x00020,
847 ATH9K_MODE_SEL_11NG_HT40MINUS = 0x00040,
848 ATH9K_MODE_SEL_11NA_HT40PLUS = 0x00080,
849 ATH9K_MODE_SEL_11NA_HT40MINUS = 0x00100,
850 ATH9K_MODE_SEL_2GHZ = (ATH9K_MODE_SEL_11B |
851 ATH9K_MODE_SEL_11G |
852 ATH9K_MODE_SEL_11NG_HT20),
853 ATH9K_MODE_SEL_5GHZ = (ATH9K_MODE_SEL_11A |
854 ATH9K_MODE_SEL_11NA_HT20),
855 ATH9K_MODE_SEL_ALL = 0xffffffff
856};
857
858struct chan_centers {
859 u16 synth_center;
860 u16 ctl_center;
861 u16 ext_center;
862};
863
864int ath_hal_getcapability(struct ath_hal *ah,
Sujith60b67f52008-08-07 10:52:38 +0530865 enum ath9k_capability_type type,
Luis R. Rodriguezf078f202008-08-04 00:16:41 -0700866 u32 capability,
867 u32 *result);
868const struct ath9k_rate_table *ath9k_hw_getratetable(struct ath_hal *ah,
869 u32 mode);
870void ath9k_hw_detach(struct ath_hal *ah);
871struct ath_hal *ath9k_hw_attach(u16 devid,
872 struct ath_softc *sc,
873 void __iomem *mem,
874 int *error);
875bool ath9k_regd_init_channels(struct ath_hal *ah,
876 u32 maxchans, u32 *nchans,
877 u8 *regclassids,
878 u32 maxregids, u32 *nregids,
879 u16 cc, u32 modeSelect,
880 bool enableOutdoor,
881 bool enableExtendedChannels);
882u32 ath9k_hw_mhz2ieee(struct ath_hal *ah, u32 freq, u32 flags);
883enum ath9k_int ath9k_hw_set_interrupts(struct ath_hal *ah,
884 enum ath9k_int ints);
885bool ath9k_hw_reset(struct ath_hal *ah, enum ath9k_opmode opmode,
886 struct ath9k_channel *chan,
887 enum ath9k_ht_macmode macmode,
888 u8 txchainmask, u8 rxchainmask,
889 enum ath9k_ht_extprotspacing extprotspacing,
890 bool bChannelChange,
891 int *status);
892bool ath9k_hw_phy_disable(struct ath_hal *ah);
893void ath9k_hw_reset_calvalid(struct ath_hal *ah, struct ath9k_channel *chan,
894 bool *isCalDone);
895void ath9k_hw_ani_monitor(struct ath_hal *ah,
896 const struct ath9k_node_stats *stats,
897 struct ath9k_channel *chan);
898bool ath9k_hw_calibrate(struct ath_hal *ah,
899 struct ath9k_channel *chan,
900 u8 rxchainmask,
901 bool longcal,
902 bool *isCalDone);
903int16_t ath9k_hw_getchan_noise(struct ath_hal *ah,
904 struct ath9k_channel *chan);
905void ath9k_hw_write_associd(struct ath_hal *ah, const u8 *bssid,
906 u16 assocId);
907void ath9k_hw_setrxfilter(struct ath_hal *ah, u32 bits);
908void ath9k_hw_write_associd(struct ath_hal *ah, const u8 *bssid,
909 u16 assocId);
910bool ath9k_hw_stoptxdma(struct ath_hal *ah, u32 q);
911void ath9k_hw_reset_tsf(struct ath_hal *ah);
912bool ath9k_hw_keyisvalid(struct ath_hal *ah, u16 entry);
913bool ath9k_hw_keysetmac(struct ath_hal *ah, u16 entry,
914 const u8 *mac);
915bool ath9k_hw_set_keycache_entry(struct ath_hal *ah,
916 u16 entry,
917 const struct ath9k_keyval *k,
918 const u8 *mac,
919 int xorKey);
920bool ath9k_hw_set_tsfadjust(struct ath_hal *ah,
921 u32 setting);
922void ath9k_hw_configpcipowersave(struct ath_hal *ah, int restore);
923bool ath9k_hw_intrpend(struct ath_hal *ah);
924bool ath9k_hw_getisr(struct ath_hal *ah, enum ath9k_int *masked);
925bool ath9k_hw_updatetxtriglevel(struct ath_hal *ah,
926 bool bIncTrigLevel);
927void ath9k_hw_procmibevent(struct ath_hal *ah,
928 const struct ath9k_node_stats *stats);
929bool ath9k_hw_setrxabort(struct ath_hal *ah, bool set);
930void ath9k_hw_set11nmac2040(struct ath_hal *ah, enum ath9k_ht_macmode mode);
931bool ath9k_hw_phycounters(struct ath_hal *ah);
932bool ath9k_hw_keyreset(struct ath_hal *ah, u16 entry);
933bool ath9k_hw_getcapability(struct ath_hal *ah,
Sujith60b67f52008-08-07 10:52:38 +0530934 enum ath9k_capability_type type,
Luis R. Rodriguezf078f202008-08-04 00:16:41 -0700935 u32 capability,
936 u32 *result);
937bool ath9k_hw_setcapability(struct ath_hal *ah,
Sujith60b67f52008-08-07 10:52:38 +0530938 enum ath9k_capability_type type,
Luis R. Rodriguezf078f202008-08-04 00:16:41 -0700939 u32 capability,
940 u32 setting,
941 int *status);
942u32 ath9k_hw_getdefantenna(struct ath_hal *ah);
943void ath9k_hw_getmac(struct ath_hal *ah, u8 *mac);
944void ath9k_hw_getbssidmask(struct ath_hal *ah, u8 *mask);
945bool ath9k_hw_setbssidmask(struct ath_hal *ah,
946 const u8 *mask);
947bool ath9k_hw_setpower(struct ath_hal *ah,
948 enum ath9k_power_mode mode);
949enum ath9k_int ath9k_hw_intrget(struct ath_hal *ah);
950u64 ath9k_hw_gettsf64(struct ath_hal *ah);
951u32 ath9k_hw_getdefantenna(struct ath_hal *ah);
952bool ath9k_hw_setslottime(struct ath_hal *ah, u32 us);
953bool ath9k_hw_setantennaswitch(struct ath_hal *ah,
954 enum ath9k_ant_setting settings,
955 struct ath9k_channel *chan,
956 u8 *tx_chainmask,
957 u8 *rx_chainmask,
958 u8 *antenna_cfgd);
959void ath9k_hw_setantenna(struct ath_hal *ah, u32 antenna);
960int ath9k_hw_select_antconfig(struct ath_hal *ah,
961 u32 cfg);
962bool ath9k_hw_puttxbuf(struct ath_hal *ah, u32 q,
963 u32 txdp);
964bool ath9k_hw_txstart(struct ath_hal *ah, u32 q);
965u16 ath9k_hw_computetxtime(struct ath_hal *ah,
966 const struct ath9k_rate_table *rates,
967 u32 frameLen, u16 rateix,
968 bool shortPreamble);
969void ath9k_hw_set11n_ratescenario(struct ath_hal *ah, struct ath_desc *ds,
970 struct ath_desc *lastds,
971 u32 durUpdateEn, u32 rtsctsRate,
972 u32 rtsctsDuration,
973 struct ath9k_11n_rate_series series[],
974 u32 nseries, u32 flags);
975void ath9k_hw_set11n_burstduration(struct ath_hal *ah,
976 struct ath_desc *ds,
977 u32 burstDuration);
978void ath9k_hw_cleartxdesc(struct ath_hal *ah, struct ath_desc *ds);
979u32 ath9k_hw_reverse_bits(u32 val, u32 n);
980bool ath9k_hw_resettxqueue(struct ath_hal *ah, u32 q);
981u32 ath9k_regd_get_ctl(struct ath_hal *ah, struct ath9k_channel *chan);
982u32 ath9k_regd_get_antenna_allowed(struct ath_hal *ah,
983 struct ath9k_channel *chan);
984u32 ath9k_hw_mhz2ieee(struct ath_hal *ah, u32 freq, u32 flags);
Sujithea9880f2008-08-07 10:53:10 +0530985bool ath9k_hw_get_txq_props(struct ath_hal *ah, int q,
986 struct ath9k_tx_queue_info *qinfo);
987bool ath9k_hw_set_txq_props(struct ath_hal *ah, int q,
988 const struct ath9k_tx_queue_info *qinfo);
Luis R. Rodriguezf078f202008-08-04 00:16:41 -0700989struct ath9k_channel *ath9k_regd_check_channel(struct ath_hal *ah,
990 const struct ath9k_channel *c);
991void ath9k_hw_set11n_txdesc(struct ath_hal *ah, struct ath_desc *ds,
992 u32 pktLen, enum ath9k_pkt_type type,
993 u32 txPower, u32 keyIx,
994 enum ath9k_key_type keyType, u32 flags);
995bool ath9k_hw_filltxdesc(struct ath_hal *ah, struct ath_desc *ds,
996 u32 segLen, bool firstSeg,
997 bool lastSeg,
998 const struct ath_desc *ds0);
999u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hal *ah,
1000 u32 *rxc_pcnt,
1001 u32 *rxf_pcnt,
1002 u32 *txf_pcnt);
1003void ath9k_hw_dmaRegDump(struct ath_hal *ah);
1004void ath9k_hw_beaconinit(struct ath_hal *ah,
1005 u32 next_beacon, u32 beacon_period);
1006void ath9k_hw_set_sta_beacon_timers(struct ath_hal *ah,
1007 const struct ath9k_beacon_state *bs);
1008bool ath9k_hw_setuprxdesc(struct ath_hal *ah, struct ath_desc *ds,
1009 u32 size, u32 flags);
1010void ath9k_hw_putrxbuf(struct ath_hal *ah, u32 rxdp);
1011void ath9k_hw_rxena(struct ath_hal *ah);
1012void ath9k_hw_setopmode(struct ath_hal *ah);
1013bool ath9k_hw_setmac(struct ath_hal *ah, const u8 *mac);
1014void ath9k_hw_setmcastfilter(struct ath_hal *ah, u32 filter0,
1015 u32 filter1);
1016u32 ath9k_hw_getrxfilter(struct ath_hal *ah);
1017void ath9k_hw_startpcureceive(struct ath_hal *ah);
1018void ath9k_hw_stoppcurecv(struct ath_hal *ah);
1019bool ath9k_hw_stopdmarecv(struct ath_hal *ah);
1020int ath9k_hw_rxprocdesc(struct ath_hal *ah,
1021 struct ath_desc *ds, u32 pa,
1022 struct ath_desc *nds, u64 tsf);
1023u32 ath9k_hw_gettxbuf(struct ath_hal *ah, u32 q);
1024int ath9k_hw_txprocdesc(struct ath_hal *ah,
1025 struct ath_desc *ds);
1026void ath9k_hw_set11n_aggr_middle(struct ath_hal *ah, struct ath_desc *ds,
1027 u32 numDelims);
1028void ath9k_hw_set11n_aggr_first(struct ath_hal *ah, struct ath_desc *ds,
1029 u32 aggrLen);
1030void ath9k_hw_set11n_aggr_last(struct ath_hal *ah, struct ath_desc *ds);
1031bool ath9k_hw_releasetxqueue(struct ath_hal *ah, u32 q);
1032void ath9k_hw_gettxintrtxqs(struct ath_hal *ah, u32 *txqs);
1033void ath9k_hw_clr11n_aggr(struct ath_hal *ah, struct ath_desc *ds);
1034void ath9k_hw_set11n_virtualmorefrag(struct ath_hal *ah,
1035 struct ath_desc *ds, u32 vmf);
1036bool ath9k_hw_set_txpowerlimit(struct ath_hal *ah, u32 limit);
1037bool ath9k_regd_is_public_safety_sku(struct ath_hal *ah);
1038int ath9k_hw_setuptxqueue(struct ath_hal *ah, enum ath9k_tx_queue type,
Sujithea9880f2008-08-07 10:53:10 +05301039 const struct ath9k_tx_queue_info *qinfo);
Luis R. Rodriguezf078f202008-08-04 00:16:41 -07001040u32 ath9k_hw_numtxpending(struct ath_hal *ah, u32 q);
1041const char *ath9k_hw_probe(u16 vendorid, u16 devid);
1042bool ath9k_hw_disable(struct ath_hal *ah);
1043void ath9k_hw_rfdetach(struct ath_hal *ah);
1044void ath9k_hw_get_channel_centers(struct ath_hal *ah,
1045 struct ath9k_channel *chan,
1046 struct chan_centers *centers);
1047bool ath9k_get_channel_edges(struct ath_hal *ah,
1048 u16 flags, u16 *low,
1049 u16 *high);
1050#endif