xmit.c (1bddc59c2546a24a92b1e7d4d8fa1e1e38aeedb2) xmit.c (56dc63369270b60e59637d153caf2e6b424ca30e)
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 115 unchanged lines hidden (view full) ---

124{
125 struct ath_txq *txq = tid->ac->txq;
126
127 WARN_ON(!tid->paused);
128
129 spin_lock_bh(&txq->axq_lock);
130 tid->paused = false;
131
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 115 unchanged lines hidden (view full) ---

124{
125 struct ath_txq *txq = tid->ac->txq;
126
127 WARN_ON(!tid->paused);
128
129 spin_lock_bh(&txq->axq_lock);
130 tid->paused = false;
131
132 if (list_empty(&tid->buf_q))
132 if (skb_queue_empty(&tid->buf_q))
133 goto unlock;
134
135 ath_tx_queue_tid(txq, tid);
136 ath_txq_schedule(sc, txq);
137unlock:
138 spin_unlock_bh(&txq->axq_lock);
139}
140
141static struct ath_frame_info *get_frame_info(struct sk_buff *skb)
142{
143 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
144 BUILD_BUG_ON(sizeof(struct ath_frame_info) >
145 sizeof(tx_info->rate_driver_data));
146 return (struct ath_frame_info *) &tx_info->rate_driver_data[0];
147}
148
149static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
150{
151 struct ath_txq *txq = tid->ac->txq;
133 goto unlock;
134
135 ath_tx_queue_tid(txq, tid);
136 ath_txq_schedule(sc, txq);
137unlock:
138 spin_unlock_bh(&txq->axq_lock);
139}
140
141static struct ath_frame_info *get_frame_info(struct sk_buff *skb)
142{
143 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
144 BUILD_BUG_ON(sizeof(struct ath_frame_info) >
145 sizeof(tx_info->rate_driver_data));
146 return (struct ath_frame_info *) &tx_info->rate_driver_data[0];
147}
148
149static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
150{
151 struct ath_txq *txq = tid->ac->txq;
152 struct sk_buff *skb;
152 struct ath_buf *bf;
153 struct list_head bf_head;
154 struct ath_tx_status ts;
155 struct ath_frame_info *fi;
156
157 INIT_LIST_HEAD(&bf_head);
158
159 memset(&ts, 0, sizeof(ts));
160 spin_lock_bh(&txq->axq_lock);
161
153 struct ath_buf *bf;
154 struct list_head bf_head;
155 struct ath_tx_status ts;
156 struct ath_frame_info *fi;
157
158 INIT_LIST_HEAD(&bf_head);
159
160 memset(&ts, 0, sizeof(ts));
161 spin_lock_bh(&txq->axq_lock);
162
162 while (!list_empty(&tid->buf_q)) {
163 bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
164 list_move_tail(&bf->list, &bf_head);
163 while ((skb = __skb_dequeue(&tid->buf_q))) {
164 fi = get_frame_info(skb);
165 bf = fi->bf;
165
166
167 list_add_tail(&bf->list, &bf_head);
168
166 spin_unlock_bh(&txq->axq_lock);
169 spin_unlock_bh(&txq->axq_lock);
167 fi = get_frame_info(bf->bf_mpdu);
168 if (fi->retries) {
169 ath_tx_update_baw(sc, tid, fi->seqno);
170 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 1);
171 } else {
172 ath_tx_send_normal(sc, txq, NULL, &bf_head);
173 }
174 spin_lock_bh(&txq->axq_lock);
175 }

--- 38 unchanged lines hidden (view full) ---

214 * sequence number(s) without setting the retry bit. The
215 * alternative is to give up on these and BAR the receiver's window
216 * forward.
217 */
218static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq,
219 struct ath_atx_tid *tid)
220
221{
170 if (fi->retries) {
171 ath_tx_update_baw(sc, tid, fi->seqno);
172 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 1);
173 } else {
174 ath_tx_send_normal(sc, txq, NULL, &bf_head);
175 }
176 spin_lock_bh(&txq->axq_lock);
177 }

