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

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 

Functions

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_calibration (struct ath5k_hw *ah)
 
void ath5k_ani_mib_intr (struct ath5k_hw *ah)
 
void ath5k_ani_phy_error_report (struct ath5k_hw *ah, enum ath5k_phy_error_code phyerr)
 
void ath5k_ani_init (struct ath5k_hw *ah, enum ath5k_ani_mode mode)
 

Macro Definition Documentation

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 17 of file ani.c.

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_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.