ath9k: add ANI fix for ar913x to improve stability
[openwrt/staging/rmilecki.git] / package / kernel / mac80211 / patches / 300-pending_work.patch
1 commit 98a713933d8495f4078f561c1e651b738dd5b531
2 Author: Felix Fietkau <nbd@openwrt.org>
3 Date: Sun Apr 27 14:49:03 2014 +0200
4
5 ath9k_hw: do not lower ANI setting below default on AR913x
6
7 When the amount of noise fluctuates strongly, low immunity settings
8 can sometimes disrupt signal detection on AR913x chips. When that
9 happens, no OFDM/CCK errors are reported anymore, and ANI tunes the
10 radio to the lowest immunity settings.
11 Usually rx/tx fails as well in that case.
12
13 To fix this, keep noise immunity settings at or above ANI default level,
14 which will keep radio parameters at or above INI values.
15
16 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
17
18 commit 7cbb4c021bfd1e656f5b9953a947ab3c64e4e3b0
19 Author: Felix Fietkau <nbd@openwrt.org>
20 Date: Thu Apr 10 10:49:01 2014 +0200
21
22 mac80211: exclude AP_VLAN interfaces from tx power calculation
23
24 Their power value is initialized to zero. This patch fixes an issue
25 where the configured power drops to the minimum value when AP_VLAN
26 interfaces are created/removed.
27
28 Cc: stable@vger.kernel.org
29 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
30
31 commit 0ca13e26341733bf9577287fb04a3bef0d2f5cc9
32 Author: Felix Fietkau <nbd@openwrt.org>
33 Date: Wed Apr 9 00:07:01 2014 +0200
34
35 mac80211: suppress BSS info change notifications for AP_VLAN
36
37 Fixes warnings on tx power changes
38
39 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
40
41 commit ec998e5991781ecdaad0911dc64f1c8d3749c308
42 Author: Felix Fietkau <nbd@openwrt.org>
43 Date: Tue Apr 8 23:42:17 2014 +0200
44
45 ath9k: fix a scheduling while atomic bug in CSA handling
46
47 Commit "ath9k: prepare for multi-interface CSA support" added a call to
48 ieee80211_iterate_active_interfaces in atomic context (beacon tasklet),
49 which is crashing.
50 Use ieee80211_iterate_active_interfaces_atomic instead.
51
52 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
53
54 commit 93f310a38a1d81a4bc8fcd9bf29628bd721cf2ef
55 Author: Felix Fietkau <nbd@openwrt.org>
56 Date: Sun Apr 6 23:35:28 2014 +0200
57
58 ath9k_hw: reduce ANI firstep range for older chips
59
60 Use 0-8 instead of 0-16, which is closer to the old implementation.
61 Also drop the overwrite of the firstep_low parameter to improve
62 stability.
63
64 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
65
66
67 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
68 +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
69 @@ -1004,11 +1004,9 @@ static bool ar5008_hw_ani_control_new(st
70 case ATH9K_ANI_FIRSTEP_LEVEL:{
71 u32 level = param;
72
73 - value = level * 2;
74 + value = level;
75 REG_RMW_FIELD(ah, AR_PHY_FIND_SIG,
76 AR_PHY_FIND_SIG_FIRSTEP, value);
77 - REG_RMW_FIELD(ah, AR_PHY_FIND_SIG_LOW,
78 - AR_PHY_FIND_SIG_FIRSTEP_LOW, value);
79
80 if (level != aniState->firstepLevel) {
81 ath_dbg(common, ANI,
82 --- a/drivers/net/wireless/ath/ath9k/beacon.c
83 +++ b/drivers/net/wireless/ath/ath9k/beacon.c
84 @@ -312,10 +312,9 @@ static void ath9k_csa_update_vif(void *d
85
86 void ath9k_csa_update(struct ath_softc *sc)
87 {
88 - ieee80211_iterate_active_interfaces(sc->hw,
89 - IEEE80211_IFACE_ITER_NORMAL,
90 - ath9k_csa_update_vif,
91 - sc);
92 + ieee80211_iterate_active_interfaces_atomic(sc->hw,
93 + IEEE80211_IFACE_ITER_NORMAL,
94 + ath9k_csa_update_vif, sc);
95 }
96
97 void ath9k_beacon_tasklet(unsigned long data)
98 --- a/net/mac80211/main.c
99 +++ b/net/mac80211/main.c
100 @@ -152,6 +152,8 @@ static u32 ieee80211_hw_conf_chan(struct
101 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
102 if (!rcu_access_pointer(sdata->vif.chanctx_conf))
103 continue;
104 + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
105 + continue;
106 power = min(power, sdata->vif.bss_conf.txpower);
107 }
108 rcu_read_unlock();
109 @@ -203,7 +205,7 @@ void ieee80211_bss_info_change_notify(st
110 {
111 struct ieee80211_local *local = sdata->local;
112
113 - if (!changed)
114 + if (!changed || sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
115 return;
116
117 drv_bss_info_changed(local, sdata, &sdata->vif.bss_conf, changed);
118 --- a/drivers/net/wireless/ath/ath9k/ani.c
119 +++ b/drivers/net/wireless/ath/ath9k/ani.c
120 @@ -155,6 +155,9 @@ static void ath9k_hw_set_ofdm_nil(struct
121 ATH9K_ANI_RSSI_THR_LOW,
122 ATH9K_ANI_RSSI_THR_HIGH);
123
124 + if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_OFDM_DEF_LEVEL)
125 + immunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL;
126 +
127 if (!scan)
128 aniState->ofdmNoiseImmunityLevel = immunityLevel;
129
130 @@ -235,6 +238,9 @@ static void ath9k_hw_set_cck_nil(struct
131 BEACON_RSSI(ah), ATH9K_ANI_RSSI_THR_LOW,
132 ATH9K_ANI_RSSI_THR_HIGH);
133
134 + if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_CCK_DEF_LEVEL)
135 + immunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
136 +
137 if (ah->opmode == NL80211_IFTYPE_STATION &&
138 BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_LOW &&
139 immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI)