iPXE
Data Structures | Defines | Enumerations | Functions
ani.h File Reference

Go to the source code of this file.

Data Structures

struct  ath9k_mib_stats
struct  ath9k_ani_default
struct  ar5416AniState
struct  ar5416Stats

Defines

#define HAL_PROCESS_ANI   0x00000001
#define DO_ANI(ah)   (((ah)->proc_phyerr & HAL_PROCESS_ANI) && ah->curchan)
#define BEACON_RSSI(ahp)   (ahp->stats.avgbrssi)
#define ATH9K_ANI_OFDM_TRIG_HIGH_OLD   500
#define ATH9K_ANI_OFDM_TRIG_HIGH_NEW   1000
#define ATH9K_ANI_OFDM_TRIG_LOW_OLD   200
#define ATH9K_ANI_OFDM_TRIG_LOW_NEW   400
#define ATH9K_ANI_CCK_TRIG_HIGH_OLD   200
#define ATH9K_ANI_CCK_TRIG_HIGH_NEW   600
#define ATH9K_ANI_CCK_TRIG_LOW_OLD   100
#define ATH9K_ANI_CCK_TRIG_LOW_NEW   300
#define ATH9K_ANI_NOISE_IMMUNE_LVL   4
#define ATH9K_ANI_USE_OFDM_WEAK_SIG   1
#define ATH9K_ANI_CCK_WEAK_SIG_THR   0
#define ATH9K_ANI_SPUR_IMMUNE_LVL_OLD   7
#define ATH9K_ANI_SPUR_IMMUNE_LVL_NEW   3
#define ATH9K_ANI_FIRSTEP_LVL_OLD   0
#define ATH9K_ANI_FIRSTEP_LVL_NEW   2
#define ATH9K_ANI_RSSI_THR_HIGH   40
#define ATH9K_ANI_RSSI_THR_LOW   7
#define ATH9K_ANI_PERIOD_OLD   100
#define ATH9K_ANI_PERIOD_NEW   1000
#define ATH9K_ANI_POLLINTERVAL_OLD   100
#define ATH9K_ANI_POLLINTERVAL_NEW   1000
#define HAL_NOISE_IMMUNE_MAX   4
#define HAL_SPUR_IMMUNE_MAX   7
#define HAL_FIRST_STEP_MAX   2
#define ATH9K_SIG_FIRSTEP_SETTING_MIN   0
#define ATH9K_SIG_FIRSTEP_SETTING_MAX   20
#define ATH9K_SIG_SPUR_IMM_SETTING_MIN   0
#define ATH9K_SIG_SPUR_IMM_SETTING_MAX   22
#define ATH9K_ANI_ENABLE_MRC_CCK   1
#define ah_mibStats   stats.ast_mibstats

Enumerations

enum  ath9k_ani_cmd {
  ATH9K_ANI_PRESENT = 0x1, ATH9K_ANI_NOISE_IMMUNITY_LEVEL = 0x2, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION = 0x4, ATH9K_ANI_CCK_WEAK_SIGNAL_THR = 0x8,
  ATH9K_ANI_FIRSTEP_LEVEL = 0x10, ATH9K_ANI_SPUR_IMMUNITY_LEVEL = 0x20, ATH9K_ANI_MODE = 0x40, ATH9K_ANI_PHYERR_RESET = 0x80,
  ATH9K_ANI_MRC_CCK = 0x100, ATH9K_ANI_ALL = 0xfff
}

Functions

 FILE_LICENCE (BSD2)
void ath9k_enable_mib_counters (struct ath_hw *ah)
void ath9k_hw_disable_mib_counters (struct ath_hw *ah)
void ath9k_hw_ani_setup (struct ath_hw *ah)
void ath9k_hw_ani_init (struct ath_hw *ah)
int ath9k_hw_get_ani_channel_idx (struct ath_hw *ah, struct ath9k_channel *chan)

Define Documentation

#define HAL_PROCESS_ANI   0x00000001

Definition at line 25 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define DO_ANI (   ah)    (((ah)->proc_phyerr & HAL_PROCESS_ANI) && ah->curchan)
#define BEACON_RSSI (   ahp)    (ahp->stats.avgbrssi)
#define ATH9K_ANI_OFDM_TRIG_HIGH_OLD   500

Definition at line 32 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_OFDM_TRIG_HIGH_NEW   1000

Definition at line 33 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_OFDM_TRIG_LOW_OLD   200

Definition at line 36 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_OFDM_TRIG_LOW_NEW   400

Definition at line 37 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_CCK_TRIG_HIGH_OLD   200

