Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2013 21:57:44 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r259341 - stable/10/sys/dev/ath
Message-ID:  <201312132157.rBDLvi61040225@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Fri Dec 13 21:57:44 2013
New Revision: 259341
URL: http://svnweb.freebsd.org/changeset/base/259341

Log:
  MFC r256658, r256666:
  
  Move a lot of debugging printf's to DPRINTF.

Modified:
  stable/10/sys/dev/ath/if_ath.c
  stable/10/sys/dev/ath/if_ath_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/ath/if_ath.c
==============================================================================
--- stable/10/sys/dev/ath/if_ath.c	Fri Dec 13 21:50:03 2013	(r259340)
+++ stable/10/sys/dev/ath/if_ath.c	Fri Dec 13 21:57:44 2013	(r259341)
@@ -2725,7 +2725,7 @@ ath_transmit(struct ifnet *ifp, struct m
 	 */
 	ATH_PCU_LOCK(sc);
 	if (sc->sc_inreset_cnt > 0) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_XMIT,
 		    "%s: sc_inreset_cnt > 0; bailing\n", __func__);
 		ATH_PCU_UNLOCK(sc);
 		IF_LOCK(&ifp->if_snd);
@@ -6430,7 +6430,7 @@ ath_node_recv_pspoll(struct ieee80211_no
 	 * Immediately punt.
 	 */
 	if (! an->an_is_powersave) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
 		    "%s: %6D: not in powersave?\n",
 		    __func__,
 		    ni->ni_macaddr,
@@ -6498,7 +6498,8 @@ ath_node_recv_pspoll(struct ieee80211_no
 	/*
 	 * XXX nothing in the TIDs at this point? Eek.
 	 */
-	device_printf(sc->sc_dev, "%s: %6D: TIDs empty, but ath_node showed traffic?!\n",
+	DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
+	    "%s: %6D: TIDs empty, but ath_node showed traffic?!\n",
 	    __func__,
 	    ni->ni_macaddr,
 	    ":");

Modified: stable/10/sys/dev/ath/if_ath_tx.c
==============================================================================
--- stable/10/sys/dev/ath/if_ath_tx.c	Fri Dec 13 21:50:03 2013	(r259340)
+++ stable/10/sys/dev/ath/if_ath_tx.c	Fri Dec 13 21:57:44 2013	(r259341)
@@ -268,7 +268,7 @@ ath_txfrag_setup(struct ath_softc *sc, a
 		/* XXX non-management? */
 		bf = _ath_getbuf_locked(sc, ATH_BUFTYPE_NORMAL);
 		if (bf == NULL) {	/* out of buffers, cleanup */
-			device_printf(sc->sc_dev, "%s: no buffer?\n",
+			DPRINTF(sc, ATH_DEBUG_XMIT, "%s: no buffer?\n",
 			    __func__);
 			ath_txfrag_cleanup(sc, frags, ni);
 			break;
@@ -560,10 +560,10 @@ ath_tx_setds_11n(struct ath_softc *sc, s
 	bf = bf_first;
 
 	if (bf->bf_state.bfs_txrate0 == 0)
-		device_printf(sc->sc_dev, "%s: bf=%p, txrate0=%d\n",
+		DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: bf=%p, txrate0=%d\n",
 		    __func__, bf, 0);
 	if (bf->bf_state.bfs_rc[0].ratecode == 0)
-		device_printf(sc->sc_dev, "%s: bf=%p, rix0=%d\n",
+		DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: bf=%p, rix0=%d\n",
 		    __func__, bf, 0);
 
 	/*
@@ -708,11 +708,9 @@ ath_tx_handoff_mcast(struct ath_softc *s
 	 * mapped correctly.
 	 */
 	if (bf->bf_state.bfs_tx_queue != sc->sc_cabq->axq_qnum) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_XMIT,
 		    "%s: bf=%p, bfs_tx_queue=%d, axq_qnum=%d\n",
-		    __func__,
-		    bf,
-		    bf->bf_state.bfs_tx_queue,
+		    __func__, bf, bf->bf_state.bfs_tx_queue,
 		    txq->axq_qnum);
 	}
 
@@ -881,11 +879,9 @@ ath_tx_handoff_hw(struct ath_softc *sc, 
 	 * checking and holding buffer manipulation is sane.
 	 */
 	if (bf->bf_state.bfs_tx_queue != txq->axq_qnum) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_XMIT,
 		    "%s: bf=%p, bfs_tx_queue=%d, axq_qnum=%d\n",
-		    __func__,
-		    bf,
-		    bf->bf_state.bfs_tx_queue,
+		    __func__, bf, bf->bf_state.bfs_tx_queue,
 		    txq->axq_qnum);
 	}
 
@@ -1343,8 +1339,8 @@ ath_tx_setds(struct ath_softc *sc, struc
 	struct ath_hal *ah = sc->sc_ah;
 
 	if (bf->bf_state.bfs_txrate0 == 0)
-		device_printf(sc->sc_dev, "%s: bf=%p, txrate0=%d\n",
-		    __func__, bf, 0);
+		DPRINTF(sc, ATH_DEBUG_XMIT, 
+		    "%s: bf=%p, txrate0=%d\n", __func__, bf, 0);
 
 	ath_hal_setuptxdesc(ah, ds
 		, bf->bf_state.bfs_pktlen	/* packet length */
@@ -1481,14 +1477,10 @@ ath_tx_should_swq_frame(struct ath_softc
 		 * Other control/mgmt frame; bypass software queuing
 		 * for now!
 		 */
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_XMIT, 
 		    "%s: %6D: Node is asleep; sending mgmt "
 		    "(type=%d, subtype=%d)\n",
-		    __func__,
-		    ni->ni_macaddr,
-		    ":",
-		    type,
-		    subtype);
+		    __func__, ni->ni_macaddr, ":", type, subtype);
 		return (0);
 	} else {
 		return (1);
@@ -1743,7 +1735,7 @@ ath_tx_normal_setup(struct ath_softc *sc
 	 */
 #if 0
 	if (txq != sc->sc_ac2q[pri]) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_XMIT, 
 		    "%s: txq=%p (%d), pri=%d, pri txq=%p (%d)\n",
 		    __func__,
 		    txq,
@@ -2145,7 +2137,7 @@ ath_tx_raw_start(struct ath_softc *sc, s
 	/* Map ADDBA to the correct priority */
 	if (do_override) {
 #if 0
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_XMIT, 
 		    "%s: overriding tid %d pri %d -> %d\n",
 		    __func__, o_tid, pri, TID_TO_WME_AC(o_tid));
 #endif
@@ -2356,8 +2348,8 @@ ath_raw_xmit(struct ieee80211_node *ni, 
 
 	ATH_PCU_LOCK(sc);
 	if (sc->sc_inreset_cnt > 0) {
-		device_printf(sc->sc_dev, "%s: sc_inreset_cnt > 0; bailing\n",
-		    __func__);
+		DPRINTF(sc, ATH_DEBUG_XMIT, 
+		    "%s: sc_inreset_cnt > 0; bailing\n", __func__);
 		error = EIO;
 		ATH_PCU_UNLOCK(sc);
 		goto bad0;
@@ -2585,16 +2577,14 @@ ath_tx_addto_baw(struct ath_softc *sc, s
 	tap = ath_tx_get_tx_tid(an, tid->tid);
 
 	if (! bf->bf_state.bfs_dobaw) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
 		    "%s: dobaw=0, seqno=%d, window %d:%d\n",
-		    __func__,
-		    SEQNO(bf->bf_state.bfs_seqno),
-		    tap->txa_start,
-		    tap->txa_wnd);
+		    __func__, SEQNO(bf->bf_state.bfs_seqno),
+		    tap->txa_start, tap->txa_wnd);
 	}
 
 	if (bf->bf_state.bfs_addedbaw)
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
 		    "%s: re-added? tid=%d, seqno %d; window %d:%d; "
 		    "baw head=%d tail=%d\n",
 		    __func__, tid->tid, SEQNO(bf->bf_state.bfs_seqno),
@@ -2607,7 +2597,7 @@ ath_tx_addto_baw(struct ath_softc *sc, s
 	 */
 	if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd,
 	    SEQNO(bf->bf_state.bfs_seqno))) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
 		    "%s: bf=%p: outside of BAW?? tid=%d, seqno %d; window %d:%d; "
 		    "baw head=%d tail=%d\n",
 		    __func__, bf, tid->tid, SEQNO(bf->bf_state.bfs_seqno),
@@ -2633,11 +2623,11 @@ ath_tx_addto_baw(struct ath_softc *sc, s
 	assert(tid->tx_buf[cindex] == NULL);
 #endif
 	if (tid->tx_buf[cindex] != NULL) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
 		    "%s: ba packet dup (index=%d, cindex=%d, "
 		    "head=%d, tail=%d)\n",
 		    __func__, index, cindex, tid->baw_head, tid->baw_tail);
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
 		    "%s: BA bf: %p; seqno=%d ; new bf: %p; seqno=%d\n",
 		    __func__,
 		    tid->tx_buf[cindex],
@@ -2684,22 +2674,21 @@ ath_tx_switch_baw_buf(struct ath_softc *
 	 * soon hang.
 	 */
 	if (old_bf->bf_state.bfs_seqno != new_bf->bf_state.bfs_seqno) {
-		device_printf(sc->sc_dev, "%s: retransmitted buffer"
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
+		    "%s: retransmitted buffer"
 		    " has mismatching seqno's, BA session may hang.\n",
 		    __func__);
-		device_printf(sc->sc_dev, "%s: old seqno=%d, new_seqno=%d\n",
-		    __func__,
-		    old_bf->bf_state.bfs_seqno,
-		    new_bf->bf_state.bfs_seqno);
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
+		    "%s: old seqno=%d, new_seqno=%d\n", __func__,
+		    old_bf->bf_state.bfs_seqno, new_bf->bf_state.bfs_seqno);
 	}
 
 	if (tid->tx_buf[cindex] != old_bf) {
-		device_printf(sc->sc_dev, "%s: ath_buf pointer incorrect; "
-		    " has m BA session may hang.\n",
-		    __func__);
-		device_printf(sc->sc_dev, "%s: old bf=%p, new bf=%p\n",
-		    __func__,
-		    old_bf, new_bf);
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
+		    "%s: ath_buf pointer incorrect; "
+		    " has m BA session may hang.\n", __func__);
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
+		    "%s: old bf=%p, new bf=%p\n", __func__, old_bf, new_bf);
 	}
 
 	tid->tx_buf[cindex] = new_bf;
@@ -2743,10 +2732,9 @@ ath_tx_update_baw(struct ath_softc *sc, 
 	 * here and causing it to fire off. Disable TDMA for now.
 	 */
 	if (tid->tx_buf[cindex] != bf) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
 		    "%s: comp bf=%p, seq=%d; slot bf=%p, seqno=%d\n",
-		    __func__,
-		    bf, SEQNO(bf->bf_state.bfs_seqno),
+		    __func__, bf, SEQNO(bf->bf_state.bfs_seqno),
 		    tid->tx_buf[cindex],
 		    (tid->tx_buf[cindex] != NULL) ?
 		      SEQNO(tid->tx_buf[cindex]->bf_state.bfs_seqno) : -1);
@@ -2992,10 +2980,9 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s
 	 * be reset or the completion code will get upset with you.
 	 */
 	if (bf->bf_state.bfs_aggr != 0 || bf->bf_state.bfs_nframes > 1) {
-		device_printf(sc->sc_dev, "%s: bfs_aggr=%d, bfs_nframes=%d\n",
-		    __func__,
-		    bf->bf_state.bfs_aggr,
-		    bf->bf_state.bfs_nframes);
+		DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
+		    "%s: bfs_aggr=%d, bfs_nframes=%d\n", __func__,
+		    bf->bf_state.bfs_aggr, bf->bf_state.bfs_nframes);
 		bf->bf_state.bfs_aggr = 0;
 		bf->bf_state.bfs_nframes = 1;
 	}
@@ -3273,10 +3260,9 @@ ath_tx_tid_resume(struct ath_softc *sc, 
 	 * until it's actually resolved.
 	 */
 	if (tid->paused == 0) {
-		device_printf(sc->sc_dev, "%s: %6D: paused=0?\n",
-		    __func__,
-		    tid->an->an_node.ni_macaddr,
-		    ":");
+		DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
+		    "%s: %6D: paused=0?\n", __func__,
+		    tid->an->an_node.ni_macaddr, ":");
 	} else {
 		tid->paused--;
 	}
@@ -3298,7 +3284,8 @@ ath_tx_tid_resume(struct ath_softc *sc, 
 
 	/* XXX isfiltered shouldn't ever be 0 at this point */
 	if (tid->isfiltered == 1) {
-		device_printf(sc->sc_dev, "%s: filtered?!\n", __func__);
+		DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: filtered?!\n",
+		    __func__);
 		return;
 	}
 
@@ -3321,8 +3308,9 @@ ath_tx_tid_filt_addbuf(struct ath_softc 
 
 	ATH_TX_LOCK_ASSERT(sc);
 
-	if (! tid->isfiltered)
-		device_printf(sc->sc_dev, "%s: not filtered?!\n", __func__);
+	if (!tid->isfiltered)
+		DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: not filtered?!\n",
+		    __func__);
 
 	DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: bf=%p\n", __func__, bf);
 
@@ -3518,8 +3506,8 @@ ath_tx_tid_bar_suspend(struct ath_softc 
 
 	/* We shouldn't be called when bar_tx is 1 */
 	if (tid->bar_tx) {
-		device_printf(sc->sc_dev, "%s: bar_tx is 1?!\n",
-		    __func__);
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
+		    "%s: bar_tx is 1?!\n", __func__);
 	}
 
 	/* If we've already been called, just be patient. */
@@ -3551,14 +3539,10 @@ ath_tx_tid_bar_unsuspend(struct ath_soft
 	    tid->tid);
 
 	if (tid->bar_tx == 0 || tid->bar_wait == 0) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
 		    "%s: %6D: TID=%d, bar_tx=%d, bar_wait=%d: ?\n",
-		    __func__,
-		    tid->an->an_node.ni_macaddr,
-		    ":",
-		    tid->tid,
-		    tid->bar_tx,
-		    tid->bar_wait);
+		    __func__, tid->an->an_node.ni_macaddr, ":",
+		    tid->tid, tid->bar_tx, tid->bar_wait);
 	}
 
 	tid->bar_tx = tid->bar_wait = 0;
