Lines Matching refs:rap

160 ampdu_rx_start(struct ieee80211_rx_ampdu *rap, int bufsiz, int start)
162 (void) memset(rap, 0, sizeof (*rap));
163 rap->rxa_wnd = (bufsiz == 0) ? IEEE80211_AGGR_BAWMAX
165 rap->rxa_start = (uint16_t)start;
166 rap->rxa_flags |= IEEE80211_AGGR_XCHGPEND;
173 ampdu_rx_purge(struct ieee80211_rx_ampdu *rap)
178 for (i = 0; i < rap->rxa_wnd; i++) {
179 m = rap->rxa_m[i];
181 rap->rxa_m[i] = NULL;
182 rap->rxa_qbytes -= MBLKL(m);
184 if (--rap->rxa_qframes == 0)
188 ASSERT(rap->rxa_qbytes == 0 && rap->rxa_qframes == 0);
195 ampdu_rx_stop(struct ieee80211_rx_ampdu *rap)
197 rap->rxa_flags &= ~IEEE80211_AGGR_XCHGPEND;
198 ampdu_rx_purge(rap);
224 ampdu_rx_dispatch(struct ieee80211_rx_ampdu *rap, struct ieee80211_node *in)
230 for (i = 1; i < rap->rxa_wnd; i++) {
231 m = rap->rxa_m[i];
234 rap->rxa_m[i] = NULL;
235 rap->rxa_qbytes -= MBLKL(m);
236 rap->rxa_qframes--;
244 if (rap->rxa_qframes != 0) {
245 int n = rap->rxa_qframes, j;
246 for (j = i+1; j < rap->rxa_wnd; j++) {
247 if (rap->rxa_m[j] != NULL) {
248 rap->rxa_m[j-i] = rap->rxa_m[j];
249 rap->rxa_m[j] = NULL;
260 rap->rxa_start = IEEE80211_SEQ_ADD(rap->rxa_start, i);
268 ampdu_rx_flush(struct ieee80211_node *in, struct ieee80211_rx_ampdu *rap)
275 rap->rxa_wnd);
277 for (i = 0; i < rap->rxa_wnd; i++) {
278 m = rap->rxa_m[i];
281 rap->rxa_m[i] = NULL;
282 rap->rxa_qbytes -= MBLKL(m);
283 rap->rxa_qframes--;
286 if (rap->rxa_qframes == 0)
299 struct ieee80211_rx_ampdu *rap, ieee80211_seq winstart)
312 seqno = rap->rxa_start;
313 for (i = 0; i < rap->rxa_wnd; i++) {
314 m = rap->rxa_m[i];
316 rap->rxa_m[i] = NULL;
317 rap->rxa_qbytes -= MBLKL(m);
318 rap->rxa_qframes--;
331 if (rap->rxa_qframes != 0) {
332 int n = rap->rxa_qframes, j;
333 for (j = i+1; j < rap->rxa_wnd; j++) {
334 if (rap->rxa_m[j] != NULL) {
335 rap->rxa_m[j-i] = rap->rxa_m[j];
336 rap->rxa_m[j] = NULL;
346 n, rap->rxa_qframes, i, rap->rxa_start,
347 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
357 rap->rxa_start = seqno;
379 struct ieee80211_rx_ampdu *rap;
395 rap = &in->in_rx_ampdu[tid];
396 if ((rap->rxa_flags & IEEE80211_AGGR_XCHGPEND) == 0) {
403 rap->rxa_nframes++;
405 if (rxseq == rap->rxa_start) {
409 if (rap->rxa_qframes != 0) {
413 ASSERT(rap->rxa_m[0] == NULL); /* [0] is m */
415 ampdu_rx_dispatch(rap, in);
418 rap->rxa_qframes);
425 rap->rxa_start = IEEE80211_SEQ_INC(rxseq);
428 rap->rxa_start);
434 rxseq, rap->rxa_start);
439 off = IEEE80211_SEQ_SUB(rxseq, rap->rxa_start);
440 if (off < rap->rxa_wnd) {
465 if (rap->rxa_qframes != 0) {
467 if (ticks - rap->rxa_age > drv_usectohz(500*1000)) {
472 if (rap->rxa_qframes != 0) {
473 ampdu_rx_flush(in, rap);
475 rap->rxa_start = IEEE80211_SEQ_INC(rxseq);
482 rap->rxa_age = ticks;
486 if (rap->rxa_m[off] == NULL) {
487 rap->rxa_m[off] = m;
488 rap->rxa_qframes++;
489 rap->rxa_qbytes += MBLKL(m);
494 rxseq, tid, rap->rxa_start,
495 IEEE80211_SEQ_ADD(rap->rxa_start,
496 rap->rxa_wnd - 1));
509 rap->rxa_start,
510 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd - 1),
511 rap->rxa_qframes, rxseq, tid);
515 * WinStart_B = rxseq - rap->rxa_wnd + 1
522 ampdu_rx_flush_upto(in, rap,
523 IEEE80211_SEQ_SUB(rxseq, rap->rxa_wnd-1));
532 rap->rxa_start,
533 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
534 rap->rxa_qframes, rxseq, tid,
554 struct ieee80211_rx_ampdu *rap;
561 rap = &in->in_rx_ampdu[tid];
562 if ((rap->rxa_flags & IEEE80211_AGGR_XCHGPEND) == 0) {
571 if (rxseq == rap->rxa_start)
574 off = IEEE80211_SEQ_SUB(rxseq, rap->rxa_start);
582 rap->rxa_start,
583 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
584 rap->rxa_qframes, rxseq, tid);
586 ampdu_rx_flush_upto(in, rap, rxseq);
587 if (off >= rap->rxa_wnd) {
593 rap->rxa_start = rxseq;
602 rap->rxa_start,
603 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
604 rap->rxa_qframes, rxseq, tid,
1136 struct ieee80211_rx_ampdu *rap;
1164 rap = &in->in_rx_ampdu[tid];
1175 ampdu_rx_start(rap, bufsiz,
1188 /* honor rap flags? */
1191 | SM(rap->rxa_wnd, IEEE80211_BAPS_BUFSIZ);
1246 rap = &in->in_rx_ampdu[tid];
1247 ampdu_rx_stop(rap);