iwlwifi: mvm: Support new version of ranging response notification
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sun, 17 Oct 2021 09:40:18 +0000 (12:40 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 22 Oct 2021 07:49:01 +0000 (10:49 +0300)
As part of the new rate_n_flags, FW added a new version for
LOCATION_RANGE_RSP_NTFY, and it's internal structure -
LOCATION_RANGE_RSP_AP_ETRY_NTFY. Add support for this.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017123741.c5c6c863631e.I4b493f4eeabbfa1dc965ae012b72fc57de7d5f4f@changeid
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/ops.c

index 5f27829f89963d988669d287701c233c90a02732..12af94e166ed0bbddb0d559c129d6fac3f52590d 100644 (file)
@@ -1501,7 +1501,9 @@ struct iwl_tof_range_rsp_ap_entry_ntfy_v6 {
        u8 reserved[3];
        u8 rx_pn[IEEE80211_CCMP_PN_LEN];
        u8 tx_pn[IEEE80211_CCMP_PN_LEN];
-} __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_6 */
+} __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_6,
+              LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_7 */
+
 
 /**
  * enum iwl_tof_response_status - tof response status
@@ -1582,7 +1584,8 @@ struct iwl_tof_range_rsp_ntfy_v8 {
        u8 last_report;
        u8 reserved;
        struct iwl_tof_range_rsp_ap_entry_ntfy_v6 ap[IWL_MVM_TOF_MAX_APS];
-} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_8 */
+} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_8,
+              LOCATION_RANGE_RSP_NTFY_API_S_VER_9 */
 
 #define IWL_MVM_TOF_MCSI_BUF_SIZE  (245)
 /**
index 73be95fffb95459be1cfccc3267eb35be062f463..949fb790f8fb71712b9d4bb78e9fed74eef433a4 100644 (file)
@@ -1154,6 +1154,7 @@ static u8 iwl_mvm_ftm_get_range_resp_ver(struct iwl_mvm *mvm)
 static bool iwl_mvm_ftm_resp_size_validation(u8 ver, unsigned int pkt_len)
 {
        switch (ver) {
+       case 9:
        case 8:
                return pkt_len == sizeof(struct iwl_tof_range_rsp_ntfy_v8);
        case 7:
@@ -1217,7 +1218,7 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
                int peer_idx;
 
                if (new_api) {
-                       if (notif_ver == 8) {
+                       if (notif_ver >= 8) {
                                fw_ap = &fw_resp_v8->ap[i];
                                iwl_mvm_ftm_pasn_update_pn(mvm, fw_ap);
                        } else if (notif_ver == 7) {
index 3b0d5a0685414c264b4100d29b1f30f75fc8afd7..e331e18b9ab188d112f1f2f5cec186574925dc8f 100644 (file)
@@ -1044,8 +1044,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
        mvm->cmd_ver.range_resp =
                iwl_fw_lookup_notif_ver(mvm->fw, LOCATION_GROUP,
                                        TOF_RANGE_RESPONSE_NOTIF, 5);
-       /* we only support up to version 8 */
-       if (WARN_ON_ONCE(mvm->cmd_ver.range_resp > 8))
+       /* we only support up to version 9 */
+       if (WARN_ON_ONCE(mvm->cmd_ver.range_resp > 9))
                goto out_free;
 
        /*