package/mac80211/patches/580-ath9k_tx_fifo_cleanup.patch |
467 | 467 | } |
468 | 468 | |
469 | 469 | static void ath_tx_complete_poll_work(struct work_struct *work) |
470 | | @@ -2237,17 +2193,17 @@ void ath_tx_tasklet(struct ath_softc *sc |
| 470 | @@ -2237,17 +2193,16 @@ void ath_tx_tasklet(struct ath_softc *sc |
471 | 471 | |
472 | 472 | void ath_tx_edma_tasklet(struct ath_softc *sc) |
473 | 473 | { |
... | ... | |
481 | 481 | int status; |
482 | 482 | - int txok; |
483 | 483 | |
484 | | + spin_lock_bh(&txq->axq_lock); |
485 | 484 | for (;;) { |
486 | 485 | - status = ath9k_hw_txprocdesc(ah, NULL, (void *)&txs); |
487 | 486 | + status = ath9k_hw_txprocdesc(ah, NULL, (void *)&ts); |
488 | 487 | if (status == -EINPROGRESS) |
489 | 488 | break; |
490 | 489 | if (status == -EIO) { |
491 | | @@ -2257,16 +2213,16 @@ void ath_tx_edma_tasklet(struct ath_soft |
| 490 | @@ -2257,12 +2212,13 @@ void ath_tx_edma_tasklet(struct ath_soft |
492 | 491 | } |
493 | 492 | |
494 | 493 | /* Skip beacon completions */ |
... | ... | |
497 | 496 | continue; |
498 | 497 | |
499 | 498 | - txq = &sc->tx.txq[txs.qid]; |
500 | | + ath_dbg(common, ATH_DBG_XMIT, |
501 | | + "Tx status, descid=%04x\n", ts.desc_id); |
502 | | |
503 | | - spin_lock_bh(&txq->axq_lock); |
504 | | - if (list_empty(&txq->txq_fifo[txq->txq_tailidx])) { |
505 | | - spin_unlock_bh(&txq->axq_lock); |
506 | | - return; |
507 | | - } |
508 | 499 | + txq = &sc->tx.txq[ts.qid]; |
509 | | + |
510 | | + if (list_empty(&txq->txq_fifo[txq->txq_tailidx])) |
511 | | + break; |
512 | 500 | |
513 | | bf = list_first_entry(&txq->txq_fifo[txq->txq_tailidx], |
514 | | struct ath_buf, list); |
515 | | @@ -2275,43 +2231,24 @@ void ath_tx_edma_tasklet(struct ath_soft |
| 501 | spin_lock_bh(&txq->axq_lock); |
| 502 | + |
| 503 | if (list_empty(&txq->txq_fifo[txq->txq_tailidx])) { |
| 504 | spin_unlock_bh(&txq->axq_lock); |
| 505 | return; |
| 506 | @@ -2275,41 +2231,21 @@ void ath_tx_edma_tasklet(struct ath_soft |
516 | 507 | INIT_LIST_HEAD(&bf_head); |
517 | 508 | list_cut_position(&bf_head, &txq->txq_fifo[txq->txq_tailidx], |
518 | 509 | &lastbf->list); |
... | ... | |
524 | 515 | - spin_unlock_bh(&txq->axq_lock); |
525 | 516 | |
526 | 517 | - txok = !(txs.ts_status & ATH9K_TXERR_MASK); |
527 | | + if (list_empty(&txq->txq_fifo[txq->txq_tailidx])) { |
528 | | + INCR(txq->txq_tailidx, ATH_TXFIFO_DEPTH); |
529 | | |
| 518 | - |
530 | 519 | - if (!bf_isampdu(bf)) { |
531 | 520 | - if (txs.ts_status & ATH9K_TXERR_XRETRY) |
532 | 521 | - bf->bf_state.bf_type |= BUF_XRETRY; |
533 | 522 | - ath_tx_rc_status(sc, bf, &txs, 1, txok ? 0 : 1, txok, true); |
534 | 523 | - } |
535 | | + if (!list_empty(&txq->axq_q)) { |
536 | | + struct list_head bf_q; |
537 | | |
| 524 | - |
538 | 525 | - if (bf_isampdu(bf)) |
539 | 526 | - ath_tx_complete_aggr(sc, txq, bf, &bf_head, &txs, |
540 | 527 | - txok, true); |
541 | 528 | - else |
542 | 529 | - ath_tx_complete_buf(sc, bf, txq, &bf_head, |
543 | 530 | - &txs, txok, 0); |
544 | | - |
| 531 | + if (list_empty(&txq->txq_fifo[txq->txq_tailidx])) { |
| 532 | + INCR(txq->txq_tailidx, ATH_TXFIFO_DEPTH); |
| 533 | |
545 | 534 | - spin_lock_bh(&txq->axq_lock); |
546 | | + INIT_LIST_HEAD(&bf_q); |
547 | | + txq->axq_link = NULL; |
548 | | + list_splice_tail_init(&txq->axq_q, &bf_q); |
549 | | + ath_tx_txqaddbuf(sc, txq, &bf_q, true); |
550 | | + } |
551 | | + } |
| 535 | + if (!list_empty(&txq->axq_q)) { |
| 536 | + struct list_head bf_q; |
552 | 537 | |
553 | 538 | - if (!list_empty(&txq->txq_fifo_pending)) { |
554 | 539 | - INIT_LIST_HEAD(&bf_head); |
... | ... | |
560 | 545 | - ath_tx_txqaddbuf(sc, txq, &bf_head); |
561 | 546 | - } else if (sc->sc_flags & SC_OP_TXAGGR) |
562 | 547 | - ath_txq_schedule(sc, txq); |
563 | | + ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); |
| 548 | + INIT_LIST_HEAD(&bf_q); |
| 549 | + txq->axq_link = NULL; |
| 550 | + list_splice_tail_init(&txq->axq_q, &bf_q); |
| 551 | + ath_tx_txqaddbuf(sc, txq, &bf_q, true); |
| 552 | + } |
| 553 | + } |
564 | 554 | |
565 | | - spin_unlock_bh(&txq->axq_lock); |
| 555 | + ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); |
| 556 | spin_unlock_bh(&txq->axq_lock); |
566 | 557 | } |
567 | | + spin_unlock_bh(&txq->axq_lock); |
568 | 558 | } |
569 | | |
570 | | /*****************/ |
571 | 559 | --- a/drivers/net/wireless/ath/ath9k/ath9k.h |
572 | 560 | +++ b/drivers/net/wireless/ath/ath9k/ath9k.h |
573 | 561 | @@ -179,7 +179,7 @@ enum ATH_AGGR_STATUS { |