From 1030caa384a1ea893efd5506645ece24a3bc9d1f Mon Sep 17 00:00:00 2001 From: adrian Date: Wed, 20 Feb 2013 11:14:55 +0000 Subject: CFG_ERR, DATA_UNDERRUN and DELIM_UNDERRUN are all flags, rather than part of ts_status. Thus: * make sure we decode them from ts_flags, rather than ts_status; * make sure we decode them regardless of whether there's an error or not. This correctly exposes descriptor configuration errors, TX delimiter underruns and TX data underruns. --- sys/dev/ath/if_ath.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'sys/dev/ath/if_ath.c') diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index b6b4217..1e796a0 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -3581,17 +3581,24 @@ ath_tx_update_stats(struct ath_softc *sc, struct ath_tx_status *ts, if (ts->ts_status & HAL_TXERR_TIMER_EXPIRED) sc->sc_stats.ast_tx_timerexpired++; - if (ts->ts_status & HAL_TX_DATA_UNDERRUN) - sc->sc_stats.ast_tx_data_underrun++; - if (ts->ts_status & HAL_TX_DELIM_UNDERRUN) - sc->sc_stats.ast_tx_delim_underrun++; - if (bf->bf_m->m_flags & M_FF) sc->sc_stats.ast_ff_txerr++; } /* XXX when is this valid? */ - if (ts->ts_status & HAL_TX_DESC_CFG_ERR) + if (ts->ts_flags & HAL_TX_DESC_CFG_ERR) sc->sc_stats.ast_tx_desccfgerr++; + /* + * This can be valid for successful frame transmission! + * If there's a TX FIFO underrun during aggregate transmission, + * the MAC will pad the rest of the aggregate with delimiters. + * If a BA is returned, the frame is marked as "OK" and it's up + * to the TX completion code to notice which frames weren't + * successfully transmitted. + */ + if (ts->ts_flags & HAL_TX_DATA_UNDERRUN) + sc->sc_stats.ast_tx_data_underrun++; + if (ts->ts_flags & HAL_TX_DELIM_UNDERRUN) + sc->sc_stats.ast_tx_delim_underrun++; sr = ts->ts_shortretry; lr = ts->ts_longretry; -- cgit v1.1