OSDN Git Service

iwlwifi: mvm: add support for non EDCA based measurements
authorAvraham Stern <avraham.stern@intel.com>
Sun, 6 Oct 2019 09:28:47 +0000 (12:28 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 27 Mar 2020 06:12:49 +0000 (08:12 +0200)
Add support for requesting trigger-based / non trigger-based
measurements.

Change-Id: Ib4d0c471da9c50d9981541a7f5926db384a0f7ce
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/api/location.h
drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

index a0d6802..0214e55 100644 (file)
@@ -427,6 +427,9 @@ struct iwl_tof_range_req_ap_entry_v2 {
  *     Default algo type is ML.
  * @IWL_INITIATOR_AP_FLAGS_MCSI_REPORT: Send the MCSI for each FTM frame to the
  *     driver.
+ * @IWL_INITIATOR_AP_FLAGS_NON_TB: Use non trigger based flow
+ * @IWL_INITIATOR_AP_FLAGS_TB: Use trigger based flow
+ * @IWL_INITIATOR_AP_FLAGS_SECURED: request secured measurement
  */
 enum iwl_initiator_ap_flags {
        IWL_INITIATOR_AP_FLAGS_ASAP = BIT(1),
@@ -436,6 +439,9 @@ enum iwl_initiator_ap_flags {
        IWL_INITIATOR_AP_FLAGS_ALGO_LR = BIT(5),
        IWL_INITIATOR_AP_FLAGS_ALGO_FFT = BIT(6),
        IWL_INITIATOR_AP_FLAGS_MCSI_REPORT = BIT(8),
+       IWL_INITIATOR_AP_FLAGS_NON_TB = BIT(9),
+       IWL_INITIATOR_AP_FLAGS_TB = BIT(10),
+       IWL_INITIATOR_AP_FLAGS_SECURED = BIT(11),
 };
 
 /**
index 6e1ea92..9e21f5e 100644 (file)
@@ -278,6 +278,10 @@ iwl_mvm_ftm_target_chandef_v2(struct iwl_mvm *mvm,
                return -EINVAL;
        }
 
+       /* non EDCA based measurement must use HE preamble */
+       if (peer->ftm.trigger_based || peer->ftm.non_trigger_based)
+               *format_bw |= IWL_LOCATION_FRAME_FORMAT_HE;
+
        *ctrl_ch_position = (peer->chandef.width > NL80211_CHAN_WIDTH_20) ?
                iwl_mvm_get_ctrl_pos(&peer->chandef) : 0;
 
@@ -349,6 +353,11 @@ iwl_mvm_ftm_put_target_common(struct iwl_mvm *mvm,
                FTM_PUT_FLAG(ALGO_LR);
        else if (IWL_MVM_FTM_INITIATOR_ALGO == IWL_TOF_ALGO_TYPE_FFT)
                FTM_PUT_FLAG(ALGO_FFT);
+
+       if (peer->ftm.trigger_based)
+               FTM_PUT_FLAG(TB);
+       else if (peer->ftm.non_trigger_based)
+               FTM_PUT_FLAG(NON_TB);
 }
 
 static int
index 7b6d144..c9c4096 100644 (file)
@@ -193,6 +193,8 @@ static const struct cfg80211_pmsr_capabilities iwl_mvm_pmsr_capa = {
                .non_asap = 1,
                .request_lci = 1,
                .request_civicloc = 1,
+               .trigger_based = 1,
+               .non_trigger_based = 1,
                .max_bursts_exponent = -1, /* all supported */
                .max_ftms_per_burst = 0, /* no limits */
                .bandwidths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
@@ -201,7 +203,8 @@ static const struct cfg80211_pmsr_capabilities iwl_mvm_pmsr_capa = {
                              BIT(NL80211_CHAN_WIDTH_80),
                .preambles = BIT(NL80211_PREAMBLE_LEGACY) |
                             BIT(NL80211_PREAMBLE_HT) |
-                            BIT(NL80211_PREAMBLE_VHT),
+                            BIT(NL80211_PREAMBLE_VHT) |
+                            BIT(NL80211_PREAMBLE_HE),
        },
 };