Commit 87515408 authored by Luciano Coelho's avatar Luciano Coelho Committed by Emmanuel Grumbach

iwlwifi: mvm: move all LMAC scan flags into a single funtion

Having an LMAC counterpart for the existing UMAC flags function makes
things more consistent and easy to compare and spot the differences.
The flags are the same, but are in different bits, so unfortunately we
can't use a single function for both APIs.
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 6f4dcc76
...@@ -798,10 +798,6 @@ iwl_mvm_build_generic_scan_cmd(struct iwl_mvm *mvm, ...@@ -798,10 +798,6 @@ iwl_mvm_build_generic_scan_cmd(struct iwl_mvm *mvm,
cmd->suspend_time = cpu_to_le32(params->suspend_time); cmd->suspend_time = cpu_to_le32(params->suspend_time);
cmd->scan_prio = cpu_to_le32(IWL_SCAN_PRIORITY_HIGH); cmd->scan_prio = cpu_to_le32(IWL_SCAN_PRIORITY_HIGH);
cmd->iter_num = cpu_to_le32(1); cmd->iter_num = cpu_to_le32(1);
if (iwl_mvm_rrm_scan_needed(mvm))
cmd->scan_flags |=
cpu_to_le32(IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED);
} }
static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids, static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids,
...@@ -836,44 +832,55 @@ static int iwl_mvm_scan_total_iterations(struct iwl_mvm_scan_params *params) ...@@ -836,44 +832,55 @@ static int iwl_mvm_scan_total_iterations(struct iwl_mvm_scan_params *params)
return params->schedule[0].iterations + params->schedule[1].iterations; return params->schedule[0].iterations + params->schedule[1].iterations;
} }
static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, static int iwl_mvm_scan_lmac_flags(struct iwl_mvm *mvm,
struct iwl_mvm_scan_params *params) struct iwl_mvm_scan_params *params)
{ {
struct iwl_scan_req_lmac *cmd = mvm->scan_cmd; int flags = 0;
struct iwl_scan_probe_req *preq =
(void *)(cmd->data + sizeof(struct iwl_scan_channel_cfg_lmac) *
mvm->fw->ucode_capa.n_scan_channels);
u32 flags = 0, ssid_bitmap = 0;
int n_iterations = iwl_mvm_scan_total_iterations(params);
lockdep_assert_held(&mvm->mutex); if (params->n_ssids == 0)
flags |= IWL_MVM_LMAC_SCAN_FLAG_PASSIVE;
iwl_mvm_build_generic_scan_cmd(mvm, cmd, params); if (params->n_ssids == 1 && params->ssids[0].ssid_len != 0)
flags |= IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION;
cmd->n_channels = (u8)params->n_channels; if (params->passive_fragmented)
flags |= IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED;
cmd->delay = cpu_to_le32(params->delay); if (iwl_mvm_rrm_scan_needed(mvm))
flags |= IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED;
if (params->pass_all) if (params->pass_all)
flags |= IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL; flags |= IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL;
else else
flags |= IWL_MVM_LMAC_SCAN_FLAG_MATCH; flags |= IWL_MVM_LMAC_SCAN_FLAG_MATCH;
if (params->n_ssids == 1 && params->ssids[0].ssid_len != 0)
flags |= IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION;
if (params->passive_fragmented)
flags |= IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED;
if (params->n_ssids == 0)
flags |= IWL_MVM_LMAC_SCAN_FLAG_PASSIVE;
#ifdef CONFIG_IWLWIFI_DEBUGFS #ifdef CONFIG_IWLWIFI_DEBUGFS
if (mvm->scan_iter_notif_enabled) if (mvm->scan_iter_notif_enabled)
flags |= IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE; flags |= IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE;
#endif #endif
cmd->scan_flags |= cpu_to_le32(flags); return flags;
}
static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct iwl_mvm_scan_params *params)
{
struct iwl_scan_req_lmac *cmd = mvm->scan_cmd;
struct iwl_scan_probe_req *preq =
(void *)(cmd->data + sizeof(struct iwl_scan_channel_cfg_lmac) *
mvm->fw->ucode_capa.n_scan_channels);
u32 ssid_bitmap = 0;
int n_iterations = iwl_mvm_scan_total_iterations(params);
lockdep_assert_held(&mvm->mutex);
iwl_mvm_build_generic_scan_cmd(mvm, cmd, params);
cmd->n_channels = (u8)params->n_channels;
cmd->delay = cpu_to_le32(params->delay);
cmd->scan_flags = cpu_to_le32(iwl_mvm_scan_lmac_flags(mvm, params));
cmd->flags = iwl_mvm_scan_rxon_flags(params->channels[0]->band); cmd->flags = iwl_mvm_scan_rxon_flags(params->channels[0]->band);
cmd->filter_flags = cpu_to_le32(MAC_FILTER_ACCEPT_GRP | cmd->filter_flags = cpu_to_le32(MAC_FILTER_ACCEPT_GRP |
......
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