Improve the debugging output - use the MAC address rather than various

pointer values everywhere.
This commit is contained in:
Adrian Chadd 2013-05-13 19:52:35 +00:00
parent ba83edd45c
commit 9b48fb4b32
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=250611
2 changed files with 112 additions and 37 deletions

View File

@ -3450,7 +3450,7 @@ ath_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
/* XXX setup ath_tid */ /* XXX setup ath_tid */
ath_tx_tid_init(sc, an); 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; return &an->an_node;
} }
@ -3460,6 +3460,9 @@ ath_node_cleanup(struct ieee80211_node *ni)
struct ieee80211com *ic = ni->ni_ic; struct ieee80211com *ic = ni->ni_ic;
struct ath_softc *sc = ic->ic_ifp->if_softc; 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 */ /* Cleanup ath_tid, free unused bufs, unlink bufs in TXQ */
ath_tx_node_flush(sc, ATH_NODE(ni)); ath_tx_node_flush(sc, ATH_NODE(ni));
ath_rate_node_cleanup(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 ieee80211com *ic = ni->ni_ic;
struct ath_softc *sc = ic->ic_ifp->if_softc; 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); mtx_destroy(&ATH_NODE(ni)->an_mtx);
sc->sc_node_free(ni); 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_softc *sc = ic->ic_ifp->if_softc;
struct ath_vap *avp = ATH_VAP(ni->ni_vap); struct ath_vap *avp = ATH_VAP(ni->ni_vap);
ATH_NODE_UNLOCK_ASSERT(an);
/* XXX and no TXQ locks should be held here */ /* XXX and no TXQ locks should be held here */
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: ni=%p, enable=%d\n", DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: %6D: enable=%d\n",
__func__, ni, enable); __func__,
ni->ni_macaddr,
":",
!! enable);
/* Suspend or resume software queue handling */ /* Suspend or resume software queue handling */
if (enable) if (enable)
@ -6018,21 +6024,30 @@ ath_node_set_tim(struct ieee80211_node *ni, int enable)
*/ */
if (enable && an->an_tim_set == 1) { if (enable && an->an_tim_set == 1) {
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
"%s: an=%p, enable=%d, tim_set=1, ignoring\n", "%s: %6D: enable=%d, tim_set=1, ignoring\n",
__func__, an, enable); __func__,
ni->ni_macaddr,
":",
enable);
ATH_TX_UNLOCK(sc); ATH_TX_UNLOCK(sc);
} else if (enable) { } else if (enable) {
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
"%s: an=%p, enable=%d, enabling TIM\n", "%s: %6D: enable=%d, enabling TIM\n",
__func__, an, enable); __func__,
ni->ni_macaddr,
":",
enable);
an->an_tim_set = 1; an->an_tim_set = 1;
ATH_TX_UNLOCK(sc); ATH_TX_UNLOCK(sc);
changed = avp->av_set_tim(ni, enable); changed = avp->av_set_tim(ni, enable);
} else if (an->an_swq_depth == 0) { } else if (an->an_swq_depth == 0) {
/* disable */ /* disable */
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
"%s: an=%p, enable=%d, an_swq_depth == 0, disabling\n", "%s: %6D: enable=%d, an_swq_depth == 0, disabling\n",
__func__, an, enable); __func__,
ni->ni_macaddr,
":",
enable);
an->an_tim_set = 0; an->an_tim_set = 0;
ATH_TX_UNLOCK(sc); ATH_TX_UNLOCK(sc);
changed = avp->av_set_tim(ni, enable); 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 * disable regardless; the node isn't in powersave now
*/ */
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
"%s: an=%p, enable=%d, an_pwrsave=0, disabling\n", "%s: %6D: enable=%d, an_pwrsave=0, disabling\n",
__func__, an, enable); __func__,
ni->ni_macaddr,
":",
enable);
an->an_tim_set = 0; an->an_tim_set = 0;
ATH_TX_UNLOCK(sc); ATH_TX_UNLOCK(sc);
changed = avp->av_set_tim(ni, enable); 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); ATH_TX_UNLOCK(sc);
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
"%s: enable=%d, an_swq_depth > 0, ignoring\n", "%s: %6D: enable=%d, an_swq_depth > 0, ignoring\n",
__func__, enable); __func__,
ni->ni_macaddr,
":",
enable);
changed = 0; 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_tim_set == 0 &&
an->an_swq_depth != 0) { an->an_swq_depth != 0) {
DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
"%s: an=%p, swq_depth>0, tim_set=0, set!\n", "%s: %6D: swq_depth>0, tim_set=0, set!\n",
__func__, an); __func__,
ni->ni_macaddr,
":");
an->an_tim_set = 1; an->an_tim_set = 1;
(void) avp->av_set_tim(ni, 1); (void) avp->av_set_tim(ni, 1);
} }

