lantiq: Tune the XWAY subtarget cflags
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 556-ath9k_ani_revert.patch
1 --- a/drivers/net/wireless/ath/ath9k/ani.h
2 +++ b/drivers/net/wireless/ath/ath9k/ani.h
3 @@ -20,8 +20,12 @@
4 #define BEACON_RSSI(ahp) (ahp->stats.avgbrssi)
5
6 /* units are errors per second */
7 -#define ATH9K_ANI_OFDM_TRIG_HIGH 1000
8 +#define ATH9K_ANI_OFDM_TRIG_HIGH 3500
9 +#define ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI 1000
10 +
11 #define ATH9K_ANI_OFDM_TRIG_LOW 400
12 +#define ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI 900
13 +
14 #define ATH9K_ANI_CCK_TRIG_HIGH 600
15 #define ATH9K_ANI_CCK_TRIG_LOW 300
16
17 --- a/drivers/net/wireless/ath/ath9k/ani.c
18 +++ b/drivers/net/wireless/ath/ath9k/ani.c
19 @@ -177,14 +177,17 @@ static void ath9k_hw_set_ofdm_nil(struct
20 BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_HIGH)
21 weak_sig = true;
22
23 - /*
24 - * OFDM Weak signal detection is always enabled for AP mode.
25 - */
26 - if (ah->opmode != NL80211_IFTYPE_AP &&
27 - aniState->ofdmWeakSigDetect != weak_sig) {
28 - ath9k_hw_ani_control(ah,
29 - ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
30 - entry_ofdm->ofdm_weak_signal_on);
31 + if (aniState->ofdmWeakSigDetect != weak_sig)
32 + ath9k_hw_ani_control(ah,
33 + ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
34 + entry_ofdm->ofdm_weak_signal_on);
35 +
36 + if (aniState->ofdmNoiseImmunityLevel >= ATH9K_ANI_OFDM_DEF_LEVEL) {
37 + ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH;
38 + ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI;
39 + } else {
40 + ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI;
41 + ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW;
42 }
43 }
44
45 @@ -420,25 +423,12 @@ void ath9k_hw_ani_monitor(struct ath_hw
46 ofdmPhyErrRate, aniState->cckNoiseImmunityLevel,
47 cckPhyErrRate, aniState->ofdmsTurn);
48
49 - if (aniState->listenTime > 5 * ah->aniperiod) {
50 - /*
51 - * Check if we need to lower immunity if
52 - * 5 ani_periods have passed.
53 - */
54 - if (ofdmPhyErrRate <= ah->config.ofdm_trig_low &&
55 - cckPhyErrRate <= ah->config.cck_trig_low) {
56 + if (aniState->listenTime > ah->aniperiod) {
57 + if (cckPhyErrRate < ah->config.cck_trig_low &&
58 + ofdmPhyErrRate < ah->config.ofdm_trig_low) {
59 ath9k_hw_ani_lower_immunity(ah);
60 aniState->ofdmsTurn = !aniState->ofdmsTurn;
61 - }
62 - ath9k_ani_restart(ah);
63 - } else if (aniState->listenTime > ah->aniperiod) {
64 - /*
65 - * Check if immunity has to be raised,
66 - * (either OFDM or CCK).
67 - */
68 - if (ofdmPhyErrRate > ah->config.ofdm_trig_high &&
69 - (cckPhyErrRate <= ah->config.cck_trig_high ||
70 - aniState->ofdmsTurn)) {
71 + } else if (ofdmPhyErrRate > ah->config.ofdm_trig_high) {
72 ath9k_hw_ani_ofdm_err_trigger(ah);
73 aniState->ofdmsTurn = false;
74 } else if (cckPhyErrRate > ah->config.cck_trig_high) {