Commit 4171bb33 authored by Luciano Coelho's avatar Luciano Coelho Committed by Emmanuel Grumbach

iwlwifi: mvm: check if scan can be started before cancelling other scans

If a new scan cannot be run for some reason, we shouldn't cancel other
ongoing scans.  Move the checks to before the code that cancels other
scans.
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@intel.com>
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent bd9564da
...@@ -2387,13 +2387,6 @@ static int iwl_mvm_mac_hw_scan(struct ieee80211_hw *hw, ...@@ -2387,13 +2387,6 @@ static int iwl_mvm_mac_hw_scan(struct ieee80211_hw *hw,
mutex_lock(&mvm->mutex); mutex_lock(&mvm->mutex);
if (!(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) &&
(mvm->scan_status & IWL_MVM_SCAN_SCHED)) {
ret = iwl_mvm_scan_offload_stop(mvm, true);
if (ret)
goto out;
}
if (iwl_mvm_is_lar_supported(mvm) && !mvm->lar_regdom_set) { if (iwl_mvm_is_lar_supported(mvm) && !mvm->lar_regdom_set) {
IWL_ERR(mvm, "scan while LAR regdomain is not set\n"); IWL_ERR(mvm, "scan while LAR regdomain is not set\n");
ret = -EBUSY; ret = -EBUSY;
...@@ -2405,6 +2398,13 @@ static int iwl_mvm_mac_hw_scan(struct ieee80211_hw *hw, ...@@ -2405,6 +2398,13 @@ static int iwl_mvm_mac_hw_scan(struct ieee80211_hw *hw,
goto out; goto out;
} }
if (!(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) &&
(mvm->scan_status & IWL_MVM_SCAN_SCHED)) {
ret = iwl_mvm_scan_offload_stop(mvm, true);
if (ret)
goto out;
}
iwl_mvm_ref(mvm, IWL_MVM_REF_SCAN); iwl_mvm_ref(mvm, IWL_MVM_REF_SCAN);
if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN)
...@@ -2758,13 +2758,6 @@ static int iwl_mvm_mac_sched_scan_start(struct ieee80211_hw *hw, ...@@ -2758,13 +2758,6 @@ static int iwl_mvm_mac_sched_scan_start(struct ieee80211_hw *hw,
mutex_lock(&mvm->mutex); mutex_lock(&mvm->mutex);
if (!(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) &&
(mvm->scan_status & IWL_MVM_SCAN_REGULAR)) {
ret = iwl_mvm_cancel_scan(mvm);
if (ret)
goto out;
}
if (iwl_mvm_is_lar_supported(mvm) && !mvm->lar_regdom_set) { if (iwl_mvm_is_lar_supported(mvm) && !mvm->lar_regdom_set) {
IWL_ERR(mvm, "sched-scan while LAR regdomain is not set\n"); IWL_ERR(mvm, "sched-scan while LAR regdomain is not set\n");
ret = -EBUSY; ret = -EBUSY;
...@@ -2781,6 +2774,13 @@ static int iwl_mvm_mac_sched_scan_start(struct ieee80211_hw *hw, ...@@ -2781,6 +2774,13 @@ static int iwl_mvm_mac_sched_scan_start(struct ieee80211_hw *hw,
goto out; goto out;
} }
if (!(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) &&
(mvm->scan_status & IWL_MVM_SCAN_REGULAR)) {
ret = iwl_mvm_cancel_scan(mvm);
if (ret)
goto out;
}
ret = iwl_mvm_scan_offload_start(mvm, vif, req, ies); ret = iwl_mvm_scan_offload_start(mvm, vif, req, ies);
if (ret) if (ret)
mvm->scan_status &= ~IWL_MVM_SCAN_SCHED; mvm->scan_status &= ~IWL_MVM_SCAN_SCHED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment