From 7ec4e6b83b6459ebc4506d97a5fd5dded50bfedb Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sat, 14 Aug 2010 14:01:12 +0000 Subject: [PATCH] Add a global counter of missed beacons. The existing missed beacon count is reset once a beacon isn't missed. --- sys/dev/ath/if_ath.c | 1 + sys/dev/ath/if_athioctl.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 9bb06555fd0..fca3a6672ab 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -2824,6 +2824,7 @@ ath_beacon_proc(void *arg, int pending) */ if (ath_hal_numtxpending(ah, sc->sc_bhalq) != 0) { sc->sc_bmisscount++; + sc->sc_stats.ast_be_missed++; DPRINTF(sc, ATH_DEBUG_BEACON, "%s: missed %u consecutive beacons\n", __func__, sc->sc_bmisscount); diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h index 35947a098d7..badda598471 100644 --- a/sys/dev/ath/if_athioctl.h +++ b/sys/dev/ath/if_athioctl.h @@ -118,7 +118,8 @@ struct ath_stats { u_int32_t ast_tdma_ack; /* TDMA tx failed 'cuz ACK required */ u_int32_t ast_tx_raw_fail;/* raw tx failed 'cuz h/w down */ u_int32_t ast_tx_nofrag; /* tx dropped 'cuz no ath frag buffer */ - u_int32_t ast_pad[14]; + u_int32_t ast_be_missed; /* missed beacons */ + u_int32_t ast_pad[13]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq)