Author: adrian
Date: Sun May 15 15:54:34 2011
New Revision: 221965
URL: http://svn.freebsd.org/changeset/base/221965

Log:
  * Add some more TX descriptor error counters; this'll be helpful when
    implementing TX aggregation
  * Whilst I'm there, comment some RX error counters

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

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c   Sun May 15 15:47:16 2011        (r221964)
+++ head/sys/dev/ath/if_ath.c   Sun May 15 15:54:34 2011        (r221965)
@@ -3966,9 +3966,21 @@ ath_tx_processq(struct ath_softc *sc, st
                                        sc->sc_stats.ast_tx_fifoerr++;
                                if (ts->ts_status & HAL_TXERR_FILT)
                                        sc->sc_stats.ast_tx_filtered++;
+                               if (ts->ts_status & HAL_TXERR_XTXOP)
+                                       sc->sc_stats.ast_tx_xtxop++;
+                               if (ts->ts_status & HAL_TXERR_TIMER_EXPIRED)
+                                       sc->sc_stats.ast_tx_timerexpired++;
+
+                               /* XXX HAL_TX_DATA_UNDERRUN */
+                               /* XXX HAL_TX_DELIM_UNDERRUN */
+
                                if (bf->bf_m->m_flags & M_FF)
                                        sc->sc_stats.ast_ff_txerr++;
                        }
+                       /* XXX when is this valid? */
+                       if (ts->ts_status & HAL_TX_DESC_CFG_ERR)
+                               sc->sc_stats.ast_tx_desccfgerr++;
+
                        sr = ts->ts_shortretry;
                        lr = ts->ts_longretry;
                        sc->sc_stats.ast_tx_shortretry += sr;

Modified: head/sys/dev/ath/if_ath_sysctl.c
==============================================================================
--- head/sys/dev/ath/if_ath_sysctl.c    Sun May 15 15:47:16 2011        
(r221964)
+++ head/sys/dev/ath/if_ath_sysctl.c    Sun May 15 15:54:34 2011        
(r221965)
@@ -709,6 +709,12 @@ ath_sysctl_stats_attach(struct ath_softc
            &sc->sc_stats.ast_tx_timeout, 0, "TX Global Timeout");
        SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_cst", CTLFLAG_RD,
            &sc->sc_stats.ast_tx_cst, 0, "TX Carrier Sense Timeout");
+       SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_xtxop", CTLFLAG_RD,
+           &sc->sc_stats.ast_tx_xtxop, 0, "TX exceeded TXOP");
+       SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_timerexpired", CTLFLAG_RD,
+           &sc->sc_stats.ast_tx_timerexpired, 0, "TX exceeded TX_TIMER 
register");
+       SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_desccfgerr", CTLFLAG_RD,
+           &sc->sc_stats.ast_tx_desccfgerr, 0, "TX Descriptor Cfg Error");
 
        /* 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      Sun May 15 15:47:16 2011        
(r221964)
+++ head/sys/dev/ath/if_athioctl.h      Sun May 15 15:54:34 2011        
(r221965)
@@ -121,17 +121,20 @@ 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_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_halfgi;  /* RX half-GI */
+       u_int32_t       ast_rx_2040;    /* RX 40mhz frame */
+       u_int32_t       ast_rx_pre_crc_err;     /* RX pre-delimiter CRC error */
+       u_int32_t       ast_rx_post_crc_err;    /* RX post-delimiter CRC error 
*/
+       u_int32_t       ast_rx_decrypt_busy_err;        /* RX decrypt engine 
busy error */
        u_int32_t       ast_rx_hi_rx_chain;
        u_int32_t       ast_tx_htprotect;       /* HT tx frames with protection 
*/
-       u_int32_t       ast_rx_hitqueueend;
+       u_int32_t       ast_rx_hitqueueend;     /* RX hit descr queue end */
        u_int32_t       ast_tx_timeout;         /* Global TX timeout */
        u_int32_t       ast_tx_cst;             /* Carrier sense timeout */
-       u_int32_t       ast_pad[16];
+       u_int32_t       ast_tx_xtxop;   /* tx exceeded TXOP */
+       u_int32_t       ast_tx_timerexpired;    /* tx exceeded TX_TIMER */
+       u_int32_t       ast_tx_desccfgerr;      /* tx desc cfg error */
+       u_int32_t       ast_pad[13];
 };
 
 #define        SIOCGATHSTATS   _IOWR('i', 137, struct ifreq)
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to