|
@@ -265,7 +265,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
|
|
|
|
|
|
mutex_lock(&local->scan_mtx);
|
|
mutex_lock(&local->scan_mtx);
|
|
|
|
|
|
- if (WARN_ON(!local->hw_scanning && !local->sw_scanning)) {
|
|
|
|
|
|
+ if (WARN_ON(!local->scanning)) {
|
|
mutex_unlock(&local->scan_mtx);
|
|
mutex_unlock(&local->scan_mtx);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -275,16 +275,15 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if (local->hw_scanning)
|
|
|
|
|
|
+ if (test_bit(SCAN_HW_SCANNING, &local->scanning))
|
|
ieee80211_restore_scan_ies(local);
|
|
ieee80211_restore_scan_ies(local);
|
|
|
|
|
|
if (local->scan_req != &local->int_scan_req)
|
|
if (local->scan_req != &local->int_scan_req)
|
|
cfg80211_scan_done(local->scan_req, aborted);
|
|
cfg80211_scan_done(local->scan_req, aborted);
|
|
local->scan_req = NULL;
|
|
local->scan_req = NULL;
|
|
|
|
|
|
- was_hw_scan = local->hw_scanning;
|
|
|
|
- local->hw_scanning = false;
|
|
|
|
- local->sw_scanning = false;
|
|
|
|
|
|
+ was_hw_scan = test_bit(SCAN_HW_SCANNING, &local->scanning);
|
|
|
|
+ local->scanning = 0;
|
|
local->scan_channel = NULL;
|
|
local->scan_channel = NULL;
|
|
|
|
|
|
/* we only have to protect scan_req and hw/sw scan */
|
|
/* we only have to protect scan_req and hw/sw scan */
|
|
@@ -434,9 +433,9 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
|
|
}
|
|
}
|
|
|
|
|
|
if (local->ops->hw_scan)
|
|
if (local->ops->hw_scan)
|
|
- local->hw_scanning = true;
|
|
|
|
|
|
+ __set_bit(SCAN_HW_SCANNING, &local->scanning);
|
|
else
|
|
else
|
|
- local->sw_scanning = true;
|
|
|
|
|
|
+ __set_bit(SCAN_SW_SCANNING, &local->scanning);
|
|
/*
|
|
/*
|
|
* Kicking off the scan need not be protected,
|
|
* Kicking off the scan need not be protected,
|
|
* only the scan variable stuff, since now
|
|
* only the scan variable stuff, since now
|
|
@@ -459,11 +458,9 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
|
|
mutex_lock(&local->scan_mtx);
|
|
mutex_lock(&local->scan_mtx);
|
|
|
|
|
|
if (rc) {
|
|
if (rc) {
|
|
- if (local->ops->hw_scan) {
|
|
|
|
- local->hw_scanning = false;
|
|
|
|
|
|
+ if (local->ops->hw_scan)
|
|
ieee80211_restore_scan_ies(local);
|
|
ieee80211_restore_scan_ies(local);
|
|
- } else
|
|
|
|
- local->sw_scanning = false;
|
|
|
|
|
|
+ local->scanning = 0;
|
|
|
|
|
|
ieee80211_recalc_idle(local);
|
|
ieee80211_recalc_idle(local);
|
|
|
|
|
|
@@ -572,7 +569,7 @@ void ieee80211_scan_work(struct work_struct *work)
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if (local->scan_req && !(local->sw_scanning || local->hw_scanning)) {
|
|
|
|
|
|
+ if (local->scan_req && !local->scanning) {
|
|
struct cfg80211_scan_request *req = local->scan_req;
|
|
struct cfg80211_scan_request *req = local->scan_req;
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
@@ -663,7 +660,7 @@ void ieee80211_scan_cancel(struct ieee80211_local *local)
|
|
* queued -- mostly at suspend under RTNL.
|
|
* queued -- mostly at suspend under RTNL.
|
|
*/
|
|
*/
|
|
mutex_lock(&local->scan_mtx);
|
|
mutex_lock(&local->scan_mtx);
|
|
- swscan = local->sw_scanning;
|
|
|
|
|
|
+ swscan = test_bit(SCAN_SW_SCANNING, &local->scanning);
|
|
mutex_unlock(&local->scan_mtx);
|
|
mutex_unlock(&local->scan_mtx);
|
|
|
|
|
|
if (swscan)
|
|
if (swscan)
|