--- 38 unchanged lines hidden (view full) ---

216 * sequence number(s) without setting the retry bit. The
217 * alternative is to give up on these and BAR the receiver's window
218 * forward.
219 */
220static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq,
221 struct ath_atx_tid *tid)
222
223{
224 struct sk_buff *skb;
222 struct ath_buf *bf;
223 struct list_head bf_head;
224 struct ath_tx_status ts;
225 struct ath_frame_info *fi;
226
227 memset(&ts, 0, sizeof(ts));
228 INIT_LIST_HEAD(&bf_head);
229
225 struct ath_buf *bf;
226 struct list_head bf_head;
227 struct ath_tx_status ts;
228 struct ath_frame_info *fi;
229
230 memset(&ts, 0, sizeof(ts));
231 INIT_LIST_HEAD(&bf_head);
232
230 for (;;) {
231 if (list_empty(&tid->buf_q))
232 break;
233 while ((skb = __skb_dequeue(&tid->buf_q))) {
234 fi = get_frame_info(skb);
235 bf = fi->bf;
233
236
234 bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
235 list_move_tail(&bf->list, &bf_head);
237 list_add_tail(&bf->list, &bf_head);
236
238
237 fi = get_frame_info(bf->bf_mpdu);
238 if (fi->retries)
239 ath_tx_update_baw(sc, tid, fi->seqno);
240
241 spin_unlock(&txq->axq_lock);
242 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
243 spin_lock(&txq->axq_lock);
244 }
245

--- 98 unchanged lines hidden (view full) ---

344 struct ath_node *an = NULL;
345 struct sk_buff *skb;
346 struct ieee80211_sta *sta;
347 struct ieee80211_hw *hw = sc->hw;
348 struct ieee80211_hdr *hdr;
349 struct ieee80211_tx_info *tx_info;
350 struct ath_atx_tid *tid = NULL;
351 struct ath_buf *bf_next, *bf_last = bf->bf_lastbf;
239 if (fi->retries)
240 ath_tx_update_baw(sc, tid, fi->seqno);
241
242 spin_unlock(&txq->axq_lock);
243 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
244 spin_lock(&txq->axq_lock);
245 }
246

--- 98 unchanged lines hidden (view full) ---

345 struct ath_node *an = NULL;
346 struct sk_buff *skb;
347 struct ieee80211_sta *sta;
348 struct ieee80211_hw *hw = sc->hw;
349 struct ieee80211_hdr *hdr;
350 struct ieee80211_tx_info *tx_info;
351 struct ath_atx_tid *tid = NULL;
352 struct ath_buf *bf_next, *bf_last = bf->bf_lastbf;
352 struct list_head bf_head, bf_pending;
353 struct list_head bf_head;
354 struct sk_buff_head bf_pending;
353 u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0;
354 u32 ba[WME_BA_BMP_SIZE >> 5];
355 int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0;
356 bool rc_update = true;
357 struct ieee80211_tx_rate rates[4];
358 struct ath_frame_info *fi;
359 int nframes;
360 u8 tidno;

--- 56 unchanged lines hidden (view full) ---

417 * when perform internal reset in this routine.
418 * Only enable reset in STA mode for now.
419 */
420 if (sc->sc_ah->opmode == NL80211_IFTYPE_STATION)
421 needreset = 1;
422 }
423 }
424
355 u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0;
356 u32 ba[WME_BA_BMP_SIZE >> 5];
357 int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0;
358 bool rc_update = true;
359 struct ieee80211_tx_rate rates[4];
360 struct ath_frame_info *fi;
361 int nframes;
362 u8 tidno;

--- 56 unchanged lines hidden (view full) ---