View File

@ -3251,13 +3251,19 @@ ath_tx_tid_bar_unsuspend(struct ath_softc *sc, struct ath_tid *tid)
ATH_TX_LOCK_ASSERT(sc); ATH_TX_LOCK_ASSERT(sc);
DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
"%s: tid=%p, called\n", "%s: %6D: tid=%p, called\n",
__func__, __func__,
tid->an->an_node.ni_macaddr,
":",
tid); tid);
if (tid->bar_tx == 0 || tid->bar_wait == 0) { if (tid->bar_tx == 0 || tid->bar_wait == 0) {
device_printf(sc->sc_dev, "%s: bar_tx=%d, bar_wait=%d: ?\n", device_printf(sc->sc_dev,
__func__, tid->bar_tx, tid->bar_wait); "%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; 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) if (tid->bar_wait == 0 || tid->hwq_depth > 0)
return (0); return (0);
DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: tid=%p (%d), bar ready\n", DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
__func__, tid, tid->tid); "%s: %6D: tid=%p (%d), bar ready\n",
__func__,
tid->an->an_node.ni_macaddr,
":",
tid, tid->tid);
return (1); return (1);
} }
@ -3304,8 +3314,10 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid)
ATH_TX_LOCK_ASSERT(sc); ATH_TX_LOCK_ASSERT(sc);
DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
"%s: tid=%p, called\n", "%s: %6D: tid=%p, called\n",
__func__, __func__,
tid->an->an_node.ni_macaddr,
":",
tid); tid);
tap = ath_tx_get_tx_tid(tid->an, tid->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) { if (tid->bar_wait == 0 || tid->bar_tx == 1) {
device_printf(sc->sc_dev, 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__, __func__,
tid->an->an_node.ni_macaddr,
":",
tid, tid,
tid->bar_tx, tid->bar_tx,
tid->bar_wait); 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 */ /* Don't do anything if we still have pending frames */
if (tid->hwq_depth > 0) { if (tid->hwq_depth > 0) {
DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, 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__, __func__,
tid->an->an_node.ni_macaddr,
":",
tid, tid,
tid->hwq_depth); tid->hwq_depth);
return; 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! * XXX verify this is _actually_ the valid value to begin at!
*/ */
DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, 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__, __func__,
tid->an->an_node.ni_macaddr,
":",
tid, tid,
tap->txa_start); 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 */ /* Failure? For now, warn loudly and continue */
ATH_TX_LOCK(sc); ATH_TX_LOCK(sc);
device_printf(sc->sc_dev, "%s: tid=%p, failed to TX BAR, continue!\n", device_printf(sc->sc_dev,
__func__, tid); "%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); 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 */ /* But don't do it for non-QoS TIDs */
if (tap) { if (tap) {
#if 0 #if 1
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
"%s: node %p: TID %d: sliding BAW left edge to %d\n", "%s: %6D: node %p: TID %d: sliding BAW left edge to %d\n",
__func__, an, tid->tid, tap->txa_start); __func__,
ni->ni_macaddr,
":",
an,
tid->tid,
tap->txa_start);
#endif #endif
ni->ni_txseqs[tid->tid] = tap->txa_start; ni->ni_txseqs[tid->tid] = tap->txa_start;
tid->baw_tail = tid->baw_head; 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); &an->an_node);
ATH_TX_LOCK(sc); 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++) { for (tid = 0; tid < IEEE80211_TID_SIZE; tid++) {
struct ath_tid *atid = &an->an_tid[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); ATH_TX_UNLOCK(sc);
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
"%s: called; dialogtoken=%d, baparamset=%d, batimeout=%d\n", "%s: %6D: called; dialogtoken=%d, baparamset=%d, batimeout=%d\n",
__func__, dialogtoken, baparamset, batimeout); __func__,
ni->ni_macaddr,
":",
dialogtoken, baparamset, batimeout);
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
"%s: txa_start=%d, ni_txseqs=%d\n", "%s: txa_start=%d, ni_txseqs=%d\n",
__func__, tap->txa_start, ni->ni_txseqs[tid]); __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; int r;
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 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); status, code, batimeout);
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 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; ath_bufhead bf_cq;
struct ath_buf *bf; 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 * 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; int attempts = tap->txa_attempts;
DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, 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__, __func__,
ni->ni_macaddr,
":",
tap, tap,
atid, atid,
tap->txa_tid, tap->txa_tid,
@ -5498,7 +5547,10 @@ ath_addba_response_timeout(struct ieee80211_node *ni,
struct ath_tid *atid = &an->an_tid[tid]; struct ath_tid *atid = &an->an_tid[tid];
DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 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); ATH_TX_LOCK(sc);
atid->addba_tx_pending = 0; atid->addba_tx_pending = 0;