Definition at line 40 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_CCK_TRIG_HIGH_NEW   600

Definition at line 41 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_CCK_TRIG_LOW_OLD   100

Definition at line 44 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_CCK_TRIG_LOW_NEW   300

Definition at line 45 of file ani.h.

Referenced by ath9k_hw_ani_init().

Definition at line 47 of file ani.h.

Definition at line 49 of file ani.h.

Referenced by ath9k_hw_ani_init().

Definition at line 51 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_FIRSTEP_LVL_OLD   0

Definition at line 54 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_FIRSTEP_LVL_NEW   2
#define ATH9K_ANI_RSSI_THR_HIGH   40

Definition at line 57 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_RSSI_THR_LOW   7

Definition at line 58 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_PERIOD_OLD   100

Definition at line 60 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_PERIOD_NEW   1000

Definition at line 61 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_POLLINTERVAL_OLD   100

Definition at line 64 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define ATH9K_ANI_POLLINTERVAL_NEW   1000

Definition at line 65 of file ani.h.

Referenced by ath9k_hw_ani_init().

#define HAL_NOISE_IMMUNE_MAX   4

Definition at line 67 of file ani.h.

Referenced by ath9k_hw_ani_cck_err_trigger_old(), and ath9k_hw_ani_ofdm_err_trigger_old().

#define HAL_SPUR_IMMUNE_MAX   7

Definition at line 68 of file ani.h.

Referenced by ath9k_hw_ani_ofdm_err_trigger_old().

#define HAL_FIRST_STEP_MAX   2

Definition at line 69 of file ani.h.

Referenced by ath9k_hw_ani_cck_err_trigger_old(), and ath9k_hw_ani_ofdm_err_trigger_old().

Definition at line 71 of file ani.h.

Referenced by ar5008_hw_ani_control_new(), and ar9003_hw_ani_control().

Definition at line 72 of file ani.h.

Referenced by ar5008_hw_ani_control_new(), and ar9003_hw_ani_control().

Definition at line 73 of file ani.h.

Referenced by ar5008_hw_ani_control_new(), and ar9003_hw_ani_control().

Definition at line 74 of file ani.h.

Referenced by ar5008_hw_ani_control_new(), and ar9003_hw_ani_control().

#define ATH9K_ANI_ENABLE_MRC_CCK   1

Definition at line 76 of file ani.h.

Referenced by ar9003_hw_ani_cache_ini_regs(), and ath9k_hw_ani_init().

#define ah_mibStats   stats.ast_mibstats

Definition at line 161 of file ani.h.


Enumeration Type Documentation

Enumerator:
ATH9K_ANI_PRESENT 
ATH9K_ANI_NOISE_IMMUNITY_LEVEL 
ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION 
ATH9K_ANI_CCK_WEAK_SIGNAL_THR 
ATH9K_ANI_FIRSTEP_LEVEL 
ATH9K_ANI_SPUR_IMMUNITY_LEVEL 
ATH9K_ANI_MODE 
ATH9K_ANI_PHYERR_RESET 
ATH9K_ANI_MRC_CCK 
ATH9K_ANI_ALL 

Definition at line 80 of file ani.h.


Function Documentation

FILE_LICENCE ( BSD2  )
void ath9k_enable_mib_counters ( struct ath_hw ah)
void ath9k_hw_disable_mib_counters ( struct ath_hw ah)
void ath9k_hw_ani_setup ( struct ath_hw ah)

Definition at line 647 of file ath9k_ani.c.

References ath_hw::coarse_high, ath_hw::coarse_low, ath_hw::firpwr, and ath_hw::totalSizeDesired.

Referenced by ath9k_hw_post_init().

{
        int i;

        static const int totalSizeDesired[] = { -55, -55, -55, -55, -62 };
        static const int coarseHigh[] = { -14, -14, -14, -14, -12 };
        static const int coarseLow[] = { -64, -64, -64, -64, -70 };
        static const int firpwr[] = { -78, -78, -78, -78, -80 };

        for (i = 0; i < 5; i++) {
                ah->totalSizeDesired[i] = totalSizeDesired[i];
                ah->coarse_high[i] = coarseHigh[i];
                ah->coarse_low[i] = coarseLow[i];
                ah->firpwr[i] = firpwr[i];
        }
}
void ath9k_hw_ani_init ( struct ath_hw ah)

Definition at line 664 of file ath9k_ani.c.

