[net80211] Add some more debugging during scanning

I'm trying to chase down more weird "I am not doing an incremental scan
when being asked" issues so these debugging statements help.
Notably, I've added more debugging around reasons why the scan is skipped -
eg because the cache is considered hot.

This should be a no-op unless you care about the debugging output!
This commit is contained in:
adrian 2020-06-05 00:16:54 +00:00
parent 7158ce9dc8
commit d4ff158c3e
2 changed files with 14 additions and 1 deletions

View File

@ -1276,6 +1276,8 @@ sta_pick_bss(struct ieee80211_scan_state *ss, struct ieee80211vap *vap)
* handle notification that this has completed.
*/
ss->ss_flags &= ~IEEE80211_SCAN_NOPICK;
IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
"%s: nopick; return 1\n", __func__);
return 1;
}
/*
@ -1285,7 +1287,9 @@ sta_pick_bss(struct ieee80211_scan_state *ss, struct ieee80211vap *vap)
/* NB: unlocked read should be ok */
if (TAILQ_FIRST(&st->st_entry) == NULL) {
IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
"%s: no scan candidate\n", __func__);
"%s: no scan candidate, join=%d, return 0\n",
__func__,
!! (ss->ss_flags & IEEE80211_SCAN_NOJOIN));
if (ss->ss_flags & IEEE80211_SCAN_NOJOIN)
return 0;
notfound:
@ -1310,6 +1314,8 @@ sta_pick_bss(struct ieee80211_scan_state *ss, struct ieee80211vap *vap)
chan = demote11b(vap, chan);
if (!ieee80211_sta_join(vap, chan, &selbs->base))
goto notfound;
IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
"%s: terminate scan; return 1\n", __func__);
return 1; /* terminate scan */
}

View File

@ -298,6 +298,11 @@ ieee80211_swscan_check_scan(const struct ieee80211_scanner *scan,
* use. Also discard any frames that might come
* in while temporarily marked as scanning.
*/
IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
"cache hot; ic_lastscan=%d, scanvalid=%d, ticks=%d\n",
ic->ic_lastscan,
vap->iv_scanvalid,
ticks);
SCAN_PRIVATE(ss)->ss_iflags |= ISCAN_DISCARD;
ic->ic_flags |= IEEE80211_F_SCAN;
@ -307,6 +312,8 @@ ieee80211_swscan_check_scan(const struct ieee80211_scanner *scan,
ic->ic_flags &= ~IEEE80211_F_SCAN;
SCAN_PRIVATE(ss)->ss_iflags &= ~ISCAN_DISCARD;
IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
"%s: scan_end returned %d\n", __func__, result);
if (result) {
ieee80211_notify_scan_done(vap);
return 1;