xref: /freebsd/sys/dev/ath/ath_hal/ar9002/ar9287.h (revision 38f0b757fd84d17d0fc24739a7cda160c4516d81)
1 /*
2  * Copyright (c) 2010 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  * $FreeBSD$
17  */
18 
19 #ifndef _ATH_AR9287_H_
20 #define _ATH_AR9287_H_
21 
22 #include "ar5416/ar5416.h"
23 
24 /*
25  * This is a chip thing, but it's used here as part of the
26  * ath_hal_9287 struct; so it's convienent to locate the
27  * define here.
28  */
29 #define AR9287_TX_GAIN_TABLE_SIZE		22
30 
31 struct ath_hal_9287 {
32 	struct ath_hal_5416 ah_5416;
33 
34 	HAL_INI_ARRAY	ah_ini_xmodes;
35 	HAL_INI_ARRAY	ah_ini_rxgain;
36 	HAL_INI_ARRAY	ah_ini_txgain;
37 
38 	HAL_INI_ARRAY	ah_ini_cckFirNormal;
39 	HAL_INI_ARRAY	ah_ini_cckFirJapan2484;
40 
41 	int PDADCdelta;
42 
43 	uint32_t	originalGain[AR9287_TX_GAIN_TABLE_SIZE];
44 };
45 #define	AH9287(_ah)	((struct ath_hal_9287 *)(_ah))
46 
47 #define	AR9287_DEFAULT_RXCHAINMASK	3
48 #define	AR9287_DEFAULT_TXCHAINMASK	3
49 
50 #define	AR_PHY_CCA_NOM_VAL_9287_2GHZ		-112
51 #define	AR_PHY_CCA_NOM_VAL_9287_5GHZ		-112
52 #define	AR_PHY_CCA_MIN_GOOD_VAL_9287_2GHZ	-127
53 #define	AR_PHY_CCA_MIN_GOOD_VAL_9287_5GHZ	-122
54 #define	AR_PHY_CCA_MAX_GOOD_VAL_9287_2GHZ	-97
55 #define	AR_PHY_CCA_MAX_GOOD_VAL_9287_5GHZ	-102
56 
57 extern	HAL_BOOL ar9287RfAttach(struct ath_hal *, HAL_STATUS *);
58 extern	HAL_BOOL ar9287SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING);
59 
60 #endif	/* _ATH_AR9287_H_ */
61