Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215087
b: refs/heads/master
c: 4136c42
h: refs/heads/master
i:
  215085: 5ce6e0c
  215083: 644175a
  215079: 1aaeb68
  215071: ea1b454
v: v3
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Oct 6, 2010
1 parent 65d428d commit e767d05
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e229f844d7223b7063bea1e649203ac521a58fe1
refs/heads/master: 4136c4224ccf1907d309e1cdfaefef9da97dbc5e
3 changes: 1 addition & 2 deletions trunk/net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,7 @@ static void ieee80211_restart_work(struct work_struct *work)
mutex_unlock(&local->mtx);

rtnl_lock();
if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning)))
ieee80211_scan_cancel(local);
ieee80211_scan_cancel(local);
ieee80211_reconfig(local);
rtnl_unlock();
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/net/mac80211/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
struct ieee80211_sub_if_data *sdata;
struct sta_info *sta;

if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning)))
ieee80211_scan_cancel(local);
ieee80211_scan_cancel(local);

ieee80211_stop_queues_by_reason(hw,
IEEE80211_QUEUE_STOP_REASON_SUSPEND);
Expand Down
35 changes: 25 additions & 10 deletions trunk/net/mac80211/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,24 +793,39 @@ int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata,
return ret;
}

/*
* Only call this function when a scan can't be queued -- under RTNL.
*/
void ieee80211_scan_cancel(struct ieee80211_local *local)
{
bool abortscan;
bool finish = false;

cancel_delayed_work_sync(&local->scan_work);
bool abortscan, finish;

/*
* Only call this function when a scan can't be
* queued -- mostly at suspend under RTNL.
* We are only canceling software scan, or deferred scan that was not
* yet really started (see __ieee80211_start_scan ).
*
* Regarding hardware scan:
* - we can not call __ieee80211_scan_completed() as when
* SCAN_HW_SCANNING bit is set this function change
* local->hw_scan_req to operate on 5G band, what race with
* driver which can use local->hw_scan_req
*
* - we can not cancel scan_work since driver can schedule it
* by ieee80211_scan_completed(..., true) to finish scan
*
* Hence low lever driver is responsible for canceling HW scan.
*/

mutex_lock(&local->mtx);
abortscan = test_bit(SCAN_SW_SCANNING, &local->scanning) ||
(!local->scanning && local->scan_req);
abortscan = local->scan_req && !test_bit(SCAN_HW_SCANNING, &local->scanning);
if (abortscan)
finish = __ieee80211_scan_completed(&local->hw, true, false);
mutex_unlock(&local->mtx);

if (finish)
__ieee80211_scan_completed_finish(&local->hw, false);
if (abortscan) {
/* The scan is canceled, but stop work from being pending */
cancel_delayed_work_sync(&local->scan_work);
if (finish)
__ieee80211_scan_completed_finish(&local->hw, false);
}
}

0 comments on commit e767d05

Please sign in to comment.