diff options
author | bschmidt <bschmidt@FreeBSD.org> | 2011-01-30 14:05:21 +0000 |
---|---|---|
committer | bschmidt <bschmidt@FreeBSD.org> | 2011-01-30 14:05:21 +0000 |
commit | 14dd7e3bfcdd3effe3dc9cad1db9c8eac5d14547 (patch) | |
tree | a9dc7c0e885f0df2fe6766a0d1d65d6fb4433ba9 /sys | |
parent | df7538722d24751454041ecbef3a64fe433f612c (diff) | |
download | FreeBSD-src-14dd7e3bfcdd3effe3dc9cad1db9c8eac5d14547.zip FreeBSD-src-14dd7e3bfcdd3effe3dc9cad1db9c8eac5d14547.tar.gz |
Instead of always returning 0 to a scan request, indicate if there is
one running already.
MFC after: 1 month
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net80211/ieee80211_ioctl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index d16797b..37d5dbe 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -2384,7 +2384,7 @@ ieee80211_scanreq(struct ieee80211vap *vap, struct ieee80211_scan_req *sr) IEEE80211_IOC_SCAN_NOJOIN | IEEE80211_IOC_SCAN_FLUSH | \ IEEE80211_IOC_SCAN_CHECK) struct ieee80211com *ic = vap->iv_ic; - int i; + int error, i; /* convert duration */ if (sr->sr_duration == IEEE80211_IOC_SCAN_FOREVER) @@ -2458,20 +2458,21 @@ ieee80211_scanreq(struct ieee80211vap *vap, struct ieee80211_scan_req *sr) } else { vap->iv_flags_ext &= ~IEEE80211_FEXT_SCANREQ; IEEE80211_UNLOCK(ic); - /* XXX neeed error return codes */ if (sr->sr_flags & IEEE80211_IOC_SCAN_CHECK) { - (void) ieee80211_check_scan(vap, sr->sr_flags, + error = ieee80211_check_scan(vap, sr->sr_flags, sr->sr_duration, sr->sr_mindwell, sr->sr_maxdwell, sr->sr_nssid, /* NB: cheat, we assume structures are compatible */ (const struct ieee80211_scan_ssid *) &sr->sr_ssid[0]); } else { - (void) ieee80211_start_scan(vap, sr->sr_flags, + error = ieee80211_start_scan(vap, sr->sr_flags, sr->sr_duration, sr->sr_mindwell, sr->sr_maxdwell, sr->sr_nssid, /* NB: cheat, we assume structures are compatible */ (const struct ieee80211_scan_ssid *) &sr->sr_ssid[0]); } + if (error == 0) + return EINPROGRESS; } return 0; #undef IEEE80211_IOC_SCAN_FLAGS |