2 * Copyright (c) 2008-2011 Atheros Communications Inc.
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.
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.
20 #define BEACON_RSSI(ahp) (ahp->stats.avgbrssi)
22 /* units are errors per second */
23 #define ATH9K_ANI_OFDM_TRIG_HIGH 3500
24 #define ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI 1000
25 #define ATH9K_ANI_OFDM_TRIG_HIGH_OLD 500
27 #define ATH9K_ANI_OFDM_TRIG_LOW 400
28 #define ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI 900
29 #define ATH9K_ANI_OFDM_TRIG_LOW_OLD 200
31 #define ATH9K_ANI_CCK_TRIG_HIGH 600
32 #define ATH9K_ANI_CCK_TRIG_HIGH_OLD 200
33 #define ATH9K_ANI_CCK_TRIG_LOW 300
34 #define ATH9K_ANI_CCK_TRIG_LOW_OLD 100
36 #define ATH9K_ANI_SPUR_IMMUNE_LVL 3
37 #define ATH9K_ANI_FIRSTEP_LVL 2
39 #define ATH9K_ANI_RSSI_THR_HIGH 40
40 #define ATH9K_ANI_RSSI_THR_LOW 7
42 #define ATH9K_ANI_PERIOD 300
45 #define ATH9K_ANI_POLLINTERVAL 1000
47 #define ATH9K_SIG_FIRSTEP_SETTING_MIN 0
48 #define ATH9K_SIG_FIRSTEP_SETTING_MAX 20
49 #define ATH9K_SIG_SPUR_IMM_SETTING_MIN 0
50 #define ATH9K_SIG_SPUR_IMM_SETTING_MAX 22
52 /* values here are relative to the INI */
55 ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION
= 0x1,
56 ATH9K_ANI_FIRSTEP_LEVEL
= 0x2,
57 ATH9K_ANI_SPUR_IMMUNITY_LEVEL
= 0x4,
58 ATH9K_ANI_MRC_CCK
= 0x8,
62 struct ath9k_mib_stats
{
70 /* INI default values for ANI registers */
71 struct ath9k_ani_default
{
88 struct ar5416AniState
{
89 u8 noiseImmunityLevel
;
90 u8 ofdmNoiseImmunityLevel
;
91 u8 cckNoiseImmunityLevel
;
96 bool ofdmWeakSigDetect
;
100 struct ath9k_ani_default iniDef
;
105 u32 ast_ani_spurdown
;
111 u32 ast_ani_stepdown
;
112 u32 ast_ani_ofdmerrs
;
115 u32 ast_ani_lneg_or_lzero
;
117 struct ath9k_mib_stats ast_mibstats
;
119 #define ah_mibStats stats.ast_mibstats
121 void ath9k_enable_mib_counters(struct ath_hw
*ah
);
122 void ath9k_hw_disable_mib_counters(struct ath_hw
*ah
);
123 void ath9k_hw_ani_init(struct ath_hw
*ah
);