Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ani.h File Reference
#include "../ath.h"

Go to the source code of this file.

Data Structures

struct  ath5k_ani_state
 

Macros

#define ATH5K_ANI_LISTEN_PERIOD   100
 
#define ATH5K_ANI_OFDM_TRIG_HIGH   500
 
#define ATH5K_ANI_OFDM_TRIG_LOW   200
 
#define ATH5K_ANI_CCK_TRIG_HIGH   200
 
#define ATH5K_ANI_CCK_TRIG_LOW   100
 
#define ATH5K_ANI_RSSI_THR_HIGH   40
 
#define ATH5K_ANI_RSSI_THR_LOW   7
 
#define ATH5K_ANI_MAX_FIRSTEP_LVL   2
 
#define ATH5K_ANI_MAX_NOISE_IMM_LVL   1
 

Enumerations

enum  ath5k_ani_mode { ATH5K_ANI_MODE_OFF = 0, ATH5K_ANI_MODE_MANUAL_LOW = 1, ATH5K_ANI_MODE_MANUAL_HIGH = 2, ATH5K_ANI_MODE_AUTO = 3 }
 

Functions

void ath5k_ani_init (struct ath5k_hw *ah, enum ath5k_ani_mode mode)
 
void ath5k_ani_mib_intr (struct ath5k_hw *ah)
 
void ath5k_ani_calibration (struct ath5k_hw *ah)
 
void ath5k_ani_phy_error_report (struct ath5k_hw *ah, enum ath5k_phy_error_code phyerr)
 
void ath5k_ani_set_noise_immunity_level (struct ath5k_hw *ah, int level)
 
void ath5k_ani_set_spur_immunity_level (struct ath5k_hw *ah, int level)
 
void ath5k_ani_set_firstep_level (struct ath5k_hw *ah, int level)
 
void ath5k_ani_set_ofdm_weak_signal_detection (struct ath5k_hw *ah, bool on)
 
void ath5k_ani_set_cck_weak_signal_detection (struct ath5k_hw *ah, bool on)
 
void ath5k_ani_print_counters (struct ath5k_hw *ah)
 

Macro Definition Documentation

#define ATH5K_ANI_CCK_TRIG_HIGH   200

Definition at line 27 of file ani.h.

#define ATH5K_ANI_CCK_TRIG_LOW   100

Definition at line 28 of file ani.h.

#define ATH5K_ANI_LISTEN_PERIOD   100

Definition at line 24 of file ani.h.

#define ATH5K_ANI_MAX_FIRSTEP_LVL   2

Definition at line 35 of file ani.h.

#define ATH5K_ANI_MAX_NOISE_IMM_LVL   1

Definition at line 36 of file ani.h.

#define ATH5K_ANI_OFDM_TRIG_HIGH   500

Definition at line 25 of file ani.h.

#define ATH5K_ANI_OFDM_TRIG_LOW   200

Definition at line 26 of file ani.h.

#define ATH5K_ANI_RSSI_THR_HIGH   40

Definition at line 31 of file ani.h.

#define ATH5K_ANI_RSSI_THR_LOW   7

Definition at line 32 of file ani.h.

Enumeration Type Documentation

enum ath5k_ani_mode - mode for ANI / noise sensitivity

: Turn ANI off. This can be useful to just stop the ANI algorithm after it has been on auto mode. : Manually set all immunity parameters to low, maximizing sensitivity. ANI will not run. : Manually set all immunity parameters to high, minimizing sensitivity. ANI will not run. : Automatically control immunity parameters based on the amount of OFDM and CCK frame errors (default).

Enumerator:
ATH5K_ANI_MODE_OFF 
ATH5K_ANI_MODE_MANUAL_LOW 
ATH5K_ANI_MODE_MANUAL_HIGH 
ATH5K_ANI_MODE_AUTO 

Definition at line 51 of file ani.h.

Function Documentation

void ath5k_ani_calibration ( struct ath5k_hw ah)

