Lines Matching full:r
28 static inline int reorder_index(struct wil_tid_ampdu_rx *r, u16 seq) in reorder_index() argument
30 return seq_sub(seq, r->ssn) % r->buf_size; in reorder_index()
34 struct wil_tid_ampdu_rx *r, in wil_release_reorder_frame() argument
37 struct sk_buff *skb = r->reorder_buf[index]; in wil_release_reorder_frame()
43 r->stored_mpdu_num--; in wil_release_reorder_frame()
44 r->reorder_buf[index] = NULL; in wil_release_reorder_frame()
48 r->head_seq_num = seq_inc(r->head_seq_num); in wil_release_reorder_frame()
52 struct wil_tid_ampdu_rx *r, in wil_release_reorder_frames() argument
58 * hseq preceding r->head_seq_num, i.e it is always true in wil_release_reorder_frames()
59 * !seq_less(hseq, r->head_seq_num) in wil_release_reorder_frames()
61 * r->head_seq_num == hseq in wil_release_reorder_frames()
63 while (seq_less(r->head_seq_num, hseq) && r->stored_mpdu_num) { in wil_release_reorder_frames()
64 index = reorder_index(r, r->head_seq_num); in wil_release_reorder_frames()
65 wil_release_reorder_frame(ndev, r, index); in wil_release_reorder_frames()
67 r->head_seq_num = hseq; in wil_release_reorder_frames()
71 struct wil_tid_ampdu_rx *r) in wil_reorder_release() argument
73 int index = reorder_index(r, r->head_seq_num); in wil_reorder_release()
75 while (r->reorder_buf[index]) { in wil_reorder_release()
76 wil_release_reorder_frame(ndev, r, index); in wil_reorder_release()
77 index = reorder_index(r, r->head_seq_num); in wil_reorder_release()
90 struct wil_tid_ampdu_rx *r; in wil_rx_reorder() local
111 r = sta->tid_rx[tid]; in wil_rx_reorder()
112 if (!r) { in wil_rx_reorder()
118 if (retry && seq == r->mcast_last_seq) { in wil_rx_reorder()
119 r->drop_dup_mcast++; in wil_rx_reorder()
125 r->mcast_last_seq = seq; in wil_rx_reorder()
130 r->total++; in wil_rx_reorder()
131 hseq = r->head_seq_num; in wil_rx_reorder()
141 if (r->first_time) { in wil_rx_reorder()
142 r->first_time = false; in wil_rx_reorder()
143 if (seq != r->head_seq_num) { in wil_rx_reorder()
144 if (seq_less(seq, r->head_seq_num)) { in wil_rx_reorder()
147 seq, r->head_seq_num); in wil_rx_reorder()
148 r->first_time = true; in wil_rx_reorder()
154 seq, r->head_seq_num); in wil_rx_reorder()
155 r->head_seq_num = seq; in wil_rx_reorder()
156 r->ssn = seq; in wil_rx_reorder()
161 if (seq_less(seq, r->head_seq_num)) { in wil_rx_reorder()
162 r->ssn_last_drop = seq; in wil_rx_reorder()
163 r->drop_old++; in wil_rx_reorder()
165 seq, r->head_seq_num); in wil_rx_reorder()
174 if (!seq_less(seq, r->head_seq_num + r->buf_size)) { in wil_rx_reorder()
175 hseq = seq_inc(seq_sub(seq, r->buf_size)); in wil_rx_reorder()
177 wil_release_reorder_frames(ndev, r, hseq); in wil_rx_reorder()
182 index = reorder_index(r, seq); in wil_rx_reorder()
185 if (r->reorder_buf[index]) { in wil_rx_reorder()
186 r->drop_dup++; in wil_rx_reorder()
198 if (seq == r->head_seq_num && r->stored_mpdu_num == 0) { in wil_rx_reorder()
199 r->head_seq_num = seq_inc(r->head_seq_num); in wil_rx_reorder()
205 r->reorder_buf[index] = skb; in wil_rx_reorder()
206 r->stored_mpdu_num++; in wil_rx_reorder()
207 wil_reorder_release(ndev, r); in wil_rx_reorder()
219 struct wil_tid_ampdu_rx *r; in wil_rx_bar() local
223 r = sta->tid_rx[tid]; in wil_rx_bar()
224 if (!r) { in wil_rx_bar()
228 if (seq_less(seq, r->head_seq_num)) { in wil_rx_bar()
230 seq, r->head_seq_num); in wil_rx_bar()
234 cid, vif->mid, tid, seq, r->head_seq_num); in wil_rx_bar()
235 wil_release_reorder_frames(ndev, r, seq); in wil_rx_bar()
244 struct wil_tid_ampdu_rx *r = kzalloc(sizeof(*r), GFP_KERNEL); in wil_tid_ampdu_rx_alloc() local
246 if (!r) in wil_tid_ampdu_rx_alloc()
249 r->reorder_buf = in wil_tid_ampdu_rx_alloc()
251 if (!r->reorder_buf) { in wil_tid_ampdu_rx_alloc()
252 kfree(r); in wil_tid_ampdu_rx_alloc()
256 r->ssn = ssn; in wil_tid_ampdu_rx_alloc()
257 r->head_seq_num = ssn; in wil_tid_ampdu_rx_alloc()
258 r->buf_size = size; in wil_tid_ampdu_rx_alloc()
259 r->stored_mpdu_num = 0; in wil_tid_ampdu_rx_alloc()
260 r->first_time = true; in wil_tid_ampdu_rx_alloc()
261 r->mcast_last_seq = U16_MAX; in wil_tid_ampdu_rx_alloc()
262 return r; in wil_tid_ampdu_rx_alloc()
266 struct wil_tid_ampdu_rx *r) in wil_tid_ampdu_rx_free() argument
270 if (!r) in wil_tid_ampdu_rx_free()
278 for (i = 0; i < r->buf_size; i++) in wil_tid_ampdu_rx_free()
279 kfree_skb(r->reorder_buf[i]); in wil_tid_ampdu_rx_free()
281 kfree(r->reorder_buf); in wil_tid_ampdu_rx_free()
282 kfree(r); in wil_tid_ampdu_rx_free()
320 struct wil_tid_ampdu_rx *r; in wil_addba_rx_request() local
363 r = wil_tid_ampdu_rx_alloc(wil, agg_wsize, ssn); in wil_addba_rx_request()
366 sta->tid_rx[tid] = r; in wil_addba_rx_request()