Commit 8a039ef6 authored by Avraham Stern's avatar Avraham Stern Committed by Johannes Berg

wifi: iwlwifi: mvm: initiator: move setting target flags into a function

Move setting the target flags into a dedicated function to support
different versions of the target struct.
This is done as preparation for moving to the new range request
version.
Signed-off-by: default avatarAvraham Stern <avraham.stern@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240527190228.9d22b61ce589.I7dbe596b4f677638d9a48c3f39b0826a9e35bea4@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 6b82f4e1
......@@ -434,44 +434,55 @@ iwl_mvm_ftm_put_target_v2(struct iwl_mvm *mvm,
#define FTM_PUT_FLAG(flag) (target->initiator_ap_flags |= \
cpu_to_le32(IWL_INITIATOR_AP_FLAGS_##flag))
#define FTM_SET_FLAG(flag) (*flags |= \
cpu_to_le32(IWL_INITIATOR_AP_FLAGS_##flag))
static void
iwl_mvm_ftm_put_target_common(struct iwl_mvm *mvm,
struct cfg80211_pmsr_request_peer *peer,
struct iwl_tof_range_req_ap_entry_v6 *target)
iwl_mvm_ftm_set_target_flags(struct iwl_mvm *mvm,
struct cfg80211_pmsr_request_peer *peer,
__le32 *flags)
{
memcpy(target->bssid, peer->addr, ETH_ALEN);
target->burst_period =
cpu_to_le16(peer->ftm.burst_period);
target->samples_per_burst = peer->ftm.ftms_per_burst;
target->num_of_bursts = peer->ftm.num_bursts_exp;
target->ftmr_max_retries = peer->ftm.ftmr_retries;
target->initiator_ap_flags = cpu_to_le32(0);
*flags = cpu_to_le32(0);
if (peer->ftm.asap)
FTM_PUT_FLAG(ASAP);
FTM_SET_FLAG(ASAP);
if (peer->ftm.request_lci)
FTM_PUT_FLAG(LCI_REQUEST);
FTM_SET_FLAG(LCI_REQUEST);
if (peer->ftm.request_civicloc)
FTM_PUT_FLAG(CIVIC_REQUEST);
FTM_SET_FLAG(CIVIC_REQUEST);
if (IWL_MVM_FTM_INITIATOR_DYNACK)
FTM_PUT_FLAG(DYN_ACK);
FTM_SET_FLAG(DYN_ACK);
if (IWL_MVM_FTM_INITIATOR_ALGO == IWL_TOF_ALGO_TYPE_LINEAR_REG)
FTM_PUT_FLAG(ALGO_LR);
FTM_SET_FLAG(ALGO_LR);
else if (IWL_MVM_FTM_INITIATOR_ALGO == IWL_TOF_ALGO_TYPE_FFT)
FTM_PUT_FLAG(ALGO_FFT);
FTM_SET_FLAG(ALGO_FFT);
if (peer->ftm.trigger_based)
FTM_PUT_FLAG(TB);
FTM_SET_FLAG(TB);
else if (peer->ftm.non_trigger_based)
FTM_PUT_FLAG(NON_TB);
FTM_SET_FLAG(NON_TB);
if ((peer->ftm.trigger_based || peer->ftm.non_trigger_based) &&
peer->ftm.lmr_feedback)
FTM_PUT_FLAG(LMR_FEEDBACK);
FTM_SET_FLAG(LMR_FEEDBACK);
}
static void
iwl_mvm_ftm_put_target_common(struct iwl_mvm *mvm,
struct cfg80211_pmsr_request_peer *peer,
struct iwl_tof_range_req_ap_entry_v6 *target)
{
memcpy(target->bssid, peer->addr, ETH_ALEN);
target->burst_period =
cpu_to_le16(peer->ftm.burst_period);
target->samples_per_burst = peer->ftm.ftms_per_burst;
target->num_of_bursts = peer->ftm.num_bursts_exp;
target->ftmr_max_retries = peer->ftm.ftmr_retries;
iwl_mvm_ftm_set_target_flags(mvm, peer, &target->initiator_ap_flags);
}
static int
......
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