From 7ca7a42ce67811dcd57c951ad7291bf222a7fa2c Mon Sep 17 00:00:00 2001 From: Bernhard Schmidt Date: Sun, 30 Jan 2011 14:05:21 +0000 Subject: [PATCH] Instead of always returning 0 to a scan request, indicate if there is one running already. MFC after: 1 month --- sys/net80211/ieee80211_ioctl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index d16797b3105..37d5dbe6929 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