xref: /openbmc/linux/drivers/net/wireless/ath/ath9k/hw.h (revision 77fac465b4b65056a2cec62c1acdc754b7ae86ed)
1203c4805SLuis R. Rodriguez /*
25b68138eSSujith Manoharan  * Copyright (c) 2008-2011 Atheros Communications Inc.
3203c4805SLuis R. Rodriguez  *
4203c4805SLuis R. Rodriguez  * Permission to use, copy, modify, and/or distribute this software for any
5203c4805SLuis R. Rodriguez  * purpose with or without fee is hereby granted, provided that the above
6203c4805SLuis R. Rodriguez  * copyright notice and this permission notice appear in all copies.
7203c4805SLuis R. Rodriguez  *
8203c4805SLuis R. Rodriguez  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9203c4805SLuis R. Rodriguez  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10203c4805SLuis R. Rodriguez  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11203c4805SLuis R. Rodriguez  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12203c4805SLuis R. Rodriguez  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13203c4805SLuis R. Rodriguez  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14203c4805SLuis R. Rodriguez  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15203c4805SLuis R. Rodriguez  */
16203c4805SLuis R. Rodriguez 
17203c4805SLuis R. Rodriguez #ifndef HW_H
18203c4805SLuis R. Rodriguez #define HW_H
19203c4805SLuis R. Rodriguez 
20203c4805SLuis R. Rodriguez #include <linux/if_ether.h>
21203c4805SLuis R. Rodriguez #include <linux/delay.h>
22203c4805SLuis R. Rodriguez #include <linux/io.h>
23203c4805SLuis R. Rodriguez 
24203c4805SLuis R. Rodriguez #include "mac.h"
25203c4805SLuis R. Rodriguez #include "ani.h"
26203c4805SLuis R. Rodriguez #include "eeprom.h"
27203c4805SLuis R. Rodriguez #include "calib.h"
28203c4805SLuis R. Rodriguez #include "reg.h"
29203c4805SLuis R. Rodriguez #include "phy.h"
30af03abecSLuis R. Rodriguez #include "btcoex.h"
31203c4805SLuis R. Rodriguez 
32203c4805SLuis R. Rodriguez #include "../regd.h"
33203c4805SLuis R. Rodriguez 
34203c4805SLuis R. Rodriguez #define ATHEROS_VENDOR_ID	0x168c
357976b426SLuis R. Rodriguez 
36203c4805SLuis R. Rodriguez #define AR5416_DEVID_PCI	0x0023
37203c4805SLuis R. Rodriguez #define AR5416_DEVID_PCIE	0x0024
38203c4805SLuis R. Rodriguez #define AR9160_DEVID_PCI	0x0027
39203c4805SLuis R. Rodriguez #define AR9280_DEVID_PCI	0x0029
40203c4805SLuis R. Rodriguez #define AR9280_DEVID_PCIE	0x002a
41203c4805SLuis R. Rodriguez #define AR9285_DEVID_PCIE	0x002b
425ffaf8a3SLuis R. Rodriguez #define AR2427_DEVID_PCIE	0x002c
43db3cc53aSSenthil Balasubramanian #define AR9287_DEVID_PCI	0x002d
44db3cc53aSSenthil Balasubramanian #define AR9287_DEVID_PCIE	0x002e
45db3cc53aSSenthil Balasubramanian #define AR9300_DEVID_PCIE	0x0030
46b99a7be4SVasanthakumar Thiagarajan #define AR9300_DEVID_AR9340	0x0031
473050c914SVasanthakumar Thiagarajan #define AR9300_DEVID_AR9485_PCIE 0x0032
485a63ef0fSLuis R. Rodriguez #define AR9300_DEVID_AR9580	0x0033
49423e38e8SRajkumar Manoharan #define AR9300_DEVID_AR9462	0x0034
5003689301SGabor Juhos #define AR9300_DEVID_AR9330	0x0035
51b1233779SGabor Juhos #define AR9300_DEVID_QCA955X	0x0038
52d4e5979cSMohammed Shafi Shajakhan #define AR9485_DEVID_AR1111	0x0037
53*77fac465SSujith Manoharan #define AR9300_DEVID_AR9565     0x0036
547976b426SLuis R. Rodriguez 
55203c4805SLuis R. Rodriguez #define AR5416_AR9100_DEVID	0x000b
567976b426SLuis R. Rodriguez 
57203c4805SLuis R. Rodriguez #define	AR_SUBVENDOR_ID_NOG	0x0e11
58203c4805SLuis R. Rodriguez #define AR_SUBVENDOR_ID_NEW_A	0x7065
59203c4805SLuis R. Rodriguez #define AR5416_MAGIC		0x19641014
60203c4805SLuis R. Rodriguez 
61fe12946eSVasanthakumar Thiagarajan #define AR9280_COEX2WIRE_SUBSYSID	0x309b
62fe12946eSVasanthakumar Thiagarajan #define AT9285_COEX3WIRE_SA_SUBSYSID	0x30aa
63fe12946eSVasanthakumar Thiagarajan #define AT9285_COEX3WIRE_DA_SUBSYSID	0x30ab
64fe12946eSVasanthakumar Thiagarajan 
65e3d01bfcSLuis R. Rodriguez #define ATH_AMPDU_LIMIT_MAX        (64 * 1024 - 1)
66e3d01bfcSLuis R. Rodriguez 
67cfe8cba9SLuis R. Rodriguez #define	ATH_DEFAULT_NOISE_FLOOR -95
68cfe8cba9SLuis R. Rodriguez 
6904658fbaSJohn W. Linville #define ATH9K_RSSI_BAD			-128
70990b70abSLuis R. Rodriguez 
71cac4220bSFelix Fietkau #define ATH9K_NUM_CHANNELS	38
72cac4220bSFelix Fietkau 
73203c4805SLuis R. Rodriguez /* Register read/write primitives */
749e4bffd2SLuis R. Rodriguez #define REG_WRITE(_ah, _reg, _val) \
75f9f84e96SFelix Fietkau 	(_ah)->reg_ops.write((_ah), (_val), (_reg))
769e4bffd2SLuis R. Rodriguez 
779e4bffd2SLuis R. Rodriguez #define REG_READ(_ah, _reg) \
78f9f84e96SFelix Fietkau 	(_ah)->reg_ops.read((_ah), (_reg))
79203c4805SLuis R. Rodriguez 
8009a525d3SSujith Manoharan #define REG_READ_MULTI(_ah, _addr, _val, _cnt)		\
81f9f84e96SFelix Fietkau 	(_ah)->reg_ops.multi_read((_ah), (_addr), (_val), (_cnt))
8209a525d3SSujith Manoharan 
83845e03c9SFelix Fietkau #define REG_RMW(_ah, _reg, _set, _clr) \
84845e03c9SFelix Fietkau 	(_ah)->reg_ops.rmw((_ah), (_reg), (_set), (_clr))
85845e03c9SFelix Fietkau 
8620b3efd9SSujith #define ENABLE_REGWRITE_BUFFER(_ah)					\
8720b3efd9SSujith 	do {								\
88f9f84e96SFelix Fietkau 		if ((_ah)->reg_ops.enable_write_buffer)	\
89f9f84e96SFelix Fietkau 			(_ah)->reg_ops.enable_write_buffer((_ah)); \
9020b3efd9SSujith 	} while (0)
9120b3efd9SSujith 
9220b3efd9SSujith #define REGWRITE_BUFFER_FLUSH(_ah)					\
9320b3efd9SSujith 	do {								\
94f9f84e96SFelix Fietkau 		if ((_ah)->reg_ops.write_flush)		\
95f9f84e96SFelix Fietkau 			(_ah)->reg_ops.write_flush((_ah));	\
9620b3efd9SSujith 	} while (0)
9720b3efd9SSujith 
9826526202SRajkumar Manoharan #define PR_EEP(_s, _val)						\
9926526202SRajkumar Manoharan 	do {								\
10026526202SRajkumar Manoharan 		len += snprintf(buf + len, size - len, "%20s : %10d\n",	\
10126526202SRajkumar Manoharan 				_s, (_val));				\
10226526202SRajkumar Manoharan 	} while (0)
10326526202SRajkumar Manoharan 
104203c4805SLuis R. Rodriguez #define SM(_v, _f)  (((_v) << _f##_S) & _f)
105203c4805SLuis R. Rodriguez #define MS(_v, _f)  (((_v) & _f) >> _f##_S)
106203c4805SLuis R. Rodriguez #define REG_RMW_FIELD(_a, _r, _f, _v) \
107845e03c9SFelix Fietkau 	REG_RMW(_a, _r, (((_v) << _f##_S) & _f), (_f))
1081547da37SLuis R. Rodriguez #define REG_READ_FIELD(_a, _r, _f) \
1091547da37SLuis R. Rodriguez 	(((REG_READ(_a, _r) & _f) >> _f##_S))
110203c4805SLuis R. Rodriguez #define REG_SET_BIT(_a, _r, _f) \
111845e03c9SFelix Fietkau 	REG_RMW(_a, _r, (_f), 0)
112203c4805SLuis R. Rodriguez #define REG_CLR_BIT(_a, _r, _f) \
113845e03c9SFelix Fietkau 	REG_RMW(_a, _r, 0, (_f))
114203c4805SLuis R. Rodriguez 
115203c4805SLuis R. Rodriguez #define DO_DELAY(x) do {					\
116e7fc6338SRajkumar Manoharan 		if (((++(x) % 64) == 0) &&			\
117e7fc6338SRajkumar Manoharan 		    (ath9k_hw_common(ah)->bus_ops->ath_bus_type	\
118e7fc6338SRajkumar Manoharan 			!= ATH_USB))				\
119203c4805SLuis R. Rodriguez 			udelay(1);				\
120203c4805SLuis R. Rodriguez 	} while (0)
121203c4805SLuis R. Rodriguez 
122a9b6b256SFelix Fietkau #define REG_WRITE_ARRAY(iniarray, column, regWr) \
123a9b6b256SFelix Fietkau 	ath9k_hw_write_array(ah, iniarray, column, &(regWr))
124203c4805SLuis R. Rodriguez 
125203c4805SLuis R. Rodriguez #define AR_GPIO_OUTPUT_MUX_AS_OUTPUT             0
126203c4805SLuis R. Rodriguez #define AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED 1
127203c4805SLuis R. Rodriguez #define AR_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED     2
128203c4805SLuis R. Rodriguez #define AR_GPIO_OUTPUT_MUX_AS_TX_FRAME           3
1291773912bSVasanthakumar Thiagarajan #define AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL  4
130203c4805SLuis R. Rodriguez #define AR_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED    5
131203c4805SLuis R. Rodriguez #define AR_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED      6
13293d36e99SMohammed Shafi Shajakhan #define AR_GPIO_OUTPUT_MUX_AS_MCI_WLAN_DATA      0x16
13393d36e99SMohammed Shafi Shajakhan #define AR_GPIO_OUTPUT_MUX_AS_MCI_WLAN_CLK       0x17
13493d36e99SMohammed Shafi Shajakhan #define AR_GPIO_OUTPUT_MUX_AS_MCI_BT_DATA        0x18
13593d36e99SMohammed Shafi Shajakhan #define AR_GPIO_OUTPUT_MUX_AS_MCI_BT_CLK         0x19
13693d36e99SMohammed Shafi Shajakhan #define AR_GPIO_OUTPUT_MUX_AS_WL_IN_TX           0x14
13793d36e99SMohammed Shafi Shajakhan #define AR_GPIO_OUTPUT_MUX_AS_WL_IN_RX           0x13
13893d36e99SMohammed Shafi Shajakhan #define AR_GPIO_OUTPUT_MUX_AS_BT_IN_TX           9
13993d36e99SMohammed Shafi Shajakhan #define AR_GPIO_OUTPUT_MUX_AS_BT_IN_RX           8
14093d36e99SMohammed Shafi Shajakhan #define AR_GPIO_OUTPUT_MUX_AS_RUCKUS_STROBE      0x1d
14193d36e99SMohammed Shafi Shajakhan #define AR_GPIO_OUTPUT_MUX_AS_RUCKUS_DATA        0x1e
142203c4805SLuis R. Rodriguez 
143203c4805SLuis R. Rodriguez #define AR_GPIOD_MASK               0x00001FFF
144203c4805SLuis R. Rodriguez #define AR_GPIO_BIT(_gpio)          (1 << (_gpio))
145203c4805SLuis R. Rodriguez 
146203c4805SLuis R. Rodriguez #define BASE_ACTIVATE_DELAY         100
1470b488ac6SVasanthakumar Thiagarajan #define RTC_PLL_SETTLE_DELAY        (AR_SREV_9340(ah) ? 1000 : 100)
148203c4805SLuis R. Rodriguez #define COEF_SCALE_S                24
149203c4805SLuis R. Rodriguez #define HT40_CHANNEL_CENTER_SHIFT   10
150203c4805SLuis R. Rodriguez 
151203c4805SLuis R. Rodriguez #define ATH9K_ANTENNA0_CHAINMASK    0x1
152203c4805SLuis R. Rodriguez #define ATH9K_ANTENNA1_CHAINMASK    0x2
153203c4805SLuis R. Rodriguez 
154203c4805SLuis R. Rodriguez #define ATH9K_NUM_DMA_DEBUG_REGS    8
155203c4805SLuis R. Rodriguez #define ATH9K_NUM_QUEUES            10
156203c4805SLuis R. Rodriguez 
157203c4805SLuis R. Rodriguez #define MAX_RATE_POWER              63
158203c4805SLuis R. Rodriguez #define AH_WAIT_TIMEOUT             100000 /* (us) */
159f9b604f6SGabor Juhos #define AH_TSF_WRITE_TIMEOUT        100    /* (us) */
160203c4805SLuis R. Rodriguez #define AH_TIME_QUANTUM             10
161203c4805SLuis R. Rodriguez #define AR_KEYTABLE_SIZE            128
162d8caa839SSujith #define POWER_UP_TIME               10000
163203c4805SLuis R. Rodriguez #define SPUR_RSSI_THRESH            40
164331c5ea2SMohammed Shafi Shajakhan #define UPPER_5G_SUB_BAND_START		5700
165331c5ea2SMohammed Shafi Shajakhan #define MID_5G_SUB_BAND_START		5400
166203c4805SLuis R. Rodriguez 
167203c4805SLuis R. Rodriguez #define CAB_TIMEOUT_VAL             10
168203c4805SLuis R. Rodriguez #define BEACON_TIMEOUT_VAL          10
169203c4805SLuis R. Rodriguez #define MIN_BEACON_TIMEOUT_VAL      1
170203c4805SLuis R. Rodriguez #define SLEEP_SLOP                  3
171203c4805SLuis R. Rodriguez 
172203c4805SLuis R. Rodriguez #define INIT_CONFIG_STATUS          0x00000000
173203c4805SLuis R. Rodriguez #define INIT_RSSI_THR               0x00000700
174203c4805SLuis R. Rodriguez #define INIT_BCON_CNTRL_REG         0x00000000
175203c4805SLuis R. Rodriguez 
176203c4805SLuis R. Rodriguez #define TU_TO_USEC(_tu)             ((_tu) << 10)
177203c4805SLuis R. Rodriguez 
178ceb26445SVasanthakumar Thiagarajan #define ATH9K_HW_RX_HP_QDEPTH	16
179ceb26445SVasanthakumar Thiagarajan #define ATH9K_HW_RX_LP_QDEPTH	128
180ceb26445SVasanthakumar Thiagarajan 
181717f6bedSFelix Fietkau #define PAPRD_GAIN_TABLE_ENTRIES	32
182717f6bedSFelix Fietkau #define PAPRD_TABLE_SZ			24
1830e44d48cSMohammed Shafi Shajakhan #define PAPRD_IDEAL_AGC2_PWR_RANGE	0xe0
184717f6bedSFelix Fietkau 
18501c78533SMohammed Shafi Shajakhan /*
18601c78533SMohammed Shafi Shajakhan  * Wake on Wireless
18701c78533SMohammed Shafi Shajakhan  */
18801c78533SMohammed Shafi Shajakhan 
18901c78533SMohammed Shafi Shajakhan /* Keep Alive Frame */
19001c78533SMohammed Shafi Shajakhan #define KAL_FRAME_LEN		28
19101c78533SMohammed Shafi Shajakhan #define KAL_FRAME_TYPE		0x2	/* data frame */
19201c78533SMohammed Shafi Shajakhan #define KAL_FRAME_SUB_TYPE	0x4	/* null data frame */
19301c78533SMohammed Shafi Shajakhan #define KAL_DURATION_ID		0x3d
19401c78533SMohammed Shafi Shajakhan #define KAL_NUM_DATA_WORDS	6
19501c78533SMohammed Shafi Shajakhan #define KAL_NUM_DESC_WORDS	12
19601c78533SMohammed Shafi Shajakhan #define KAL_ANTENNA_MODE	1
19701c78533SMohammed Shafi Shajakhan #define KAL_TO_DS		1
19801c78533SMohammed Shafi Shajakhan #define KAL_DELAY		4	/*delay of 4ms between 2 KAL frames */
19901c78533SMohammed Shafi Shajakhan #define KAL_TIMEOUT		900
20001c78533SMohammed Shafi Shajakhan 
20101c78533SMohammed Shafi Shajakhan #define MAX_PATTERN_SIZE		256
20201c78533SMohammed Shafi Shajakhan #define MAX_PATTERN_MASK_SIZE		32
20301c78533SMohammed Shafi Shajakhan #define MAX_NUM_PATTERN			8
20401c78533SMohammed Shafi Shajakhan #define MAX_NUM_USER_PATTERN		6 /*  deducting the disassociate and
20501c78533SMohammed Shafi Shajakhan 					      deauthenticate packets */
20601c78533SMohammed Shafi Shajakhan 
20701c78533SMohammed Shafi Shajakhan /*
20801c78533SMohammed Shafi Shajakhan  * WoW trigger mapping to hardware code
20901c78533SMohammed Shafi Shajakhan  */
21001c78533SMohammed Shafi Shajakhan 
21101c78533SMohammed Shafi Shajakhan #define AH_WOW_USER_PATTERN_EN		BIT(0)
21201c78533SMohammed Shafi Shajakhan #define AH_WOW_MAGIC_PATTERN_EN		BIT(1)
21301c78533SMohammed Shafi Shajakhan #define AH_WOW_LINK_CHANGE		BIT(2)
21401c78533SMohammed Shafi Shajakhan #define AH_WOW_BEACON_MISS		BIT(3)
21501c78533SMohammed Shafi Shajakhan 
216066dae93SFelix Fietkau enum ath_hw_txq_subtype {
217066dae93SFelix Fietkau 	ATH_TXQ_AC_BE = 0,
218066dae93SFelix Fietkau 	ATH_TXQ_AC_BK = 1,
219066dae93SFelix Fietkau 	ATH_TXQ_AC_VI = 2,
220066dae93SFelix Fietkau 	ATH_TXQ_AC_VO = 3,
221066dae93SFelix Fietkau };
222066dae93SFelix Fietkau 
22313ce3e99SLuis R. Rodriguez enum ath_ini_subsys {
22413ce3e99SLuis R. Rodriguez 	ATH_INI_PRE = 0,
22513ce3e99SLuis R. Rodriguez 	ATH_INI_CORE,
22613ce3e99SLuis R. Rodriguez 	ATH_INI_POST,
22713ce3e99SLuis R. Rodriguez 	ATH_INI_NUM_SPLIT,
22813ce3e99SLuis R. Rodriguez };
22913ce3e99SLuis R. Rodriguez 
230203c4805SLuis R. Rodriguez enum ath9k_hw_caps {
231364734faSFelix Fietkau 	ATH9K_HW_CAP_HT                         = BIT(0),
232364734faSFelix Fietkau 	ATH9K_HW_CAP_RFSILENT                   = BIT(1),
2331b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_AUTOSLEEP                  = BIT(2),
2341b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_4KB_SPLITTRANS             = BIT(3),
2351b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_EDMA			= BIT(4),
2361b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_RAC_SUPPORTED		= BIT(5),
2371b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_LDPC			= BIT(6),
2381b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_FASTCLOCK			= BIT(7),
2391b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_SGI_20			= BIT(8),
2401b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_PAPRD			= BIT(9),
2411b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_ANT_DIV_COMB		= BIT(10),
2421b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_2GHZ			= BIT(11),
2431b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_5GHZ			= BIT(12),
2441b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_APM			= BIT(13),
2451b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_RTT			= BIT(14),
2461b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_MCI			= BIT(15),
2471b2538b2SMohammed Shafi Shajakhan 	ATH9K_HW_CAP_DFS			= BIT(16),
2488e981389SMohammed Shafi Shajakhan 	ATH9K_HW_WOW_DEVICE_CAPABLE		= BIT(17),
2498e981389SMohammed Shafi Shajakhan 	ATH9K_HW_WOW_PATTERN_MATCH_EXACT	= BIT(18),
2508e981389SMohammed Shafi Shajakhan 	ATH9K_HW_WOW_PATTERN_MATCH_DWORD	= BIT(19),
251203c4805SLuis R. Rodriguez };
252203c4805SLuis R. Rodriguez 
2538e981389SMohammed Shafi Shajakhan /*
2548e981389SMohammed Shafi Shajakhan  * WoW device capabilities
2558e981389SMohammed Shafi Shajakhan  * @ATH9K_HW_WOW_DEVICE_CAPABLE: device revision is capable of WoW.
2568e981389SMohammed Shafi Shajakhan  * @ATH9K_HW_WOW_PATTERN_MATCH_EXACT: device is capable of matching
2578e981389SMohammed Shafi Shajakhan  * an exact user defined pattern or de-authentication/disassoc pattern.
2588e981389SMohammed Shafi Shajakhan  * @ATH9K_HW_WOW_PATTERN_MATCH_DWORD: device requires the first four
2598e981389SMohammed Shafi Shajakhan  * bytes of the pattern for user defined pattern, de-authentication and
2608e981389SMohammed Shafi Shajakhan  * disassociation patterns for all types of possible frames recieved
2618e981389SMohammed Shafi Shajakhan  * of those types.
2628e981389SMohammed Shafi Shajakhan  */
2638e981389SMohammed Shafi Shajakhan 
264203c4805SLuis R. Rodriguez struct ath9k_hw_capabilities {
265203c4805SLuis R. Rodriguez 	u32 hw_caps; /* ATH9K_HW_CAP_* from ath9k_hw_caps */
266203c4805SLuis R. Rodriguez 	u16 rts_aggr_limit;
267203c4805SLuis R. Rodriguez 	u8 tx_chainmask;
268203c4805SLuis R. Rodriguez 	u8 rx_chainmask;
26947c80de6SVasanthakumar Thiagarajan 	u8 max_txchains;
27047c80de6SVasanthakumar Thiagarajan 	u8 max_rxchains;
271203c4805SLuis R. Rodriguez 	u8 num_gpio_pins;
272ceb26445SVasanthakumar Thiagarajan 	u8 rx_hp_qdepth;
273ceb26445SVasanthakumar Thiagarajan 	u8 rx_lp_qdepth;
274ceb26445SVasanthakumar Thiagarajan 	u8 rx_status_len;
275162c3be3SVasanthakumar Thiagarajan 	u8 tx_desc_len;
2765088c2f1SVasanthakumar Thiagarajan 	u8 txs_len;
2778060e169SVasanthakumar Thiagarajan 	u16 pcie_lcr_offset;
2788060e169SVasanthakumar Thiagarajan 	bool pcie_lcr_extsync_en;
279203c4805SLuis R. Rodriguez };
280203c4805SLuis R. Rodriguez 
281203c4805SLuis R. Rodriguez struct ath9k_ops_config {
282203c4805SLuis R. Rodriguez 	int dma_beacon_response_time;
283203c4805SLuis R. Rodriguez 	int sw_beacon_response_time;
284203c4805SLuis R. Rodriguez 	int additional_swba_backoff;
285203c4805SLuis R. Rodriguez 	int ack_6mb;
28641f3e54dSFelix Fietkau 	u32 cwm_ignore_extcca;
2876a0ec30aSLuis R. Rodriguez 	bool pcieSerDesWrite;
288203c4805SLuis R. Rodriguez 	u8 pcie_clock_req;
289203c4805SLuis R. Rodriguez 	u32 pcie_waen;
290203c4805SLuis R. Rodriguez 	u8 analog_shiftreg;
2916f481010SLuis R. Rodriguez 	u8 paprd_disable;
292203c4805SLuis R. Rodriguez 	u32 ofdm_trig_low;
293203c4805SLuis R. Rodriguez 	u32 ofdm_trig_high;
294203c4805SLuis R. Rodriguez 	u32 cck_trig_high;
295203c4805SLuis R. Rodriguez 	u32 cck_trig_low;
296203c4805SLuis R. Rodriguez 	u32 enable_ani;
297203c4805SLuis R. Rodriguez 	int serialize_regmode;
2980ce024cbSSujith 	bool rx_intr_mitigation;
29955e82df4SVasanthakumar Thiagarajan 	bool tx_intr_mitigation;
300203c4805SLuis R. Rodriguez #define SPUR_DISABLE        	0
301203c4805SLuis R. Rodriguez #define SPUR_ENABLE_IOCTL   	1
302203c4805SLuis R. Rodriguez #define SPUR_ENABLE_EEPROM  	2
303203c4805SLuis R. Rodriguez #define AR_SPUR_5413_1      	1640
304203c4805SLuis R. Rodriguez #define AR_SPUR_5413_2      	1200
305203c4805SLuis R. Rodriguez #define AR_NO_SPUR      	0x8000
306203c4805SLuis R. Rodriguez #define AR_BASE_FREQ_2GHZ   	2300
307203c4805SLuis R. Rodriguez #define AR_BASE_FREQ_5GHZ   	4900
308203c4805SLuis R. Rodriguez #define AR_SPUR_FEEQ_BOUND_HT40 19
309203c4805SLuis R. Rodriguez #define AR_SPUR_FEEQ_BOUND_HT20 10
310203c4805SLuis R. Rodriguez 	int spurmode;
311203c4805SLuis R. Rodriguez 	u16 spurchans[AR_EEPROM_MODAL_SPURS][2];
312f4709fdfSLuis R. Rodriguez 	u8 max_txtrig_level;
313e36b27afSLuis R. Rodriguez 	u16 ani_poll_interval; /* ANI poll interval in ms */
314203c4805SLuis R. Rodriguez };
315203c4805SLuis R. Rodriguez 
316203c4805SLuis R. Rodriguez enum ath9k_int {
317203c4805SLuis R. Rodriguez 	ATH9K_INT_RX = 0x00000001,
318203c4805SLuis R. Rodriguez 	ATH9K_INT_RXDESC = 0x00000002,
319b5c80475SFelix Fietkau 	ATH9K_INT_RXHP = 0x00000001,
320b5c80475SFelix Fietkau 	ATH9K_INT_RXLP = 0x00000002,
321203c4805SLuis R. Rodriguez 	ATH9K_INT_RXNOFRM = 0x00000008,
322203c4805SLuis R. Rodriguez 	ATH9K_INT_RXEOL = 0x00000010,
323203c4805SLuis R. Rodriguez 	ATH9K_INT_RXORN = 0x00000020,
324203c4805SLuis R. Rodriguez 	ATH9K_INT_TX = 0x00000040,
325203c4805SLuis R. Rodriguez 	ATH9K_INT_TXDESC = 0x00000080,
326203c4805SLuis R. Rodriguez 	ATH9K_INT_TIM_TIMER = 0x00000100,
3272ee4bd1eSMohammed Shafi Shajakhan 	ATH9K_INT_MCI = 0x00000200,
328aea702b7SLuis R. Rodriguez 	ATH9K_INT_BB_WATCHDOG = 0x00000400,
329203c4805SLuis R. Rodriguez 	ATH9K_INT_TXURN = 0x00000800,
330203c4805SLuis R. Rodriguez 	ATH9K_INT_MIB = 0x00001000,
331203c4805SLuis R. Rodriguez 	ATH9K_INT_RXPHY = 0x00004000,
332203c4805SLuis R. Rodriguez 	ATH9K_INT_RXKCM = 0x00008000,
333203c4805SLuis R. Rodriguez 	ATH9K_INT_SWBA = 0x00010000,
334203c4805SLuis R. Rodriguez 	ATH9K_INT_BMISS = 0x00040000,
335203c4805SLuis R. Rodriguez 	ATH9K_INT_BNR = 0x00100000,
336203c4805SLuis R. Rodriguez 	ATH9K_INT_TIM = 0x00200000,
337203c4805SLuis R. Rodriguez 	ATH9K_INT_DTIM = 0x00400000,
338203c4805SLuis R. Rodriguez 	ATH9K_INT_DTIMSYNC = 0x00800000,
339203c4805SLuis R. Rodriguez 	ATH9K_INT_GPIO = 0x01000000,
340203c4805SLuis R. Rodriguez 	ATH9K_INT_CABEND = 0x02000000,
341203c4805SLuis R. Rodriguez 	ATH9K_INT_TSFOOR = 0x04000000,
342ff155a45SVasanthakumar Thiagarajan 	ATH9K_INT_GENTIMER = 0x08000000,
343203c4805SLuis R. Rodriguez 	ATH9K_INT_CST = 0x10000000,
344203c4805SLuis R. Rodriguez 	ATH9K_INT_GTT = 0x20000000,
345203c4805SLuis R. Rodriguez 	ATH9K_INT_FATAL = 0x40000000,
346203c4805SLuis R. Rodriguez 	ATH9K_INT_GLOBAL = 0x80000000,
347203c4805SLuis R. Rodriguez 	ATH9K_INT_BMISC = ATH9K_INT_TIM |
348203c4805SLuis R. Rodriguez 		ATH9K_INT_DTIM |
349203c4805SLuis R. Rodriguez 		ATH9K_INT_DTIMSYNC |
350203c4805SLuis R. Rodriguez 		ATH9K_INT_TSFOOR |
351203c4805SLuis R. Rodriguez 		ATH9K_INT_CABEND,
352203c4805SLuis R. Rodriguez 	ATH9K_INT_COMMON = ATH9K_INT_RXNOFRM |
353203c4805SLuis R. Rodriguez 		ATH9K_INT_RXDESC |
354203c4805SLuis R. Rodriguez 		ATH9K_INT_RXEOL |
355203c4805SLuis R. Rodriguez 		ATH9K_INT_RXORN |
356203c4805SLuis R. Rodriguez 		ATH9K_INT_TXURN |
357203c4805SLuis R. Rodriguez 		ATH9K_INT_TXDESC |
358203c4805SLuis R. Rodriguez 		ATH9K_INT_MIB |
359203c4805SLuis R. Rodriguez 		ATH9K_INT_RXPHY |
360203c4805SLuis R. Rodriguez 		ATH9K_INT_RXKCM |
361203c4805SLuis R. Rodriguez 		ATH9K_INT_SWBA |
362203c4805SLuis R. Rodriguez 		ATH9K_INT_BMISS |
363203c4805SLuis R. Rodriguez 		ATH9K_INT_GPIO,
364203c4805SLuis R. Rodriguez 	ATH9K_INT_NOCARD = 0xffffffff
365203c4805SLuis R. Rodriguez };
366203c4805SLuis R. Rodriguez 
367203c4805SLuis R. Rodriguez #define CHANNEL_CW_INT    0x00002
368203c4805SLuis R. Rodriguez #define CHANNEL_CCK       0x00020
369203c4805SLuis R. Rodriguez #define CHANNEL_OFDM      0x00040
370203c4805SLuis R. Rodriguez #define CHANNEL_2GHZ      0x00080
371203c4805SLuis R. Rodriguez #define CHANNEL_5GHZ      0x00100
372203c4805SLuis R. Rodriguez #define CHANNEL_PASSIVE   0x00200
373203c4805SLuis R. Rodriguez #define CHANNEL_DYN       0x00400
374203c4805SLuis R. Rodriguez #define CHANNEL_HALF      0x04000
375203c4805SLuis R. Rodriguez #define CHANNEL_QUARTER   0x08000
376203c4805SLuis R. Rodriguez #define CHANNEL_HT20      0x10000
377203c4805SLuis R. Rodriguez #define CHANNEL_HT40PLUS  0x20000
378203c4805SLuis R. Rodriguez #define CHANNEL_HT40MINUS 0x40000
379203c4805SLuis R. Rodriguez 
380203c4805SLuis R. Rodriguez #define CHANNEL_A           (CHANNEL_5GHZ|CHANNEL_OFDM)
381203c4805SLuis R. Rodriguez #define CHANNEL_B           (CHANNEL_2GHZ|CHANNEL_CCK)
382203c4805SLuis R. Rodriguez #define CHANNEL_G           (CHANNEL_2GHZ|CHANNEL_OFDM)
383203c4805SLuis R. Rodriguez #define CHANNEL_G_HT20      (CHANNEL_2GHZ|CHANNEL_HT20)
384203c4805SLuis R. Rodriguez #define CHANNEL_A_HT20      (CHANNEL_5GHZ|CHANNEL_HT20)
385203c4805SLuis R. Rodriguez #define CHANNEL_G_HT40PLUS  (CHANNEL_2GHZ|CHANNEL_HT40PLUS)
386203c4805SLuis R. Rodriguez #define CHANNEL_G_HT40MINUS (CHANNEL_2GHZ|CHANNEL_HT40MINUS)
387203c4805SLuis R. Rodriguez #define CHANNEL_A_HT40PLUS  (CHANNEL_5GHZ|CHANNEL_HT40PLUS)
388203c4805SLuis R. Rodriguez #define CHANNEL_A_HT40MINUS (CHANNEL_5GHZ|CHANNEL_HT40MINUS)
389203c4805SLuis R. Rodriguez #define CHANNEL_ALL				\
390203c4805SLuis R. Rodriguez 	(CHANNEL_OFDM|				\
391203c4805SLuis R. Rodriguez 	 CHANNEL_CCK|				\
392203c4805SLuis R. Rodriguez 	 CHANNEL_2GHZ |				\
393203c4805SLuis R. Rodriguez 	 CHANNEL_5GHZ |				\
394203c4805SLuis R. Rodriguez 	 CHANNEL_HT20 |				\
395203c4805SLuis R. Rodriguez 	 CHANNEL_HT40PLUS |			\
396203c4805SLuis R. Rodriguez 	 CHANNEL_HT40MINUS)
397203c4805SLuis R. Rodriguez 
398324c74adSRajkumar Manoharan #define MAX_RTT_TABLE_ENTRY     6
3995f0c04eaSRajkumar Manoharan #define MAX_IQCAL_MEASUREMENT	8
40077a5a664SRajkumar Manoharan #define MAX_CL_TAB_ENTRY	16
4015f0c04eaSRajkumar Manoharan 
40220bd2a09SFelix Fietkau struct ath9k_hw_cal_data {
403203c4805SLuis R. Rodriguez 	u16 channel;
404203c4805SLuis R. Rodriguez 	u32 channelFlags;
405203c4805SLuis R. Rodriguez 	int32_t CalValid;
406203c4805SLuis R. Rodriguez 	int8_t iCoff;
407203c4805SLuis R. Rodriguez 	int8_t qCoff;
4088a90555fSSujith Manoharan 	bool rtt_done;
40951dea9beSFelix Fietkau 	bool paprd_packet_sent;
410717f6bedSFelix Fietkau 	bool paprd_done;
4114254bc1cSFelix Fietkau 	bool nfcal_pending;
41270cf1533SFelix Fietkau 	bool nfcal_interference;
4135f0c04eaSRajkumar Manoharan 	bool done_txiqcal_once;
41477a5a664SRajkumar Manoharan 	bool done_txclcal_once;
415717f6bedSFelix Fietkau 	u16 small_signal_gain[AR9300_MAX_CHAINS];
416717f6bedSFelix Fietkau 	u32 pa_table[AR9300_MAX_CHAINS][PAPRD_TABLE_SZ];
4175f0c04eaSRajkumar Manoharan 	u32 num_measures[AR9300_MAX_CHAINS];
4185f0c04eaSRajkumar Manoharan 	int tx_corr_coeff[MAX_IQCAL_MEASUREMENT][AR9300_MAX_CHAINS];
41977a5a664SRajkumar Manoharan 	u32 tx_clcal[AR9300_MAX_CHAINS][MAX_CL_TAB_ENTRY];
4208a90555fSSujith Manoharan 	u32 rtt_table[AR9300_MAX_CHAINS][MAX_RTT_TABLE_ENTRY];
42120bd2a09SFelix Fietkau 	struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
42220bd2a09SFelix Fietkau };
42320bd2a09SFelix Fietkau 
42420bd2a09SFelix Fietkau struct ath9k_channel {
42520bd2a09SFelix Fietkau 	struct ieee80211_channel *chan;
426093115b7SFelix Fietkau 	struct ar5416AniState ani;
42720bd2a09SFelix Fietkau 	u16 channel;
42820bd2a09SFelix Fietkau 	u32 channelFlags;
42920bd2a09SFelix Fietkau 	u32 chanmode;
430d9891c78SFelix Fietkau 	s16 noisefloor;
431203c4805SLuis R. Rodriguez };
432203c4805SLuis R. Rodriguez 
433203c4805SLuis R. Rodriguez #define IS_CHAN_G(_c) ((((_c)->channelFlags & (CHANNEL_G)) == CHANNEL_G) || \
434203c4805SLuis R. Rodriguez        (((_c)->channelFlags & CHANNEL_G_HT20) == CHANNEL_G_HT20) || \
435203c4805SLuis R. Rodriguez        (((_c)->channelFlags & CHANNEL_G_HT40PLUS) == CHANNEL_G_HT40PLUS) || \
436203c4805SLuis R. Rodriguez        (((_c)->channelFlags & CHANNEL_G_HT40MINUS) == CHANNEL_G_HT40MINUS))
437203c4805SLuis R. Rodriguez #define IS_CHAN_OFDM(_c) (((_c)->channelFlags & CHANNEL_OFDM) != 0)
438203c4805SLuis R. Rodriguez #define IS_CHAN_5GHZ(_c) (((_c)->channelFlags & CHANNEL_5GHZ) != 0)
439203c4805SLuis R. Rodriguez #define IS_CHAN_2GHZ(_c) (((_c)->channelFlags & CHANNEL_2GHZ) != 0)
440203c4805SLuis R. Rodriguez #define IS_CHAN_HALF_RATE(_c) (((_c)->channelFlags & CHANNEL_HALF) != 0)
441203c4805SLuis R. Rodriguez #define IS_CHAN_QUARTER_RATE(_c) (((_c)->channelFlags & CHANNEL_QUARTER) != 0)
4426b42e8d0SFelix Fietkau #define IS_CHAN_A_FAST_CLOCK(_ah, _c)			\
443203c4805SLuis R. Rodriguez 	((((_c)->channelFlags & CHANNEL_5GHZ) != 0) &&	\
4446b42e8d0SFelix Fietkau 	 ((_ah)->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK))
445203c4805SLuis R. Rodriguez 
446203c4805SLuis R. Rodriguez /* These macros check chanmode and not channelFlags */
447203c4805SLuis R. Rodriguez #define IS_CHAN_B(_c) ((_c)->chanmode == CHANNEL_B)
448203c4805SLuis R. Rodriguez #define IS_CHAN_HT20(_c) (((_c)->chanmode == CHANNEL_A_HT20) ||	\
449203c4805SLuis R. Rodriguez 			  ((_c)->chanmode == CHANNEL_G_HT20))
450203c4805SLuis R. Rodriguez #define IS_CHAN_HT40(_c) (((_c)->chanmode == CHANNEL_A_HT40PLUS) ||	\
451203c4805SLuis R. Rodriguez 			  ((_c)->chanmode == CHANNEL_A_HT40MINUS) ||	\
452203c4805SLuis R. Rodriguez 			  ((_c)->chanmode == CHANNEL_G_HT40PLUS) ||	\
453203c4805SLuis R. Rodriguez 			  ((_c)->chanmode == CHANNEL_G_HT40MINUS))
454203c4805SLuis R. Rodriguez #define IS_CHAN_HT(_c) (IS_CHAN_HT20((_c)) || IS_CHAN_HT40((_c)))
455203c4805SLuis R. Rodriguez 
456203c4805SLuis R. Rodriguez enum ath9k_power_mode {
457203c4805SLuis R. Rodriguez 	ATH9K_PM_AWAKE = 0,
458203c4805SLuis R. Rodriguez 	ATH9K_PM_FULL_SLEEP,
459203c4805SLuis R. Rodriguez 	ATH9K_PM_NETWORK_SLEEP,
460203c4805SLuis R. Rodriguez 	ATH9K_PM_UNDEFINED
461203c4805SLuis R. Rodriguez };
462203c4805SLuis R. Rodriguez 
463203c4805SLuis R. Rodriguez enum ser_reg_mode {
464203c4805SLuis R. Rodriguez 	SER_REG_MODE_OFF = 0,
465203c4805SLuis R. Rodriguez 	SER_REG_MODE_ON = 1,
466203c4805SLuis R. Rodriguez 	SER_REG_MODE_AUTO = 2,
467203c4805SLuis R. Rodriguez };
468203c4805SLuis R. Rodriguez 
469ad7b8060SVasanthakumar Thiagarajan enum ath9k_rx_qtype {
470ad7b8060SVasanthakumar Thiagarajan 	ATH9K_RX_QUEUE_HP,
471ad7b8060SVasanthakumar Thiagarajan 	ATH9K_RX_QUEUE_LP,
472ad7b8060SVasanthakumar Thiagarajan 	ATH9K_RX_QUEUE_MAX,
473ad7b8060SVasanthakumar Thiagarajan };
474ad7b8060SVasanthakumar Thiagarajan 
475203c4805SLuis R. Rodriguez struct ath9k_beacon_state {
476203c4805SLuis R. Rodriguez 	u32 bs_nexttbtt;
477203c4805SLuis R. Rodriguez 	u32 bs_nextdtim;
478203c4805SLuis R. Rodriguez 	u32 bs_intval;
479203c4805SLuis R. Rodriguez #define ATH9K_TSFOOR_THRESHOLD    0x00004240 /* 16k us */
480203c4805SLuis R. Rodriguez 	u32 bs_dtimperiod;
481203c4805SLuis R. Rodriguez 	u16 bs_cfpperiod;
482203c4805SLuis R. Rodriguez 	u16 bs_cfpmaxduration;
483203c4805SLuis R. Rodriguez 	u32 bs_cfpnext;
484203c4805SLuis R. Rodriguez 	u16 bs_timoffset;
485203c4805SLuis R. Rodriguez 	u16 bs_bmissthreshold;
486203c4805SLuis R. Rodriguez 	u32 bs_sleepduration;
487203c4805SLuis R. Rodriguez 	u32 bs_tsfoor_threshold;
488203c4805SLuis R. Rodriguez };
489203c4805SLuis R. Rodriguez 
490203c4805SLuis R. Rodriguez struct chan_centers {
491203c4805SLuis R. Rodriguez 	u16 synth_center;
492203c4805SLuis R. Rodriguez 	u16 ctl_center;
493203c4805SLuis R. Rodriguez 	u16 ext_center;
494203c4805SLuis R. Rodriguez };
495203c4805SLuis R. Rodriguez 
496203c4805SLuis R. Rodriguez enum {
497203c4805SLuis R. Rodriguez 	ATH9K_RESET_POWER_ON,
498203c4805SLuis R. Rodriguez 	ATH9K_RESET_WARM,
499203c4805SLuis R. Rodriguez 	ATH9K_RESET_COLD,
500203c4805SLuis R. Rodriguez };
501203c4805SLuis R. Rodriguez 
502203c4805SLuis R. Rodriguez struct ath9k_hw_version {
503203c4805SLuis R. Rodriguez 	u32 magic;
504203c4805SLuis R. Rodriguez 	u16 devid;
505203c4805SLuis R. Rodriguez 	u16 subvendorid;
506203c4805SLuis R. Rodriguez 	u32 macVersion;
507203c4805SLuis R. Rodriguez 	u16 macRev;
508203c4805SLuis R. Rodriguez 	u16 phyRev;
509203c4805SLuis R. Rodriguez 	u16 analog5GhzRev;
510203c4805SLuis R. Rodriguez 	u16 analog2GhzRev;
5110b5ead91SSujith Manoharan 	enum ath_usb_dev usbdev;
512203c4805SLuis R. Rodriguez };
513203c4805SLuis R. Rodriguez 
514ff155a45SVasanthakumar Thiagarajan /* Generic TSF timer definitions */
515ff155a45SVasanthakumar Thiagarajan 
516ff155a45SVasanthakumar Thiagarajan #define ATH_MAX_GEN_TIMER	16
517ff155a45SVasanthakumar Thiagarajan 
518ff155a45SVasanthakumar Thiagarajan #define AR_GENTMR_BIT(_index)	(1 << (_index))
519ff155a45SVasanthakumar Thiagarajan 
520ff155a45SVasanthakumar Thiagarajan /*
52177c2061dSWalter Goldens  * Using de Bruijin sequence to look up 1's index in a 32 bit number
522ff155a45SVasanthakumar Thiagarajan  * debruijn32 = 0000 0111 0111 1100 1011 0101 0011 0001
523ff155a45SVasanthakumar Thiagarajan  */
524c90017ddSVasanthakumar Thiagarajan #define debruijn32 0x077CB531U
525ff155a45SVasanthakumar Thiagarajan 
526ff155a45SVasanthakumar Thiagarajan struct ath_gen_timer_configuration {
527ff155a45SVasanthakumar Thiagarajan 	u32 next_addr;
528ff155a45SVasanthakumar Thiagarajan 	u32 period_addr;
529ff155a45SVasanthakumar Thiagarajan 	u32 mode_addr;
530ff155a45SVasanthakumar Thiagarajan 	u32 mode_mask;
531ff155a45SVasanthakumar Thiagarajan };
532ff155a45SVasanthakumar Thiagarajan 
533ff155a45SVasanthakumar Thiagarajan struct ath_gen_timer {
534ff155a45SVasanthakumar Thiagarajan 	void (*trigger)(void *arg);
535ff155a45SVasanthakumar Thiagarajan 	void (*overflow)(void *arg);
536ff155a45SVasanthakumar Thiagarajan 	void *arg;
537ff155a45SVasanthakumar Thiagarajan 	u8 index;
538ff155a45SVasanthakumar Thiagarajan };
539ff155a45SVasanthakumar Thiagarajan 
540ff155a45SVasanthakumar Thiagarajan struct ath_gen_timer_table {
541ff155a45SVasanthakumar Thiagarajan 	u32 gen_timer_index[32];
542ff155a45SVasanthakumar Thiagarajan 	struct ath_gen_timer *timers[ATH_MAX_GEN_TIMER];
543ff155a45SVasanthakumar Thiagarajan 	union {
544ff155a45SVasanthakumar Thiagarajan 		unsigned long timer_bits;
545ff155a45SVasanthakumar Thiagarajan 		u16 val;
546ff155a45SVasanthakumar Thiagarajan 	} timer_mask;
547ff155a45SVasanthakumar Thiagarajan };
548ff155a45SVasanthakumar Thiagarajan 
54921cc630fSVasanthakumar Thiagarajan struct ath_hw_antcomb_conf {
55021cc630fSVasanthakumar Thiagarajan 	u8 main_lna_conf;
55121cc630fSVasanthakumar Thiagarajan 	u8 alt_lna_conf;
55221cc630fSVasanthakumar Thiagarajan 	u8 fast_div_bias;
553c6ba9febSMohammed Shafi Shajakhan 	u8 main_gaintb;
554c6ba9febSMohammed Shafi Shajakhan 	u8 alt_gaintb;
555c6ba9febSMohammed Shafi Shajakhan 	int lna1_lna2_delta;
5568afbcc8bSMohammed Shafi Shajakhan 	u8 div_group;
55721cc630fSVasanthakumar Thiagarajan };
55821cc630fSVasanthakumar Thiagarajan 
559d70357d5SLuis R. Rodriguez /**
5604e8c14e9SFelix Fietkau  * struct ath_hw_radar_conf - radar detection initialization parameters
5614e8c14e9SFelix Fietkau  *
5624e8c14e9SFelix Fietkau  * @pulse_inband: threshold for checking the ratio of in-band power
5634e8c14e9SFelix Fietkau  *	to total power for short radar pulses (half dB steps)
5644e8c14e9SFelix Fietkau  * @pulse_inband_step: threshold for checking an in-band power to total
5654e8c14e9SFelix Fietkau  *	power ratio increase for short radar pulses (half dB steps)
5664e8c14e9SFelix Fietkau  * @pulse_height: threshold for detecting the beginning of a short
5674e8c14e9SFelix Fietkau  *	radar pulse (dB step)
5684e8c14e9SFelix Fietkau  * @pulse_rssi: threshold for detecting if a short radar pulse is
5694e8c14e9SFelix Fietkau  *	gone (dB step)
5704e8c14e9SFelix Fietkau  * @pulse_maxlen: maximum pulse length (0.8 us steps)
5714e8c14e9SFelix Fietkau  *
5724e8c14e9SFelix Fietkau  * @radar_rssi: RSSI threshold for starting long radar detection (dB steps)
5734e8c14e9SFelix Fietkau  * @radar_inband: threshold for checking the ratio of in-band power
5744e8c14e9SFelix Fietkau  *	to total power for long radar pulses (half dB steps)
5754e8c14e9SFelix Fietkau  * @fir_power: threshold for detecting the end of a long radar pulse (dB)
5764e8c14e9SFelix Fietkau  *
5774e8c14e9SFelix Fietkau  * @ext_channel: enable extension channel radar detection
5784e8c14e9SFelix Fietkau  */
5794e8c14e9SFelix Fietkau struct ath_hw_radar_conf {
5804e8c14e9SFelix Fietkau 	unsigned int pulse_inband;
5814e8c14e9SFelix Fietkau 	unsigned int pulse_inband_step;
5824e8c14e9SFelix Fietkau 	unsigned int pulse_height;
5834e8c14e9SFelix Fietkau 	unsigned int pulse_rssi;
5844e8c14e9SFelix Fietkau 	unsigned int pulse_maxlen;
5854e8c14e9SFelix Fietkau 
5864e8c14e9SFelix Fietkau 	unsigned int radar_rssi;
5874e8c14e9SFelix Fietkau 	unsigned int radar_inband;
5884e8c14e9SFelix Fietkau 	int fir_power;
5894e8c14e9SFelix Fietkau 
5904e8c14e9SFelix Fietkau 	bool ext_channel;
5914e8c14e9SFelix Fietkau };
5924e8c14e9SFelix Fietkau 
5934e8c14e9SFelix Fietkau /**
594d70357d5SLuis R. Rodriguez  * struct ath_hw_private_ops - callbacks used internally by hardware code
595d70357d5SLuis R. Rodriguez  *
596d70357d5SLuis R. Rodriguez  * This structure contains private callbacks designed to only be used internally
597d70357d5SLuis R. Rodriguez  * by the hardware core.
598d70357d5SLuis R. Rodriguez  *
599795f5e2cSLuis R. Rodriguez  * @init_cal_settings: setup types of calibrations supported
600795f5e2cSLuis R. Rodriguez  * @init_cal: starts actual calibration
601795f5e2cSLuis R. Rodriguez  *
602d70357d5SLuis R. Rodriguez  * @init_mode_regs: Initializes mode registers
603991312d8SLuis R. Rodriguez  * @init_mode_gain_regs: Initialize TX/RX gain registers
6048fe65368SLuis R. Rodriguez  *
6058fe65368SLuis R. Rodriguez  * @rf_set_freq: change frequency
6068fe65368SLuis R. Rodriguez  * @spur_mitigate_freq: spur mitigation
6078fe65368SLuis R. Rodriguez  * @rf_alloc_ext_banks:
6088fe65368SLuis R. Rodriguez  * @rf_free_ext_banks:
6098fe65368SLuis R. Rodriguez  * @set_rf_regs:
61064773964SLuis R. Rodriguez  * @compute_pll_control: compute the PLL control value to use for
61164773964SLuis R. Rodriguez  *	AR_RTC_PLL_CONTROL for a given channel
612795f5e2cSLuis R. Rodriguez  * @setup_calibration: set up calibration
613795f5e2cSLuis R. Rodriguez  * @iscal_supported: used to query if a type of calibration is supported
614ac0bb767SLuis R. Rodriguez  *
615e36b27afSLuis R. Rodriguez  * @ani_cache_ini_regs: cache the values for ANI from the initial
616e36b27afSLuis R. Rodriguez  *	register settings through the register initialization.
617d70357d5SLuis R. Rodriguez  */
618d70357d5SLuis R. Rodriguez struct ath_hw_private_ops {
619795f5e2cSLuis R. Rodriguez 	/* Calibration ops */
620d70357d5SLuis R. Rodriguez 	void (*init_cal_settings)(struct ath_hw *ah);
621795f5e2cSLuis R. Rodriguez 	bool (*init_cal)(struct ath_hw *ah, struct ath9k_channel *chan);
622795f5e2cSLuis R. Rodriguez 
623d70357d5SLuis R. Rodriguez 	void (*init_mode_regs)(struct ath_hw *ah);
624991312d8SLuis R. Rodriguez 	void (*init_mode_gain_regs)(struct ath_hw *ah);
625795f5e2cSLuis R. Rodriguez 	void (*setup_calibration)(struct ath_hw *ah,
626795f5e2cSLuis R. Rodriguez 				  struct ath9k_cal_list *currCal);
6278fe65368SLuis R. Rodriguez 
6288fe65368SLuis R. Rodriguez 	/* PHY ops */
6298fe65368SLuis R. Rodriguez 	int (*rf_set_freq)(struct ath_hw *ah,
6308fe65368SLuis R. Rodriguez 			   struct ath9k_channel *chan);
6318fe65368SLuis R. Rodriguez 	void (*spur_mitigate_freq)(struct ath_hw *ah,
6328fe65368SLuis R. Rodriguez 				   struct ath9k_channel *chan);
6338fe65368SLuis R. Rodriguez 	int (*rf_alloc_ext_banks)(struct ath_hw *ah);
6348fe65368SLuis R. Rodriguez 	void (*rf_free_ext_banks)(struct ath_hw *ah);
6358fe65368SLuis R. Rodriguez 	bool (*set_rf_regs)(struct ath_hw *ah,
6368fe65368SLuis R. Rodriguez 			    struct ath9k_channel *chan,
6378fe65368SLuis R. Rodriguez 			    u16 modesIndex);
6388fe65368SLuis R. Rodriguez 	void (*set_channel_regs)(struct ath_hw *ah, struct ath9k_channel *chan);
6398fe65368SLuis R. Rodriguez 	void (*init_bb)(struct ath_hw *ah,
6408fe65368SLuis R. Rodriguez 			struct ath9k_channel *chan);
6418fe65368SLuis R. Rodriguez 	int (*process_ini)(struct ath_hw *ah, struct ath9k_channel *chan);
6428fe65368SLuis R. Rodriguez 	void (*olc_init)(struct ath_hw *ah);
6438fe65368SLuis R. Rodriguez 	void (*set_rfmode)(struct ath_hw *ah, struct ath9k_channel *chan);
6448fe65368SLuis R. Rodriguez 	void (*mark_phy_inactive)(struct ath_hw *ah);
6458fe65368SLuis R. Rodriguez 	void (*set_delta_slope)(struct ath_hw *ah, struct ath9k_channel *chan);
6468fe65368SLuis R. Rodriguez 	bool (*rfbus_req)(struct ath_hw *ah);
6478fe65368SLuis R. Rodriguez 	void (*rfbus_done)(struct ath_hw *ah);
6488fe65368SLuis R. Rodriguez 	void (*restore_chainmask)(struct ath_hw *ah);
64964773964SLuis R. Rodriguez 	u32 (*compute_pll_control)(struct ath_hw *ah,
65064773964SLuis R. Rodriguez 				   struct ath9k_channel *chan);
651c16fcb49SFelix Fietkau 	bool (*ani_control)(struct ath_hw *ah, enum ath9k_ani_cmd cmd,
652c16fcb49SFelix Fietkau 			    int param);
653641d9921SFelix Fietkau 	void (*do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS]);
6544e8c14e9SFelix Fietkau 	void (*set_radar_params)(struct ath_hw *ah,
6554e8c14e9SFelix Fietkau 				 struct ath_hw_radar_conf *conf);
6565f0c04eaSRajkumar Manoharan 	int (*fast_chan_change)(struct ath_hw *ah, struct ath9k_channel *chan,
6575f0c04eaSRajkumar Manoharan 				u8 *ini_reloaded);
658ac0bb767SLuis R. Rodriguez 
659ac0bb767SLuis R. Rodriguez 	/* ANI */
660e36b27afSLuis R. Rodriguez 	void (*ani_cache_ini_regs)(struct ath_hw *ah);
661d70357d5SLuis R. Rodriguez };
662d70357d5SLuis R. Rodriguez 
663d70357d5SLuis R. Rodriguez /**
664d70357d5SLuis R. Rodriguez  * struct ath_hw_ops - callbacks used by hardware code and driver code
665d70357d5SLuis R. Rodriguez  *
666d70357d5SLuis R. Rodriguez  * This structure contains callbacks designed to to be used internally by
667d70357d5SLuis R. Rodriguez  * hardware code and also by the lower level driver.
668d70357d5SLuis R. Rodriguez  *
669d70357d5SLuis R. Rodriguez  * @config_pci_powersave:
670795f5e2cSLuis R. Rodriguez  * @calibrate: periodic calibration for NF, ANI, IQ, ADC gain, ADC-DC
671d70357d5SLuis R. Rodriguez  */
672d70357d5SLuis R. Rodriguez struct ath_hw_ops {
673d70357d5SLuis R. Rodriguez 	void (*config_pci_powersave)(struct ath_hw *ah,
67484c87dc8SStanislaw Gruszka 				     bool power_off);
675cee1f625SVasanthakumar Thiagarajan 	void (*rx_enable)(struct ath_hw *ah);
67687d5efbbSVasanthakumar Thiagarajan 	void (*set_desc_link)(void *ds, u32 link);
677795f5e2cSLuis R. Rodriguez 	bool (*calibrate)(struct ath_hw *ah,
678795f5e2cSLuis R. Rodriguez 			  struct ath9k_channel *chan,
679795f5e2cSLuis R. Rodriguez 			  u8 rxchainmask,
680795f5e2cSLuis R. Rodriguez 			  bool longcal);
68155e82df4SVasanthakumar Thiagarajan 	bool (*get_isr)(struct ath_hw *ah, enum ath9k_int *masked);
6822b63a41dSFelix Fietkau 	void (*set_txdesc)(struct ath_hw *ah, void *ds,
6832b63a41dSFelix Fietkau 			   struct ath_tx_info *i);
684cc610ac0SVasanthakumar Thiagarajan 	int (*proc_txdesc)(struct ath_hw *ah, void *ds,
685cc610ac0SVasanthakumar Thiagarajan 			   struct ath_tx_status *ts);
68669de3721SMohammed Shafi Shajakhan 	void (*antdiv_comb_conf_get)(struct ath_hw *ah,
68769de3721SMohammed Shafi Shajakhan 			struct ath_hw_antcomb_conf *antconf);
68869de3721SMohammed Shafi Shajakhan 	void (*antdiv_comb_conf_set)(struct ath_hw *ah,
68969de3721SMohammed Shafi Shajakhan 			struct ath_hw_antcomb_conf *antconf);
69069de3721SMohammed Shafi Shajakhan 
691d70357d5SLuis R. Rodriguez };
692d70357d5SLuis R. Rodriguez 
693f2552e28SFelix Fietkau struct ath_nf_limits {
694f2552e28SFelix Fietkau 	s16 max;
695f2552e28SFelix Fietkau 	s16 min;
696f2552e28SFelix Fietkau 	s16 nominal;
697f2552e28SFelix Fietkau };
698f2552e28SFelix Fietkau 
6998ad74c4dSRajkumar Manoharan enum ath_cal_list {
7008ad74c4dSRajkumar Manoharan 	TX_IQ_CAL         =	BIT(0),
7018ad74c4dSRajkumar Manoharan 	TX_IQ_ON_AGC_CAL  =	BIT(1),
7028ad74c4dSRajkumar Manoharan 	TX_CL_CAL         =	BIT(2),
7038ad74c4dSRajkumar Manoharan };
7048ad74c4dSRajkumar Manoharan 
70597dcec57SSujith Manoharan /* ah_flags */
70697dcec57SSujith Manoharan #define AH_USE_EEPROM   0x1
70797dcec57SSujith Manoharan #define AH_UNPLUGGED    0x2 /* The card has been physically removed. */
708a126ff51SRajkumar Manoharan #define AH_FASTCC       0x4
70997dcec57SSujith Manoharan 
710203c4805SLuis R. Rodriguez struct ath_hw {
711f9f84e96SFelix Fietkau 	struct ath_ops reg_ops;
712f9f84e96SFelix Fietkau 
713b002a4a9SLuis R. Rodriguez 	struct ieee80211_hw *hw;
71427c51f1aSLuis R. Rodriguez 	struct ath_common common;
715203c4805SLuis R. Rodriguez 	struct ath9k_hw_version hw_version;
716203c4805SLuis R. Rodriguez 	struct ath9k_ops_config config;
717203c4805SLuis R. Rodriguez 	struct ath9k_hw_capabilities caps;
718cac4220bSFelix Fietkau 	struct ath9k_channel channels[ATH9K_NUM_CHANNELS];
719203c4805SLuis R. Rodriguez 	struct ath9k_channel *curchan;
720203c4805SLuis R. Rodriguez 
721203c4805SLuis R. Rodriguez 	union {
722203c4805SLuis R. Rodriguez 		struct ar5416_eeprom_def def;
723203c4805SLuis R. Rodriguez 		struct ar5416_eeprom_4k map4k;
724475f5989SLuis R. Rodriguez 		struct ar9287_eeprom map9287;
72515c9ee7aSSenthil Balasubramanian 		struct ar9300_eeprom ar9300_eep;
726203c4805SLuis R. Rodriguez 	} eeprom;
727203c4805SLuis R. Rodriguez 	const struct eeprom_ops *eep_ops;
728203c4805SLuis R. Rodriguez 
729203c4805SLuis R. Rodriguez 	bool sw_mgmt_crypto;
730203c4805SLuis R. Rodriguez 	bool is_pciexpress;
731d4930086SStanislaw Gruszka 	bool aspm_enabled;
7325f841b41SRajkumar Manoharan 	bool is_monitoring;
7332eb46d9bSPavel Roskin 	bool need_an_top2_fixup;
734203c4805SLuis R. Rodriguez 	u16 tx_trig_level;
735f2552e28SFelix Fietkau 
736bbacee13SFelix Fietkau 	u32 nf_regs[6];
737f2552e28SFelix Fietkau 	struct ath_nf_limits nf_2g;
738f2552e28SFelix Fietkau 	struct ath_nf_limits nf_5g;
739203c4805SLuis R. Rodriguez 	u16 rfsilent;
740203c4805SLuis R. Rodriguez 	u32 rfkill_gpio;
741203c4805SLuis R. Rodriguez 	u32 rfkill_polarity;
742203c4805SLuis R. Rodriguez 	u32 ah_flags;
743203c4805SLuis R. Rodriguez 
744d7e7d229SLuis R. Rodriguez 	bool htc_reset_init;
745d7e7d229SLuis R. Rodriguez 
746203c4805SLuis R. Rodriguez 	enum nl80211_iftype opmode;
747203c4805SLuis R. Rodriguez 	enum ath9k_power_mode power_mode;
748203c4805SLuis R. Rodriguez 
749f23fba49SFelix Fietkau 	s8 noise;
75020bd2a09SFelix Fietkau 	struct ath9k_hw_cal_data *caldata;
751a13883b0SSujith 	struct ath9k_pacal_info pacal_info;
752203c4805SLuis R. Rodriguez 	struct ar5416Stats stats;
753203c4805SLuis R. Rodriguez 	struct ath9k_tx_queue_info txq[ATH9K_NUM_TX_QUEUES];
754203c4805SLuis R. Rodriguez 
7553069168cSPavel Roskin 	enum ath9k_int imask;
75674bad5cbSPavel Roskin 	u32 imrs2_reg;
757203c4805SLuis R. Rodriguez 	u32 txok_interrupt_mask;
758203c4805SLuis R. Rodriguez 	u32 txerr_interrupt_mask;
759203c4805SLuis R. Rodriguez 	u32 txdesc_interrupt_mask;
760203c4805SLuis R. Rodriguez 	u32 txeol_interrupt_mask;
761203c4805SLuis R. Rodriguez 	u32 txurn_interrupt_mask;
762e8fe7336SRajkumar Manoharan 	atomic_t intr_ref_cnt;
763203c4805SLuis R. Rodriguez 	bool chip_fullsleep;
764203c4805SLuis R. Rodriguez 	u32 atim_window;
7655f0c04eaSRajkumar Manoharan 	u32 modes_index;
766203c4805SLuis R. Rodriguez 
767203c4805SLuis R. Rodriguez 	/* Calibration */
7686497827fSFelix Fietkau 	u32 supp_cals;
769cbfe9468SSujith 	struct ath9k_cal_list iq_caldata;
770cbfe9468SSujith 	struct ath9k_cal_list adcgain_caldata;
771cbfe9468SSujith 	struct ath9k_cal_list adcdc_caldata;
772df23acaaSLuis R. Rodriguez 	struct ath9k_cal_list tempCompCalData;
773cbfe9468SSujith 	struct ath9k_cal_list *cal_list;
774cbfe9468SSujith 	struct ath9k_cal_list *cal_list_last;
775cbfe9468SSujith 	struct ath9k_cal_list *cal_list_curr;
776203c4805SLuis R. Rodriguez #define totalPowerMeasI meas0.unsign
777203c4805SLuis R. Rodriguez #define totalPowerMeasQ meas1.unsign
778203c4805SLuis R. Rodriguez #define totalIqCorrMeas meas2.sign
779203c4805SLuis R. Rodriguez #define totalAdcIOddPhase  meas0.unsign
780203c4805SLuis R. Rodriguez #define totalAdcIEvenPhase meas1.unsign
781203c4805SLuis R. Rodriguez #define totalAdcQOddPhase  meas2.unsign
782203c4805SLuis R. Rodriguez #define totalAdcQEvenPhase meas3.unsign
783203c4805SLuis R. Rodriguez #define totalAdcDcOffsetIOddPhase  meas0.sign
784203c4805SLuis R. Rodriguez #define totalAdcDcOffsetIEvenPhase meas1.sign
785203c4805SLuis R. Rodriguez #define totalAdcDcOffsetQOddPhase  meas2.sign
786203c4805SLuis R. Rodriguez #define totalAdcDcOffsetQEvenPhase meas3.sign
787203c4805SLuis R. Rodriguez 	union {
788203c4805SLuis R. Rodriguez 		u32 unsign[AR5416_MAX_CHAINS];
789203c4805SLuis R. Rodriguez 		int32_t sign[AR5416_MAX_CHAINS];
790203c4805SLuis R. Rodriguez 	} meas0;
791203c4805SLuis R. Rodriguez 	union {
792203c4805SLuis R. Rodriguez 		u32 unsign[AR5416_MAX_CHAINS];
793203c4805SLuis R. Rodriguez 		int32_t sign[AR5416_MAX_CHAINS];
794203c4805SLuis R. Rodriguez 	} meas1;
795203c4805SLuis R. Rodriguez 	union {
796203c4805SLuis R. Rodriguez 		u32 unsign[AR5416_MAX_CHAINS];
797203c4805SLuis R. Rodriguez 		int32_t sign[AR5416_MAX_CHAINS];
798203c4805SLuis R. Rodriguez 	} meas2;
799203c4805SLuis R. Rodriguez 	union {
800203c4805SLuis R. Rodriguez 		u32 unsign[AR5416_MAX_CHAINS];
801203c4805SLuis R. Rodriguez 		int32_t sign[AR5416_MAX_CHAINS];
802203c4805SLuis R. Rodriguez 	} meas3;
803203c4805SLuis R. Rodriguez 	u16 cal_samples;
8048ad74c4dSRajkumar Manoharan 	u8 enabled_cals;
805203c4805SLuis R. Rodriguez 
806203c4805SLuis R. Rodriguez 	u32 sta_id1_defaults;
807203c4805SLuis R. Rodriguez 	u32 misc_mode;
808203c4805SLuis R. Rodriguez 
809d70357d5SLuis R. Rodriguez 	/* Private to hardware code */
810d70357d5SLuis R. Rodriguez 	struct ath_hw_private_ops private_ops;
811d70357d5SLuis R. Rodriguez 	/* Accessed by the lower level driver */
812d70357d5SLuis R. Rodriguez 	struct ath_hw_ops ops;
813d70357d5SLuis R. Rodriguez 
814e68a060bSLuis R. Rodriguez 	/* Used to program the radio on non single-chip devices */
815203c4805SLuis R. Rodriguez 	u32 *analogBank0Data;
816203c4805SLuis R. Rodriguez 	u32 *analogBank1Data;
817203c4805SLuis R. Rodriguez 	u32 *analogBank2Data;
818203c4805SLuis R. Rodriguez 	u32 *analogBank3Data;
819203c4805SLuis R. Rodriguez 	u32 *analogBank6Data;
820203c4805SLuis R. Rodriguez 	u32 *analogBank6TPCData;
821203c4805SLuis R. Rodriguez 	u32 *analogBank7Data;
822203c4805SLuis R. Rodriguez 	u32 *bank6Temp;
823203c4805SLuis R. Rodriguez 
824e239d859SFelix Fietkau 	int coverage_class;
825203c4805SLuis R. Rodriguez 	u32 slottime;
826203c4805SLuis R. Rodriguez 	u32 globaltxtimeout;
827203c4805SLuis R. Rodriguez 
828203c4805SLuis R. Rodriguez 	/* ANI */
829203c4805SLuis R. Rodriguez 	u32 proc_phyerr;
830203c4805SLuis R. Rodriguez 	u32 aniperiod;
831203c4805SLuis R. Rodriguez 	int totalSizeDesired[5];
832203c4805SLuis R. Rodriguez 	int coarse_high[5];
833203c4805SLuis R. Rodriguez 	int coarse_low[5];
834203c4805SLuis R. Rodriguez 	int firpwr[5];
835203c4805SLuis R. Rodriguez 	enum ath9k_ani_cmd ani_function;
836203c4805SLuis R. Rodriguez 
837dbccdd1dSSujith Manoharan #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
838766ec4a9SLuis R. Rodriguez 	struct ath_btcoex_hw btcoex_hw;
839dbccdd1dSSujith Manoharan #endif
840af03abecSLuis R. Rodriguez 
841203c4805SLuis R. Rodriguez 	u32 intr_txqs;
842203c4805SLuis R. Rodriguez 	u8 txchainmask;
843203c4805SLuis R. Rodriguez 	u8 rxchainmask;
844203c4805SLuis R. Rodriguez 
845c5d0855aSFelix Fietkau 	struct ath_hw_radar_conf radar_conf;
846c5d0855aSFelix Fietkau 
847203c4805SLuis R. Rodriguez 	u32 originalGain[22];
848203c4805SLuis R. Rodriguez 	int initPDADC;
849203c4805SLuis R. Rodriguez 	int PDADCdelta;
8506de66dd9SFelix Fietkau 	int led_pin;
851691680b8SFelix Fietkau 	u32 gpio_mask;
852691680b8SFelix Fietkau 	u32 gpio_val;
853203c4805SLuis R. Rodriguez 
854203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniModes;
855203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniCommon;
856203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniBank0;
857203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniBB_RfGain;
858203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniBank1;
859203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniBank2;
860203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniBank3;
861203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniBank6;
862203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniBank6TPC;
863203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniBank7;
864203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniAddac;
865203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniPcieSerdes;
8663b604b6cSMohammed Shafi Shajakhan #ifdef CONFIG_PM_SLEEP
8673b604b6cSMohammed Shafi Shajakhan 	struct ar5416IniArray iniPcieSerdesWow;
8683b604b6cSMohammed Shafi Shajakhan #endif
86913ce3e99SLuis R. Rodriguez 	struct ar5416IniArray iniPcieSerdesLowPower;
870c7d36f9fSFelix Fietkau 	struct ar5416IniArray iniModesFastClock;
871c7d36f9fSFelix Fietkau 	struct ar5416IniArray iniAdditional;
872203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniModesRxGain;
8738bc45c6bSGabor Juhos 	struct ar5416IniArray ini_modes_rx_gain_bounds;
874203c4805SLuis R. Rodriguez 	struct ar5416IniArray iniModesTxGain;
875193cd458SSujith 	struct ar5416IniArray iniCckfirNormal;
876193cd458SSujith 	struct ar5416IniArray iniCckfirJapan2484;
877ce407afcSSenthil Balasubramanian 	struct ar5416IniArray ini_japan2484;
87870807e99SSujith 	struct ar5416IniArray iniModes_9271_ANI_reg;
879ce407afcSSenthil Balasubramanian 	struct ar5416IniArray ini_radio_post_sys2ant;
880ff155a45SVasanthakumar Thiagarajan 
88113ce3e99SLuis R. Rodriguez 	struct ar5416IniArray iniMac[ATH_INI_NUM_SPLIT];
88213ce3e99SLuis R. Rodriguez 	struct ar5416IniArray iniBB[ATH_INI_NUM_SPLIT];
88313ce3e99SLuis R. Rodriguez 	struct ar5416IniArray iniRadio[ATH_INI_NUM_SPLIT];
88413ce3e99SLuis R. Rodriguez 	struct ar5416IniArray iniSOC[ATH_INI_NUM_SPLIT];
88513ce3e99SLuis R. Rodriguez 
886ff155a45SVasanthakumar Thiagarajan 	u32 intr_gen_timer_trigger;
887ff155a45SVasanthakumar Thiagarajan 	u32 intr_gen_timer_thresh;
888ff155a45SVasanthakumar Thiagarajan 	struct ath_gen_timer_table hw_gen_timers;
889744d4025SVasanthakumar Thiagarajan 
890744d4025SVasanthakumar Thiagarajan 	struct ar9003_txs *ts_ring;
891744d4025SVasanthakumar Thiagarajan 	u32 ts_paddr_start;
892744d4025SVasanthakumar Thiagarajan 	u32 ts_paddr_end;
893744d4025SVasanthakumar Thiagarajan 	u16 ts_tail;
894016c2177SRajkumar Manoharan 	u16 ts_size;
895aea702b7SLuis R. Rodriguez 
896aea702b7SLuis R. Rodriguez 	u32 bb_watchdog_last_status;
897aea702b7SLuis R. Rodriguez 	u32 bb_watchdog_timeout_ms; /* in ms, 0 to disable */
89851ac8cbbSRajkumar Manoharan 	u8 bb_hang_rx_ofdm; /* true if bb hang due to rx_ofdm */
899717f6bedSFelix Fietkau 
9001bf38661SFelix Fietkau 	unsigned int paprd_target_power;
9011bf38661SFelix Fietkau 	unsigned int paprd_training_power;
9027072bf62SVasanthakumar Thiagarajan 	unsigned int paprd_ratemask;
903f1a8abb0SFelix Fietkau 	unsigned int paprd_ratemask_ht40;
90445ef6a0bSVasanthakumar Thiagarajan 	bool paprd_table_write_done;
905717f6bedSFelix Fietkau 	u32 paprd_gain_table_entries[PAPRD_GAIN_TABLE_ENTRIES];
906717f6bedSFelix Fietkau 	u8 paprd_gain_table_index[PAPRD_GAIN_TABLE_ENTRIES];
9079a658d2bSLuis R. Rodriguez 	/*
9089a658d2bSLuis R. Rodriguez 	 * Store the permanent value of Reg 0x4004in WARegVal
9099a658d2bSLuis R. Rodriguez 	 * so we dont have to R/M/W. We should not be reading
9109a658d2bSLuis R. Rodriguez 	 * this register when in sleep states.
9119a658d2bSLuis R. Rodriguez 	 */
9129a658d2bSLuis R. Rodriguez 	u32 WARegVal;
9136ee63f55SSenthil Balasubramanian 
9146ee63f55SSenthil Balasubramanian 	/* Enterprise mode cap */
9156ee63f55SSenthil Balasubramanian 	u32 ent_mode;
916f2f5f2a1SVasanthakumar Thiagarajan 
91701c78533SMohammed Shafi Shajakhan #ifdef CONFIG_PM_SLEEP
91801c78533SMohammed Shafi Shajakhan 	u32 wow_event_mask;
91901c78533SMohammed Shafi Shajakhan #endif
920f2f5f2a1SVasanthakumar Thiagarajan 	bool is_clk_25mhz;
9213762561aSGabor Juhos 	int (*get_mac_revision)(void);
9227d95847cSGabor Juhos 	int (*external_reset)(void);
923203c4805SLuis R. Rodriguez };
924203c4805SLuis R. Rodriguez 
9250cb9e06bSFelix Fietkau struct ath_bus_ops {
9260cb9e06bSFelix Fietkau 	enum ath_bus_type ath_bus_type;
9270cb9e06bSFelix Fietkau 	void (*read_cachesize)(struct ath_common *common, int *csz);
9280cb9e06bSFelix Fietkau 	bool (*eeprom_read)(struct ath_common *common, u32 off, u16 *data);
9290cb9e06bSFelix Fietkau 	void (*bt_coex_prep)(struct ath_common *common);
9300cb9e06bSFelix Fietkau 	void (*extn_synch_en)(struct ath_common *common);
931d4930086SStanislaw Gruszka 	void (*aspm_init)(struct ath_common *common);
9320cb9e06bSFelix Fietkau };
9330cb9e06bSFelix Fietkau 
9349e4bffd2SLuis R. Rodriguez static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah)
9359e4bffd2SLuis R. Rodriguez {
9369e4bffd2SLuis R. Rodriguez 	return &ah->common;
9379e4bffd2SLuis R. Rodriguez }
9389e4bffd2SLuis R. Rodriguez 
9399e4bffd2SLuis R. Rodriguez static inline struct ath_regulatory *ath9k_hw_regulatory(struct ath_hw *ah)
9409e4bffd2SLuis R. Rodriguez {
9419e4bffd2SLuis R. Rodriguez 	return &(ath9k_hw_common(ah)->regulatory);
9429e4bffd2SLuis R. Rodriguez }
9439e4bffd2SLuis R. Rodriguez 
944d70357d5SLuis R. Rodriguez static inline struct ath_hw_private_ops *ath9k_hw_private_ops(struct ath_hw *ah)
945d70357d5SLuis R. Rodriguez {
946d70357d5SLuis R. Rodriguez 	return &ah->private_ops;
947d70357d5SLuis R. Rodriguez }
948d70357d5SLuis R. Rodriguez 
949d70357d5SLuis R. Rodriguez static inline struct ath_hw_ops *ath9k_hw_ops(struct ath_hw *ah)
950d70357d5SLuis R. Rodriguez {
951d70357d5SLuis R. Rodriguez 	return &ah->ops;
952d70357d5SLuis R. Rodriguez }
953d70357d5SLuis R. Rodriguez 
954895ad7ebSVasanthakumar Thiagarajan static inline u8 get_streams(int mask)
955895ad7ebSVasanthakumar Thiagarajan {
956895ad7ebSVasanthakumar Thiagarajan 	return !!(mask & BIT(0)) + !!(mask & BIT(1)) + !!(mask & BIT(2));
957895ad7ebSVasanthakumar Thiagarajan }
958895ad7ebSVasanthakumar Thiagarajan 
959f637cfd6SLuis R. Rodriguez /* Initialization, Detach, Reset */
960285f2ddaSSujith void ath9k_hw_deinit(struct ath_hw *ah);
961f637cfd6SLuis R. Rodriguez int ath9k_hw_init(struct ath_hw *ah);
962203c4805SLuis R. Rodriguez int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
963caed6579SSujith Manoharan 		   struct ath9k_hw_cal_data *caldata, bool fastcc);
964a9a29ce6SGabor Juhos int ath9k_hw_fill_cap_info(struct ath_hw *ah);
9658fe65368SLuis R. Rodriguez u32 ath9k_regd_get_ctl(struct ath_regulatory *reg, struct ath9k_channel *chan);
966203c4805SLuis R. Rodriguez 
967203c4805SLuis R. Rodriguez /* GPIO / RFKILL / Antennae */
968203c4805SLuis R. Rodriguez void ath9k_hw_cfg_gpio_input(struct ath_hw *ah, u32 gpio);
969203c4805SLuis R. Rodriguez u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio);
970203c4805SLuis R. Rodriguez void ath9k_hw_cfg_output(struct ath_hw *ah, u32 gpio,
971203c4805SLuis R. Rodriguez 			 u32 ah_signal_type);
972203c4805SLuis R. Rodriguez void ath9k_hw_set_gpio(struct ath_hw *ah, u32 gpio, u32 val);
973203c4805SLuis R. Rodriguez void ath9k_hw_setantenna(struct ath_hw *ah, u32 antenna);
974203c4805SLuis R. Rodriguez 
975203c4805SLuis R. Rodriguez /* General Operation */
9767c5adc8dSFelix Fietkau void ath9k_hw_synth_delay(struct ath_hw *ah, struct ath9k_channel *chan,
9777c5adc8dSFelix Fietkau 			  int hw_delay);
978203c4805SLuis R. Rodriguez bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout);
979a9b6b256SFelix Fietkau void ath9k_hw_write_array(struct ath_hw *ah, struct ar5416IniArray *array,
980a9b6b256SFelix Fietkau 			  int column, unsigned int *writecnt);
981203c4805SLuis R. Rodriguez u32 ath9k_hw_reverse_bits(u32 val, u32 n);
9824f0fc7c3SLuis R. Rodriguez u16 ath9k_hw_computetxtime(struct ath_hw *ah,
983545750d3SFelix Fietkau 			   u8 phy, int kbps,
984203c4805SLuis R. Rodriguez 			   u32 frameLen, u16 rateix, bool shortPreamble);
985203c4805SLuis R. Rodriguez void ath9k_hw_get_channel_centers(struct ath_hw *ah,
986203c4805SLuis R. Rodriguez 				  struct ath9k_channel *chan,
987203c4805SLuis R. Rodriguez 				  struct chan_centers *centers);
988203c4805SLuis R. Rodriguez u32 ath9k_hw_getrxfilter(struct ath_hw *ah);
989203c4805SLuis R. Rodriguez void ath9k_hw_setrxfilter(struct ath_hw *ah, u32 bits);
990203c4805SLuis R. Rodriguez bool ath9k_hw_phy_disable(struct ath_hw *ah);
991203c4805SLuis R. Rodriguez bool ath9k_hw_disable(struct ath_hw *ah);
992de40f316SFelix Fietkau void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test);
993203c4805SLuis R. Rodriguez void ath9k_hw_setopmode(struct ath_hw *ah);
994203c4805SLuis R. Rodriguez void ath9k_hw_setmcastfilter(struct ath_hw *ah, u32 filter0, u32 filter1);
995f2b2143eSLuis R. Rodriguez void ath9k_hw_write_associd(struct ath_hw *ah);
996dd347f2fSFelix Fietkau u32 ath9k_hw_gettsf32(struct ath_hw *ah);
997203c4805SLuis R. Rodriguez u64 ath9k_hw_gettsf64(struct ath_hw *ah);
998203c4805SLuis R. Rodriguez void ath9k_hw_settsf64(struct ath_hw *ah, u64 tsf64);
999203c4805SLuis R. Rodriguez void ath9k_hw_reset_tsf(struct ath_hw *ah);
100060ca9f87SSujith Manoharan void ath9k_hw_set_tsfadjust(struct ath_hw *ah, bool set);
10010005baf4SFelix Fietkau void ath9k_hw_init_global_settings(struct ath_hw *ah);
1002b84628ebSSenthil Balasubramanian u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah);
100325c56eecSLuis R. Rodriguez void ath9k_hw_set11nmac2040(struct ath_hw *ah);
1004203c4805SLuis R. Rodriguez void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period);
1005203c4805SLuis R. Rodriguez void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah,
1006203c4805SLuis R. Rodriguez 				    const struct ath9k_beacon_state *bs);
1007c9c99e5eSFelix Fietkau bool ath9k_hw_check_alive(struct ath_hw *ah);
1008a91d75aeSLuis R. Rodriguez 
10099ecdef4bSLuis R. Rodriguez bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);
1010a91d75aeSLuis R. Rodriguez 
1011462e58f2SBen Greear #ifdef CONFIG_ATH9K_DEBUGFS
1012462e58f2SBen Greear void ath9k_debug_sync_cause(struct ath_common *common, u32 sync_cause);
1013462e58f2SBen Greear #else
1014990e08a0SBen Greear static inline void ath9k_debug_sync_cause(struct ath_common *common,
1015990e08a0SBen Greear 					  u32 sync_cause) {}
1016462e58f2SBen Greear #endif
1017462e58f2SBen Greear 
1018ff155a45SVasanthakumar Thiagarajan /* Generic hw timer primitives */
1019ff155a45SVasanthakumar Thiagarajan struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah,
1020ff155a45SVasanthakumar Thiagarajan 					  void (*trigger)(void *),
1021ff155a45SVasanthakumar Thiagarajan 					  void (*overflow)(void *),
1022ff155a45SVasanthakumar Thiagarajan 					  void *arg,
1023ff155a45SVasanthakumar Thiagarajan 					  u8 timer_index);
1024cd9bf689SLuis R. Rodriguez void ath9k_hw_gen_timer_start(struct ath_hw *ah,
1025cd9bf689SLuis R. Rodriguez 			      struct ath_gen_timer *timer,
1026cd9bf689SLuis R. Rodriguez 			      u32 timer_next,
1027cd9bf689SLuis R. Rodriguez 			      u32 timer_period);
1028cd9bf689SLuis R. Rodriguez void ath9k_hw_gen_timer_stop(struct ath_hw *ah, struct ath_gen_timer *timer);
1029cd9bf689SLuis R. Rodriguez 
1030ff155a45SVasanthakumar Thiagarajan void ath_gen_timer_free(struct ath_hw *ah, struct ath_gen_timer *timer);
1031ff155a45SVasanthakumar Thiagarajan void ath_gen_timer_isr(struct ath_hw *hw);
1032ff155a45SVasanthakumar Thiagarajan 
1033f934c4d9SLuis R. Rodriguez void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len);
10342da4f01aSLuis R. Rodriguez 
10358fe65368SLuis R. Rodriguez /* PHY */
10368fe65368SLuis R. Rodriguez void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled,
10378fe65368SLuis R. Rodriguez 				   u32 *coef_mantissa, u32 *coef_exponent);
103864ea57d0SGabor Juhos void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
103964ea57d0SGabor Juhos 			    bool test);
10408fe65368SLuis R. Rodriguez 
1041ebd5a14aSLuis R. Rodriguez /*
1042ebd5a14aSLuis R. Rodriguez  * Code Specific to AR5008, AR9001 or AR9002,
1043ebd5a14aSLuis R. Rodriguez  * we stuff these here to avoid callbacks for AR9003.
1044ebd5a14aSLuis R. Rodriguez  */
1045ebd5a14aSLuis R. Rodriguez int ar9002_hw_rf_claim(struct ath_hw *ah);
104678ec2677SLuis R. Rodriguez void ar9002_hw_enable_async_fifo(struct ath_hw *ah);
1047d8f492b7SLuis R. Rodriguez 
1048641d9921SFelix Fietkau /*
1049aea702b7SLuis R. Rodriguez  * Code specific to AR9003, we stuff these here to avoid callbacks
1050641d9921SFelix Fietkau  * for older families
1051641d9921SFelix Fietkau  */
1052aea702b7SLuis R. Rodriguez void ar9003_hw_bb_watchdog_config(struct ath_hw *ah);
1053aea702b7SLuis R. Rodriguez void ar9003_hw_bb_watchdog_read(struct ath_hw *ah);
1054aea702b7SLuis R. Rodriguez void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah);
105551ac8cbbSRajkumar Manoharan void ar9003_hw_disable_phy_restart(struct ath_hw *ah);
1056717f6bedSFelix Fietkau void ar9003_paprd_enable(struct ath_hw *ah, bool val);
1057717f6bedSFelix Fietkau void ar9003_paprd_populate_single_table(struct ath_hw *ah,
105820bd2a09SFelix Fietkau 					struct ath9k_hw_cal_data *caldata,
1059717f6bedSFelix Fietkau 					int chain);
106020bd2a09SFelix Fietkau int ar9003_paprd_create_curve(struct ath_hw *ah,
106120bd2a09SFelix Fietkau 			      struct ath9k_hw_cal_data *caldata, int chain);
1062717f6bedSFelix Fietkau int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain);
1063717f6bedSFelix Fietkau int ar9003_paprd_init_table(struct ath_hw *ah);
1064717f6bedSFelix Fietkau bool ar9003_paprd_is_done(struct ath_hw *ah);
1065641d9921SFelix Fietkau 
1066641d9921SFelix Fietkau /* Hardware family op attach helpers */
10678fe65368SLuis R. Rodriguez void ar5008_hw_attach_phy_ops(struct ath_hw *ah);
10688525f280SLuis R. Rodriguez void ar9002_hw_attach_phy_ops(struct ath_hw *ah);
10698525f280SLuis R. Rodriguez void ar9003_hw_attach_phy_ops(struct ath_hw *ah);
10708fe65368SLuis R. Rodriguez 
1071795f5e2cSLuis R. Rodriguez void ar9002_hw_attach_calib_ops(struct ath_hw *ah);
1072795f5e2cSLuis R. Rodriguez void ar9003_hw_attach_calib_ops(struct ath_hw *ah);
1073795f5e2cSLuis R. Rodriguez 
1074b3950e6aSLuis R. Rodriguez void ar9002_hw_attach_ops(struct ath_hw *ah);
1075b3950e6aSLuis R. Rodriguez void ar9003_hw_attach_ops(struct ath_hw *ah);
1076b3950e6aSLuis R. Rodriguez 
1077c2ba3342SRajkumar Manoharan void ar9002_hw_load_ani_reg(struct ath_hw *ah, struct ath9k_channel *chan);
10786790ae7aSFelix Fietkau 
10798eb4980cSFelix Fietkau void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning);
108095792178SFelix Fietkau void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan);
1081ac0bb767SLuis R. Rodriguez 
10828a309305SFelix Fietkau #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
1083dbccdd1dSSujith Manoharan static inline bool ath9k_hw_btcoex_is_enabled(struct ath_hw *ah)
1084dbccdd1dSSujith Manoharan {
1085dbccdd1dSSujith Manoharan 	return ah->btcoex_hw.enabled;
1086dbccdd1dSSujith Manoharan }
10875955b2b0SSujith Manoharan static inline bool ath9k_hw_mci_is_enabled(struct ath_hw *ah)
10885955b2b0SSujith Manoharan {
1089e1ecad78SRajkumar Manoharan 	return ah->common.btcoex_enabled &&
1090e1ecad78SRajkumar Manoharan 	       (ah->caps.hw_caps & ATH9K_HW_CAP_MCI);
10915955b2b0SSujith Manoharan 
10925955b2b0SSujith Manoharan }
1093dbccdd1dSSujith Manoharan void ath9k_hw_btcoex_enable(struct ath_hw *ah);
10948a309305SFelix Fietkau static inline enum ath_btcoex_scheme
10958a309305SFelix Fietkau ath9k_hw_get_btcoex_scheme(struct ath_hw *ah)
10968a309305SFelix Fietkau {
10978a309305SFelix Fietkau 	return ah->btcoex_hw.scheme;
10988a309305SFelix Fietkau }
10998a309305SFelix Fietkau #else
1100dbccdd1dSSujith Manoharan static inline bool ath9k_hw_btcoex_is_enabled(struct ath_hw *ah)
1101dbccdd1dSSujith Manoharan {
1102dbccdd1dSSujith Manoharan 	return false;
1103dbccdd1dSSujith Manoharan }
11045955b2b0SSujith Manoharan static inline bool ath9k_hw_mci_is_enabled(struct ath_hw *ah)
11055955b2b0SSujith Manoharan {
11065955b2b0SSujith Manoharan 	return false;
11075955b2b0SSujith Manoharan }
1108dbccdd1dSSujith Manoharan static inline void ath9k_hw_btcoex_enable(struct ath_hw *ah)
1109dbccdd1dSSujith Manoharan {
1110dbccdd1dSSujith Manoharan }
1111dbccdd1dSSujith Manoharan static inline enum ath_btcoex_scheme
1112dbccdd1dSSujith Manoharan ath9k_hw_get_btcoex_scheme(struct ath_hw *ah)
1113dbccdd1dSSujith Manoharan {
1114dbccdd1dSSujith Manoharan 	return ATH_BTCOEX_CFG_NONE;
1115dbccdd1dSSujith Manoharan }
111664ab38dfSSujith Manoharan #endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */
11178a309305SFelix Fietkau 
111864875c63SMohammed Shafi Shajakhan 
111964875c63SMohammed Shafi Shajakhan #ifdef CONFIG_PM_SLEEP
112064875c63SMohammed Shafi Shajakhan const char *ath9k_hw_wow_event_to_string(u32 wow_event);
112164875c63SMohammed Shafi Shajakhan void ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
112264875c63SMohammed Shafi Shajakhan 				u8 *user_mask, int pattern_count,
112364875c63SMohammed Shafi Shajakhan 				int pattern_len);
112464875c63SMohammed Shafi Shajakhan u32 ath9k_hw_wow_wakeup(struct ath_hw *ah);
112564875c63SMohammed Shafi Shajakhan void ath9k_hw_wow_enable(struct ath_hw *ah, u32 pattern_enable);
112664875c63SMohammed Shafi Shajakhan #else
112764875c63SMohammed Shafi Shajakhan static inline const char *ath9k_hw_wow_event_to_string(u32 wow_event)
112864875c63SMohammed Shafi Shajakhan {
112964875c63SMohammed Shafi Shajakhan 	return NULL;
113064875c63SMohammed Shafi Shajakhan }
113164875c63SMohammed Shafi Shajakhan static inline void ath9k_hw_wow_apply_pattern(struct ath_hw *ah,
113264875c63SMohammed Shafi Shajakhan 					      u8 *user_pattern,
113364875c63SMohammed Shafi Shajakhan 					      u8 *user_mask,
113464875c63SMohammed Shafi Shajakhan 					      int pattern_count,
113564875c63SMohammed Shafi Shajakhan 					      int pattern_len)
113664875c63SMohammed Shafi Shajakhan {
113764875c63SMohammed Shafi Shajakhan }
113864875c63SMohammed Shafi Shajakhan static inline u32 ath9k_hw_wow_wakeup(struct ath_hw *ah)
113964875c63SMohammed Shafi Shajakhan {
114064875c63SMohammed Shafi Shajakhan 	return 0;
114164875c63SMohammed Shafi Shajakhan }
114264875c63SMohammed Shafi Shajakhan static inline void ath9k_hw_wow_enable(struct ath_hw *ah, u32 pattern_enable)
114364875c63SMohammed Shafi Shajakhan {
114464875c63SMohammed Shafi Shajakhan }
114564875c63SMohammed Shafi Shajakhan #endif
114664875c63SMohammed Shafi Shajakhan 
114764875c63SMohammed Shafi Shajakhan 
114864875c63SMohammed Shafi Shajakhan 
114973377256SLuis R. Rodriguez #define ATH9K_CLOCK_RATE_CCK		22
115073377256SLuis R. Rodriguez #define ATH9K_CLOCK_RATE_5GHZ_OFDM	40
115173377256SLuis R. Rodriguez #define ATH9K_CLOCK_RATE_2GHZ_OFDM	44
115273377256SLuis R. Rodriguez #define ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM 44
115373377256SLuis R. Rodriguez 
1154203c4805SLuis R. Rodriguez #endif
1155