Commit 8176c838 authored by Ilan Peer's avatar Ilan Peer Committed by Johannes Berg

wifi: iwlwifi: mvm: Refactor scan start

To support staring internal scan, refactor the scan code such
that the body iwl_mvm_reg_scan_start() is now moved to a local
function that can be used by other flows as well.
Signed-off-by: default avatarIlan Peer <ilan.peer@intel.com>
Reviewed-by: default avatarAyala Beker <ayala.beker@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240311081938.e7833d4cfc53.I43c1c533c2a5243229002fde6360d423946c54fa@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent bbd6d0f8
......@@ -2914,9 +2914,11 @@ static void iwl_mvm_fill_respect_p2p_go(struct iwl_mvm *mvm,
}
}
int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct cfg80211_scan_request *req,
struct ieee80211_scan_ies *ies)
static int _iwl_mvm_single_scan_start(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
struct cfg80211_scan_request *req,
struct ieee80211_scan_ies *ies,
int type)
{
struct iwl_host_cmd hcmd = {
.len = { iwl_mvm_scan_size(mvm), },
......@@ -2934,7 +2936,7 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
return -EBUSY;
}
ret = iwl_mvm_check_running_scans(mvm, IWL_MVM_SCAN_REGULAR);
ret = iwl_mvm_check_running_scans(mvm, type);
if (ret)
return ret;
......@@ -2983,8 +2985,7 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
iwl_mvm_scan_6ghz_passive_scan(mvm, &params, vif);
uid = iwl_mvm_build_scan_cmd(mvm, vif, &hcmd, &params,
IWL_MVM_SCAN_REGULAR);
uid = iwl_mvm_build_scan_cmd(mvm, vif, &hcmd, &params, type);
if (uid < 0)
return uid;
......@@ -3004,7 +3005,7 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
}
IWL_DEBUG_SCAN(mvm, "Scan request was sent successfully\n");
mvm->scan_status |= IWL_MVM_SCAN_REGULAR;
mvm->scan_status |= type;
mvm->scan_vif = iwl_mvm_vif_from_mac80211(vif);
if (params.enable_6ghz_passive)
......@@ -3016,6 +3017,14 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
return 0;
}
int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct cfg80211_scan_request *req,
struct ieee80211_scan_ies *ies)
{
return _iwl_mvm_single_scan_start(mvm, vif, req, ies,
IWL_MVM_SCAN_REGULAR);
}
int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
struct cfg80211_sched_scan_request *req,
......
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