419 * when perform internal reset in this routine.
420 * Only enable reset in STA mode for now.
421 */
422 if (sc->sc_ah->opmode == NL80211_IFTYPE_STATION)
423 needreset = 1;
424 }
425 }
426
425 INIT_LIST_HEAD(&bf_pending);
426 INIT_LIST_HEAD(&bf_head);
427 __skb_queue_head_init(&bf_pending);
427
428 ath_tx_count_frames(sc, bf, ts, txok, &nframes, &nbad);
429 while (bf) {
430 txfail = txpending = sendbar = 0;
431 bf_next = bf->bf_next;
432
433 skb = bf->bf_mpdu;
434 tx_info = IEEE80211_SKB_CB(skb);

--- 27 unchanged lines hidden (view full) ---

462 txfail_cnt++;
463 }
464 }
465
466 /*
467 * Make sure the last desc is reclaimed if it
468 * not a holding desc.
469 */
428
429 ath_tx_count_frames(sc, bf, ts, txok, &nframes, &nbad);
430 while (bf) {
431 txfail = txpending = sendbar = 0;
432 bf_next = bf->bf_next;
433
434 skb = bf->bf_mpdu;
435 tx_info = IEEE80211_SKB_CB(skb);

--- 27 unchanged lines hidden (view full) ---

463 txfail_cnt++;
464 }
465 }
466
467 /*
468 * Make sure the last desc is reclaimed if it
469 * not a holding desc.
470 */
470 if (!bf_last->bf_stale || bf_next != NULL)
471 INIT_LIST_HEAD(&bf_head);
472 if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) ||
473 bf_next != NULL || !bf_last->bf_stale)
471 list_move_tail(&bf->list, &bf_head);
474 list_move_tail(&bf->list, &bf_head);
472 else
473 INIT_LIST_HEAD(&bf_head);
474
475 if (!txpending || (tid->state & AGGR_CLEANUP)) {
476 /*
477 * complete the acked-ones/xretried ones; update
478 * block-ack window
479 */
480 spin_lock_bh(&txq->axq_lock);
481 ath_tx_update_baw(sc, tid, fi->seqno);

--- 34 unchanged lines hidden (view full) ---

516 ath_tx_complete_buf(sc, bf, txq,
517 &bf_head,
518 ts, 0, 0);
519 break;
520 }
521
522 ath9k_hw_cleartxdesc(sc->sc_ah,
523 tbf->bf_desc);
475
476 if (!txpending || (tid->state & AGGR_CLEANUP)) {
477 /*
478 * complete the acked-ones/xretried ones; update
479 * block-ack window
480 */
481 spin_lock_bh(&txq->axq_lock);
482 ath_tx_update_baw(sc, tid, fi->seqno);

--- 34 unchanged lines hidden (view full) ---

517 ath_tx_complete_buf(sc, bf, txq,
518 &bf_head,
519 ts, 0, 0);
520 break;
521 }
522
523 ath9k_hw_cleartxdesc(sc->sc_ah,
524 tbf->bf_desc);
524 list_add_tail(&tbf->list, &bf_head);
525 fi->bf = tbf;
525 } else {
526 /*
527 * Clear descriptor status words for
528 * software retry
529 */
530 ath9k_hw_cleartxdesc(sc->sc_ah,
531 bf->bf_desc);
532 }
533 }
534
535 /*
536 * Put this buffer to the temporary pending
537 * queue to retain ordering
538 */
526 } else {
527 /*
528 * Clear descriptor status words for
529 * software retry
530 */
531 ath9k_hw_cleartxdesc(sc->sc_ah,
532 bf->bf_desc);
533 }
534 }
535
536 /*
537 * Put this buffer to the temporary pending
538 * queue to retain ordering
539 */
539 list_splice_tail_init(&bf_head, &bf_pending);
540 __skb_queue_tail(&bf_pending, skb);
540 }
541
542 bf = bf_next;
543 }
544
545 /* prepend un-acked frames to the beginning of the pending frame queue */
541 }
542
543 bf = bf_next;
544 }
545
546 /* prepend un-acked frames to the beginning of the pending frame queue */
546 if (!list_empty(&bf_pending)) {
547 if (!skb_queue_empty(&bf_pending)) {
547 if (an->sleeping)
548 ieee80211_sta_set_tim(sta);
549
550 spin_lock_bh(&txq->axq_lock);
551 if (clear_filter)
552 tid->ac->clear_ps_filter = true;
548 if (an->sleeping)
549 ieee80211_sta_set_tim(sta);
550
551 spin_lock_bh(&txq->axq_lock);
552 if (clear_filter)
553 tid->ac->clear_ps_filter = true;
553 list_splice(&bf_pending, &tid->buf_q);
554 skb_queue_splice(&bf_pending, &tid->buf_q);
554 if (!an->sleeping)
555 ath_tx_queue_tid(txq, tid);
556 spin_unlock_bh(&txq->axq_lock);
557 }
558
559 if (tid->state & AGGR_CLEANUP) {
560 ath_tx_flush_tid(sc, tid);
561

--- 15 unchanged lines hidden (view full) ---

577 struct ieee80211_tx_info *tx_info;
578 struct ieee80211_tx_rate *rates;
579 int i;
580
581 skb = bf->bf_mpdu;
582 tx_info = IEEE80211_SKB_CB(skb);
583 rates = tx_info->control.rates;
584
555 if (!an->sleeping)
556 ath_tx_queue_tid(txq, tid);
557 spin_unlock_bh(&txq->axq_lock);
558 }
559
560 if (tid->state & AGGR_CLEANUP) {
561 ath_tx_flush_tid(sc, tid);
562

--- 15 unchanged lines hidden (view full) ---

578 struct ieee80211_tx_info *tx_info;
579 struct ieee80211_tx_rate *rates;
580 int i;
581
582 skb = bf->bf_mpdu;
583 tx_info = IEEE80211_SKB_CB(skb);
584 rates = tx_info->control.rates;
585
585 for (i = 3; i >= 0; i--) {
586 for (i = 0; i < 4; i++) {
587 if (!rates[i].count || rates[i].idx < 0)
588 break;
589
586 if (!(rates[i].flags & IEEE80211_TX_RC_MCS))
587 return true;
588 }
589
590 return false;
591}
592
593static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,

--- 141 unchanged lines hidden (view full) ---

735
736static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
737 struct ath_txq *txq,
738 struct ath_atx_tid *tid,
739 struct list_head *bf_q,
740 int *aggr_len)
741{
742#define PADBYTES(_len) ((4 - ((_len) % 4)) % 4)
590 if (!(rates[i].flags & IEEE80211_TX_RC_MCS))
591 return true;
592 }
593
594 return false;
595}
596
597static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,