References ath9k_channel::ani, ath9k_ops_config::ani_poll_interval, ath_hw::aniperiod, AR_SREV_9300_20_OR_LATER, ARRAY_SIZE, ATH9K_ANI_CCK_DEF_LEVEL, ATH9K_ANI_CCK_TRIG_HIGH_NEW, ATH9K_ANI_CCK_TRIG_HIGH_OLD, ATH9K_ANI_CCK_TRIG_LOW_NEW, ATH9K_ANI_CCK_TRIG_LOW_OLD, ATH9K_ANI_CCK_WEAK_SIG_THR, ATH9K_ANI_ENABLE_MRC_CCK, ATH9K_ANI_FIRSTEP_LVL_NEW, ATH9K_ANI_FIRSTEP_LVL_OLD, ATH9K_ANI_OFDM_TRIG_HIGH_NEW, ATH9K_ANI_OFDM_TRIG_HIGH_OLD, ATH9K_ANI_OFDM_TRIG_LOW_NEW, ATH9K_ANI_OFDM_TRIG_LOW_OLD, ATH9K_ANI_PERIOD_NEW, ATH9K_ANI_PERIOD_OLD, ATH9K_ANI_POLLINTERVAL_NEW, ATH9K_ANI_POLLINTERVAL_OLD, ath9k_ani_restart(), ATH9K_ANI_RSSI_THR_HIGH, ATH9K_ANI_RSSI_THR_LOW, ATH9K_ANI_SPUR_IMMUNE_LVL_NEW, ATH9K_ANI_SPUR_IMMUNE_LVL_OLD, ATH9K_ANI_USE_OFDM_WEAK_SIG, ath9k_ops_config::cck_trig_high, ath9k_ops_config::cck_trig_low, ar5416AniState::cckNoiseImmunityLevel, ar5416AniState::cckWeakSigThreshold, ath9k_channel::chan, ath_hw::channels, ath_hw::config, DBG2, ath9k_ops_config::enable_ani, ar5416AniState::firstepLevel, HAL_PROCESS_ANI, ar5416AniState::mrcCCKOff, ath9k_ops_config::ofdm_trig_high, ath9k_ops_config::ofdm_trig_low, ar5416AniState::ofdmsTurn, ar5416AniState::ofdmWeakSigDetect, ath_hw::proc_phyerr, ar5416AniState::rssiThrHigh, ar5416AniState::rssiThrLow, ar5416AniState::spurImmunityLevel, and use_new_ani().

Referenced by ath9k_hw_post_init().

{
        unsigned int i;

        DBG2("ath9k: Initialize ANI\n");

        if (use_new_ani(ah)) {
                ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_NEW;
                ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_NEW;

                ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_NEW;
                ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_NEW;
        } else {
                ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_OLD;
                ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_OLD;

                ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_OLD;
                ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_OLD;
        }

        for (i = 0; i < ARRAY_SIZE(ah->channels); i++) {
                struct ath9k_channel *chan = &ah->channels[i];
                struct ar5416AniState *ani = &chan->ani;

                if (use_new_ani(ah)) {
                        ani->spurImmunityLevel =
                                ATH9K_ANI_SPUR_IMMUNE_LVL_NEW;

                        ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_NEW;

                        if (AR_SREV_9300_20_OR_LATER(ah))
                                ani->mrcCCKOff =
                                        !ATH9K_ANI_ENABLE_MRC_CCK;
                        else
                                ani->mrcCCKOff = 1;

                        ani->ofdmsTurn = 1;
                } else {
                        ani->spurImmunityLevel =
                                ATH9K_ANI_SPUR_IMMUNE_LVL_OLD;
                        ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL_OLD;

                        ani->cckWeakSigThreshold =
                                ATH9K_ANI_CCK_WEAK_SIG_THR;
                }

                ani->rssiThrHigh = ATH9K_ANI_RSSI_THR_HIGH;
                ani->rssiThrLow = ATH9K_ANI_RSSI_THR_LOW;
                ani->ofdmWeakSigDetect =
                        ATH9K_ANI_USE_OFDM_WEAK_SIG;
                ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
        }

        /*
         * since we expect some ongoing maintenance on the tables, let's sanity
         * check here default level should not modify INI setting.
         */
        if (use_new_ani(ah)) {
                ah->aniperiod = ATH9K_ANI_PERIOD_NEW;
                ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_NEW;
        } else {
                ah->aniperiod = ATH9K_ANI_PERIOD_OLD;
                ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_OLD;
        }

        if (ah->config.enable_ani)
                ah->proc_phyerr |= HAL_PROCESS_ANI;

        ath9k_ani_restart(ah);
}
int ath9k_hw_get_ani_channel_idx ( struct ath_hw ah,
struct ath9k_channel chan 
)