Lines Matching refs:tid

16 mt76_aggr_release(struct mt76_rx_tid *tid, struct sk_buff_head *frames, int idx)
20 tid->head = ieee80211_sn_inc(tid->head);
22 skb = tid->reorder_buf[idx];
26 tid->reorder_buf[idx] = NULL;
27 tid->nframes--;
32 mt76_rx_aggr_release_frames(struct mt76_rx_tid *tid,
38 while (ieee80211_sn_less(tid->head, head)) {
39 idx = tid->head % tid->size;
40 mt76_aggr_release(tid, frames, idx);
45 mt76_rx_aggr_release_head(struct mt76_rx_tid *tid, struct sk_buff_head *frames)
47 int idx = tid->head % tid->size;
49 while (tid->reorder_buf[idx]) {
50 mt76_aggr_release(tid, frames, idx);
51 idx = tid->head % tid->size;
56 mt76_rx_aggr_check_release(struct mt76_rx_tid *tid, struct sk_buff_head *frames)
62 if (!tid->nframes)
65 mt76_rx_aggr_release_head(tid, frames);
67 start = tid->head % tid->size;
68 nframes = tid->nframes;
70 for (idx = (tid->head + 1) % tid->size;
72 idx = (idx + 1) % tid->size) {
73 skb = tid->reorder_buf[idx];
81 mt76_aggr_tid_to_timeo(tid->num)))
84 mt76_rx_aggr_release_frames(tid, frames, status->seqno);
87 mt76_rx_aggr_release_head(tid, frames);
93 struct mt76_rx_tid *tid = container_of(work, struct mt76_rx_tid,
95 struct mt76_dev *dev = tid->dev;
104 spin_lock(&tid->lock);
105 mt76_rx_aggr_check_release(tid, &frames);
106 nframes = tid->nframes;
107 spin_unlock(&tid->lock);
110 ieee80211_queue_delayed_work(tid->dev->hw, &tid->reorder_work,
111 mt76_aggr_tid_to_timeo(tid->num));
124 struct mt76_rx_tid *tid;
133 status->tid = le16_to_cpu(bar->control) >> 12;
135 tid = rcu_dereference(wcid->aggr[status->tid]);
136 if (!tid)
139 spin_lock_bh(&tid->lock);
140 if (!tid->stopped) {
141 mt76_rx_aggr_release_frames(tid, frames, seqno);
142 mt76_rx_aggr_release_head(tid, frames);
144 spin_unlock_bh(&tid->lock);
153 struct mt76_rx_tid *tid;
175 tid = rcu_dereference(wcid->aggr[status->tid]);
176 if (!tid)
180 spin_lock_bh(&tid->lock);
182 if (tid->stopped)
185 head = tid->head;
187 size = tid->size;
190 if (!tid->started) {
194 tid->started = true;
204 tid->head = ieee80211_sn_inc(head);
205 if (tid->nframes)
206 mt76_rx_aggr_release_head(tid, frames);
218 mt76_rx_aggr_release_frames(tid, frames, head);
224 if (tid->reorder_buf[idx]) {
230 tid->reorder_buf[idx] = skb;
231 tid->nframes++;
232 mt76_rx_aggr_release_head(tid, frames);
234 ieee80211_queue_delayed_work(tid->dev->hw, &tid->reorder_work,
235 mt76_aggr_tid_to_timeo(tid->num));
238 spin_unlock_bh(&tid->lock);
244 struct mt76_rx_tid *tid;
248 tid = kzalloc(struct_size(tid, reorder_buf, size), GFP_KERNEL);
249 if (!tid)
252 tid->dev = dev;
253 tid->head = ssn;
254 tid->size = size;
255 tid->num = tidno;
256 INIT_DELAYED_WORK(&tid->reorder_work, mt76_rx_aggr_reorder_work);
257 spin_lock_init(&tid->lock);
259 rcu_assign_pointer(wcid->aggr[tidno], tid);
265 static void mt76_rx_aggr_shutdown(struct mt76_dev *dev, struct mt76_rx_tid *tid)
267 u16 size = tid->size;
270 spin_lock_bh(&tid->lock);
272 tid->stopped = true;
273 for (i = 0; tid->nframes && i < size; i++) {
274 struct sk_buff *skb = tid->reorder_buf[i];
279 tid->reorder_buf[i] = NULL;
280 tid->nframes--;
284 spin_unlock_bh(&tid->lock);
286 cancel_delayed_work_sync(&tid->reorder_work);
291 struct mt76_rx_tid *tid = NULL;
293 tid = rcu_replace_pointer(wcid->aggr[tidno], tid,
295 if (tid) {
296 mt76_rx_aggr_shutdown(dev, tid);
297 kfree_rcu(tid, rcu_head);