--- 141 unchanged lines hidden (view full) ---

739
740static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
741 struct ath_txq *txq,
742 struct ath_atx_tid *tid,
743 struct list_head *bf_q,
744 int *aggr_len)
745{
746#define PADBYTES(_len) ((4 - ((_len) % 4)) % 4)
743 struct ath_buf *bf, *bf_first, *bf_prev = NULL;
747 struct ath_buf *bf, *bf_first = NULL, *bf_prev = NULL;
744 int rl = 0, nframes = 0, ndelim, prev_al = 0;
745 u16 aggr_limit = 0, al = 0, bpad = 0,
746 al_delta, h_baw = tid->baw_size / 2;
747 enum ATH_AGGR_STATUS status = ATH_AGGR_DONE;
748 struct ieee80211_tx_info *tx_info;
749 struct ath_frame_info *fi;
748 int rl = 0, nframes = 0, ndelim, prev_al = 0;
749 u16 aggr_limit = 0, al = 0, bpad = 0,
750 al_delta, h_baw = tid->baw_size / 2;
751 enum ATH_AGGR_STATUS status = ATH_AGGR_DONE;
752 struct ieee80211_tx_info *tx_info;
753 struct ath_frame_info *fi;
754 struct sk_buff *skb;
750
755
751 bf_first = list_first_entry(&tid->buf_q, struct ath_buf, list);
752
753 do {
756 do {
754 bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
755 fi = get_frame_info(bf->bf_mpdu);
757 skb = skb_peek(&tid->buf_q);
758 fi = get_frame_info(skb);
759 bf = fi->bf;
756
760
761 if (!bf_first)
762 bf_first = bf;
763
757 /* do not step over block-ack window */
758 if (!BAW_WITHIN(tid->seq_start, tid->baw_size, fi->seqno)) {
759 status = ATH_AGGR_BAW_CLOSED;
760 break;
761 }
762
763 if (!rl) {
764 aggr_limit = ath_lookup_rate(sc, bf, tid);

--- 35 unchanged lines hidden (view full) ---

800 nframes++;
801 bf->bf_next = NULL;
802 ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, 0);
803
804 /* link buffers of this frame to the aggregate */
805 if (!fi->retries)
806 ath_tx_addto_baw(sc, tid, fi->seqno);
807 ath9k_hw_set11n_aggr_middle(sc->sc_ah, bf->bf_desc, ndelim);
764 /* do not step over block-ack window */
765 if (!BAW_WITHIN(tid->seq_start, tid->baw_size, fi->seqno)) {
766 status = ATH_AGGR_BAW_CLOSED;
767 break;
768 }
769
770 if (!rl) {
771 aggr_limit = ath_lookup_rate(sc, bf, tid);

--- 35 unchanged lines hidden (view full) ---

807 nframes++;
808 bf->bf_next = NULL;
809 ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, 0);
810
811 /* link buffers of this frame to the aggregate */
812 if (!fi->retries)
813 ath_tx_addto_baw(sc, tid, fi->seqno);
814 ath9k_hw_set11n_aggr_middle(sc->sc_ah, bf->bf_desc, ndelim);
808 list_move_tail(&bf->list, bf_q);
815
816 __skb_unlink(skb, &tid->buf_q);
817 list_add_tail(&bf->list, bf_q);
809 if (bf_prev) {
810 bf_prev->bf_next = bf;
811 ath9k_hw_set_desc_link(sc->sc_ah, bf_prev->bf_desc,
812 bf->bf_daddr);
813 }
814 bf_prev = bf;
815
818 if (bf_prev) {
819 bf_prev->bf_next = bf;
820 ath9k_hw_set_desc_link(sc->sc_ah, bf_prev->bf_desc,
821 bf->bf_daddr);
822 }
823 bf_prev = bf;
824
816 } while (!list_empty(&tid->buf_q));
825 } while (!skb_queue_empty(&tid->buf_q));
817
818 *aggr_len = al;
819
820 return status;
821#undef PADBYTES
822}
823
824static void ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq,
825 struct ath_atx_tid *tid)
826{
827 struct ath_buf *bf;
828 enum ATH_AGGR_STATUS status;
829 struct ath_frame_info *fi;
830 struct list_head bf_q;
831 int aggr_len;
832
833 do {
826
827 *aggr_len = al;
828
829 return status;
830#undef PADBYTES
831}
832
833static void ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq,
834 struct ath_atx_tid *tid)
835{
836 struct ath_buf *bf;
837 enum ATH_AGGR_STATUS status;
838 struct ath_frame_info *fi;
839 struct list_head bf_q;
840 int aggr_len;
841
842 do {
834 if (list_empty(&tid->buf_q))
843 if (skb_queue_empty(&tid->buf_q))
835 return;
836
837 INIT_LIST_HEAD(&bf_q);
838
839 status = ath_tx_form_aggr(sc, txq, tid, &bf_q, &aggr_len);
840
841 /*
842 * no frames picked up to be aggregated;

--- 104 unchanged lines hidden (view full) ---

947 if (!tid->sched)
948 continue;
949
950 ac = tid->ac;
951 txq = ac->txq;
952
953 spin_lock_bh(&txq->axq_lock);
954
844 return;
845
846 INIT_LIST_HEAD(&bf_q);
847
848 status = ath_tx_form_aggr(sc, txq, tid, &bf_q, &aggr_len);
849
850 /*
851 * no frames picked up to be aggregated;

--- 104 unchanged lines hidden (view full) ---

956 if (!tid->sched)
957 continue;
958
959 ac = tid->ac;
960 txq = ac->txq;
961
962 spin_lock_bh(&txq->axq_lock);
963
955 if (!list_empty(&tid->buf_q))
964 if (!skb_queue_empty(&tid->buf_q))
956 buffered = true;
957
958 tid->sched = false;
959 list_del(&tid->list);
960
961 if (ac->sched) {
962 ac->sched = false;
963 list_del(&ac->list);

--- 16 unchanged lines hidden (view full) ---

980 tidno < WME_NUM_TID; tidno++, tid++) {
981
982 ac = tid->ac;
983 txq = ac->txq;
984
985 spin_lock_bh(&txq->axq_lock);
986 ac->clear_ps_filter = true;
987
965 buffered = true;
966
967 tid->sched = false;
968 list_del(&tid->list);
969
970 if (ac->sched) {
971 ac->sched = false;
972 list_del(&ac->list);

--- 16 unchanged lines hidden (view full) ---

989 tidno < WME_NUM_TID; tidno++, tid++) {
990
991 ac = tid->ac;
992 txq = ac->txq;
993
994 spin_lock_bh(&txq->axq_lock);
995 ac->clear_ps_filter = true;
996
988 if (!list_empty(&tid->buf_q) && !tid->paused) {
997 if (!skb_queue_empty(&tid->buf_q) && !tid->paused) {
989 ath_tx_queue_tid(txq, tid);
990 ath_txq_schedule(sc, txq);
991 }
992
993 spin_unlock_bh(&txq->axq_lock);
994 }
995}
996

--- 327 unchanged lines hidden (view full) ---

1324 continue;
1325
1326 ath_tx_sched_aggr(sc, txq, tid);
1327
1328 /*
1329 * add tid to round-robin queue if more frames
1330 * are pending for the tid
1331 */
998 ath_tx_queue_tid(txq, tid);
999 ath_txq_schedule(sc, txq);
1000 }
1001
1002 spin_unlock_bh(&txq->axq_lock);
1003 }
1004}
1005