@@ -3621,14 +3605,10 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, 
 	 * This is an error condition!
 	 */
 	if (tid->bar_wait == 0 || tid->bar_tx == 1) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
 		    "%s: %6D: TID=%d, bar_tx=%d, bar_wait=%d: ?\n",
-		    __func__,
-		    tid->an->an_node.ni_macaddr,
-		    ":",
-		    tid->tid,
-		    tid->bar_tx,
-		    tid->bar_wait);
+		    __func__, tid->an->an_node.ni_macaddr, ":",
+		    tid->tid, tid->bar_tx, tid->bar_wait);
 		return;
 	}
 
@@ -3679,11 +3659,9 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, 
 
 	/* Failure? For now, warn loudly and continue */
 	ATH_TX_LOCK(sc);
-	device_printf(sc->sc_dev,
+	DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
 	    "%s: %6D: TID=%d, failed to TX BAR, continue!\n",
-	    __func__,
-	    tid->an->an_node.ni_macaddr,
-	    ":",
+	    __func__, tid->an->an_node.ni_macaddr, ":",
 	    tid->tid);
 	ath_tx_tid_bar_unsuspend(sc, tid);
 }
@@ -3715,7 +3693,7 @@ ath_tx_tid_drain_pkt(struct ath_softc *s
 		 * This has become a non-fatal error now
 		 */
 		if (! bf->bf_state.bfs_addedbaw)
-			device_printf(sc->sc_dev,
+			DPRINTF(sc, ATH_DEBUG_SW_TX_BAW
 			    "%s: wasn't added: seqno %d\n",
 			    __func__, SEQNO(bf->bf_state.bfs_seqno));
 #endif
@@ -3733,12 +3711,13 @@ ath_tx_tid_drain_print(struct ath_softc 
     const char *pfx, struct ath_tid *tid, struct ath_buf *bf)
 {
 	struct ieee80211_node *ni = &an->an_node;
-	struct ath_txq *txq = sc->sc_ac2q[tid->ac];
+	struct ath_txq *txq;
 	struct ieee80211_tx_ampdu *tap;
 
+	txq = sc->sc_ac2q[tid->ac];
 	tap = ath_tx_get_tx_tid(an, tid->tid);
 
-	device_printf(sc->sc_dev,
+	DPRINTF(sc, ATH_DEBUG_SW_TX,
 	    "%s: %s: %6D: bf=%p: addbaw=%d, dobaw=%d, "
 	    "seqno=%d, retry=%d\n",
 	    __func__,
@@ -3750,7 +3729,7 @@ ath_tx_tid_drain_print(struct ath_softc 
 	    bf->bf_state.bfs_dobaw,
 	    SEQNO(bf->bf_state.bfs_seqno),
 	    bf->bf_state.bfs_retries);
-	device_printf(sc->sc_dev,
+	DPRINTF(sc, ATH_DEBUG_SW_TX,
 	    "%s: %s: %6D: bf=%p: txq[%d] axq_depth=%d, axq_aggr_depth=%d\n",
 	    __func__,
 	    pfx,
@@ -3760,8 +3739,7 @@ ath_tx_tid_drain_print(struct ath_softc 
 	    txq->axq_qnum,
 	    txq->axq_depth,
 	    txq->axq_aggr_depth);
-
-	device_printf(sc->sc_dev,
+	DPRINTF(sc, ATH_DEBUG_SW_TX,
 	    "%s: %s: %6D: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d, "
 	      "isfiltered=%d\n",
 	    __func__,
@@ -3773,7 +3751,7 @@ ath_tx_tid_drain_print(struct ath_softc 
 	    tid->hwq_depth,
 	    tid->bar_wait,
 	    tid->isfiltered);
-	device_printf(sc->sc_dev,
+	DPRINTF(sc, ATH_DEBUG_SW_TX,
 	    "%s: %s: %6D: tid %d: "
 	    "sched=%d, paused=%d, "
 	    "incomp=%d, baw_head=%d, "
@@ -4091,7 +4069,7 @@ ath_tx_normal_comp(struct ath_softc *sc,
 	 */
 	if ((ts->ts_status & HAL_TXERR_FILT) ||
 	    (ts->ts_status != 0 && atid->isfiltered)) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_SW_TX,
 		    "%s: isfiltered=%d, ts_status=%d: huh?\n",
 		    __func__,
 		    atid->isfiltered,
@@ -4100,9 +4078,9 @@ ath_tx_normal_comp(struct ath_softc *sc,
 	}
 #endif
 	if (atid->isfiltered)
-		device_printf(sc->sc_dev, "%s: filtered?!\n", __func__);
+		DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: filtered?!\n", __func__);
 	if (atid->hwq_depth < 0)
-		device_printf(sc->sc_dev, "%s: hwq_depth < 0: %d\n",
+		DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: hwq_depth < 0: %d\n",
 		    __func__, atid->hwq_depth);
 
 	/*
@@ -4213,8 +4191,8 @@ ath_tx_tid_cleanup(struct ath_softc *sc,
 			ATH_TID_REMOVE(atid, bf, bf_list);
 			if (bf->bf_state.bfs_dobaw) {
 				ath_tx_update_baw(sc, an, atid, bf);
-				if (! bf->bf_state.bfs_addedbaw)
-					device_printf(sc->sc_dev,
+				if (!bf->bf_state.bfs_addedbaw)
+					DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
 					    "%s: wasn't added: seqno %d\n",
 					    __func__,
 					    SEQNO(bf->bf_state.bfs_seqno));
@@ -4275,13 +4253,13 @@ ath_tx_retry_clone(struct ath_softc *sc,
 	nbf = ath_buf_clone(sc, bf);
 
 #if 0
-	device_printf(sc->sc_dev, "%s: ATH_BUF_BUSY; cloning\n",
+	DPRINTF(sc, ATH_DEBUG_XMIT, "%s: ATH_BUF_BUSY; cloning\n",
 	    __func__);
 #endif
 
 	if (nbf == NULL) {
 		/* Failed to clone */
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_XMIT,
 		    "%s: failed to clone a busy buffer\n",
 		    __func__);
 		return NULL;
@@ -4290,7 +4268,7 @@ ath_tx_retry_clone(struct ath_softc *sc,
 	/* Setup the dma for the new buffer */
 	error = ath_tx_dmasetup(sc, nbf, nbf->bf_m);
 	if (error != 0) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_XMIT,
 		    "%s: failed to setup dma for clone\n",
 		    __func__);
 		/*
@@ -4367,7 +4345,7 @@ ath_tx_aggr_retry_unaggr(struct ath_soft
 		if (bf->bf_state.bfs_dobaw) {
 			ath_tx_update_baw(sc, an, atid, bf);
 			if (! bf->bf_state.bfs_addedbaw)
-				device_printf(sc->sc_dev,
+				DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
 				    "%s: wasn't added: seqno %d\n",
 				    __func__, SEQNO(bf->bf_state.bfs_seqno));
 		}
@@ -4457,8 +4435,8 @@ ath_tx_retry_subframe(struct ath_softc *
 		    "%s: max retries: seqno %d\n",
 		    __func__, SEQNO(bf->bf_state.bfs_seqno));
 		ath_tx_update_baw(sc, an, atid, bf);
-		if (! bf->bf_state.bfs_addedbaw)
-			device_printf(sc->sc_dev,
+		if (!bf->bf_state.bfs_addedbaw)
+			DPRINTF(sc, ATH_DEBUG_SW_TX_BAW,
 			    "%s: wasn't added: seqno %d\n",
 			    __func__, SEQNO(bf->bf_state.bfs_seqno));
 		bf->bf_state.bfs_dobaw = 0;
@@ -4663,7 +4641,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 
 	atid->hwq_depth--;
 	if (atid->hwq_depth < 0)
-		device_printf(sc->sc_dev, "%s: hwq_depth < 0: %d\n",
+		DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: hwq_depth < 0: %d\n",
 		    __func__, atid->hwq_depth);
 
 	/*
@@ -4681,7 +4659,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 	 */
 	if (atid->cleanup_inprogress) {
 		if (atid->isfiltered)
-			device_printf(sc->sc_dev,
+			DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
 			    "%s: isfiltered=1, normal_comp?\n",
 			    __func__);
 		ATH_TX_UNLOCK(sc);
@@ -4699,7 +4677,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 	if ((ts.ts_status & HAL_TXERR_FILT) ||
 	    (ts.ts_status != 0 && atid->isfiltered)) {
 		if (fail != 0)
-			device_printf(sc->sc_dev,
+			DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
 			    "%s: isfiltered=1, fail=%d\n", __func__, fail);
 		ath_tx_tid_filt_comp_aggr(sc, atid, bf_first, &bf_cq);
 
@@ -4709,8 +4687,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 				drops++;
 			if (bf->bf_state.bfs_dobaw) {
 				ath_tx_update_baw(sc, an, atid, bf);
-				if (! bf->bf_state.bfs_addedbaw)
-					device_printf(sc->sc_dev,
+				if (!bf->bf_state.bfs_addedbaw)
+					DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
 					    "%s: wasn't added: seqno %d\n",
 					    __func__,
 					    SEQNO(bf->bf_state.bfs_seqno));
@@ -4792,7 +4770,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 #if 0
 	/* Occasionally, the MAC sends a tx status for the wrong TID. */
 	if (tid != ts.ts_tid) {
-		device_printf(sc->sc_dev, "%s: tid %d != hw tid %d\n",
+		DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: tid %d != hw tid %d\n",
 		    __func__, tid, ts.ts_tid);
 		tx_ok = 0;
 	}
@@ -4800,7 +4778,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 
 	/* AR5416 BA bug; this requires an interface reset */
 	if (isaggr && tx_ok && (! hasba)) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
 		    "%s: AR5416 bug: hasba=%d; txok=%d, isaggr=%d, "
 		    "seq_st=%d\n",
 		    __func__, hasba, tx_ok, isaggr, seq_st);
@@ -4851,8 +4829,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 			sc->sc_stats.ast_tx_aggr_ok++;
 			ath_tx_update_baw(sc, an, atid, bf);
 			bf->bf_state.bfs_dobaw = 0;
-			if (! bf->bf_state.bfs_addedbaw)
-				device_printf(sc->sc_dev,
+			if (!bf->bf_state.bfs_addedbaw)
+				DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
 				    "%s: wasn't added: seqno %d\n",
 				    __func__, SEQNO(bf->bf_state.bfs_seqno));
 			bf->bf_next = NULL;
@@ -4881,7 +4859,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *
 	ATH_TX_UNLOCK(sc);
 
 	if (nframes != nf)
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
 		    "%s: num frames seen=%d; bf nframes=%d\n",
 		    __func__, nframes, nf);
 
@@ -4992,7 +4970,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc
 	ATH_TX_LOCK(sc);
 
 	if (tid == IEEE80211_NONQOS_TID)
-		device_printf(sc->sc_dev, "%s: TID=16!\n", __func__);
+		DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: TID=16!\n", __func__);
 
 	DPRINTF(sc, ATH_DEBUG_SW_TX,
 	    "%s: bf=%p: tid=%d, hwq_depth=%d, seqno=%d\n",
@@ -5001,7 +4979,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc
 
 	atid->hwq_depth--;
 	if (atid->hwq_depth < 0)
-		device_printf(sc->sc_dev, "%s: hwq_depth < 0: %d\n",
+		DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: hwq_depth < 0: %d\n",
 		    __func__, atid->hwq_depth);
 
 	/*
@@ -5020,7 +4998,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc
 	 */
 	if (atid->cleanup_inprogress) {
 		if (atid->isfiltered)
-			device_printf(sc->sc_dev,
+			DPRINTF(sc, ATH_DEBUG_SW_TX,
 			    "%s: isfiltered=1, normal_comp?\n",
 			    __func__);
 		ATH_TX_UNLOCK(sc);
@@ -5047,10 +5025,9 @@ ath_tx_aggr_comp_unaggr(struct ath_softc
 		int freeframe;
 
 		if (fail != 0)
-			device_printf(sc->sc_dev,
+			DPRINTF(sc, ATH_DEBUG_SW_TX,
 			    "%s: isfiltered=1, fail=%d\n",
-			    __func__,
-			    fail);
+			    __func__, fail);
 		freeframe = ath_tx_tid_filt_comp_single(sc, atid, bf);
 		if (freeframe) {
 			/* Remove from BAW */
@@ -5058,8 +5035,8 @@ ath_tx_aggr_comp_unaggr(struct ath_softc
 				drops++;
 			if (bf->bf_state.bfs_dobaw) {
 				ath_tx_update_baw(sc, an, atid, bf);
-				if (! bf->bf_state.bfs_addedbaw)
-					device_printf(sc->sc_dev,
+				if (!bf->bf_state.bfs_addedbaw)
+					DPRINTF(sc, ATH_DEBUG_SW_TX,
 					    "%s: wasn't added: seqno %d\n",
 					    __func__, SEQNO(bf->bf_state.bfs_seqno));
 			}
@@ -5111,8 +5088,8 @@ ath_tx_aggr_comp_unaggr(struct ath_softc
 	if (bf->bf_state.bfs_dobaw) {
 		ath_tx_update_baw(sc, an, atid, bf);
 		bf->bf_state.bfs_dobaw = 0;
-		if (! bf->bf_state.bfs_addedbaw)
-			device_printf(sc->sc_dev,
+		if (!bf->bf_state.bfs_addedbaw)
+			DPRINTF(sc, ATH_DEBUG_SW_TX,
 			    "%s: wasn't added: seqno %d\n",
 			    __func__, SEQNO(bf->bf_state.bfs_seqno));
 	}
@@ -5177,8 +5154,8 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft
 	tap = ath_tx_get_tx_tid(an, tid->tid);
 
 	if (tid->tid == IEEE80211_NONQOS_TID)
-		device_printf(sc->sc_dev, "%s: called for TID=NONQOS_TID?\n",
-		    __func__);
+		DPRINTF(sc, ATH_DEBUG_SW_TX, 
+		    "%s: called for TID=NONQOS_TID?\n", __func__);
 
 	for (;;) {
 		status = ATH_AGGR_DONE;
@@ -5210,7 +5187,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft
 			ATH_TID_REMOVE(tid, bf, bf_list);
 
 			if (bf->bf_state.bfs_nframes > 1)
-				device_printf(sc->sc_dev,
+				DPRINTF(sc, ATH_DEBUG_SW_TX, 
 				    "%s: aggr=%d, nframes=%d\n",
 				    __func__,
 				    bf->bf_state.bfs_aggr,
@@ -5341,7 +5318,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft
 		bf->bf_comp = ath_tx_aggr_comp;
 
 		if (bf->bf_state.bfs_tid == IEEE80211_NONQOS_TID)
-		    device_printf(sc->sc_dev, "%s: TID=16?\n", __func__);
+			DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: TID=16?\n", __func__);
 
 		/*
 		 * Update leak count and frame config if were leaking frames.
@@ -5399,10 +5376,10 @@ ath_tx_tid_hw_queue_norm(struct ath_soft
 
 	/* Check - is AMPDU pending or running? then print out something */
 	if (ath_tx_ampdu_pending(sc, an, tid->tid))
-		device_printf(sc->sc_dev, "%s: tid=%d, ampdu pending?\n",
+		DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, ampdu pending?\n",
 		    __func__, tid->tid);
 	if (ath_tx_ampdu_running(sc, an, tid->tid))
-		device_printf(sc->sc_dev, "%s: tid=%d, ampdu running?\n",
+		DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, ampdu running?\n",
 		    __func__, tid->tid);
 
 	for (;;) {
@@ -5426,9 +5403,9 @@ ath_tx_tid_hw_queue_norm(struct ath_soft
 
 		/* Sanity check! */
 		if (tid->tid != bf->bf_state.bfs_tid) {
-			device_printf(sc->sc_dev, "%s: bfs_tid %d !="
-			    " tid %d\n",
-			    __func__, bf->bf_state.bfs_tid, tid->tid);
+			DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bfs_tid %d !="
+			    " tid %d\n", __func__, bf->bf_state.bfs_tid,
+			    tid->tid);
 		}
 		/* Normal completion handler */
 		bf->bf_comp = ath_tx_normal_comp;
@@ -5900,7 +5877,7 @@ ath_bar_response(struct ieee80211_node *
 	if (status == 0 || attempts == 50) {
 		ATH_TX_LOCK(sc);
 		if (atid->bar_tx == 0 || atid->bar_wait == 0)
-			device_printf(sc->sc_dev,
+			DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
 			    "%s: huh? bar_tx=%d, bar_wait=%d\n",
 			    __func__,
 			    atid->bar_tx, atid->bar_wait);
@@ -5986,11 +5963,9 @@ ath_tx_node_sleep(struct ath_softc *sc, 
 	ATH_TX_LOCK(sc);
 
 	if (an->an_is_powersave) {
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_XMIT,
 		    "%s: %6D: node was already asleep!\n",
-		    __func__,
-		    an->an_node.ni_macaddr,
-		    ":");
+		    __func__, an->an_node.ni_macaddr, ":");
 		ATH_TX_UNLOCK(sc);
 		return;
 	}
@@ -6026,7 +6001,7 @@ ath_tx_node_wakeup(struct ath_softc *sc,
 	/* !? */
 	if (an->an_is_powersave == 0) {
 		ATH_TX_UNLOCK(sc);
-		device_printf(sc->sc_dev,
+		DPRINTF(sc, ATH_DEBUG_XMIT,
 		    "%s: an=%p: node was already awake\n",
 		    __func__, an);
 		return;



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