summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-05-13 19:52:35 +0000
committeradrian <adrian@FreeBSD.org>2013-05-13 19:52:35 +0000
commite848dec808ea0844791c78f21718da2be9ab43ed (patch)
treeeb7c79fea599e940314a3d8e4de81902d46702c5 /sys/dev
parent6bbf566f5d8c2c0697f87ff081e6f996e799069a (diff)
downloadFreeBSD-src-e848dec808ea0844791c78f21718da2be9ab43ed.zip
FreeBSD-src-e848dec808ea0844791c78f21718da2be9ab43ed.tar.gz
Improve the debugging output - use the MAC address rather than various
pointer values everywhere.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ath/if_ath.c57
-rw-r--r--sys/dev/ath/if_ath_tx.c92
2 files changed, 112 insertions, 37 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 991c42d..e418039 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -3450,7 +3450,7 @@ ath_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
/* XXX setup ath_tid */
ath_tx_tid_init(sc, an);
- DPRINTF(sc, ATH_DEBUG_NODE, "%s: an %p\n", __func__, an);
+ DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__, mac, ":", an);
return &an->an_node;
}
@@ -3460,6 +3460,9 @@ ath_node_cleanup(struct ieee80211_node *ni)
struct ieee80211com *ic = ni->ni_ic;
struct ath_softc *sc = ic->ic_ifp->if_softc;
+ DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__,
+ ni->ni_macaddr, ":", ATH_NODE(ni));
+
/* Cleanup ath_tid, free unused bufs, unlink bufs in TXQ */
ath_tx_node_flush(sc, ATH_NODE(ni));
ath_rate_node_cleanup(sc, ATH_NODE(ni));
@@ -3472,7 +3475,8 @@ ath_node_free(struct ieee80211_node *ni)
struct ieee80211com *ic = ni->ni_ic;
struct ath_softc *sc = ic->ic_ifp->if_softc;
- DPRINTF(sc, ATH_DEBUG_NODE, "%s: ni %p\n", __func__, ni);
+ DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__,
+ ni->ni_macaddr, ":", ATH_NODE(ni));
mtx_destroy(&ATH_NODE(ni)->an_mtx);
sc->sc_node_free(ni);
}
@@ -5920,11 +5924,13 @@ ath_node_powersave(struct ieee80211_node *ni, int enable)
struct ath_softc *sc = ic->ic_ifp->if_softc;
struct ath_vap *avp = ATH_VAP(ni->ni_vap);
- ATH_NODE_UNLOCK_ASSERT(an);
/* XXX and no TXQ locks should be held here */
- DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: ni=%p, enable=%d\n",
- __func__, ni, enable);
+ DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: %6D: enable=%d\n",
+ __func__,
+ ni->ni_macaddr,
+ ":",
+ !! enable);
/* Suspend or resume software queue handling */
if (enable)
@@ -6018,21 +6024,30 @@ ath_node_set_tim(struct ieee80211_node *ni, int enable)
*/
if (enable && an->an_tim_set == 1) {
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
- "%s: an=%p, enable=%d, tim_set=1, ignoring\n",
- __func__, an, enable);
+ "%s: %6D: enable=%d, tim_set=1, ignoring\n",
+ __func__,
+ ni->ni_macaddr,
+ ":",
+ enable);
ATH_TX_UNLOCK(sc);
} else if (enable) {
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
- "%s: an=%p, enable=%d, enabling TIM\n",
- __func__, an, enable);
+ "%s: %6D: enable=%d, enabling TIM\n",
+ __func__,
+ ni->ni_macaddr,
+ ":",
+ enable);
an->an_tim_set = 1;
ATH_TX_UNLOCK(sc);
changed = avp->av_set_tim(ni, enable);
} else if (an->an_swq_depth == 0) {
/* disable */
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
- "%s: an=%p, enable=%d, an_swq_depth == 0, disabling\n",
- __func__, an, enable);
+ "%s: %6D: enable=%d, an_swq_depth == 0, disabling\n",
+ __func__,
+ ni->ni_macaddr,
+ ":",
+ enable);
an->an_tim_set = 0;
ATH_TX_UNLOCK(sc);
changed = avp->av_set_tim(ni, enable);
@@ -6041,8 +6056,11 @@ ath_node_set_tim(struct ieee80211_node *ni, int enable)
* disable regardless; the node isn't in powersave now
*/
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
- "%s: an=%p, enable=%d, an_pwrsave=0, disabling\n",
- __func__, an, enable);
+ "%s: %6D: enable=%d, an_pwrsave=0, disabling\n",
+ __func__,
+ ni->ni_macaddr,
+ ":",
+ enable);
an->an_tim_set = 0;
ATH_TX_UNLOCK(sc);
changed = avp->av_set_tim(ni, enable);
@@ -6054,8 +6072,11 @@ ath_node_set_tim(struct ieee80211_node *ni, int enable)
*/
ATH_TX_UNLOCK(sc);
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
- "%s: enable=%d, an_swq_depth > 0, ignoring\n",
- __func__, enable);
+ "%s: %6D: enable=%d, an_swq_depth > 0, ignoring\n",
+ __func__,
+ ni->ni_macaddr,
+ ":",
+ enable);
changed = 0;
}
@@ -6124,8 +6145,10 @@ ath_tx_update_tim(struct ath_softc *sc, struct ieee80211_node *ni,
an->an_tim_set == 0 &&
an->an_swq_depth != 0) {
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
- "%s: an=%p, swq_depth>0, tim_set=0, set!\n",
- __func__, an);
+ "%s: %6D: swq_depth>0, tim_set=0, set!\n",
+ __func__,
+ ni->ni_macaddr,
+ ":");
an->an_tim_set = 1;
(void) avp->av_set_tim(ni, 1);
}
diff --git a/sys/dev/ath/if_ath_tx.c b/sys/dev/ath/if_ath_tx.c
index 3664160..2a0d9eb 100644
--- a/sys/dev/ath/if_ath_tx.c
+++ b/sys/dev/ath/if_ath_tx.c
@@ -3251,13 +3251,19 @@ ath_tx_tid_bar_unsuspend(struct ath_softc *sc, struct ath_tid *tid)
ATH_TX_LOCK_ASSERT(sc);
DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
- "%s: tid=%p, called\n",
+ "%s: %6D: tid=%p, called\n",
__func__,
+ tid->an->an_node.ni_macaddr,
+ ":",
tid);
if (tid->bar_tx == 0 || tid->bar_wait == 0) {
- device_printf(sc->sc_dev, "%s: bar_tx=%d, bar_wait=%d: ?\n",
- __func__, tid->bar_tx, tid->bar_wait);
+ device_printf(sc->sc_dev,
+ "%s: %6D: bar_tx=%d, bar_wait=%d: ?\n",
+ __func__,
+ tid->an->an_node.ni_macaddr,
+ ":",
+ tid->bar_tx, tid->bar_wait);
}
tid->bar_tx = tid->bar_wait = 0;
@@ -3278,8 +3284,12 @@ ath_tx_tid_bar_tx_ready(struct ath_softc *sc, struct ath_tid *tid)
if (tid->bar_wait == 0 || tid->hwq_depth > 0)
return (0);
- DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: tid=%p (%d), bar ready\n",
- __func__, tid, tid->tid);
+ DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
+ "%s: %6D: tid=%p (%d), bar ready\n",
+ __func__,
+ tid->an->an_node.ni_macaddr,
+ ":",
+ tid, tid->tid);
return (1);
}
@@ -3304,8 +3314,10 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid)
ATH_TX_LOCK_ASSERT(sc);
DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
- "%s: tid=%p, called\n",
+ "%s: %6D: tid=%p, called\n",
__func__,
+ tid->an->an_node.ni_macaddr,
+ ":",
tid);
tap = ath_tx_get_tx_tid(tid->an, tid->tid);
@@ -3315,8 +3327,10 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid)
*/
if (tid->bar_wait == 0 || tid->bar_tx == 1) {
device_printf(sc->sc_dev,
- "%s: tid=%p, bar_tx=%d, bar_wait=%d: ?\n",
+ "%s: %6D: tid=%p, bar_tx=%d, bar_wait=%d: ?\n",
__func__,
+ tid->an->an_node.ni_macaddr,
+ ":",
tid,
tid->bar_tx,
tid->bar_wait);
@@ -3326,8 +3340,10 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid)
/* Don't do anything if we still have pending frames */
if (tid->hwq_depth > 0) {
DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
- "%s: tid=%p, hwq_depth=%d, waiting\n",
+ "%s: %6D: tid=%p, hwq_depth=%d, waiting\n",
__func__,
+ tid->an->an_node.ni_macaddr,
+ ":",
tid,
tid->hwq_depth);
return;
@@ -3349,8 +3365,10 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid)
* XXX verify this is _actually_ the valid value to begin at!
*/
DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
- "%s: tid=%p, new BAW left edge=%d\n",
+ "%s: %6D: tid=%p, new BAW left edge=%d\n",
__func__,
+ tid->an->an_node.ni_macaddr,
+ ":",
tid,
tap->txa_start);
@@ -3366,8 +3384,12 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid)
/* Failure? For now, warn loudly and continue */
ATH_TX_LOCK(sc);
- device_printf(sc->sc_dev, "%s: tid=%p, failed to TX BAR, continue!\n",
- __func__, tid);
+ device_printf(sc->sc_dev,
+ "%s: %6D: tid=%p, failed to TX BAR, continue!\n",
+ __func__,
+ tid->an->an_node.ni_macaddr,
+ ":",
+ tid);
ath_tx_tid_bar_unsuspend(sc, tid);
}
@@ -3545,10 +3567,15 @@ ath_tx_tid_drain(struct ath_softc *sc, struct ath_node *an,
/* But don't do it for non-QoS TIDs */
if (tap) {
-#if 0
+#if 1
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
- "%s: node %p: TID %d: sliding BAW left edge to %d\n",
- __func__, an, tid->tid, tap->txa_start);
+ "%s: %6D: node %p: TID %d: sliding BAW left edge to %d\n",
+ __func__,
+ ni->ni_macaddr,
+ ":",
+ an,
+ tid->tid,
+ tap->txa_start);
#endif
ni->ni_txseqs[tid->tid] = tap->txa_start;
tid->baw_tail = tid->baw_head;
@@ -3641,6 +3668,18 @@ ath_tx_node_flush(struct ath_softc *sc, struct ath_node *an)
&an->an_node);
ATH_TX_LOCK(sc);
+ DPRINTF(sc, ATH_DEBUG_NODE,
+ "%s: %6D: flush; is_powersave=%d, stack_psq=%d, tim=%d, "
+ "swq_depth=%d, clrdmask=%d\n",
+ __func__,
+ an->an_node.ni_macaddr,
+ ":",
+ an->an_is_powersave,
+ an->an_stack_psq,
+ an->an_tim_set,
+ an->an_swq_depth,
+ an->clrdmask);
+
for (tid = 0; tid < IEEE80211_TID_SIZE; tid++) {
struct ath_tid *atid = &an->an_tid[tid];
@@ -5263,8 +5302,11 @@ ath_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
ATH_TX_UNLOCK(sc);
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
- "%s: called; dialogtoken=%d, baparamset=%d, batimeout=%d\n",
- __func__, dialogtoken, baparamset, batimeout);
+ "%s: %6D: called; dialogtoken=%d, baparamset=%d, batimeout=%d\n",
+ __func__,
+ ni->ni_macaddr,
+ ":",
+ dialogtoken, baparamset, batimeout);
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
"%s: txa_start=%d, ni_txseqs=%d\n",
__func__, tap->txa_start, ni->ni_txseqs[tid]);
@@ -5304,7 +5346,9 @@ ath_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
int r;
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
- "%s: called; status=%d, code=%d, batimeout=%d\n", __func__,
+ "%s: %6D: called; status=%d, code=%d, batimeout=%d\n", __func__,
+ ni->ni_macaddr,
+ ":",
status, code, batimeout);
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
@@ -5349,7 +5393,10 @@ ath_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
ath_bufhead bf_cq;
struct ath_buf *bf;
- DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: called\n", __func__);
+ DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: %6D: called\n",
+ __func__,
+ ni->ni_macaddr,
+ ":");
/*
* Pause TID traffic early, so there aren't any races
@@ -5450,8 +5497,10 @@ ath_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
int attempts = tap->txa_attempts;
DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
- "%s: called; tap=%p, atid=%p, txa_tid=%d, atid->tid=%d, status=%d, attempts=%d\n",
+ "%s: %6D: called; tap=%p, atid=%p, txa_tid=%d, atid->tid=%d, status=%d, attempts=%d\n",
__func__,
+ ni->ni_macaddr,
+ ":",
tap,
atid,
tap->txa_tid,
@@ -5498,7 +5547,10 @@ ath_addba_response_timeout(struct ieee80211_node *ni,
struct ath_tid *atid = &an->an_tid[tid];
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
- "%s: called; resuming\n", __func__);
+ "%s: %6D: called; resuming\n",
+ __func__,
+ ni->ni_macaddr,
+ ":");
ATH_TX_LOCK(sc);
atid->addba_tx_pending = 0;
OpenPOWER on IntegriCloud