--- 327 unchanged lines hidden (view full) ---

1333 continue;
1334
1335 ath_tx_sched_aggr(sc, txq, tid);
1336
1337 /*
1338 * add tid to round-robin queue if more frames
1339 * are pending for the tid
1340 */
1332 if (!list_empty(&tid->buf_q))
1341 if (!skb_queue_empty(&tid->buf_q))
1333 ath_tx_queue_tid(txq, tid);
1334
1335 if (tid == last_tid ||
1336 txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
1337 break;
1338 }
1339
1340 if (!list_empty(&ac->tid_q)) {

--- 89 unchanged lines hidden (view full) ---

1430
1431 /*
1432 * Do not queue to h/w when any of the following conditions is true:
1433 * - there are pending frames in software queue
1434 * - the TID is currently paused for ADDBA/BAR request
1435 * - seqno is not within block-ack window
1436 * - h/w queue depth exceeds low water mark
1437 */
1342 ath_tx_queue_tid(txq, tid);
1343
1344 if (tid == last_tid ||
1345 txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
1346 break;
1347 }
1348
1349 if (!list_empty(&ac->tid_q)) {

--- 89 unchanged lines hidden (view full) ---

1439
1440 /*
1441 * Do not queue to h/w when any of the following conditions is true:
1442 * - there are pending frames in software queue
1443 * - the TID is currently paused for ADDBA/BAR request
1444 * - seqno is not within block-ack window
1445 * - h/w queue depth exceeds low water mark
1446 */
1438 if (!list_empty(&tid->buf_q) || tid->paused ||
1447 if (!skb_queue_empty(&tid->buf_q) || tid->paused ||
1439 !BAW_WITHIN(tid->seq_start, tid->baw_size, fi->seqno) ||
1440 txctl->txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) {
1441 /*
1442 * Add this frame to software queue for scheduling later
1443 * for aggregation.
1444 */
1445 TX_STAT_INC(txctl->txq->axq_qnum, a_queued_sw);
1448 !BAW_WITHIN(tid->seq_start, tid->baw_size, fi->seqno) ||
1449 txctl->txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) {
1450 /*
1451 * Add this frame to software queue for scheduling later
1452 * for aggregation.
1453 */
1454 TX_STAT_INC(txctl->txq->axq_qnum, a_queued_sw);
1446 list_add_tail(&bf->list, &tid->buf_q);
1455 __skb_queue_tail(&tid->buf_q, bf->bf_mpdu);
1447 if (!txctl->an || !txctl->an->sleeping)
1448 ath_tx_queue_tid(txctl->txq, tid);
1449 return;
1450 }
1451
1452 INIT_LIST_HEAD(&bf_head);
1453 list_add(&bf->list, &bf_head);
1454

--- 314 unchanged lines hidden (view full) ---

1769 ath9k_hw_filltxdesc(ah, ds,
1770 skb->len, /* segment length */
1771 true, /* first segment */
1772 true, /* last segment */
1773 ds, /* first descriptor */
1774 bf->bf_buf_addr,
1775 txq->axq_qnum);
1776
1456 if (!txctl->an || !txctl->an->sleeping)
1457 ath_tx_queue_tid(txctl->txq, tid);
1458 return;
1459 }
1460
1461 INIT_LIST_HEAD(&bf_head);
1462 list_add(&bf->list, &bf_head);
1463

--- 314 unchanged lines hidden (view full) ---

1778 ath9k_hw_filltxdesc(ah, ds,
1779 skb->len, /* segment length */
1780 true, /* first segment */
1781 true, /* last segment */
1782 ds, /* first descriptor */
1783 bf->bf_buf_addr,
1784 txq->axq_qnum);
1785
1786 fi->bf = bf;
1777
1778 return bf;
1779}
1780
1781/* FIXME: tx power */
1782static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf,
1783 struct ath_tx_control *txctl)
1784{

--- 601 unchanged lines hidden (view full) ---

2386 tid->an = an;
2387 tid->tidno = tidno;
2388 tid->seq_start = tid->seq_next = 0;
2389 tid->baw_size = WME_MAX_BA;
2390 tid->baw_head = tid->baw_tail = 0;
2391 tid->sched = false;
2392 tid->paused = false;
2393 tid->state &= ~AGGR_CLEANUP;
1787
1788 return bf;
1789}
1790
1791/* FIXME: tx power */
1792static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf,
1793 struct ath_tx_control *txctl)
1794{

--- 601 unchanged lines hidden (view full) ---

2396 tid->an = an;
2397 tid->tidno = tidno;
2398 tid->seq_start = tid->seq_next = 0;
2399 tid->baw_size = WME_MAX_BA;
2400 tid->baw_head = tid->baw_tail = 0;
2401 tid->sched = false;
2402 tid->paused = false;
2403 tid->state &= ~AGGR_CLEANUP;
2394 INIT_LIST_HEAD(&tid->buf_q);
2404 __skb_queue_head_init(&tid->buf_q);
2395 acno = TID_TO_WME_AC(tidno);
2396 tid->ac = &an->ac[acno];
2397 tid->state &= ~AGGR_ADDBA_COMPLETE;
2398 tid->state &= ~AGGR_ADDBA_PROGRESS;
2399 }
2400
2401 for (acno = 0, ac = &an->ac[acno];
2402 acno < WME_NUM_AC; acno++, ac++) {

--- 38 unchanged lines hidden ---
2405 acno = TID_TO_WME_AC(tidno);
2406 tid->ac = &an->ac[acno];
2407 tid->state &= ~AGGR_ADDBA_COMPLETE;
2408 tid->state &= ~AGGR_ADDBA_PROGRESS;
2409 }
2410
2411 for (acno = 0, ac = &an->ac[acno];
2412 acno < WME_NUM_AC; acno++, ac++) {

--- 38 unchanged lines hidden ---