Skip to content

Commit

Permalink
mac80211: fix sched_scan restart on recovery
Browse files Browse the repository at this point in the history
In case we were not suspended, the reconfig function returns without
configuring the scheduled scan.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Arik Nemtsov authored and Johannes Berg committed Feb 11, 2014
1 parent fab57a6 commit 3276981
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1740,6 +1740,26 @@ int ieee80211_reconfig(struct ieee80211_local *local)
ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_SUSPEND);

/*
* Reconfigure sched scan if it was interrupted by FW restart or
* suspend.
*/
mutex_lock(&local->mtx);
sched_scan_sdata = rcu_dereference_protected(local->sched_scan_sdata,
lockdep_is_held(&local->mtx));
if (sched_scan_sdata && local->sched_scan_req)
/*
* Sched scan stopped, but we don't want to report it. Instead,
* we're trying to reschedule.
*/
if (__ieee80211_request_sched_scan_start(sched_scan_sdata,
local->sched_scan_req))
sched_scan_stopped = true;
mutex_unlock(&local->mtx);

if (sched_scan_stopped)
cfg80211_sched_scan_stopped(local->hw.wiphy);

/*
* If this is for hw restart things are still running.
* We may want to change that later, however.
Expand Down Expand Up @@ -1768,26 +1788,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
WARN_ON(1);
#endif

/*
* Reconfigure sched scan if it was interrupted by FW restart or
* suspend.
*/
mutex_lock(&local->mtx);
sched_scan_sdata = rcu_dereference_protected(local->sched_scan_sdata,
lockdep_is_held(&local->mtx));
if (sched_scan_sdata && local->sched_scan_req)
/*
* Sched scan stopped, but we don't want to report it. Instead,
* we're trying to reschedule.
*/
if (__ieee80211_request_sched_scan_start(sched_scan_sdata,
local->sched_scan_req))
sched_scan_stopped = true;
mutex_unlock(&local->mtx);

if (sched_scan_stopped)
cfg80211_sched_scan_stopped(local->hw.wiphy);

return 0;
}

Expand Down

0 comments on commit 3276981

Please sign in to comment.