From 818253338aec9ce33c83b4d2e839520ae406d5ce Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Tue, 22 Jul 2014 18:48:59 +0200 Subject: [PATCH] ath9k: more debug output Signed-off-by: Simon Wunderlich --- drivers/net/wireless/ath/ath9k/xmit.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 41e9169..b75e9f7 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -1327,7 +1327,7 @@ ath_tx_form_burst(struct ath_softc *sc, struct ath_txq *txq, } static bool ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq, - struct ath_atx_tid *tid, bool *stop) + struct ath_atx_tid *tid, bool *stop, int *step) { struct ath_buf *bf; struct ieee80211_tx_info *tx_info; @@ -1336,15 +1336,18 @@ static bool ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq, int aggr_len = 0; bool aggr, last = true; + *step = 0; if (!ath_tid_has_buffered(tid)) return false; INIT_LIST_HEAD(&bf_q); + *step = 1; bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q); if (!bf) return false; + *step = 2; tx_info = IEEE80211_SKB_CB(bf->bf_mpdu); aggr = !!(tx_info->flags & IEEE80211_TX_CTL_AMPDU); if ((aggr && txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) || @@ -1353,6 +1356,7 @@ static bool ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq, return false; } + *step = 3; ath_set_rates(tid->an->vif, tid->an->sta, bf); if (aggr) last = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf, @@ -1360,13 +1364,16 @@ static bool ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq, else ath_tx_form_burst(sc, txq, tid, &bf_q, bf, tid_q); + *step = 4; if (list_empty(&bf_q)) return false; + *step = 5; if (tid->ac->clear_ps_filter || tid->an->no_ps_filter) { tid->ac->clear_ps_filter = false; tx_info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; } + *step = 6; ath_tx_fill_desc(sc, bf, txq, aggr_len); ath_tx_txqaddbuf(sc, txq, &bf_q, false); @@ -1836,22 +1843,32 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq) __func__, __LINE__, ac, list_empty(&ac->tid_q)); while (!list_empty(&ac->tid_q)) { + int ret, step; tid = list_first_entry(&ac->tid_q, struct ath_atx_tid, list); list_del(&tid->list); tid->sched = false; - if (ath_tx_sched_aggr(sc, txq, tid, &stop)) + ret = ath_tx_sched_aggr(sc, txq, tid, &stop, &step); + if (ret) sent = true; + ath_dbg(common, QUEUE, "%s %d tid %d of ac %p: ath_tx_sched_aggr returned %d, stop = %d, last_tid = %d, step = %d\n", + __func__, __LINE__, tid->tidno, ac, ret, stop, last_tid->tidno, step); /* * add tid to round-robin queue if more frames * are pending for the tid */ - if (ath_tid_has_buffered(tid)) + ret = ath_tid_has_buffered(tid); + if (ret) ath_tx_queue_tid(txq, tid); + ath_dbg(common, QUEUE, "%s %d tid %d of ac %p: ath_tid_has_buffered returned %d\n", + __func__, __LINE__, tid->tidno, ac, ret); + + + if (stop || tid == last_tid) break; } -- 1.9.1