LinuxKPI: 802.11: fix lkpi_lsta_dump() debugging

Fix two last-minute changes of d9f59799fc:
(1) for consitency name the debugging function lkpi_lsta_dump()
(2) pass in the original node (ni) rather than taking it from the lsta
    to avoid problems realted to bss_update as mentioned in the above
    commit.

No functional changes for users.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
X-MFC with:	d9f59799fc
This commit is contained in:
Bjoern A. Zeeb 2022-03-23 17:14:03 +00:00
parent 6a8973c332
commit 67674c1cb1

View File

@ -141,7 +141,8 @@ static void lkpi_80211_txq_task(void *, int);
static void lkpi_ieee80211_free_skb_mbuf(void *);
static void
lkpi_dump_lsta(struct lkpi_sta *lsta, const char *_f, int _l)
lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni,
const char *_f, int _l)
{
if ((debug_80211 & D80211_TRACE_STA) == 0)
@ -150,9 +151,9 @@ lkpi_dump_lsta(struct lkpi_sta *lsta, const char *_f, int _l)
return;
printf("%s:%d lsta %p ni %p sta %p\n",
_f, _l, lsta, lsta->ni, &lsta->sta);
if (lsta->ni != NULL)
ieee80211_dump_node(NULL, lsta->ni);
_f, _l, lsta, ni, &lsta->sta);
if (ni != NULL)
ieee80211_dump_node(NULL, ni);
printf("\ttxq_task txq len %d mtx\n", mbufq_len(&lsta->txq));
printf("\tkc %p state %d added_to_drv %d in_mgd %d\n",
lsta->kc, lsta->state, lsta->added_to_drv, lsta->in_mgd);
@ -1098,7 +1099,7 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lsta = ni->ni_drv_data;
sta = LSTA_TO_STA(lsta);
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
IEEE80211_UNLOCK(vap->iv_ic);
@ -1140,7 +1141,7 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lsta->added_to_drv = false; /* mo manages. */
#endif
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
lkpi_lsta_remove(lsta, lvif);
@ -1324,7 +1325,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i
lsta = ni->ni_drv_data;
sta = LSTA_TO_STA(lsta);
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
IEEE80211_UNLOCK(vap->iv_ic);
@ -1349,7 +1350,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i
IEEE80211_UNLOCK(vap->iv_ic);
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
/* Wake tx queues to get packet(s) out. */
lkpi_wake_tx_queues(hw, sta, true, true);
@ -1381,7 +1382,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i
if (error != 0)
goto out;
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
/* Adjust sta and change state (from NONE) to NOTEXIST. */
KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni));
@ -1396,7 +1397,7 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i
lsta->added_to_drv = false; /* mo manages. */
#endif
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
/* Update bss info (bss_info_changed) (assoc, aid, ..). */
/* We need to do this now, can only do after sta is IEEE80211_STA_NOTEXIST. */
@ -1640,7 +1641,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lsta = ni->ni_drv_data;
sta = LSTA_TO_STA(lsta);
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
IEEE80211_UNLOCK(vap->iv_ic);
@ -1665,7 +1666,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int
IEEE80211_UNLOCK(vap->iv_ic);
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
/* Wake tx queues to get packet(s) out. */
lkpi_wake_tx_queues(hw, sta, true, true);
@ -1699,7 +1700,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int
if (error != 0)
goto out;
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
/* Update sta_state (ASSOC to AUTH). */
KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni));
@ -1709,7 +1710,7 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int
if (error != 0)
goto out;
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
#if 0
/* Update bss info (bss_info_changed) (assoc, aid, ..). */
@ -1749,7 +1750,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lsta = ni->ni_drv_data;
sta = LSTA_TO_STA(lsta);
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
IEEE80211_UNLOCK(vap->iv_ic);
@ -1774,7 +1775,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
IEEE80211_UNLOCK(vap->iv_ic);
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
/* Wake tx queues to get packet(s) out. */
lkpi_wake_tx_queues(hw, sta, true, true);
@ -1806,7 +1807,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
if (error != 0)
goto out;
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
/* Update sta_state (ASSOC to AUTH). */
KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni));
@ -1816,7 +1817,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
if (error != 0)
goto out;
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
/* Update sta and change state (from AUTH) to NONE. */
KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni));
@ -1826,7 +1827,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
if (error != 0)
goto out;
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
/* Adjust sta and change state (from NONE) to NOTEXIST. */
KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni));
@ -1841,7 +1842,7 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int
lsta->added_to_drv = false; /* mo manages. */
#endif
lkpi_dump_lsta(lsta, __func__, __LINE__);
lkpi_lsta_dump(lsta, ni, __func__, __LINE__);
/* Update bss info (bss_info_changed) (assoc, aid, ..). */
/*