diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2008-10-03 18:45:27 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-06 18:14:56 -0400 |
commit | 6f255425ac3b10c3352c926e7b53e5ea1c364ca4 (patch) | |
tree | 529cf0d1d1e9d9fdd8e9d6da67f5d99072872dc4 /drivers/net/wireless/ath9k/main.c | |
parent | a477e4e6d48d3ac7c7a75bad40585cb391e5c237 (diff) |
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 <Sujith.Manoharan@atheros.com>
Signed-off-by: Jouni Malinen <Jouni.Malinen@Atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 2caba4403167..74726990d59e 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -274,10 +274,12 @@ static void ath9k_rx_prepare(struct ath_softc *sc, | |||
274 | rx_status->mactime = status->tsf; | 274 | rx_status->mactime = status->tsf; |
275 | rx_status->band = curchan->band; | 275 | rx_status->band = curchan->band; |
276 | rx_status->freq = curchan->center_freq; | 276 | rx_status->freq = curchan->center_freq; |
277 | rx_status->noise = ATH_DEFAULT_NOISE_FLOOR; | 277 | rx_status->noise = sc->sc_ani.sc_noise_floor; |
278 | rx_status->signal = rx_status->noise + status->rssi; | 278 | rx_status->signal = rx_status->noise + status->rssi; |
279 | rx_status->rate_idx = ath_rate2idx(sc, (status->rateKbps / 100)); | 279 | rx_status->rate_idx = ath_rate2idx(sc, (status->rateKbps / 100)); |
280 | rx_status->antenna = status->antenna; | 280 | rx_status->antenna = status->antenna; |
281 | |||
282 | /* XXX Fix me, 64 cannot be the max rssi value, rigure it out */ | ||
281 | rx_status->qual = status->rssi * 100 / 64; | 283 | rx_status->qual = status->rssi * 100 / 64; |
282 | 284 | ||
283 | if (status->flags & ATH_RX_MIC_ERROR) | 285 | if (status->flags & ATH_RX_MIC_ERROR) |
@@ -427,6 +429,11 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc, | |||
427 | ath_rate_newstate(sc, avp); | 429 | ath_rate_newstate(sc, avp); |
428 | /* Update ratectrl about the new state */ | 430 | /* Update ratectrl about the new state */ |
429 | ath_rc_node_update(hw, avp->rc_node); | 431 | ath_rc_node_update(hw, avp->rc_node); |
432 | |||
433 | /* Start ANI */ | ||
434 | mod_timer(&sc->sc_ani.timer, | ||
435 | jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL)); | ||
436 | |||
430 | } else { | 437 | } else { |
431 | DPRINTF(sc, ATH_DBG_CONFIG, | 438 | DPRINTF(sc, ATH_DBG_CONFIG, |
432 | "%s: Bss Info DISSOC\n", __func__); | 439 | "%s: Bss Info DISSOC\n", __func__); |
@@ -1173,6 +1180,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
1173 | return error; | 1180 | return error; |
1174 | } | 1181 | } |
1175 | 1182 | ||
1183 | if (conf->type == NL80211_IFTYPE_AP) { | ||
1184 | /* TODO: is this a suitable place to start ANI for AP mode? */ | ||
1185 | /* Start ANI */ | ||
1186 | mod_timer(&sc->sc_ani.timer, | ||
1187 | jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL)); | ||
1188 | } | ||
1189 | |||
1176 | return 0; | 1190 | return 0; |
1177 | } | 1191 | } |
1178 | 1192 | ||
@@ -1195,6 +1209,8 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
1195 | #ifdef CONFIG_SLOW_ANT_DIV | 1209 | #ifdef CONFIG_SLOW_ANT_DIV |
1196 | ath_slow_ant_div_stop(&sc->sc_antdiv); | 1210 | ath_slow_ant_div_stop(&sc->sc_antdiv); |
1197 | #endif | 1211 | #endif |
1212 | /* Stop ANI */ | ||
1213 | del_timer_sync(&sc->sc_ani.timer); | ||
1198 | 1214 | ||
1199 | /* Update ratectrl */ | 1215 | /* Update ratectrl */ |
1200 | ath_rate_newstate(sc, avp); | 1216 | ath_rate_newstate(sc, avp); |