diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/mac80211.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index fff66ab2cfda..a6df00d675b7 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -1708,9 +1708,26 @@ static int iwl_mvm_mac_sched_scan_start(struct ieee80211_hw *hw, | |||
1708 | 1708 | ||
1709 | mutex_lock(&mvm->mutex); | 1709 | mutex_lock(&mvm->mutex); |
1710 | 1710 | ||
1711 | if (mvm->scan_status != IWL_MVM_SCAN_NONE) { | 1711 | switch (mvm->scan_status) { |
1712 | IWL_DEBUG_SCAN(mvm, | 1712 | case IWL_MVM_SCAN_OS: |
1713 | "SCHED SCAN request during internal scan - abort\n"); | 1713 | IWL_DEBUG_SCAN(mvm, "Stopping previous scan for sched_scan\n"); |
1714 | ret = iwl_mvm_cancel_scan(mvm); | ||
1715 | if (ret) { | ||
1716 | ret = -EBUSY; | ||
1717 | goto out; | ||
1718 | } | ||
1719 | |||
1720 | /* | ||
1721 | * iwl_mvm_rx_scan_complete() will be called soon but will | ||
1722 | * not reset the scan status as it won't be IWL_MVM_SCAN_OS | ||
1723 | * any more since we queue the next scan immediately (below). | ||
1724 | * We make sure it is called before the next scan starts by | ||
1725 | * flushing the async-handlers work. | ||
1726 | */ | ||
1727 | break; | ||
1728 | case IWL_MVM_SCAN_NONE: | ||
1729 | break; | ||
1730 | default: | ||
1714 | ret = -EBUSY; | 1731 | ret = -EBUSY; |
1715 | goto out; | 1732 | goto out; |
1716 | } | 1733 | } |
@@ -1732,6 +1749,8 @@ err: | |||
1732 | mvm->scan_status = IWL_MVM_SCAN_NONE; | 1749 | mvm->scan_status = IWL_MVM_SCAN_NONE; |
1733 | out: | 1750 | out: |
1734 | mutex_unlock(&mvm->mutex); | 1751 | mutex_unlock(&mvm->mutex); |
1752 | /* make sure to flush the Rx handler before the next scan arrives */ | ||
1753 | iwl_mvm_wait_for_async_handlers(mvm); | ||
1735 | return ret; | 1754 | return ret; |
1736 | } | 1755 | } |
1737 | 1756 | ||