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) {
IWL_ERR(mvm, "scan while LAR regdomain is not set\n");
ret = -EBUSY;
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);
if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN)
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) {
IWL_ERR(mvm, "sched-scan while LAR regdomain is not set\n");
ret = -EBUSY;
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);
if (ret)
mvm->scan_status &= ~IWL_MVM_SCAN_SCHED;