Skip to content

Commit

Permalink
net80211: split scan_task() (freebsd#2) (add scan_end() function)
Browse files Browse the repository at this point in the history
Tested with:
 * Intel 3945BG, STA mode.
 * RTL8188EU, IBSS mode.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5143


git-svn-id: svn+ssh://svn.freebsd.org/base/head@296231 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
  • Loading branch information
avos committed Feb 29, 2016
1 parent 1da3a6b commit 0f8fcdb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions sys/net80211/ieee80211_scan_sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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++];

Expand Down Expand Up @@ -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__);

Expand Down

0 comments on commit 0f8fcdb

Please sign in to comment.