Skip to content

Commit

Permalink
ath9k: Add support for get_stats callback
Browse files Browse the repository at this point in the history
this useful for debugging and to keep track of success/failure of
frames such as ACK, RTS and FCS error count in a noisy environment

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Mohammed Shafi Shajakhan authored and John W. Linville committed Aug 24, 2011
1 parent 0d78156 commit 52c94f4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2403,6 +2403,20 @@ static int ath9k_tx_last_beacon(struct ieee80211_hw *hw)
return sc->beacon.tx_last;
}

static int ath9k_get_stats(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats)
{
struct ath_softc *sc = hw->priv;
struct ath_hw *ah = sc->sc_ah;
struct ath9k_mib_stats *mib_stats = &ah->ah_mibStats;

stats->dot11ACKFailureCount = mib_stats->ackrcv_bad;
stats->dot11RTSFailureCount = mib_stats->rts_bad;
stats->dot11FCSErrorCount = mib_stats->fcs_bad;
stats->dot11RTSSuccessCount = mib_stats->rts_good;
return 0;
}

struct ieee80211_ops ath9k_ops = {
.tx = ath9k_tx,
.start = ath9k_start,
Expand All @@ -2427,5 +2441,6 @@ struct ieee80211_ops ath9k_ops = {
.set_coverage_class = ath9k_set_coverage_class,
.flush = ath9k_flush,
.tx_frames_pending = ath9k_tx_frames_pending,
.tx_last_beacon = ath9k_tx_last_beacon,
.tx_last_beacon = ath9k_tx_last_beacon,
.get_stats = ath9k_get_stats,
};

0 comments on commit 52c94f4

Please sign in to comment.