Commit 470f4d61 authored by Eliad Peller's avatar Eliad Peller Committed by Johannes Berg

mac80211: avoid ROC during hw restart

Defer ROC requests during hw restart, as the driver
might not be fully configured in this stage (e.g.
channel contexts were not added yet)
Signed-off-by: default avatarEliad Peller <eliadx.peller@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent c3826807
...@@ -256,6 +256,11 @@ static void ieee80211_restart_work(struct work_struct *work) ...@@ -256,6 +256,11 @@ static void ieee80211_restart_work(struct work_struct *work)
list_for_each_entry(sdata, &local->interfaces, list) list_for_each_entry(sdata, &local->interfaces, list)
flush_delayed_work(&sdata->dec_tailroom_needed_wk); flush_delayed_work(&sdata->dec_tailroom_needed_wk);
ieee80211_scan_cancel(local); ieee80211_scan_cancel(local);
/* make sure any new ROC will consider local->in_reconfig */
flush_delayed_work(&local->roc_work);
flush_work(&local->hw_roc_done);
ieee80211_reconfig(local); ieee80211_reconfig(local);
rtnl_unlock(); rtnl_unlock();
} }
......
...@@ -408,6 +408,10 @@ void ieee80211_start_next_roc(struct ieee80211_local *local) ...@@ -408,6 +408,10 @@ void ieee80211_start_next_roc(struct ieee80211_local *local)
return; return;
} }
/* defer roc if driver is not started (i.e. during reconfig) */
if (local->in_reconfig)
return;
roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work,
list); list);
......
...@@ -2051,8 +2051,15 @@ int ieee80211_reconfig(struct ieee80211_local *local) ...@@ -2051,8 +2051,15 @@ int ieee80211_reconfig(struct ieee80211_local *local)
cfg80211_sched_scan_stopped_rtnl(local->hw.wiphy); cfg80211_sched_scan_stopped_rtnl(local->hw.wiphy);
wake_up: wake_up:
local->in_reconfig = false; if (local->in_reconfig) {
barrier(); local->in_reconfig = false;
barrier();
/* Restart deferred ROCs */
mutex_lock(&local->mtx);
ieee80211_start_next_roc(local);
mutex_unlock(&local->mtx);
}
if (local->monitors == local->open_count && local->monitors > 0) if (local->monitors == local->open_count && local->monitors > 0)
ieee80211_add_virtual_monitor(local); ieee80211_add_virtual_monitor(local);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment