Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Feb 2011 15:09:13 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218402 - head/sys/dev/ath
Message-ID:  <201102071509.p17F9DOs013153@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102071509.p17F9DOs013153>