Date: Sat, 13 Dec 2003 21:58:09 -0800 (PST) From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 43924 for review Message-ID: <200312140558.hBE5w9Ta008602@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=43924 Change 43924 by sam@sam_ebb on 2003/12/13 21:57:46 o move xmit and recv descriptor debugging stuff under ath_debug bit flags o collect stats about xmits that make use of the multi-rate support o add more debug stuff for rate control monitoring Affected files ... .. //depot/projects/netperf/sys/dev/ath/if_ath.c#53 edit .. //depot/projects/netperf/sys/dev/ath/if_athioctl.h#9 edit Differences ... ==== //depot/projects/netperf/sys/dev/ath/if_ath.c#53 (text+ko) ==== @@ -162,18 +162,21 @@ int ath_debug = 0; SYSCTL_INT(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug, 0, "control debugging printfs"); -#define IFF_DUMPPKTS(_ifp) \ - (ath_debug || \ +#define IFF_DUMPPKTS(_ifp, _m) \ + ((ath_debug & _m) || \ ((_ifp)->if_flags & (IFF_DEBUG|IFF_LINK2)) == (IFF_DEBUG|IFF_LINK2)) static void ath_printrxbuf(struct ath_buf *bf, int); static void ath_printtxbuf(struct ath_buf *bf, int); enum { ATH_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ - ATH_DEBUG_RECV = 0x00000002, /* basic recv operation */ - ATH_DEBUG_RATE = 0x00000004, /* rate control */ - ATH_DEBUG_RESET = 0x00000008, /* device reset */ - ATH_DEBUG_MODE = 0x00000010, /* mode init/setup */ - ATH_DEBUG_BEACON = 0x00000020, /* beacon handling */ + ATH_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */ + ATH_DEBUG_RECV = 0x00000004, /* basic recv operation */ + ATH_DEBUG_RECV_DESC = 0x00000008, /* recv descriptors */ + ATH_DEBUG_RATE = 0x00000010, /* rate control */ + ATH_DEBUG_RESET = 0x00000020, /* reset processing */ + ATH_DEBUG_MODE = 0x00000040, /* mode init/setup */ + ATH_DEBUG_BEACON = 0x00000080, /* beacon handling */ + ATH_DEBUG_WATCHDOG = 0x00000100, /* watchdog timeout */ ATH_DEBUG_INTR = 0x00001000, /* ISR */ ATH_DEBUG_TX_PROC = 0x00002000, /* tx ISR proc */ ATH_DEBUG_RX_PROC = 0x00004000, /* rx ISR proc */ @@ -181,9 +184,9 @@ ATH_DEBUG_CALIBRATE = 0x00010000, /* periodic calibration */ ATH_DEBUG_ANY = 0xffffffff }; -#define DPRINTF(_m,X) if (ath_debug&_m) printf X +#define DPRINTF(_m,X) if (ath_debug & _m) printf X #else -#define IFF_DUMPPKTS(_ifp) \ +#define IFF_DUMPPKTS(_ifp, _m) \ (((_ifp)->if_flags & (IFF_DEBUG|IFF_LINK2)) == (IFF_DEBUG|IFF_LINK2)) #define DPRINTF(_m, X) #endif @@ -840,7 +843,7 @@ if (--sc->sc_tx_timer == 0) { if_printf(ifp, "device timeout\n"); #ifdef AR_DEBUG - if (ath_debug) + if (ath_debug & ATH_DEBUG_WATCHDOG) ath_hal_dumpstate(sc->sc_ah); #endif /* AR_DEBUG */ ath_reset(sc, 0); @@ -1691,7 +1694,7 @@ status = ath_hal_rxprocdesc(ah, ds, bf->bf_daddr, PA2DESC(sc, ds->ds_link)); #ifdef AR_DEBUG - if (ath_debug > 1) + if (ath_debug & ATH_DEBUG_RECV_DESC) ath_printrxbuf(bf, status == HAL_OK); #endif if (status == HAL_EINPROGRESS) @@ -2208,7 +2211,7 @@ ds = &bf->bf_desc[bf->bf_nseg - 1]; status = ath_hal_txprocdesc(ah, ds); #ifdef AR_DEBUG - if (ath_debug > 1) + if (ath_debug & ATH_DEBUG_XMIT_DESC) ath_printtxbuf(bf, status == HAL_OK); #endif if (status == HAL_EINPROGRESS) { @@ -2224,6 +2227,8 @@ if (ds->ds_txstat.ts_status == 0) { an->an_tx_ok++; an->an_tx_antenna = ds->ds_txstat.ts_antenna; + if (ds->ds_txstat.ts_rate != 0) + sc->sc_stats.ast_tx_altrate++; } else { an->an_tx_err++; ifp->if_oerrors++; @@ -2304,7 +2309,7 @@ TAILQ_REMOVE(&sc->sc_txq, bf, bf_list); ATH_TXQ_UNLOCK(sc); #ifdef AR_DEBUG - if (ath_debug) + if (ath_debug & ATH_DEBUG_RESET) ath_printtxbuf(bf, ath_hal_txprocdesc(ah, bf->bf_desc) == HAL_OK); #endif /* AR_DEBUG */ @@ -2343,12 +2348,11 @@ ath_hal_stopdmarecv(ah); /* disable DMA engine */ DELAY(3000); /* long enough for 1 frame */ #ifdef AR_DEBUG - if (ath_debug) { + if (ath_debug & ATH_DEBUG_RESET) { struct ath_buf *bf; - DPRINTF(ATH_DEBUG_RECV, ("%s: rx queue %p, link %p\n", - __func__, - (caddr_t) ath_hal_getrxbuf(ah), sc->sc_rxlink)); + printf("%s: rx queue %p, link %p\n", __func__, + (caddr_t) ath_hal_getrxbuf(ah), sc->sc_rxlink); TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { struct ath_desc *ds = bf->bf_desc; if (ath_hal_rxprocdesc(ah, ds, bf->bf_daddr, @@ -2766,6 +2770,10 @@ KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); + DPRINTF(ATH_DEBUG_RATE, ("%s: set xmit rate for %s to %dM\n", + __func__, ether_sprintf(ni->ni_macaddr), + (ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL) / 2)); + ni->ni_txrate = rate; an->an_tx_rix0 = sc->sc_rixmap[ ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL]; ==== //depot/projects/netperf/sys/dev/ath/if_athioctl.h#9 (text+ko) ==== @@ -70,6 +70,7 @@ u_int32_t ast_tx_rts; /* tx frames with rts enabled */ u_int32_t ast_tx_cts; /* tx frames with cts enabled */ u_int32_t ast_tx_shortpre;/* tx frames with short preamble */ + u_int32_t ast_tx_altrate; /* tx frames with alternate rate */ u_int32_t ast_rx_nombuf; /* rx setup failed 'cuz no mbuf */ u_int32_t ast_rx_busdma; /* rx setup failed for dma resrcs */ u_int32_t ast_rx_orn; /* rx failed 'cuz of desc overrun */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200312140558.hBE5w9Ta008602>