mac80211: do not add debugfs_create_devm_seqfile() on recent kernel versions
[openwrt.git] / package / kernel / mac80211 / patches / 305-ath9k-remove-the-sched-field-in-struct-ath_atx_tid.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Sat, 4 Apr 2015 18:42:33 +0200
3 Subject: [PATCH] ath9k: remove the sched field in struct ath_atx_tid
4
5 Use list_empty(&tid->list) instead
6
7 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
8 ---
9
10 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
11 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
12 @@ -245,7 +245,6 @@ struct ath_atx_tid {
13         int baw_tail;   /* next unused tx buffer slot */
14  
15         s8 bar_index;
16 -       bool sched;
17         bool active;
18         bool clear_ps_filter;
19  };
20 --- a/drivers/net/wireless/ath/ath9k/xmit.c
21 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
22 @@ -113,12 +113,9 @@ static void ath_tx_queue_tid(struct ath_
23         if (!ctx)
24                 return;
25  
26 -       if (tid->sched)
27 -               return;
28 -
29 -       tid->sched = true;
30         list = &ctx->acq[TID_TO_WME_AC(tid->tidno)];
31 -       list_add_tail(&tid->list, list);
32 +       if (list_empty(&tid->list))
33 +               list_add_tail(&tid->list, list);
34  }
35  
36  static struct ath_frame_info *get_frame_info(struct sk_buff *skb)
37 @@ -1556,15 +1553,14 @@ void ath_tx_aggr_sleep(struct ieee80211_
38  
39                 ath_txq_lock(sc, txq);
40  
41 -               if (!tid->sched) {
42 +               if (list_empty(&tid->list)) {
43                         ath_txq_unlock(sc, txq);
44                         continue;
45                 }
46  
47                 buffered = ath_tid_has_buffered(tid);
48  
49 -               tid->sched = false;
50 -               list_del(&tid->list);
51 +               list_del_init(&tid->list);
52  
53                 ath_txq_unlock(sc, txq);
54  
55 @@ -1944,8 +1940,7 @@ void ath_txq_schedule(struct ath_softc *
56                         break;
57  
58                 tid = list_first_entry(tid_list, struct ath_atx_tid, list);
59 -               list_del(&tid->list);
60 -               tid->sched = false;
61 +               list_del_init(&tid->list);
62  
63                 if (ath_tx_sched_aggr(sc, txq, tid, &stop))
64                         sent = true;
65 @@ -2863,11 +2858,11 @@ void ath_tx_node_init(struct ath_softc *
66                 tid->seq_start = tid->seq_next = 0;
67                 tid->baw_size  = WME_MAX_BA;
68                 tid->baw_head  = tid->baw_tail = 0;
69 -               tid->sched     = false;
70                 tid->active        = false;
71                 tid->clear_ps_filter = true;
72                 __skb_queue_head_init(&tid->buf_q);
73                 __skb_queue_head_init(&tid->retry_q);
74 +               INIT_LIST_HEAD(&tid->list);
75                 acno = TID_TO_WME_AC(tidno);
76                 tid->txq = sc->tx.txq_map[acno];
77         }
78 @@ -2886,10 +2881,8 @@ void ath_tx_node_cleanup(struct ath_soft
79  
80                 ath_txq_lock(sc, txq);
81  
82 -               if (tid->sched) {
83 -                       list_del(&tid->list);
84 -                       tid->sched = false;
85 -               }
86 +               if (!list_empty(&tid->list))
87 +                       list_del_init(&tid->list);
88  
89                 ath_tid_drain(sc, txq, tid);
90                 tid->active = false;