diff options
author | avos <avos@FreeBSD.org> | 2016-02-29 20:47:07 +0000 |
---|---|---|
committer | avos <avos@FreeBSD.org> | 2016-02-29 20:47:07 +0000 |
commit | 61cdf21180ea3ae036ba2de85df6e101f7bc44bb (patch) | |
tree | d168bd818f964273023937fdc788d25dd5bae4ed | |
parent | 2d5c2ecb960abb6eba8f8bc1b428cddf3cf134de (diff) | |
download | FreeBSD-src-61cdf21180ea3ae036ba2de85df6e101f7bc44bb.zip FreeBSD-src-61cdf21180ea3ae036ba2de85df6e101f7bc44bb.tar.gz |
net80211: split scan_task() (#2) (add scan_end() function)
Tested with:
* Intel 3945BG, STA mode.
* RTL8188EU, IBSS mode.
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5143
-rw-r--r-- | sys/net80211/ieee80211_scan_sw.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_scan_sw.c b/sys/net80211/ieee80211_scan_sw.c index 0208d95..0b92a8e 100644 --- a/sys/net80211/ieee80211_scan_sw.c +++ b/sys/net80211/ieee80211_scan_sw.c @@ -100,6 +100,7 @@ static void scan_curchan(struct ieee80211_scan_state *, unsigned long); static void scan_mindwell(struct ieee80211_scan_state *); static void scan_signal(void *); static void scan_task(void *, int); +static void scan_end(struct ieee80211_scan_state *, int); static void scan_done(struct ieee80211_scan_state *, int); MALLOC_DEFINE(M_80211_SCAN, "80211scan", "802.11 scan state"); @@ -655,8 +656,10 @@ scan_task(void *arg, int pending) if (scandone || (ss->ss_flags & IEEE80211_SCAN_GOTPICK) || (ss_priv->ss_iflags & ISCAN_ABORT) || - time_after(ticks + ss->ss_mindwell, ss_priv->ss_scanend)) - break; + time_after(ticks + ss->ss_mindwell, ss_priv->ss_scanend)) { + scan_end(ss, scandone); + return; + } chan = ss->ss_chans[ss->ss_next++]; @@ -722,6 +725,16 @@ scan_task(void *arg, int pending) /* Wait to be signalled to scan the next channel */ cv_wait(&ss_priv->ss_scan_cv, IEEE80211_LOCK_OBJ(ic)); } +} + +static void +scan_end(struct ieee80211_scan_state *ss, int scandone) +{ + struct scan_state *ss_priv = SCAN_PRIVATE(ss); + struct ieee80211vap *vap = ss->ss_vap; + struct ieee80211com *ic = ss->ss_ic; + + IEEE80211_LOCK_ASSERT(ic); IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: out\n", __func__); |