iPXE
ani.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2011 Atheros Communications Inc.
3  *
4  * Modified for iPXE by Scott K Logan <logans@cottsay.net> July 2011
5  * Original from Linux kernel 3.0.1
6  *
7  * Permission to use, copy, modify, and/or distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef ANI_H
21 #define ANI_H
22 
23 FILE_LICENCE ( BSD2 );
24 FILE_SECBOOT ( FORBIDDEN );
25 
26 #define HAL_PROCESS_ANI 0x00000001
27 
28 #define DO_ANI(ah) (((ah)->proc_phyerr & HAL_PROCESS_ANI) && ah->curchan)
29 
30 #define BEACON_RSSI(ahp) (ahp->stats.avgbrssi)
31 
32 /* units are errors per second */
33 #define ATH9K_ANI_OFDM_TRIG_HIGH_OLD 500
34 #define ATH9K_ANI_OFDM_TRIG_HIGH_NEW 1000
35 
36 /* units are errors per second */
37 #define ATH9K_ANI_OFDM_TRIG_LOW_OLD 200
38 #define ATH9K_ANI_OFDM_TRIG_LOW_NEW 400
39 
40 /* units are errors per second */
41 #define ATH9K_ANI_CCK_TRIG_HIGH_OLD 200
42 #define ATH9K_ANI_CCK_TRIG_HIGH_NEW 600
43 
44 /* units are errors per second */
45 #define ATH9K_ANI_CCK_TRIG_LOW_OLD 100
46 #define ATH9K_ANI_CCK_TRIG_LOW_NEW 300
47 
48 #define ATH9K_ANI_NOISE_IMMUNE_LVL 4
49 #define ATH9K_ANI_USE_OFDM_WEAK_SIG 1
50 #define ATH9K_ANI_CCK_WEAK_SIG_THR 0
51 
52 #define ATH9K_ANI_SPUR_IMMUNE_LVL_OLD 7
53 #define ATH9K_ANI_SPUR_IMMUNE_LVL_NEW 3
54 
55 #define ATH9K_ANI_FIRSTEP_LVL_OLD 0
56 #define ATH9K_ANI_FIRSTEP_LVL_NEW 2
57 
58 #define ATH9K_ANI_RSSI_THR_HIGH 40
59 #define ATH9K_ANI_RSSI_THR_LOW 7
60 
61 #define ATH9K_ANI_PERIOD_OLD 100
62 #define ATH9K_ANI_PERIOD_NEW 1000
63 
64 /* in ms */
65 #define ATH9K_ANI_POLLINTERVAL_OLD 100
66 #define ATH9K_ANI_POLLINTERVAL_NEW 1000
67 
68 #define HAL_NOISE_IMMUNE_MAX 4
69 #define HAL_SPUR_IMMUNE_MAX 7
70 #define HAL_FIRST_STEP_MAX 2
71 
72 #define ATH9K_SIG_FIRSTEP_SETTING_MIN 0
73 #define ATH9K_SIG_FIRSTEP_SETTING_MAX 20
74 #define ATH9K_SIG_SPUR_IMM_SETTING_MIN 0
75 #define ATH9K_SIG_SPUR_IMM_SETTING_MAX 22
76 
77 #define ATH9K_ANI_ENABLE_MRC_CCK 1
78 
79 /* values here are relative to the INI */
80 
91  ATH9K_ANI_ALL = 0xfff
92 };
93 
100 };
101 
102 /* INI default values for ANI registers */
118 };
119 
121  struct ath9k_channel *c;
141 };
142 
143 struct ar5416Stats {
161 };
162 #define ah_mibStats stats.ast_mibstats
163 
164 void ath9k_enable_mib_counters(struct ath_hw *ah);
166 void ath9k_hw_ani_setup(struct ath_hw *ah);
167 void ath9k_hw_ani_init(struct ath_hw *ah);
169  struct ath9k_channel *chan);
170 
171 #endif /* ANI_H */
uint16_t u16
Definition: stdint.h:22
u32 listenTime
Definition: ani.h:131
Definition: hw.h:657
u16 m1ThreshLow
Definition: ani.h:104
u32 ast_ani_ofdmerrs
Definition: ani.h:154
u8 spurImmunityLevel
Definition: ani.h:127
u32 noiseFloor
Definition: ani.h:134
FILE_SECBOOT(FORBIDDEN)
u8 mrcCCKOff
Definition: ani.h:126
int ath9k_hw_get_ani_channel_idx(struct ath_hw *ah, struct ath9k_channel *chan)
int32_t rssiThrHigh
Definition: ani.h:133
u16 m2CountThrLow
Definition: ani.h:109
u16 m2CountThr
Definition: ani.h:108
u32 avgbrssi
Definition: ani.h:159
int32_t rssiThrLow
Definition: ani.h:132
u32 ast_ani_ccklow
Definition: ani.h:151
u32 ast_ani_ofdmon
Definition: ani.h:148
u32 ast_ani_stepup
Definition: ani.h:152
u16 m1ThreshExt
Definition: ani.h:112
u16 cycpwrThr1Ext
Definition: ani.h:117
u32 ast_ani_nidown
Definition: ani.h:145
u32 beacons
Definition: ani.h:99
u8 cckNoiseImmunityLevel
Definition: ani.h:124
u16 m2Thresh
Definition: ani.h:107
u32 rts_good
Definition: ani.h:97
u16 firstepLow
Definition: ani.h:115
u32 ast_ani_cckhigh
Definition: ani.h:150
FILE_LICENCE(BSD2)
u16 m1Thresh
Definition: ani.h:106
u32 rts_bad
Definition: ani.h:96
u8 ofdmWeakSigDetect
Definition: ani.h:129
u8 firstepLevel
Definition: ani.h:128
u32 ast_ani_stepdown
Definition: ani.h:153
void ath9k_hw_disable_mib_counters(struct ath_hw *ah)
u16 cycpwrThr1
Definition: ani.h:116
u32 ast_ani_cckerrs
Definition: ani.h:155
void ath9k_enable_mib_counters(struct ath_hw *ah)
u32 ast_ani_spurup
Definition: ani.h:146
u8 cckWeakSigThreshold
Definition: ani.h:130
u16 m2ThreshLowExt
Definition: ani.h:111
ath9k_ani_cmd
Definition: ani.h:81
signed int int32_t
Definition: stdint.h:17
u32 ackrcv_bad
Definition: ani.h:95
int16_t pktRssi[2]
Definition: ani.h:137
int ofdmsTurn
Definition: ani.h:125
int16_t cckErrRssi[2]
Definition: ani.h:139
u16 m1ThreshLowExt
Definition: ani.h:110
u32 ofdmPhyErrCount
Definition: ani.h:135
u32 fcs_bad
Definition: ani.h:98
u16 m2ThreshLow
Definition: ani.h:105
u32 ast_ani_ofdmoff
Definition: ani.h:149
u32 ast_ani_lneg
Definition: ani.h:158
void ath9k_hw_ani_init(struct ath_hw *ah)
Definition: ath9k_ani.c:666
uint8_t ah
Definition: registers.h:85
u32 ast_ani_lzero
Definition: ani.h:157
signed short int16_t
Definition: stdint.h:16
struct ath9k_mib_stats ast_mibstats
Definition: ani.h:160
u32 ast_ani_spurdown
Definition: ani.h:147
void ath9k_hw_ani_setup(struct ath_hw *ah)
Definition: ath9k_ani.c:649
u32 cckPhyErrCount
Definition: ani.h:136
struct ath9k_ani_default iniDef
Definition: ani.h:140
int16_t ofdmErrRssi[2]
Definition: ani.h:138
u16 m2ThreshExt
Definition: ani.h:113
u32 ast_ani_reset
Definition: ani.h:156
uint8_t u8
Definition: stdint.h:20
u8 noiseImmunityLevel
Definition: ani.h:122
u8 ofdmNoiseImmunityLevel
Definition: ani.h:123
u32 ast_ani_niup
Definition: ani.h:144
uint32_t u32
Definition: stdint.h:24
struct ath9k_channel * c
Definition: ani.h:121