svn commit: r218689 - head/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Mon Feb 14 21:24:54 UTC 2011


Author: adrian
Date: Mon Feb 14 21:24:54 2011
New Revision: 218689
URL: http://svn.freebsd.org/changeset/base/218689

Log:
  Some statistics additions - prepare for error codes > 32 (since the AR5416
  error mask is > 5 bits) and add some extra CRC/HT40/ShortGI counters to
  help debug 802.11n issues.

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

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Mon Feb 14 20:49:37 2011	(r218688)
+++ head/sys/dev/ath/if_ath.c	Mon Feb 14 21:24:54 2011	(r218689)
@@ -3715,7 +3715,6 @@ ath_rx_proc(void *arg, int npending)
 	struct mbuf *m;
 	struct ieee80211_node *ni;
 	int len, type, ngood;
-	u_int phyerr;
 	HAL_STATUS status;
 	int16_t nf;
 	u_int64_t tsf;
@@ -3769,6 +3768,21 @@ ath_rx_proc(void *arg, int npending)
 		if (status == HAL_EINPROGRESS)
 			break;
 		STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list);
+
+		/* These aren't specifically errors */
+		if (rs->rs_flags & HAL_RX_GI)
+			sc->sc_stats.ast_rx_halfgi++;
+		if (rs->rs_flags & HAL_RX_2040)
+			sc->sc_stats.ast_rx_2040++;
+		if (rs->rs_flags & HAL_RX_DELIM_CRC_PRE)
+			sc->sc_stats.ast_rx_pre_crc_err++;
+		if (rs->rs_flags & HAL_RX_DELIM_CRC_POST)
+			sc->sc_stats.ast_rx_post_crc_err++;
+		if (rs->rs_flags & HAL_RX_DECRYPT_BUSY)
+			sc->sc_stats.ast_rx_decrypt_busy_err++;
+		if (rs->rs_flags & HAL_RX_HI_RX_CHAIN)
+			sc->sc_stats.ast_rx_hi_rx_chain++;
+
 		if (rs->rs_status != 0) {
 			if (rs->rs_status & HAL_RXERR_CRC)
 				sc->sc_stats.ast_rx_crcerr++;
@@ -3776,8 +3790,9 @@ ath_rx_proc(void *arg, int npending)
 				sc->sc_stats.ast_rx_fifoerr++;
 			if (rs->rs_status & HAL_RXERR_PHY) {
 				sc->sc_stats.ast_rx_phyerr++;
-				phyerr = rs->rs_phyerr & 0x1f;
-				sc->sc_stats.ast_rx_phy[phyerr]++;
+				/* Be suitably paranoid about receiving phy errors out of the stats array bounds */
+				if (rs->rs_phyerr < 64)
+					sc->sc_stats.ast_rx_phy[rs->rs_phyerr]++;
 				goto rx_error;	/* NB: don't count in ierrors */
 			}
 			if (rs->rs_status & HAL_RXERR_DECRYPT) {
@@ -6402,7 +6417,7 @@ ath_sysctl_stats_attach_rxphyerr(struct 
 
 	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++) {
+	for (i = 0; i < 64; 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, "");
 	}
@@ -6580,6 +6595,13 @@ ath_sysctl_stats_attach(struct ath_softc
 	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_agg", CTLFLAG_RD,
 	    &sc->sc_stats.ast_rx_agg, 0, "number of aggregate frames received");
 
+	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_halfgi", CTLFLAG_RD, &sc->sc_stats.ast_rx_halfgi, 0, "");
+	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_2040", CTLFLAG_RD, &sc->sc_stats.ast_rx_2040, 0, "");
+	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_pre_crc_err", CTLFLAG_RD, &sc->sc_stats.ast_rx_pre_crc_err, 0, "");
+	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_post_crc_err", CTLFLAG_RD, &sc->sc_stats.ast_rx_post_crc_err, 0, "");
+	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_decrypt_busy_err", CTLFLAG_RD, &sc->sc_stats.ast_rx_decrypt_busy_err, 0, "");
+	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_hi_rx_chain", CTLFLAG_RD, &sc->sc_stats.ast_rx_hi_rx_chain, 0, "");
+
 	/* Attach the RX phy error array */
 	ath_sysctl_stats_attach_rxphyerr(sc, child);
 }

Modified: head/sys/dev/ath/if_athioctl.h
==============================================================================
--- head/sys/dev/ath/if_athioctl.h	Mon Feb 14 20:49:37 2011	(r218688)
+++ head/sys/dev/ath/if_athioctl.h	Mon Feb 14 21:24:54 2011	(r218689)
@@ -79,7 +79,7 @@ struct ath_stats {
 	u_int32_t	ast_rx_badcrypt;/* rx failed 'cuz decryption */
 	u_int32_t	ast_rx_badmic;	/* rx failed 'cuz MIC failure */
 	u_int32_t	ast_rx_phyerr;	/* rx failed 'cuz of PHY err */
-	u_int32_t	ast_rx_phy[32];	/* rx PHY error per-code counts */
+	u_int32_t	ast_rx_phy[64];	/* rx PHY error per-code counts */
 	u_int32_t	ast_rx_tooshort;/* rx discarded 'cuz frame too short */
 	u_int32_t	ast_rx_toobig;	/* rx discarded 'cuz frame too large */
 	u_int32_t	ast_rx_packets;	/* packet recv on the interface */
@@ -121,7 +121,13 @@ struct ath_stats {
 	u_int32_t	ast_be_missed;	/* missed beacons */
 	u_int32_t	ast_ani_cal;	/* ANI calibrations performed */
 	u_int32_t	ast_rx_agg;	/* number of aggregate frames RX'ed */
-	u_int32_t	ast_pad[11];
+	u_int32_t	ast_rx_halfgi;
+	u_int32_t	ast_rx_2040;
+	u_int32_t	ast_rx_pre_crc_err;
+	u_int32_t	ast_rx_post_crc_err;
+	u_int32_t	ast_rx_decrypt_busy_err;
+	u_int32_t	ast_rx_hi_rx_chain;
+	u_int32_t	ast_pad[4];
 };
 
 #define	SIOCGATHSTATS	_IOWR('i', 137, struct ifreq)


More information about the svn-src-head mailing list