Lines Matching defs: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;
568 struct ieee80211_rx_ampdu *rap;
572 rap = &ni->ni_rx_ampdu[tid];
574 if (rap->rxa_flags & IEEE80211_AGGR_RUNNING) {
579 ampdu_rx_purge(rap);
582 memset(rap, 0, sizeof(*rap));
583 rap->rxa_wnd = (baw== 0) ?
585 rap->rxa_start = seq;
586 rap->rxa_flags |= IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_XCHGPEND;
593 rap->rxa_wnd,
594 rap->rxa_flags);
603 ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
606 ampdu_rx_purge(rap);
607 rap->rxa_flags &= ~(IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_XCHGPEND);
633 ampdu_rx_dispatch(struct ieee80211_rx_ampdu *rap, struct ieee80211_node *ni)
640 for (i = 1; i < rap->rxa_wnd; i++) {
641 m = rap->rxa_m[i];
644 rap->rxa_m[i] = NULL;
645 rap->rxa_qbytes -= m->m_pkthdr.len;
646 rap->rxa_qframes--;
654 if (rap->rxa_qframes != 0) {
655 int n = rap->rxa_qframes, j;
656 for (j = i+1; j < rap->rxa_wnd; j++) {
657 if (rap->rxa_m[j] != NULL) {
658 rap->rxa_m[j-i] = rap->rxa_m[j];
659 rap->rxa_m[j] = NULL;
665 vap->iv_stats.is_ampdu_rx_copy += rap->rxa_qframes;
671 rap->rxa_start = IEEE80211_SEQ_ADD(rap->rxa_start, i);
679 ampdu_rx_flush(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
685 for (i = 0; i < rap->rxa_wnd; i++) {
686 m = rap->rxa_m[i];
689 rap->rxa_m[i] = NULL;
690 rap->rxa_qbytes -= m->m_pkthdr.len;
691 rap->rxa_qframes--;
695 if (rap->rxa_qframes == 0)
707 struct ieee80211_rx_ampdu *rap, ieee80211_seq winstart)
721 seqno = rap->rxa_start;
722 for (i = 0; i < rap->rxa_wnd; i++) {
723 m = rap->rxa_m[i];
725 rap->rxa_m[i] = NULL;
726 rap->rxa_qbytes -= m->m_pkthdr.len;
727 rap->rxa_qframes--;
741 if (rap->rxa_qframes != 0) {
742 int n = rap->rxa_qframes, j;
745 KASSERT(rap->rxa_m[0] == NULL,
747 for (j = i+1; j < rap->rxa_wnd; j++) {
748 if (rap->rxa_m[j] != NULL) {
749 rap->rxa_m[j-i] = rap->rxa_m[j];
750 rap->rxa_m[j] = NULL;
757 __func__, n, rap->rxa_qframes, i, rap->rxa_start,
758 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
760 vap->iv_stats.is_ampdu_rx_copy += rap->rxa_qframes;
768 rap->rxa_start = seqno;
788 struct ieee80211_rx_ampdu *rap;
808 rap = &ni->ni_rx_ampdu[tid];
809 if ((rap->rxa_flags & IEEE80211_AGGR_XCHGPEND) == 0) {
830 rap->rxa_nframes++;
832 if (rxseq == rap->rxa_start) {
836 if (rap->rxa_qframes != 0) {
840 KASSERT(rap->rxa_m[0] == NULL, ("unexpected dup"));
842 ampdu_rx_dispatch(rap, ni);
849 rap->rxa_start = IEEE80211_SEQ_INC(rxseq);
857 off = IEEE80211_SEQ_SUB(rxseq, rap->rxa_start);
858 if (off < rap->rxa_wnd) {
881 if (rap->rxa_qframes != 0) {
883 if (ticks - rap->rxa_age > ieee80211_ampdu_age) {
888 if (rap->rxa_qframes != 0) {
890 rap->rxa_qframes;
891 ampdu_rx_flush(ni, rap);
893 rap->rxa_start = IEEE80211_SEQ_INC(rxseq);
900 rap->rxa_age = ticks;
904 if (rap->rxa_m[off] == NULL) {
905 rap->rxa_m[off] = m;
906 rap->rxa_qframes++;
907 rap->rxa_qbytes += m->m_pkthdr.len;
914 rxseq, tid, rap->rxa_start,
915 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1));
930 rap->rxa_start,
931 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
932 rap->rxa_qframes, rxseq, tid);
937 * WinStart_B = rxseq - rap->rxa_wnd + 1
944 ampdu_rx_flush_upto(ni, rap,
945 IEEE80211_SEQ_SUB(rxseq, rap->rxa_wnd-1));
955 rap->rxa_start,
956 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
957 rap->rxa_qframes, rxseq, tid,
979 struct ieee80211_rx_ampdu *rap;
994 rap = &ni->ni_rx_ampdu[tid];
995 if ((rap->rxa_flags & IEEE80211_AGGR_XCHGPEND) == 0) {
1007 if (rxseq == rap->rxa_start)
1010 off = IEEE80211_SEQ_SUB(rxseq, rap->rxa_start);
1018 rap->rxa_start,
1019 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
1020 rap->rxa_qframes, rxseq, tid);
1023 ampdu_rx_flush_upto(ni, rap, rxseq);
1024 if (off >= rap->rxa_wnd) {
1030 rap->rxa_start = rxseq;
1040 rap->rxa_start,
1041 IEEE80211_SEQ_ADD(rap->rxa_start, rap->rxa_wnd-1),
1042 rap->rxa_qframes, rxseq, tid,
1130 struct ieee80211_rx_ampdu *rap;
1132 rap = &ni->ni_rx_ampdu[tid];
1133 if ((rap->rxa_flags & IEEE80211_AGGR_XCHGPEND) == 0)
1135 if (rap->rxa_qframes == 0)
1142 if (ticks - rap->rxa_age > ieee80211_ampdu_age) {
1147 vap->iv_stats.is_ampdu_rx_age += rap->rxa_qframes;
1148 ampdu_rx_flush(ni, rap);
1930 struct ieee80211_rx_ampdu *rap;
1952 rap = &ni->ni_rx_ampdu[tid];
1964 ic->ic_ampdu_rx_start(ni, rap,
1977 /* XXX honor rap flags? */
1980 | SM(rap->rxa_wnd, IEEE80211_BAPS_BUFSIZ)
2069 struct ieee80211_rx_ampdu *rap;
2088 rap = &ni->ni_rx_ampdu[tid];
2089 ic->ic_ampdu_rx_stop(ni, rap);