aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2015-10-25 04:59:33 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-11-03 04:42:05 -0500
commit0d440ea294a00b60ced66c0bc5cb5caa42fd4fbd (patch)
tree0f8e7a81bc3843836a4557cb8adbe5d9a34ff34f /net/mac80211/util.c
parent968a76cef3d1bb9a3b4d135cd788056e742859f3 (diff)
mac80211: don't reconfigure sched scan in case of wowlan
Scheduled scan has to be reconfigured only if wowlan wasn't configured, since otherwise it should continue to run (with the 'any' trigger) or be aborted. The current code will end up asking the driver to start a new scheduled scan without stopping the previous one, and leaking some memory (from the previous request.) Fix this by doing the abort/restart under the proper conditions. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 551164dabbaf..d38daf0181e8 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2008,6 +2008,29 @@ int ieee80211_reconfig(struct ieee80211_local *local)
2008 if (ieee80211_sdata_running(sdata)) 2008 if (ieee80211_sdata_running(sdata))
2009 ieee80211_enable_keys(sdata); 2009 ieee80211_enable_keys(sdata);
2010 2010
2011 /* Reconfigure sched scan if it was interrupted by FW restart */
2012 mutex_lock(&local->mtx);
2013 sched_scan_sdata = rcu_dereference_protected(local->sched_scan_sdata,
2014 lockdep_is_held(&local->mtx));
2015 sched_scan_req = rcu_dereference_protected(local->sched_scan_req,
2016 lockdep_is_held(&local->mtx));
2017 if (sched_scan_sdata && sched_scan_req)
2018 /*
2019 * Sched scan stopped, but we don't want to report it. Instead,
2020 * we're trying to reschedule. However, if more than one scan
2021 * plan was set, we cannot reschedule since we don't know which
2022 * scan plan was currently running (and some scan plans may have
2023 * already finished).
2024 */
2025 if (sched_scan_req->n_scan_plans > 1 ||
2026 __ieee80211_request_sched_scan_start(sched_scan_sdata,
2027 sched_scan_req))
2028 sched_scan_stopped = true;
2029 mutex_unlock(&local->mtx);
2030
2031 if (sched_scan_stopped)
2032 cfg80211_sched_scan_stopped_rtnl(local->hw.wiphy);
2033
2011 wake_up: 2034 wake_up:
2012 local->in_reconfig = false; 2035 local->in_reconfig = false;
2013 barrier(); 2036 barrier();
@@ -2043,32 +2066,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
2043 false); 2066 false);
2044 2067
2045 /* 2068 /*
2046 * Reconfigure sched scan if it was interrupted by FW restart or
2047 * suspend.
2048 */
2049 mutex_lock(&local->mtx);
2050 sched_scan_sdata = rcu_dereference_protected(local->sched_scan_sdata,
2051 lockdep_is_held(&local->mtx));
2052 sched_scan_req = rcu_dereference_protected(local->sched_scan_req,
2053 lockdep_is_held(&local->mtx));
2054 if (sched_scan_sdata && sched_scan_req)
2055 /*
2056 * Sched scan stopped, but we don't want to report it. Instead,
2057 * we're trying to reschedule. However, if more than one scan
2058 * plan was set, we cannot reschedule since we don't know which
2059 * scan plan was currently running (and some scan plans may have
2060 * already finished).
2061 */
2062 if (sched_scan_req->n_scan_plans > 1 ||
2063 __ieee80211_request_sched_scan_start(sched_scan_sdata,
2064 sched_scan_req))
2065 sched_scan_stopped = true;
2066 mutex_unlock(&local->mtx);
2067
2068 if (sched_scan_stopped)
2069 cfg80211_sched_scan_stopped_rtnl(local->hw.wiphy);
2070
2071 /*
2072 * If this is for hw restart things are still running. 2069 * If this is for hw restart things are still running.
2073 * We may want to change that later, however. 2070 * We may want to change that later, however.
2074 */ 2071 */