commit 42b6382a39fe6bfb329007477fb6e17db6b33d3f Author: Jiri Slaby Date: Sun Jul 15 09:38:31 2007 +0200 stats diff --git a/ath/if_ath_pci.c b/ath/if_ath_pci.c index 5a1bdab..2d9794c 100644 --- a/ath/if_ath_pci.c +++ b/ath/if_ath_pci.c @@ -180,6 +180,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) txs.retry_count = ds->ds_txstat.ts_shortretry + ds->ds_txstat.ts_longretry / 6; if (ds->ds_txstat.ts_status) { + sc->ll_stats.dot11ACKFailureCount++; if (ds->ds_txstat.ts_status & AR5K_TXERR_XRETRY) { txs.excessive_retries = 1; } else if (ds->ds_txstat.ts_status & AR5K_TXERR_FILT) { @@ -191,10 +192,12 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) } ieee80211_tx_status(sc->hw, skb, &txs); + sc->tx_stats.data[txq->qnum].count++; // printk(KERN_DEBUG "DONE skb: %p, rssi: %d, stat: %x, seq: %u, stamp: %u\n", skb, ds->ds_txstat.ts_rssi, ds->ds_txstat.ts_status, ds->ds_txstat.ts_seqnum, ds->ds_txstat.ts_tstamp); spin_lock(&sc->txbuflock); + sc->tx_stats.data[txq->qnum].len--; list_move_tail(&bf->list, &sc->txbuf); spin_unlock(&sc->txbuflock); } @@ -637,6 +640,7 @@ static void ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) bf->skb = NULL; spin_lock_bh(&sc->txbuflock); + sc->tx_stats.data[txq->qnum].len--; list_move_tail(&bf->list, &sc->txbuf); spin_unlock_bh(&sc->txbuflock); } @@ -925,6 +929,7 @@ static int ath_tx_bf(struct ath_softc *sc, struct ath_buf *bf, spin_lock_bh(&txq->lock); list_add_tail(&bf->list, &txq->q); + sc->tx_stats.data[txq->qnum].len++; if (txq->link == NULL) /* is this first packet? */ ath5k_hw_put_tx_buf(ah, txq->qnum, bf->daddr); else /* no, so only link it */ @@ -1093,6 +1098,26 @@ unlock: return ret; } +static int ath_get_stats(struct ieee80211_hw *hw, + struct ieee80211_low_level_stats *stats) +{ + struct ath_softc *sc = hw->priv; + + memcpy(stats, &sc->ll_stats, sizeof(sc->ll_stats)); + + return 0; +} + +static int ath_get_tx_stats(struct ieee80211_hw *hw, + struct ieee80211_tx_queue_stats *stats) +{ + struct ath_softc *sc = hw->priv; + + memcpy(stats, &sc->tx_stats, sizeof(sc->tx_stats)); + + return 0; +} + static u64 ath_get_tsf(struct ieee80211_hw *hw) { struct ath_softc *sc = hw->priv; @@ -1117,9 +1142,9 @@ static struct ieee80211_ops ath_hw_ops = { .config = ath_config, .config_interface = NULL, .set_key = ath_set_key, -/* .get_stats = , - .conf_tx = , - .get_tx_stats = ,*/ + .get_stats = ath_get_stats, + .conf_tx = NULL, + .get_tx_stats = ath_get_tx_stats, .get_tsf = ath_get_tsf, .reset_tsf = ath_reset_tsf, .beacon_update = NULL, diff --git a/ath/if_athvar.h b/ath/if_athvar.h index f44464b..b884d06 100644 --- a/ath/if_athvar.h +++ b/ath/if_athvar.h @@ -120,6 +120,8 @@ struct ath_softc { void __iomem *iobase; /* address of the device */ struct mutex lock; /* dev-level lock */ struct ath_stats stats; /* private statistics */ + struct ieee80211_tx_queue_stats tx_stats; + struct ieee80211_low_level_stats ll_stats; struct ieee80211_hw *hw; /* IEEE 802.11 common */ struct ieee80211_hw_mode modes[NUM_IEEE80211_MODES]; struct ieee80211_channel channels[ATH_CHAN_MAX];