xref: /freebsd/sys/dev/ath/ath_hal/ar9002/ar9285.h (revision 730cecb05aaf016ac52ef7cfc691ccec3a0408cd)
1 /*
2  * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting
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 #ifndef _ATH_AR9285_H_
19 #define _ATH_AR9285_H_
20 
21 #include "ar5416/ar5416.h"
22 
23 struct ar9285_ant_comb {
24 	uint16_t count;
25 	uint16_t total_pkt_count;
26 	HAL_BOOL scan;
27 	HAL_BOOL scan_not_start;
28 	int main_total_rssi;
29 	int alt_total_rssi;
30 	int alt_recv_cnt;
31 	int main_recv_cnt;
32 	int rssi_lna1;
33 	int rssi_lna2;
34 	int rssi_add;
35 	int rssi_sub;
36 	int rssi_first;
37 	int rssi_second;
38 	int rssi_third;
39 	HAL_BOOL alt_good;
40 	int quick_scan_cnt;
41 	int main_conf;
42 	HAL_ANT_DIV_COMB_LNA_CONF first_quick_scan_conf;
43 	HAL_ANT_DIV_COMB_LNA_CONF second_quick_scan_conf;
44 	int first_bias;
45 	int second_bias;
46 	HAL_BOOL first_ratio;
47 	HAL_BOOL second_ratio;
48 	unsigned long scan_start_time;
49 };
50 
51 struct ath_hal_9285 {
52 	struct ath_hal_5416 ah_5416;
53 
54 	HAL_INI_ARRAY	ah_ini_txgain;
55 	HAL_INI_ARRAY	ah_ini_rxgain;
56 
57 	struct ar9285_ant_comb ant_comb;	/* Kite Antenna comb/diversity */
58 
59 	struct {
60 		int32_t prev_offset;	/* Previous value of PA offset value */
61 		int8_t max_skipcount;	/* Max No. of times PACAL can be skipped */
62 		int8_t skipcount;	/* No. of times the PACAL to be skipped */
63 	} pacal_info;
64 };
65 #define	AH9285(_ah)	((struct ath_hal_9285 *)(_ah))
66 
67 #define	AR9285_DEFAULT_RXCHAINMASK	1
68 #define	AR9285_DEFAULT_TXCHAINMASK	1
69 
70 #define	AR_PHY_CCA_NOM_VAL_9285_2GHZ		-118
71 #define	AR_PHY_CCA_MIN_GOOD_VAL_9285_2GHZ	-127
72 #define	AR_PHY_CCA_MAX_GOOD_VAL_9285_2GHZ	-108
73 
74 HAL_BOOL ar9285SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING);
75 HAL_BOOL ar9285RfAttach(struct ath_hal *, HAL_STATUS *);
76 
77 extern	HAL_BOOL ar9285SetTransmitPower(struct ath_hal *,
78 		const struct ieee80211_channel *, uint16_t *);
79 extern HAL_BOOL ar9285SetBoardValues(struct ath_hal *,
80 		const struct ieee80211_channel *);
81 
82 /* ar9285_btcoex.h */
83 extern	void ar9285BTCoexAntennaDiversity(struct ath_hal *ah);
84 extern	void ar9285BTCoexSetParameter(struct ath_hal *ah,
85 		u_int32_t value, u_int32_t type);
86 
87 #endif	/* _ATH_AR9285_H_ */
88