Author: adrian
Date: Mon Feb  7 15:09:13 2011
New Revision: 218402
URL: http://svn.freebsd.org/changeset/base/218402

Log:
  Add in a per phy error sysctl.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c   Mon Feb  7 15:04:53 2011        (r218401)
+++ head/sys/dev/ath/if_ath.c   Mon Feb  7 15:09:13 2011        (r218402)
@@ -6333,6 +6333,23 @@ ath_sysctl_clearstats(SYSCTL_HANDLER_ARG
 }
 
 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_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);
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to