From 5594f5c06606e3b6bdf957f2a8b4c4226d124b89 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Mon, 18 Apr 2011 14:06:18 +0000 Subject: [PATCH] Add TX carrier sense timeout statistics. --- sys/dev/ath/if_ath.c | 6 ++++-- sys/dev/ath/if_ath_sysctl.c | 2 ++ sys/dev/ath/if_athioctl.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 00db1874bb33..f31a9ac90054 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -1357,6 +1357,8 @@ ath_intr(void *arg) } if (status & HAL_INT_GTT) sc->sc_stats.ast_tx_timeout++; + if (status & HAL_INT_CST) + sc->sc_stats.ast_tx_cst++; if (status & HAL_INT_MIB) { sc->sc_stats.ast_mib++; /* @@ -1561,9 +1563,9 @@ ath_init(void *arg) if (sc->sc_needmib && ic->ic_opmode == IEEE80211_M_STA) sc->sc_imask |= HAL_INT_MIB; - /* Enable global TX timeout statistics if available */ + /* Enable global TX timeout and carrier sense timeout if available */ if (ath_hal_gtxto_supported(ah)) - sc->sc_imask |= HAL_INT_GTT; + sc->sc_imask |= (HAL_INT_GTT | HAL_INT_CST); DPRINTF(sc, ATH_DEBUG_RESET, "%s: imask=0x%x\n", __func__, sc->sc_imask); diff --git a/sys/dev/ath/if_ath_sysctl.c b/sys/dev/ath/if_ath_sysctl.c index 45a9b5d738d7..8e064971bfbc 100644 --- a/sys/dev/ath/if_ath_sysctl.c +++ b/sys/dev/ath/if_ath_sysctl.c @@ -707,6 +707,8 @@ ath_sysctl_stats_attach(struct ath_softc *sc) &sc->sc_stats.ast_rx_hitqueueend, 0, "RX hit queue end"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_timeout", CTLFLAG_RD, &sc->sc_stats.ast_tx_timeout, 0, "TX Global Timeout"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_cst", CTLFLAG_RD, + &sc->sc_stats.ast_tx_cst, 0, "TX Carrier Sense Timeout"); /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h index 9c41aa5ad45f..1c9d23fe7cd7 100644 --- a/sys/dev/ath/if_athioctl.h +++ b/sys/dev/ath/if_athioctl.h @@ -130,6 +130,7 @@ struct ath_stats { u_int32_t ast_tx_htprotect; /* HT tx frames with protection */ u_int32_t ast_rx_hitqueueend; u_int32_t ast_tx_timeout; /* Global TX timeout */ + u_int32_t ast_tx_cst; /* Carrier sense timeout */ u_int32_t ast_pad[16]; };