Lines Matching +full:lock +full:- +full:status

1 // SPDX-License-Identifier: ISC
10 * no special handling is needed. AC_BE/AC_BK use tids 0-3. Just check in mt76_aggr_tid_to_timeo()
20 tid->head = ieee80211_sn_inc(tid->head); in mt76_aggr_release()
22 skb = tid->reorder_buf[idx]; in mt76_aggr_release()
26 tid->reorder_buf[idx] = NULL; in mt76_aggr_release()
27 tid->nframes--; in mt76_aggr_release()
38 while (ieee80211_sn_less(tid->head, head)) { in mt76_rx_aggr_release_frames()
39 idx = tid->head % tid->size; in mt76_rx_aggr_release_frames()
47 int idx = tid->head % tid->size; in mt76_rx_aggr_release_head()
49 while (tid->reorder_buf[idx]) { in mt76_rx_aggr_release_head()
51 idx = tid->head % tid->size; in mt76_rx_aggr_release_head()
58 struct mt76_rx_status *status; in mt76_rx_aggr_check_release() local
62 if (!tid->nframes) in mt76_rx_aggr_check_release()
67 start = tid->head % tid->size; in mt76_rx_aggr_check_release()
68 nframes = tid->nframes; in mt76_rx_aggr_check_release()
70 for (idx = (tid->head + 1) % tid->size; in mt76_rx_aggr_check_release()
72 idx = (idx + 1) % tid->size) { in mt76_rx_aggr_check_release()
73 skb = tid->reorder_buf[idx]; in mt76_rx_aggr_check_release()
77 nframes--; in mt76_rx_aggr_check_release()
78 status = (struct mt76_rx_status *)skb->cb; in mt76_rx_aggr_check_release()
80 status->reorder_time + in mt76_rx_aggr_check_release()
81 mt76_aggr_tid_to_timeo(tid->num))) in mt76_rx_aggr_check_release()
84 mt76_rx_aggr_release_frames(tid, frames, status->seqno); in mt76_rx_aggr_check_release()
95 struct mt76_dev *dev = tid->dev; in mt76_rx_aggr_reorder_work()
104 spin_lock(&tid->lock); in mt76_rx_aggr_reorder_work()
106 nframes = tid->nframes; in mt76_rx_aggr_reorder_work()
107 spin_unlock(&tid->lock); in mt76_rx_aggr_reorder_work()
110 ieee80211_queue_delayed_work(tid->dev->hw, &tid->reorder_work, in mt76_rx_aggr_reorder_work()
111 mt76_aggr_tid_to_timeo(tid->num)); in mt76_rx_aggr_reorder_work()
121 struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb; in mt76_rx_aggr_check_ctl() local
123 struct mt76_wcid *wcid = status->wcid; in mt76_rx_aggr_check_ctl()
128 if (!ieee80211_is_ctl(bar->frame_control)) in mt76_rx_aggr_check_ctl()
131 if (!ieee80211_is_back_req(bar->frame_control)) in mt76_rx_aggr_check_ctl()
134 status->qos_ctl = tidno = le16_to_cpu(bar->control) >> 12; in mt76_rx_aggr_check_ctl()
135 seqno = IEEE80211_SEQ_TO_SN(le16_to_cpu(bar->start_seq_num)); in mt76_rx_aggr_check_ctl()
136 tid = rcu_dereference(wcid->aggr[tidno]); in mt76_rx_aggr_check_ctl()
140 spin_lock_bh(&tid->lock); in mt76_rx_aggr_check_ctl()
141 if (!tid->stopped) { in mt76_rx_aggr_check_ctl()
145 spin_unlock_bh(&tid->lock); in mt76_rx_aggr_check_ctl()
150 struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb; in mt76_rx_aggr_reorder() local
151 struct mt76_wcid *wcid = status->wcid; in mt76_rx_aggr_reorder()
156 u8 tidno = status->qos_ctl & IEEE80211_QOS_CTL_TID_MASK; in mt76_rx_aggr_reorder()
165 if (!status->aggr) { in mt76_rx_aggr_reorder()
166 if (!(status->flag & RX_FLAG_8023)) in mt76_rx_aggr_reorder()
172 ackp = status->qos_ctl & IEEE80211_QOS_CTL_ACK_POLICY_MASK; in mt76_rx_aggr_reorder()
176 tid = rcu_dereference(wcid->aggr[tidno]); in mt76_rx_aggr_reorder()
180 status->flag |= RX_FLAG_DUP_VALIDATED; in mt76_rx_aggr_reorder()
181 spin_lock_bh(&tid->lock); in mt76_rx_aggr_reorder()
183 if (tid->stopped) in mt76_rx_aggr_reorder()
186 head = tid->head; in mt76_rx_aggr_reorder()
187 seqno = status->seqno; in mt76_rx_aggr_reorder()
188 size = tid->size; in mt76_rx_aggr_reorder()
191 if (!tid->started) { in mt76_rx_aggr_reorder()
195 tid->started = true; in mt76_rx_aggr_reorder()
205 tid->head = ieee80211_sn_inc(head); in mt76_rx_aggr_reorder()
206 if (tid->nframes) in mt76_rx_aggr_reorder()
225 if (tid->reorder_buf[idx]) { in mt76_rx_aggr_reorder()
230 status->reorder_time = jiffies; in mt76_rx_aggr_reorder()
231 tid->reorder_buf[idx] = skb; in mt76_rx_aggr_reorder()
232 tid->nframes++; in mt76_rx_aggr_reorder()
235 ieee80211_queue_delayed_work(tid->dev->hw, &tid->reorder_work, in mt76_rx_aggr_reorder()
236 mt76_aggr_tid_to_timeo(tid->num)); in mt76_rx_aggr_reorder()
239 spin_unlock_bh(&tid->lock); in mt76_rx_aggr_reorder()
251 return -ENOMEM; in mt76_rx_aggr_start()
253 tid->dev = dev; in mt76_rx_aggr_start()
254 tid->head = ssn; in mt76_rx_aggr_start()
255 tid->size = size; in mt76_rx_aggr_start()
256 tid->num = tidno; in mt76_rx_aggr_start()
257 INIT_DELAYED_WORK(&tid->reorder_work, mt76_rx_aggr_reorder_work); in mt76_rx_aggr_start()
258 spin_lock_init(&tid->lock); in mt76_rx_aggr_start()
260 rcu_assign_pointer(wcid->aggr[tidno], tid); in mt76_rx_aggr_start()
268 u16 size = tid->size; in mt76_rx_aggr_shutdown()
271 spin_lock_bh(&tid->lock); in mt76_rx_aggr_shutdown()
273 tid->stopped = true; in mt76_rx_aggr_shutdown()
274 for (i = 0; tid->nframes && i < size; i++) { in mt76_rx_aggr_shutdown()
275 struct sk_buff *skb = tid->reorder_buf[i]; in mt76_rx_aggr_shutdown()
280 tid->reorder_buf[i] = NULL; in mt76_rx_aggr_shutdown()
281 tid->nframes--; in mt76_rx_aggr_shutdown()
285 spin_unlock_bh(&tid->lock); in mt76_rx_aggr_shutdown()
287 cancel_delayed_work_sync(&tid->reorder_work); in mt76_rx_aggr_shutdown()
294 tid = rcu_replace_pointer(wcid->aggr[tidno], tid, in mt76_rx_aggr_stop()
295 lockdep_is_held(&dev->mutex)); in mt76_rx_aggr_stop()