diff options
author | adrian <adrian@FreeBSD.org> | 2011-02-07 15:09:13 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2011-02-07 15:09:13 +0000 |
commit | 545592a7f0d9e1c98e74032f77e917bcc0849982 (patch) | |
tree | c4f9f16e987c53d383f83400c1adb9b17e42c45c | |
parent | 9ccaf288c9178d6dbdbb001ffec81fa6f7139f57 (diff) | |
download | FreeBSD-src-545592a7f0d9e1c98e74032f77e917bcc0849982.zip FreeBSD-src-545592a7f0d9e1c98e74032f77e917bcc0849982.tar.gz |
Add in a per phy error sysctl.
-rw-r--r-- | sys/dev/ath/if_ath.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index cb651ae..eb0d27c 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -6333,6 +6333,23 @@ ath_sysctl_clearstats(SYSCTL_HANDLER_ARGS) } static void +ath_sysctl_stats_attach_rxphyerr(struct ath_softc *sc, struct sysctl_oid_list *parent) +{ + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); + struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); + struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + int i; + char sn[8]; + + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx_phy_err", CTLFLAG_RD, NULL, "Per-code RX PHY Errors"); + child = SYSCTL_CHILDREN(tree); + for (i = 0; i < 32; i++) { + snprintf(sn, sizeof(sn), "%d", i); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, sn, CTLFLAG_RD, &sc->sc_stats.ast_rx_phy[i], 0, ""); + } +} + +static void ath_sysctl_stats_attach(struct ath_softc *sc) { struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); @@ -6503,4 +6520,7 @@ ath_sysctl_stats_attach(struct ath_softc *sc) &sc->sc_stats.ast_ani_cal, 0, "number of ANI polls"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_agg", CTLFLAG_RD, &sc->sc_stats.ast_rx_agg, 0, "number of aggregate frames received"); + + /* Attach the RX phy error array */ + ath_sysctl_stats_attach_rxphyerr(sc, child); } |