diff options
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r-- | net/mac80211/scan.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index e65d74ba404b..2a8d09ad17ff 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -631,3 +631,21 @@ int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, | |||
631 | mutex_unlock(&local->scan_mtx); | 631 | mutex_unlock(&local->scan_mtx); |
632 | return ret; | 632 | return ret; |
633 | } | 633 | } |
634 | |||
635 | void ieee80211_scan_cancel(struct ieee80211_local *local) | ||
636 | { | ||
637 | bool swscan; | ||
638 | |||
639 | cancel_delayed_work_sync(&local->scan_work); | ||
640 | |||
641 | /* | ||
642 | * Only call this function when a scan can't be | ||
643 | * queued -- mostly at suspend under RTNL. | ||
644 | */ | ||
645 | mutex_lock(&local->scan_mtx); | ||
646 | swscan = local->sw_scanning; | ||
647 | mutex_unlock(&local->scan_mtx); | ||
648 | |||
649 | if (swscan) | ||
650 | ieee80211_scan_completed(&local->hw, true); | ||
651 | } | ||