diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/mac80211.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 1ff7ec08532d..09654e73a533 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -405,7 +405,10 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) | |||
405 | hw->wiphy->bands[IEEE80211_BAND_5GHZ] = | 405 | hw->wiphy->bands[IEEE80211_BAND_5GHZ] = |
406 | &mvm->nvm_data->bands[IEEE80211_BAND_5GHZ]; | 406 | &mvm->nvm_data->bands[IEEE80211_BAND_5GHZ]; |
407 | 407 | ||
408 | if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_BEAMFORMER) | 408 | if ((mvm->fw->ucode_capa.capa[0] & |
409 | IWL_UCODE_TLV_CAPA_BEAMFORMER) && | ||
410 | (mvm->fw->ucode_capa.api[0] & | ||
411 | IWL_UCODE_TLV_API_LQ_SS_PARAMS)) | ||
409 | hw->wiphy->bands[IEEE80211_BAND_5GHZ]->vht_cap.cap |= | 412 | hw->wiphy->bands[IEEE80211_BAND_5GHZ]->vht_cap.cap |= |
410 | IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE; | 413 | IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE; |
411 | } | 414 | } |
@@ -2215,7 +2218,19 @@ static void iwl_mvm_mac_cancel_hw_scan(struct ieee80211_hw *hw, | |||
2215 | 2218 | ||
2216 | mutex_lock(&mvm->mutex); | 2219 | mutex_lock(&mvm->mutex); |
2217 | 2220 | ||
2218 | iwl_mvm_cancel_scan(mvm); | 2221 | /* Due to a race condition, it's possible that mac80211 asks |
2222 | * us to stop a hw_scan when it's already stopped. This can | ||
2223 | * happen, for instance, if we stopped the scan ourselves, | ||
2224 | * called ieee80211_scan_completed() and the userspace called | ||
2225 | * cancel scan scan before ieee80211_scan_work() could run. | ||
2226 | * To handle that, simply return if the scan is not running. | ||
2227 | */ | ||
2228 | /* FIXME: for now, we ignore this race for UMAC scans, since | ||
2229 | * they don't set the scan_status. | ||
2230 | */ | ||
2231 | if ((mvm->scan_status == IWL_MVM_SCAN_OS) || | ||
2232 | (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN)) | ||
2233 | iwl_mvm_cancel_scan(mvm); | ||
2219 | 2234 | ||
2220 | mutex_unlock(&mvm->mutex); | 2235 | mutex_unlock(&mvm->mutex); |
2221 | } | 2236 | } |
@@ -2559,12 +2574,29 @@ static int iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw, | |||
2559 | int ret; | 2574 | int ret; |
2560 | 2575 | ||
2561 | mutex_lock(&mvm->mutex); | 2576 | mutex_lock(&mvm->mutex); |
2577 | |||
2578 | /* Due to a race condition, it's possible that mac80211 asks | ||
2579 | * us to stop a sched_scan when it's already stopped. This | ||
2580 | * can happen, for instance, if we stopped the scan ourselves, | ||
2581 | * called ieee80211_sched_scan_stopped() and the userspace called | ||
2582 | * stop sched scan scan before ieee80211_sched_scan_stopped_work() | ||
2583 | * could run. To handle this, simply return if the scan is | ||
2584 | * not running. | ||
2585 | */ | ||
2586 | /* FIXME: for now, we ignore this race for UMAC scans, since | ||
2587 | * they don't set the scan_status. | ||
2588 | */ | ||
2589 | if (mvm->scan_status != IWL_MVM_SCAN_SCHED && | ||
2590 | !(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN)) { | ||
2591 | mutex_unlock(&mvm->mutex); | ||
2592 | return 0; | ||
2593 | } | ||
2594 | |||
2562 | ret = iwl_mvm_scan_offload_stop(mvm, false); | 2595 | ret = iwl_mvm_scan_offload_stop(mvm, false); |
2563 | mutex_unlock(&mvm->mutex); | 2596 | mutex_unlock(&mvm->mutex); |
2564 | iwl_mvm_wait_for_async_handlers(mvm); | 2597 | iwl_mvm_wait_for_async_handlers(mvm); |
2565 | 2598 | ||
2566 | return ret; | 2599 | return ret; |
2567 | |||
2568 | } | 2600 | } |
2569 | 2601 | ||
2570 | static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw, | 2602 | static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw, |