From 6f255425ac3b10c3352c926e7b53e5ea1c364ca4 Mon Sep 17 00:00:00 2001 From: Luis R. Rodriguez Date: Fri, 3 Oct 2008 15:45:27 -0700 Subject: ath9k: enable ANI to help with noisy environments This enables Adaptive Noise Immunity (ANI) on ath9k. ANI is as algorithm designed to minimize the detrimental effects of time-varying interferences. This should help with throughput in noisy environments. To use ANI we re-enable the MIB interrupt. Since ANI works on a timer and updates the noise floor we take advantage of this and also report a non-static noise floor now to mac80211. Signed-off-by: Sujith Manoharan Signed-off-by: Jouni Malinen Signed-off-by: Luis R. Rodriguez Signed-off-by: John W. Linville --- drivers/net/wireless/ath9k/core.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'drivers/net/wireless/ath9k/core.h') diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 5b4f1c48a618..cb3e61e57c4d 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h @@ -800,6 +800,28 @@ void ath_slow_ant_div(struct ath_antdiv *antdiv, struct ath_rx_status *rx_stats); void ath_setdefantenna(void *sc, u32 antenna); +/*******/ +/* ANI */ +/*******/ + +/* ANI values for STA only. + FIXME: Add appropriate values for AP later */ + +#define ATH_ANI_POLLINTERVAL 100 /* 100 milliseconds between ANI poll */ +#define ATH_SHORT_CALINTERVAL 1000 /* 1 second between calibrations */ +#define ATH_LONG_CALINTERVAL 30000 /* 30 seconds between calibrations */ +#define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes between calibrations */ + +struct ath_ani { + bool sc_caldone; + int16_t sc_noise_floor; + unsigned int sc_longcal_timer; + unsigned int sc_shortcal_timer; + unsigned int sc_resetcal_timer; + unsigned int sc_checkani_timer; + struct timer_list timer; +}; + /********************/ /* LED Control */ /********************/ @@ -1028,6 +1050,9 @@ struct ath_softc { /* Rfkill */ struct ath_rfkill rf_kill; + + /* ANI */ + struct ath_ani sc_ani; }; int ath_init(u16 devid, struct ath_softc *sc); -- cgit v1.2.3-55-g7522