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

Function scan_start

freebsd/net80211/ieee80211_scan_sw.c:619–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617}
618
619static void
620scan_start(void *arg, int pending)
621{
622#define ISCAN_REP (ISCAN_MINDWELL | ISCAN_DISCARD)
623 struct ieee80211_scan_state *ss = (struct ieee80211_scan_state *) arg;
624 struct scan_state *ss_priv = SCAN_PRIVATE(ss);
625 struct ieee80211vap *vap = ss->ss_vap;
626 struct ieee80211com *ic = ss->ss_ic;
627
628 IEEE80211_LOCK(ic);
629 if (vap == NULL || (ic->ic_flags & IEEE80211_F_SCAN) == 0 ||
630 (ss_priv->ss_iflags & ISCAN_ABORT)) {
631 /* Cancelled before we started */
632 scan_done(ss, 0);
633 return;
634 }
635
636 if (ss->ss_next == ss->ss_last) {
637 IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
638 "%s: no channels to scan\n", __func__);
639 scan_done(ss, 1);
640 return;
641 }
642
643 /*
644 * Put the station into power save mode.
645 *
646 * This is only required if we're not a full-offload devices;
647 * those devices manage scan/traffic differently.
648 */
649 if (((vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) == 0) &&
650 vap->iv_opmode == IEEE80211_M_STA &&
651 vap->iv_state == IEEE80211_S_RUN) {
652 if ((vap->iv_bss->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) {
653 /* Enable station power save mode */
654 vap->iv_sta_ps(vap, 1);
655 /* Wait until null data frame will be ACK'ed */
656 mtx_sleep(vap, IEEE80211_LOCK_OBJ(ic), PCATCH,
657 "sta_ps", msecs_to_ticks(10));
658 if (ss_priv->ss_iflags & ISCAN_ABORT) {
659 scan_done(ss, 0);
660 return;
661 }
662 }
663 }
664
665 ss_priv->ss_scanend = ticks + ss_priv->ss_duration;
666
667 /* XXX scan state can change! Re-validate scan state! */
668
669 IEEE80211_UNLOCK(ic);
670
671 ic->ic_scan_start(ic); /* notify driver */
672
673 scan_curchan_task(ss, 0);
674}
675
676static void

Callers

nothing calls this directly

Calls 2

scan_doneFunction · 0.85
scan_curchan_taskFunction · 0.85

Tested by

no test coverage detected