MCPcopy Create free account
hub / github.com/F-Stack/f-stack / scan_curchan_task

Function scan_curchan_task

freebsd/net80211/ieee80211_scan_sw.c:676–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674}
675
676static void
677scan_curchan_task(void *arg, int pending)
678{
679 struct ieee80211_scan_state *ss = arg;
680 struct scan_state *ss_priv = SCAN_PRIVATE(ss);
681 struct ieee80211com *ic = ss->ss_ic;
682 struct ieee80211_channel *chan;
683 unsigned long maxdwell;
684 int scandone, scanstop;
685
686 IEEE80211_LOCK(ic);
687end:
688 /*
689 * Note: only /end/ the scan if we're CANCEL rather than
690 * CANCEL+INTERRUPT (ie, 'PAUSE').
691 *
692 * We can stop the scan if we hit cancel, but we shouldn't
693 * call scan_end(ss, 1) if we're just PAUSEing the scan.
694 */
695 scandone = (ss->ss_next >= ss->ss_last) ||
696 ((ss_priv->ss_iflags & ISCAN_PAUSE) == ISCAN_CANCEL);
697 scanstop = (ss->ss_next >= ss->ss_last) ||
698 ((ss_priv->ss_iflags & ISCAN_CANCEL) != 0);
699
700 IEEE80211_DPRINTF(ss->ss_vap, IEEE80211_MSG_SCAN,
701 "%s: loop start; scandone=%d, scanstop=%d, ss_iflags=0x%x, ss_next=%u, ss_last=%u\n",
702 __func__,
703 scandone,
704 scanstop,
705 (uint32_t) ss_priv->ss_iflags,
706 (uint32_t) ss->ss_next,
707 (uint32_t) ss->ss_last);
708
709 if (scanstop || (ss->ss_flags & IEEE80211_SCAN_GOTPICK) ||
710 (ss_priv->ss_iflags & ISCAN_ABORT) ||
711 ieee80211_time_after(ticks + ss->ss_mindwell, ss_priv->ss_scanend)) {
712 ss_priv->ss_iflags &= ~ISCAN_RUNNING;
713 scan_end(ss, scandone);
714 return;
715 } else
716 ss_priv->ss_iflags |= ISCAN_RUNNING;
717
718 chan = ss->ss_chans[ss->ss_next++];
719
720 /*
721 * Watch for truncation due to the scan end time.
722 */
723 if (ieee80211_time_after(ticks + ss->ss_maxdwell, ss_priv->ss_scanend))
724 maxdwell = ss_priv->ss_scanend - ticks;
725 else
726 maxdwell = ss->ss_maxdwell;
727
728 IEEE80211_DPRINTF(ss->ss_vap, IEEE80211_MSG_SCAN,
729 "%s: chan %3d%c -> %3d%c [%s, dwell min %lums max %lums]\n",
730 __func__,
731 ieee80211_chan2ieee(ic, ic->ic_curchan),
732 ieee80211_channel_type_char(ic->ic_curchan),
733 ieee80211_chan2ieee(ic, chan),

Callers 1

scan_startFunction · 0.85

Calls 6

scan_endFunction · 0.85
ieee80211_chan2ieeeFunction · 0.85
ieee80211_get_ratetableFunction · 0.85
taskqueue_cancel_timeoutFunction · 0.85

Tested by

no test coverage detected