xref: /freebsd/sys/dev/ath/ath_hal/ar9002/ar9280.h (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1 /*-
2  * SPDX-License-Identifier: ISC
3  *
4  * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting
5  *
6  * Permission to use, copy, modify, and/or distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 #ifndef _ATH_AR9280_H_
19 #define _ATH_AR9280_H_
20 
21 #include "ar5416/ar5416.h"
22 
23 /*
24  * This is a chip thing, but it's used here as part of the
25  * ath_hal_9280 struct; so it's convienent to locate the
26  * define here.
27  */
28 #define AR9280_TX_GAIN_TABLE_SIZE               22
29 
30 struct ath_hal_9280 {
31 	struct ath_hal_5416 ah_5416;
32 
33 	HAL_INI_ARRAY	ah_ini_xmodes;
34 	HAL_INI_ARRAY	ah_ini_rxgain;
35 	HAL_INI_ARRAY	ah_ini_txgain;
36 
37 	int PDADCdelta;
38 
39 	uint32_t	originalGain[AR9280_TX_GAIN_TABLE_SIZE];
40 };
41 #define	AH9280(_ah)	((struct ath_hal_9280 *)(_ah))
42 
43 #define	AR9280_DEFAULT_RXCHAINMASK	3
44 #define	AR9285_DEFAULT_RXCHAINMASK	1
45 #define	AR9280_DEFAULT_TXCHAINMASK	1
46 #define	AR9285_DEFAULT_TXCHAINMASK	1
47 
48 #define	AR_PHY_CCA_NOM_VAL_9280_2GHZ		-112
49 #define	AR_PHY_CCA_NOM_VAL_9280_5GHZ		-112
50 #define	AR_PHY_CCA_MIN_GOOD_VAL_9280_2GHZ	-127
51 #define	AR_PHY_CCA_MIN_GOOD_VAL_9280_5GHZ	-122
52 #define	AR_PHY_CCA_MAX_GOOD_VAL_9280_2GHZ	-97
53 #define	AR_PHY_CCA_MAX_GOOD_VAL_9280_5GHZ	-102
54 
55 HAL_BOOL ar9280RfAttach(struct ath_hal *, HAL_STATUS *);
56 
57 struct ath_hal;
58 
59 HAL_BOOL	ar9280SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING);
60 void		ar9280SpurMitigate(struct ath_hal *,
61     			const struct ieee80211_channel *);
62 void		ar9280InitPLL(struct ath_hal *ah,
63 			const struct ieee80211_channel *chan);
64 #endif	/* _ATH_AR9280_H_ */
65