linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Do not restart scheduled scan if multiple scan plans are set
@ 2015-09-21 12:48 Luca Coelho
  2015-09-23  9:16 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Luca Coelho @ 2015-09-21 12:48 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Avraham Stern, Luca Coelho

From: Avraham Stern <avraham.stern@intel.com>

If multiple scan plans were set for scheduled scan, do not restart
scheduled scan on reconfig because it is possible that some scan
plans were already completed and there is no need to run them all
over again. Instead, notify userspace that scheduled scan stopped
so it can configure new scan plans for scheduled scan.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 net/mac80211/util.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 9cabf07..005fc8e 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2041,9 +2041,13 @@ int ieee80211_reconfig(struct ieee80211_local *local)
 	if (sched_scan_sdata && sched_scan_req)
 		/*
 		 * Sched scan stopped, but we don't want to report it. Instead,
-		 * we're trying to reschedule.
+		 * we're trying to reschedule. However, if more than one scan
+		 * plan was set, we cannot reschedule since we don't know which
+		 * scan plan was currently running (and some scan plans may have
+		 * already finished).
 		 */
-		if (__ieee80211_request_sched_scan_start(sched_scan_sdata,
+		if (sched_scan_req->n_scan_plans > 1 ||
+		    __ieee80211_request_sched_scan_start(sched_scan_sdata,
 							 sched_scan_req))
 			sched_scan_stopped = true;
 	mutex_unlock(&local->mtx);
-- 
2.5.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: Do not restart scheduled scan if multiple scan plans are set
  2015-09-21 12:48 [PATCH] mac80211: Do not restart scheduled scan if multiple scan plans are set Luca Coelho
@ 2015-09-23  9:16 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2015-09-23  9:16 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless, Avraham Stern, Luca Coelho

On Mon, 2015-09-21 at 15:48 +0300, Luca Coelho wrote:
> From: Avraham Stern <avraham.stern@intel.com>
> 
> If multiple scan plans were set for scheduled scan, do not restart
> scheduled scan on reconfig because it is possible that some scan
> plans were already completed and there is no need to run them all
> over again. Instead, notify userspace that scheduled scan stopped
> so it can configure new scan plans for scheduled scan.
> 
Please also resend this one with the cfg80211 one.

johannes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-23  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21 12:48 [PATCH] mac80211: Do not restart scheduled scan if multiple scan plans are set Luca Coelho
2015-09-23  9:16 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).