ath9k: add some rx path fixes
[oweals/openwrt.git] / package / kernel / mac80211 / patches / 300-pending_work.patch
1 commit 230ab8c1880266c9cfceac962e2d48309dea79a7
2 Author: Felix Fietkau <nbd@openwrt.org>
3 Date:   Mon May 19 21:48:56 2014 +0200
4
5     ath9k: re-schedule rx processing after budget exceeded
6     
7     Should improve rx stability under load
8     
9     Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10
11 commit 27647baeaee1b12bc3c57ccf1c7eba53bcd7fe53
12 Author: Felix Fietkau <nbd@openwrt.org>
13 Date:   Mon May 19 21:20:49 2014 +0200
14
15     ath9k: avoid passing buffers to the hardware during flush
16     
17     The commit "ath9k: fix possible hang on flush" changed the receive code
18     to always link rx descriptors of processed frames, even when flushing.
19     In some cases, this leads to flushed rx buffers being passed to the
20     hardware while rx is already stopped.
21     
22     Signed-off-by: Felix Fietkau <nbd@openwrt.org>
23
24 commit 92e9dd662542683856e62a5e7e43fcf5b9da5c4a
25 Author: Henning Rogge <hrogge@gmail.com>
26 Date:   Thu May 1 10:03:46 2014 +0200
27
28     mac80211: Fix mac80211 station info rx bitrate for IBSS mode
29     
30     Filter out incoming multicast packages before applying their bitrate
31     to the rx bitrate station info field to prevent them from setting the
32     rx bitrate to the basic multicast rate.
33     
34     Signed-off-by: Henning Rogge <hrogge@gmail.com>
35
36 commit 4c8a3486cb577d40c1ef75f0a8dc9a04773eef83
37 Author: Nickolay Ledovskikh <nledovskikh@gmail.com>
38 Date:   Fri Apr 25 22:53:34 2014 +0400
39
40     ath5k: Fix AR5K_PHY_TXPOWER_RATE_MAX register value setting.
41     
42     I was reading ath5k power setting code and
43     noticed typing error in ath5k_hw_txpower function.
44     Invalid value was written to AR5K_PHY_TXPOWER_RATE_MAX
45     register.
46     
47     Signed-off-by: Nikolay Ledovskikh <nledovskikh@gmail.com>
48     Acked-by: Nick Kossifidis <mickflemm@gmail.com>
49     Signed-off-by: John W. Linville <linville@tuxdriver.com>
50
51 commit 4d76248013dbb1948429555208900a585b0f351d
52 Author: Janusz Dziedzic <janusz.dziedzic@tieto.com>
53 Date:   Tue Apr 8 13:38:43 2014 +0200
54
55     ath9k: Enable DFS only when ATH9K_DFS_CERTIFIED
56     
57     Add DFS interface combination only when
58     CONFIG_ATH9K_DFS_CERTIFIED is set. In other case
59     user can run CAC/beaconing without proper handling
60     of pulse events (without radar detection activated).
61     
62     Reported-by: Cedric Voncken <cedric.voncken@acksys.fr>
63     Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
64     Signed-off-by: John W. Linville <linville@tuxdriver.com>
65
66 commit c83a4e5156a4b4dd22137d33a5625440982d6d37
67 Author: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
68 Date:   Mon Apr 28 21:17:08 2014 +0530
69
70     ath9k_hw: fix worse EVM for 11b rates
71     
72     Adjust FIR filter co-efficients to improve EVM for 11b rates.
73     
74     Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
75     Signed-off-by: John W. Linville <linville@tuxdriver.com>
76
77 commit 8aab2c7a2f4a957e344db429dfb1190ae59ce8b5
78 Author: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
79 Date:   Mon Apr 28 21:17:07 2014 +0530
80
81     ath9k_hw: update ar9300 initvals
82     
83      * rfsat gainchange hysteresis of rf_gain stuck with large
84        interference present.
85     
86     Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
87     Signed-off-by: John W. Linville <linville@tuxdriver.com>
88
89 commit 8c7ae357cc5b6bd037ad2d666e9f3789cf882925
90 Author: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
91 Date:   Wed Apr 23 15:07:57 2014 +0530
92
93     ath9k: fix race in setting ATH_OP_INVALID
94     
95     The commit "ath9k: move sc_flags to ath_common" moved setting
96     ATH_OP_INVALID flag below ieee80211_register_hw. This is causing
97     the flag never being cleared randomly as the drv_start is called
98     prior to setting flag. Fix this by setting the flag prior to
99     register_hw.
100     
101     Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
102     Signed-off-by: John W. Linville <linville@tuxdriver.com>
103
104 commit c82552c5b0cb1735dbcbad78b1ffc6d3c212dc56
105 Author: Tim Harvey <tharvey@gateworks.com>
106 Date:   Mon Apr 21 16:14:57 2014 -0700
107
108     ath9k: add a recv budget
109     
110     Implement a recv budget so that in cases of high traffic we still allow other
111     taskets to get processed.
112     
113     Without this, we can encounter a host of issues during high wireless traffic
114     reception depending on system load including rcu stall's detected (ARM),
115     soft lockups, failure to service critical tasks such as watchdog resets,
116     and triggering of the tx stuck tasklet.
117     
118     The same thing was proposed previously by Ben:
119      http://www.spinics.net/lists/linux-wireless/msg112891.html
120     
121     The only difference here is that I make sure only processed packets are counted
122     in the budget by checking at the end of the rx loop.
123     
124     Signed-off-by: Tim Harvey <tharvey@gateworks.com>
125     Acked-by: Felix Fietkau <nbd@openwrt.org>
126     Signed-off-by: John W. Linville <linville@tuxdriver.com>
127
128 commit 3a758134e66ca74a9df792616b5288b2fa2cfd7f
129 Author: Tim Harvey <tharvey@gateworks.com>
130 Date:   Mon Apr 21 16:14:56 2014 -0700
131
132     ath9k: fix possible hang on flush
133     
134     If a flush is requested, make sure to clear the descriptor once we've
135     processed it.
136     
137     This resolves a hang that will occur if all RX descriptors are full when a
138     flush is requested.
139     
140     Signed-off-by: Tim Harvey <tharvey@gateworks.com>
141     Acked-by: Felix Fietkau <nbd@openwrt.org>
142     Signed-off-by: John W. Linville <linville@tuxdriver.com>
143
144 commit eefb1d6adc4c60d219182b8917e4567484ce07fc
145 Author: Felix Fietkau <nbd@openwrt.org>
146 Date:   Mon Apr 28 18:27:41 2014 +0200
147
148     ath9k: remove tid->paused flag
149     
150     There are some corner cases where the driver could get stuck with a full
151     tid queue that is paused, leading to a software tx queue hang.
152     
153     Since the tx queueing rework, pausing per-tid queues on aggregation
154     session setup is no longer necessary. The driver will assign sequence
155     numbers to buffered frames when a new session is established, in order
156     to get the correct starting sequence number.
157     
158     mac80211 prevents new frames from entering the queue during setup.
159     
160     Signed-off-by: Felix Fietkau <nbd@openwrt.org>
161
162 commit 98a713933d8495f4078f561c1e651b738dd5b531
163 Author: Felix Fietkau <nbd@openwrt.org>
164 Date:   Sun Apr 27 14:49:03 2014 +0200
165
166     ath9k_hw: do not lower ANI setting below default on AR913x
167     
168     When the amount of noise fluctuates strongly, low immunity settings
169     can sometimes disrupt signal detection on AR913x chips. When that
170     happens, no OFDM/CCK errors are reported anymore, and ANI tunes the
171     radio to the lowest immunity settings.
172     Usually rx/tx fails as well in that case.
173     
174     To fix this, keep noise immunity settings at or above ANI default level,
175     which will keep radio parameters at or above INI values.
176     
177     Signed-off-by: Felix Fietkau <nbd@openwrt.org>
178
179 commit 7cbb4c021bfd1e656f5b9953a947ab3c64e4e3b0
180 Author: Felix Fietkau <nbd@openwrt.org>
181 Date:   Thu Apr 10 10:49:01 2014 +0200
182
183     mac80211: exclude AP_VLAN interfaces from tx power calculation
184     
185     Their power value is initialized to zero. This patch fixes an issue
186     where the configured power drops to the minimum value when AP_VLAN
187     interfaces are created/removed.
188     
189     Cc: stable@vger.kernel.org
190     Signed-off-by: Felix Fietkau <nbd@openwrt.org>
191
192 commit 0ca13e26341733bf9577287fb04a3bef0d2f5cc9
193 Author: Felix Fietkau <nbd@openwrt.org>
194 Date:   Wed Apr 9 00:07:01 2014 +0200
195
196     mac80211: suppress BSS info change notifications for AP_VLAN
197     
198     Fixes warnings on tx power changes
199     
200     Signed-off-by: Felix Fietkau <nbd@openwrt.org>
201
202 commit ec998e5991781ecdaad0911dc64f1c8d3749c308
203 Author: Felix Fietkau <nbd@openwrt.org>
204 Date:   Tue Apr 8 23:42:17 2014 +0200
205
206     ath9k: fix a scheduling while atomic bug in CSA handling
207     
208     Commit "ath9k: prepare for multi-interface CSA support" added a call to
209     ieee80211_iterate_active_interfaces in atomic context (beacon tasklet),
210     which is crashing.
211     Use ieee80211_iterate_active_interfaces_atomic instead.
212     
213     Signed-off-by: Felix Fietkau <nbd@openwrt.org>
214
215 commit 93f310a38a1d81a4bc8fcd9bf29628bd721cf2ef
216 Author: Felix Fietkau <nbd@openwrt.org>
217 Date:   Sun Apr 6 23:35:28 2014 +0200
218
219     ath9k_hw: reduce ANI firstep range for older chips
220     
221     Use 0-8 instead of 0-16, which is closer to the old implementation.
222     Also drop the overwrite of the firstep_low parameter to improve
223     stability.
224     
225     Signed-off-by: Felix Fietkau <nbd@openwrt.org>
226
227
228 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
229 +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
230 @@ -1004,11 +1004,9 @@ static bool ar5008_hw_ani_control_new(st
231         case ATH9K_ANI_FIRSTEP_LEVEL:{
232                 u32 level = param;
233  
234 -               value = level * 2;
235 +               value = level;
236                 REG_RMW_FIELD(ah, AR_PHY_FIND_SIG,
237                               AR_PHY_FIND_SIG_FIRSTEP, value);
238 -               REG_RMW_FIELD(ah, AR_PHY_FIND_SIG_LOW,
239 -                             AR_PHY_FIND_SIG_FIRSTEP_LOW, value);
240  
241                 if (level != aniState->firstepLevel) {
242                         ath_dbg(common, ANI,
243 --- a/drivers/net/wireless/ath/ath9k/beacon.c
244 +++ b/drivers/net/wireless/ath/ath9k/beacon.c
245 @@ -312,10 +312,9 @@ static void ath9k_csa_update_vif(void *d
246  
247  void ath9k_csa_update(struct ath_softc *sc)
248  {
249 -       ieee80211_iterate_active_interfaces(sc->hw,
250 -                                           IEEE80211_IFACE_ITER_NORMAL,
251 -                                           ath9k_csa_update_vif,
252 -                                           sc);
253 +       ieee80211_iterate_active_interfaces_atomic(sc->hw,
254 +                                                  IEEE80211_IFACE_ITER_NORMAL,
255 +                                                  ath9k_csa_update_vif, sc);
256  }
257  
258  void ath9k_beacon_tasklet(unsigned long data)
259 --- a/net/mac80211/main.c
260 +++ b/net/mac80211/main.c
261 @@ -152,6 +152,8 @@ static u32 ieee80211_hw_conf_chan(struct
262         list_for_each_entry_rcu(sdata, &local->interfaces, list) {
263                 if (!rcu_access_pointer(sdata->vif.chanctx_conf))
264                         continue;
265 +               if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
266 +                       continue;
267                 power = min(power, sdata->vif.bss_conf.txpower);
268         }
269         rcu_read_unlock();
270 @@ -203,7 +205,7 @@ void ieee80211_bss_info_change_notify(st
271  {
272         struct ieee80211_local *local = sdata->local;
273  
274 -       if (!changed)
275 +       if (!changed || sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
276                 return;
277  
278         drv_bss_info_changed(local, sdata, &sdata->vif.bss_conf, changed);
279 --- a/drivers/net/wireless/ath/ath9k/ani.c
280 +++ b/drivers/net/wireless/ath/ath9k/ani.c
281 @@ -155,6 +155,9 @@ static void ath9k_hw_set_ofdm_nil(struct
282                 ATH9K_ANI_RSSI_THR_LOW,
283                 ATH9K_ANI_RSSI_THR_HIGH);
284  
285 +       if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_OFDM_DEF_LEVEL)
286 +               immunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL;
287 +
288         if (!scan)
289                 aniState->ofdmNoiseImmunityLevel = immunityLevel;
290  
291 @@ -235,6 +238,9 @@ static void ath9k_hw_set_cck_nil(struct 
292                 BEACON_RSSI(ah), ATH9K_ANI_RSSI_THR_LOW,
293                 ATH9K_ANI_RSSI_THR_HIGH);
294  
295 +       if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_CCK_DEF_LEVEL)
296 +               immunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
297 +
298         if (ah->opmode == NL80211_IFTYPE_STATION &&
299             BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_LOW &&
300             immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI)
301 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
302 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
303 @@ -251,7 +251,6 @@ struct ath_atx_tid {
304  
305         s8 bar_index;
306         bool sched;
307 -       bool paused;
308         bool active;
309  };
310  
311 --- a/drivers/net/wireless/ath/ath9k/xmit.c
312 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
313 @@ -107,9 +107,6 @@ static void ath_tx_queue_tid(struct ath_
314  {
315         struct ath_atx_ac *ac = tid->ac;
316  
317 -       if (tid->paused)
318 -               return;
319 -
320         if (tid->sched)
321                 return;
322  
323 @@ -1407,7 +1404,6 @@ int ath_tx_aggr_start(struct ath_softc *
324         ath_tx_tid_change_state(sc, txtid);
325  
326         txtid->active = true;
327 -       txtid->paused = true;
328         *ssn = txtid->seq_start = txtid->seq_next;
329         txtid->bar_index = -1;
330  
331 @@ -1427,7 +1423,6 @@ void ath_tx_aggr_stop(struct ath_softc *
332  
333         ath_txq_lock(sc, txq);
334         txtid->active = false;
335 -       txtid->paused = false;
336         ath_tx_flush_tid(sc, txtid);
337         ath_tx_tid_change_state(sc, txtid);
338         ath_txq_unlock_complete(sc, txq);
339 @@ -1487,7 +1482,7 @@ void ath_tx_aggr_wakeup(struct ath_softc
340                 ath_txq_lock(sc, txq);
341                 ac->clear_ps_filter = true;
342  
343 -               if (!tid->paused && ath_tid_has_buffered(tid)) {
344 +               if (ath_tid_has_buffered(tid)) {
345                         ath_tx_queue_tid(txq, tid);
346                         ath_txq_schedule(sc, txq);
347                 }
348 @@ -1510,7 +1505,6 @@ void ath_tx_aggr_resume(struct ath_softc
349         ath_txq_lock(sc, txq);
350  
351         tid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor;
352 -       tid->paused = false;
353  
354         if (ath_tid_has_buffered(tid)) {
355                 ath_tx_queue_tid(txq, tid);
356 @@ -1544,8 +1538,6 @@ void ath9k_release_buffered_frames(struc
357                         continue;
358  
359                 tid = ATH_AN_2_TID(an, i);
360 -               if (tid->paused)
361 -                       continue;
362  
363                 ath_txq_lock(sc, tid->ac->txq);
364                 while (nframes > 0) {
365 @@ -1844,9 +1836,6 @@ void ath_txq_schedule(struct ath_softc *
366                         list_del(&tid->list);
367                         tid->sched = false;
368  
369 -                       if (tid->paused)
370 -                               continue;
371 -
372                         if (ath_tx_sched_aggr(sc, txq, tid, &stop))
373                                 sent = true;
374  
375 @@ -2698,7 +2687,6 @@ void ath_tx_node_init(struct ath_softc *
376                 tid->baw_size  = WME_MAX_BA;
377                 tid->baw_head  = tid->baw_tail = 0;
378                 tid->sched     = false;
379 -               tid->paused    = false;
380                 tid->active        = false;
381                 __skb_queue_head_init(&tid->buf_q);
382                 __skb_queue_head_init(&tid->retry_q);
383 --- a/drivers/net/wireless/ath/ath9k/recv.c
384 +++ b/drivers/net/wireless/ath/ath9k/recv.c
385 @@ -34,7 +34,8 @@ static inline bool ath9k_check_auto_slee
386   * buffer (or rx fifo). This can incorrectly acknowledge packets
387   * to a sender if last desc is self-linked.
388   */
389 -static void ath_rx_buf_link(struct ath_softc *sc, struct ath_rxbuf *bf)
390 +static void ath_rx_buf_link(struct ath_softc *sc, struct ath_rxbuf *bf,
391 +                           bool flush)
392  {
393         struct ath_hw *ah = sc->sc_ah;
394         struct ath_common *common = ath9k_hw_common(ah);
395 @@ -59,18 +60,19 @@ static void ath_rx_buf_link(struct ath_s
396                              common->rx_bufsize,
397                              0);
398  
399 -       if (sc->rx.rxlink == NULL)
400 -               ath9k_hw_putrxbuf(ah, bf->bf_daddr);
401 -       else
402 +       if (sc->rx.rxlink)
403                 *sc->rx.rxlink = bf->bf_daddr;
404 +       else if (!flush)
405 +               ath9k_hw_putrxbuf(ah, bf->bf_daddr);
406  
407         sc->rx.rxlink = &ds->ds_link;
408  }
409  
410 -static void ath_rx_buf_relink(struct ath_softc *sc, struct ath_rxbuf *bf)
411 +static void ath_rx_buf_relink(struct ath_softc *sc, struct ath_rxbuf *bf,
412 +                             bool flush)
413  {
414         if (sc->rx.buf_hold)
415 -               ath_rx_buf_link(sc, sc->rx.buf_hold);
416 +               ath_rx_buf_link(sc, sc->rx.buf_hold, flush);
417  
418         sc->rx.buf_hold = bf;
419  }
420 @@ -106,7 +108,7 @@ static void ath_opmode_init(struct ath_s
421  }
422  
423  static bool ath_rx_edma_buf_link(struct ath_softc *sc,
424 -                                enum ath9k_rx_qtype qtype)
425 +                                enum ath9k_rx_qtype qtype, bool flush)
426  {
427         struct ath_hw *ah = sc->sc_ah;
428         struct ath_rx_edma *rx_edma;
429 @@ -127,7 +129,8 @@ static bool ath_rx_edma_buf_link(struct 
430                                 ah->caps.rx_status_len, DMA_TO_DEVICE);
431  
432         SKB_CB_ATHBUF(skb) = bf;
433 -       ath9k_hw_addrxbuf_edma(ah, bf->bf_buf_addr, qtype);
434 +       if (!flush)
435 +               ath9k_hw_addrxbuf_edma(ah, bf->bf_buf_addr, qtype);
436         __skb_queue_tail(&rx_edma->rx_fifo, skb);
437  
438         return true;
439 @@ -145,7 +148,7 @@ static void ath_rx_addbuffer_edma(struct
440         }
441  
442         list_for_each_entry_safe(bf, tbf, &sc->rx.rxbuf, list)
443 -               if (!ath_rx_edma_buf_link(sc, qtype))
444 +               if (!ath_rx_edma_buf_link(sc, qtype, false))
445                         break;
446  
447  }
448 @@ -442,7 +445,7 @@ int ath_startrecv(struct ath_softc *sc)
449         sc->rx.buf_hold = NULL;
450         sc->rx.rxlink = NULL;
451         list_for_each_entry_safe(bf, tbf, &sc->rx.rxbuf, list) {
452 -               ath_rx_buf_link(sc, bf);
453 +               ath_rx_buf_link(sc, bf, false);
454         }
455  
456         /* We could have deleted elements so the list may be empty now */
457 @@ -636,7 +639,7 @@ static bool ath_edma_get_buffers(struct 
458         if (ret == -EINVAL) {
459                 /* corrupt descriptor, skip this one and the following one */
460                 list_add_tail(&bf->list, &sc->rx.rxbuf);
461 -               ath_rx_edma_buf_link(sc, qtype);
462 +               ath_rx_edma_buf_link(sc, qtype, false);
463  
464                 skb = skb_peek(&rx_edma->rx_fifo);
465                 if (skb) {
466 @@ -645,7 +648,7 @@ static bool ath_edma_get_buffers(struct 
467  
468                         __skb_unlink(skb, &rx_edma->rx_fifo);
469                         list_add_tail(&bf->list, &sc->rx.rxbuf);
470 -                       ath_rx_edma_buf_link(sc, qtype);
471 +                       ath_rx_edma_buf_link(sc, qtype, false);
472                 }
473  
474                 bf = NULL;
475 @@ -975,6 +978,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
476         u64 tsf = 0;
477         unsigned long flags;
478         dma_addr_t new_buf_addr;
479 +       unsigned int budget = 512;
480  
481         if (edma)
482                 dma_type = DMA_BIDIRECTIONAL;
483 @@ -1113,15 +1117,17 @@ requeue_drop_frag:
484                 }
485  requeue:
486                 list_add_tail(&bf->list, &sc->rx.rxbuf);
487 -               if (flush)
488 -                       continue;
489  
490                 if (edma) {
491 -                       ath_rx_edma_buf_link(sc, qtype);
492 +                       ath_rx_edma_buf_link(sc, qtype, flush);
493                 } else {
494 -                       ath_rx_buf_relink(sc, bf);
495 -                       ath9k_hw_rxena(ah);
496 +                       ath_rx_buf_relink(sc, bf, flush);
497 +                       if (!flush)
498 +                               ath9k_hw_rxena(ah);
499                 }
500 +
501 +               if (!budget--)
502 +                       break;
503         } while (1);
504  
505         if (!(ah->imask & ATH9K_INT_RXEOL)) {
506 @@ -1129,5 +1135,5 @@ requeue:
507                 ath9k_hw_set_interrupts(ah);
508         }
509  
510 -       return 0;
511 +       return !budget;
512  }
513 --- a/drivers/net/wireless/ath/ath9k/ahb.c
514 +++ b/drivers/net/wireless/ath/ath9k/ahb.c
515 @@ -86,7 +86,6 @@ static int ath_ahb_probe(struct platform
516         int irq;
517         int ret = 0;
518         struct ath_hw *ah;
519 -       struct ath_common *common;
520         char hw_name[64];
521  
522         if (!dev_get_platdata(&pdev->dev)) {
523 @@ -146,9 +145,6 @@ static int ath_ahb_probe(struct platform
524         wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n",
525                    hw_name, (unsigned long)mem, irq);
526  
527 -       common = ath9k_hw_common(sc->sc_ah);
528 -       /* Will be cleared in ath9k_start() */
529 -       set_bit(ATH_OP_INVALID, &common->op_flags);
530         return 0;
531  
532   err_irq:
533 --- a/drivers/net/wireless/ath/ath9k/init.c
534 +++ b/drivers/net/wireless/ath/ath9k/init.c
535 @@ -670,6 +670,7 @@ static const struct ieee80211_iface_comb
536                 .num_different_channels = 1,
537                 .beacon_int_infra_match = true,
538         },
539 +#ifdef CONFIG_ATH9K_DFS_CERTIFIED
540         {
541                 .limits = if_dfs_limits,
542                 .n_limits = ARRAY_SIZE(if_dfs_limits),
543 @@ -679,6 +680,7 @@ static const struct ieee80211_iface_comb
544                 .radar_detect_widths =  BIT(NL80211_CHAN_WIDTH_20_NOHT) |
545                                         BIT(NL80211_CHAN_WIDTH_20),
546         }
547 +#endif
548  };
549  
550  static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
551 @@ -781,6 +783,9 @@ int ath9k_init_device(u16 devid, struct 
552         common = ath9k_hw_common(ah);
553         ath9k_set_hw_capab(sc, hw);
554  
555 +       /* Will be cleared in ath9k_start() */
556 +       set_bit(ATH_OP_INVALID, &common->op_flags);
557 +
558         /* Initialize regulatory */
559         error = ath_regd_init(&common->regulatory, sc->hw->wiphy,
560                               ath9k_reg_notifier);
561 --- a/drivers/net/wireless/ath/ath9k/pci.c
562 +++ b/drivers/net/wireless/ath/ath9k/pci.c
563 @@ -784,7 +784,6 @@ static int ath_pci_probe(struct pci_dev 
564  {
565         struct ath_softc *sc;
566         struct ieee80211_hw *hw;
567 -       struct ath_common *common;
568         u8 csz;
569         u32 val;
570         int ret = 0;
571 @@ -877,10 +876,6 @@ static int ath_pci_probe(struct pci_dev 
572         wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n",
573                    hw_name, (unsigned long)sc->mem, pdev->irq);
574  
575 -       /* Will be cleared in ath9k_start() */
576 -       common = ath9k_hw_common(sc->sc_ah);
577 -       set_bit(ATH_OP_INVALID, &common->op_flags);
578 -
579         return 0;
580  
581  err_init:
582 --- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
583 +++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
584 @@ -410,7 +410,7 @@ static const u32 ar9300_2p2_baseband_cor
585         {0x00009e30, 0x06336f77},
586         {0x00009e34, 0x6af6532f},
587         {0x00009e38, 0x0cc80c00},
588 -       {0x00009e40, 0x0d261820},
589 +       {0x00009e40, 0x0d261800},
590         {0x00009e4c, 0x00001004},
591         {0x00009e50, 0x00ff03f1},
592         {0x00009e54, 0x00000000},
593 --- a/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
594 +++ b/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
595 @@ -592,7 +592,7 @@ static const u32 ar9331_1p1_baseband_cor
596         {0x00009e30, 0x06336f77},
597         {0x00009e34, 0x6af6532f},
598         {0x00009e38, 0x0cc80c00},
599 -       {0x00009e40, 0x0d261820},
600 +       {0x00009e40, 0x0d261800},
601         {0x00009e4c, 0x00001004},
602         {0x00009e50, 0x00ff03f1},
603         {0x00009fc0, 0x803e4788},
604 --- a/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
605 +++ b/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
606 @@ -231,7 +231,7 @@ static const u32 ar9331_1p2_baseband_cor
607         {0x00009e30, 0x06336f77},
608         {0x00009e34, 0x6af6532f},
609         {0x00009e38, 0x0cc80c00},
610 -       {0x00009e40, 0x0d261820},
611 +       {0x00009e40, 0x0d261800},
612         {0x00009e4c, 0x00001004},
613         {0x00009e50, 0x00ff03f1},
614         {0x00009fc0, 0x803e4788},
615 --- a/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
616 +++ b/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
617 @@ -318,7 +318,7 @@ static const u32 ar9340_1p0_baseband_cor
618         {0x00009e30, 0x06336f77},
619         {0x00009e34, 0x6af6532f},
620         {0x00009e38, 0x0cc80c00},
621 -       {0x00009e40, 0x0d261820},
622 +       {0x00009e40, 0x0d261800},
623         {0x00009e4c, 0x00001004},
624         {0x00009e50, 0x00ff03f1},
625         {0x00009e54, 0x00000000},
626 @@ -348,9 +348,9 @@ static const u32 ar9340_1p0_baseband_cor
627         {0x0000a370, 0x00000000},
628         {0x0000a390, 0x00000001},
629         {0x0000a394, 0x00000444},
630 -       {0x0000a398, 0x00000000},
631 -       {0x0000a39c, 0x210d0401},
632 -       {0x0000a3a0, 0xab9a7144},
633 +       {0x0000a398, 0x001f0e0f},
634 +       {0x0000a39c, 0x0075393f},
635 +       {0x0000a3a0, 0xb79f6427},
636         {0x0000a3a4, 0x00000000},
637         {0x0000a3a8, 0xaaaaaaaa},
638         {0x0000a3ac, 0x3c466478},
639 --- a/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
640 +++ b/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
641 @@ -90,7 +90,7 @@ static const u32 ar9580_1p0_baseband_cor
642         {0x00009e30, 0x06336f77},
643         {0x00009e34, 0x6af6532f},
644         {0x00009e38, 0x0cc80c00},
645 -       {0x00009e40, 0x0d261820},
646 +       {0x00009e40, 0x0d261800},
647         {0x00009e4c, 0x00001004},
648         {0x00009e50, 0x00ff03f1},
649         {0x00009e54, 0x00000000},
650 --- a/drivers/net/wireless/ath/ath9k/ar953x_initvals.h
651 +++ b/drivers/net/wireless/ath/ath9k/ar953x_initvals.h
652 @@ -257,9 +257,9 @@ static const u32 qca953x_1p0_baseband_co
653         {0x0000a370, 0x00000000},
654         {0x0000a390, 0x00000001},
655         {0x0000a394, 0x00000444},
656 -       {0x0000a398, 0x1f020503},
657 -       {0x0000a39c, 0x29180c03},
658 -       {0x0000a3a0, 0x9a8b6844},
659 +       {0x0000a398, 0x001f0e0f},
660 +       {0x0000a39c, 0x0075393f},
661 +       {0x0000a3a0, 0xb79f6427},
662         {0x0000a3a4, 0x000000ff},
663         {0x0000a3a8, 0x6a6a6a6a},
664         {0x0000a3ac, 0x6a6a6a6a},
665 --- a/drivers/net/wireless/ath/ath5k/phy.c
666 +++ b/drivers/net/wireless/ath/ath5k/phy.c
667 @@ -3709,8 +3709,8 @@ ath5k_hw_txpower(struct ath5k_hw *ah, st
668                         AR5K_REG_MS(AR5K_TUNE_MAX_TXPOWER, AR5K_TPC_CHIRP),
669                         AR5K_TPC);
670         } else {
671 -               ath5k_hw_reg_write(ah, AR5K_PHY_TXPOWER_RATE_MAX |
672 -                       AR5K_TUNE_MAX_TXPOWER, AR5K_PHY_TXPOWER_RATE_MAX);
673 +               ath5k_hw_reg_write(ah, AR5K_TUNE_MAX_TXPOWER,
674 +                       AR5K_PHY_TXPOWER_RATE_MAX);
675         }
676  
677         return 0;
678 --- a/net/mac80211/rx.c
679 +++ b/net/mac80211/rx.c
680 @@ -1231,7 +1231,8 @@ ieee80211_rx_h_sta_process(struct ieee80
681                 if (ether_addr_equal(bssid, rx->sdata->u.ibss.bssid) &&
682                     test_sta_flag(sta, WLAN_STA_AUTHORIZED)) {
683                         sta->last_rx = jiffies;
684 -                       if (ieee80211_is_data(hdr->frame_control)) {
685 +                       if (ieee80211_is_data(hdr->frame_control) &&
686 +                           !is_multicast_ether_addr(hdr->addr1)) {
687                                 sta->last_rx_rate_idx = status->rate_idx;
688                                 sta->last_rx_rate_flag = status->flag;
689                                 sta->last_rx_rate_vht_flag = status->vht_flag;
690 --- a/drivers/net/wireless/ath/ath9k/main.c
691 +++ b/drivers/net/wireless/ath/ath9k/main.c
692 @@ -442,6 +442,8 @@ void ath9k_tasklet(unsigned long data)
693         ath9k_ps_wakeup(sc);
694         spin_lock(&sc->sc_pcu_lock);
695  
696 +       sc->intrstatus = 0;
697 +
698         if (status & ATH9K_INT_FATAL) {
699                 type = RESET_TYPE_FATAL_INT;
700                 ath9k_queue_reset(sc, type);
701 @@ -510,10 +512,12 @@ void ath9k_tasklet(unsigned long data)
702         if (status & rxmask) {
703                 /* Check for high priority Rx first */
704                 if ((ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) &&
705 -                   (status & ATH9K_INT_RXHP))
706 -                       ath_rx_tasklet(sc, 0, true);
707 +                   (status & ATH9K_INT_RXHP) &&
708 +                   ath_rx_tasklet(sc, 0, true))
709 +                       sc->intrstatus |= ATH9K_INT_RXHP;
710  
711 -               ath_rx_tasklet(sc, 0, false);
712 +               if (ath_rx_tasklet(sc, 0, false))
713 +                       sc->intrstatus |= ATH9K_INT_RXLP;
714         }
715  
716         if (status & ATH9K_INT_TX) {
717 @@ -541,6 +545,9 @@ void ath9k_tasklet(unsigned long data)
718  
719         /* re-enable hardware interrupt */
720         ath9k_hw_enable_interrupts(ah);
721 +       if (sc->intrstatus)
722 +               tasklet_schedule(&sc->intr_tq);
723 +
724  out:
725         spin_unlock(&sc->sc_pcu_lock);
726         ath9k_ps_restore(sc);
727 @@ -607,7 +614,7 @@ irqreturn_t ath_isr(int irq, void *dev)
728                 return IRQ_NONE;
729  
730         /* Cache the status */
731 -       sc->intrstatus = status;
732 +       sc->intrstatus |= status;
733  
734         if (status & SCHED_INTR)
735                 sched = true;