ath5k_ani_calibration() - The main ANI calibration function : The &struct ath5k_hw

We count OFDM and CCK errors relative to the time where we did not send or receive ("listen" time) and raise or lower immunity accordingly. This is called regularly (every second) from the calibration timer, but also when an error threshold has been reached.

In order to synchronize access from different contexts, this should be called only indirectly by scheduling the ANI tasklet!

Definition at line 475 of file ani.c.

void ath5k_ani_init ( struct ath5k_hw ah,
enum ath5k_ani_mode  mode 
)

ath5k_ani_init() - Initialize ANI : The &struct ath5k_hw : One of enum ath5k_ani_mode

Initialize ANI according to mode.

Definition at line 645 of file ani.c.

void ath5k_ani_mib_intr ( struct ath5k_hw ah)

ath5k_ani_mib_intr() - Interrupt handler for ANI MIB counters : The &struct ath5k_hw

Just read & reset the registers quickly, so they don't generate more interrupts, save the counters and schedule the tasklet to decide whether to raise immunity or not.

We just need to handle PHY error counters, ath5k_hw_update_mib_counters() should take care of all "normal" MIB interrupts.

Definition at line 539 of file ani.c.

void ath5k_ani_phy_error_report ( struct ath5k_hw ah,
enum ath5k_phy_error_code  phyerr 
)

ath5k_ani_phy_error_report - Used by older HW to report PHY errors

: The &struct ath5k_hw : One of enum ath5k_phy_error_code

This is used by hardware without PHY error counters to report PHY errors on a frame-by-frame basis, instead of the interrupt.

Definition at line 576 of file ani.c.

void ath5k_ani_print_counters ( struct ath5k_hw ah)
void ath5k_ani_set_cck_weak_signal_detection ( struct ath5k_hw ah,
bool  on 
)

ath5k_ani_set_cck_weak_signal_detection() - Set CCK weak signal detection : The &struct ath5k_hw : turn on or off

Definition at line 197 of file ani.c.

void ath5k_ani_set_firstep_level ( struct ath5k_hw ah,
int  level 
)

ath5k_ani_set_firstep_level() - Set "firstep" level : The &struct ath5k_hw : level between 0 and

Definition at line 135 of file ani.c.

void ath5k_ani_set_noise_immunity_level ( struct ath5k_hw ah,
int  level 
)

DOC: Basic ANI Operation

Adaptive Noise Immunity (ANI) controls five noise immunity parameters depending on the amount of interference in the environment, increasing or reducing sensitivity as necessary.

The parameters are:

  • "noise immunity"
  • "spur immunity"
  • "firstep level"
  • "OFDM weak signal detection"
  • "CCK weak signal detection"

Basically we look at the amount of ODFM and CCK timing errors we get and then raise or lower immunity accordingly by setting one or more of these parameters.

Newer chipsets have PHY error counters in hardware which will generate a MIB interrupt when they overflow. Older hardware has too enable PHY error frames by setting a RX flag and then count every single PHY error. When a specified threshold of errors has been reached we will raise immunity. Also we regularly check the amount of errors and lower or raise immunity as necessary. ath5k_ani_set_noise_immunity_level() - Set noise immunity level : The &struct ath5k_hw : level between 0 and

Definition at line 66 of file ani.c.

void ath5k_ani_set_ofdm_weak_signal_detection ( struct ath5k_hw ah,
bool  on 
)

ath5k_ani_set_ofdm_weak_signal_detection() - Set OFDM weak signal detection : The &struct ath5k_hw : turn on or off

Definition at line 157 of file ani.c.

void ath5k_ani_set_spur_immunity_level ( struct ath5k_hw ah,
int  level 
)

ath5k_ani_set_spur_immunity_level() - Set spur immunity level : The &struct ath5k_hw : level between 0 and (the maximum level is dependent on the chip revision).

Definition at line 111 of file ani.c.