Lines Matching refs:rap

517 ampdu_rx_purge(struct ieee80211_rx_ampdu *rap)
522 for (i = 0; i < rap->rxa_wnd; i++) {
523 m = rap->rxa_m[i];
525 rap->rxa_m[i] = NULL;
526 rap->rxa_qbytes -= m->m_pkthdr.len;
528 if (--rap->rxa_qframes == 0)
532 KASSERT(rap->rxa_qbytes == 0 && rap->rxa_qframes == 0,
534 rap->rxa_qbytes, rap->rxa_qframes));
541 ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap,
546 if (rap->rxa_flags & IEEE80211_AGGR_RUNNING) {
551 ampdu_rx_purge(rap);
553 memset(rap, 0, sizeof(*rap));
554 rap->rxa_wnd = (bufsiz == 0) ?
556 rap->rxa_start = MS(baseqctl, IEEE80211_BASEQ_START);
557 rap->rxa_flags |= IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_XCHGPEND;
566 ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
569 ampdu_rx_purge(rap);
570 rap->rxa_flags &= ~(IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_XCHGPEND);
596 ampdu_rx_dispatch(struct ieee80211_rx_ampdu *rap, struct ieee80211_node *ni)
603 for (i = 1; i < rap->rxa_wnd; i++) {
604 m = rap->rxa_m[i];
607 rap->rxa_m[i] = NULL;
608 rap->rxa_qbytes -= m->m_pkthdr.len;
609 rap->rxa_qframes--;
617 if (rap->rxa_qframes != 0) {
618 int n = rap->rxa_qframes, j;
619 for (j = i+1; j < rap->rxa_wnd; j++) {
620 if (rap->rxa_m[j] != NULL) {
621 rap->rxa_m[j-i] = rap->rxa_m[j];
622 rap->rxa_m[j] = NULL;
628 vap->iv_stats.is_ampdu_rx_copy += rap->rxa_qframes;
634 rap->rxa_start = IEEE80211_SEQ_ADD(rap->rxa_start, i);
643 ampdu_rx_flush(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
649 for (i = 0; i < rap->rxa_wnd; i++) {
650 m = rap->rxa_m[i];
653 rap->rxa_m[i] = NULL;
654 rap->rxa_qbytes -= m->m_pkthdr.len;
655 rap->rxa_qframes--;
659 if (rap->rxa_qframes == 0)
672 struct ieee80211_rx_ampdu *rap, ieee80211_seq winstart)
686 seqno = rap->rxa_start;
687 for (i = 0; i < rap->rxa_wnd; i++) {
688 m = rap->rxa_m[i];
690 rap->rxa_m[i] = NULL;
691 rap->rxa_qbytes -= m->m_pkthdr.len;
692 rap->rxa_qframes--;
706 if (rap->rxa_qframes != 0) {
707 int n = rap->rxa_qframes, j;
710 KASSERT(rap->rxa_m[0] == NULL,
712 for (j = i+1; j < rap->rxa_wnd; j++) {
713 if (rap->rxa_m[j] != NULL) {
714 rap->rxa_m[j-i] = rap->rxa_m[j];
715 rap->rxa_m[j] = NULL;
722 __func__, n, rap->rxa_qframes, i, rap->rxa_start,
723 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
725 vap->iv_stats.is_ampdu_rx_copy += rap->rxa_qframes;
733 rap->rxa_start = seqno;
753 struct ieee80211_rx_ampdu *rap;
776 rap = &ni->ni_rx_ampdu[tid];
777 if ((rap->rxa_flags & IEEE80211_AGGR_XCHGPEND) == 0) {
798 rap->rxa_nframes++;
800 if (rxseq == rap->rxa_start) {
804 if (rap->rxa_qframes != 0) {
808 KASSERT(rap->rxa_m[0] == NULL, ("unexpected dup"));
810 ampdu_rx_dispatch(rap, ni);
817 rap->rxa_start = IEEE80211_SEQ_INC(rxseq);
825 off = IEEE80211_SEQ_SUB(rxseq, rap->rxa_start);
826 if (off < rap->rxa_wnd) {
849 if (rap->rxa_qframes != 0) {
851 if (ticks - rap->rxa_age > ieee80211_ampdu_age) {
856 if (rap->rxa_qframes != 0) {
858 rap->rxa_qframes;
859 ampdu_rx_flush(ni, rap);
861 rap->rxa_start = IEEE80211_SEQ_INC(rxseq);
868 rap->rxa_age = ticks;
872 if (rap->rxa_m[off] == NULL) {
873 rap->rxa_m[off] = m;
874 rap->rxa_qframes++;
875 rap->rxa_qbytes += m->m_pkthdr.len;
882 rxseq, tid, rap->rxa_start,
883 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1));
898 rap->rxa_start,
899 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
900 rap->rxa_qframes, rxseq, tid);
905 * WinStart_B = rxseq - rap->rxa_wnd + 1
912 ampdu_rx_flush_upto(ni, rap,
913 IEEE80211_SEQ_SUB(rxseq, rap->rxa_wnd-1));
923 rap->rxa_start,
924 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
925 rap->rxa_qframes, rxseq, tid,
947 struct ieee80211_rx_ampdu *rap;
962 rap = &ni->ni_rx_ampdu[tid];
963 if ((rap->rxa_flags & IEEE80211_AGGR_XCHGPEND) == 0) {
975 if (rxseq == rap->rxa_start)
978 off = IEEE80211_SEQ_SUB(rxseq, rap->rxa_start);
986 rap->rxa_start,
987 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
988 rap->rxa_qframes, rxseq, tid);
991 ampdu_rx_flush_upto(ni, rap, rxseq);
992 if (off >= rap->rxa_wnd) {
998 rap->rxa_start = rxseq;
1008 rap->rxa_start,
1009 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
1010 rap->rxa_qframes, rxseq, tid,
1099 struct ieee80211_rx_ampdu *rap;
1101 rap = &ni->ni_rx_ampdu[tid];
1102 if ((rap->rxa_flags & IEEE80211_AGGR_XCHGPEND) == 0)
1104 if (rap->rxa_qframes == 0)
1111 if (ticks - rap->rxa_age > ieee80211_ampdu_age) {
1116 vap->iv_stats.is_ampdu_rx_age += rap->rxa_qframes;
1117 ampdu_rx_flush(ni, rap);
1852 struct ieee80211_rx_ampdu *rap;
1874 rap = &ni->ni_rx_ampdu[tid];
1886 ic->ic_ampdu_rx_start(ni, rap,
1899 /* XXX honor rap flags? */
1902 | SM(rap->rxa_wnd, IEEE80211_BAPS_BUFSIZ)
1991 struct ieee80211_rx_ampdu *rap;
2010 rap = &ni->ni_rx_ampdu[tid];
2011 ic->ic_ampdu_rx_stop(ni, rap);