Path: blob/main/sys/contrib/dev/iwlwifi/fw/api/location.h
48426 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2015-2017 Intel Deutschland GmbH3* Copyright (C) 2018-2022 Intel Corporation4* Copyright (C) 2024-2025 Intel Corporation5*/6#ifndef __iwl_fw_api_location_h__7#define __iwl_fw_api_location_h__8#include <linux/ieee80211.h>9#include <linux/if_ether.h>10#include <linux/types.h>11#include <linux/bits.h>12#include "rs.h"1314/**15* enum iwl_location_subcmd_ids - location group command IDs16*/17enum iwl_location_subcmd_ids {18/**19* @TOF_RANGE_REQ_CMD: TOF ranging request,20* uses one of &struct iwl_tof_range_req_cmd_v5,21* &struct iwl_tof_range_req_cmd_v7,22* &struct iwl_tof_range_req_cmd_v8,23* &struct iwl_tof_range_req_cmd_v9,24* &struct iwl_tof_range_req_cmd_v11,25* &struct iwl_tof_range_req_cmd_v726*/27TOF_RANGE_REQ_CMD = 0x0,28/**29* @TOF_CONFIG_CMD: TOF configuration, uses &struct iwl_tof_config_cmd30*/31TOF_CONFIG_CMD = 0x1,32/**33* @TOF_RANGE_ABORT_CMD: abort ongoing ranging, uses34* &struct iwl_tof_range_abort_cmd35*/36TOF_RANGE_ABORT_CMD = 0x2,37/**38* @TOF_RANGE_REQ_EXT_CMD: TOF extended ranging config,39* uses &struct iwl_tof_range_req_ext_cmd40*/41TOF_RANGE_REQ_EXT_CMD = 0x3,42/**43* @TOF_RESPONDER_CONFIG_CMD: FTM responder configuration, one of44* &struct iwl_tof_responder_config_cmd_v6,45* &struct iwl_tof_responder_config_cmd_v7,46* &struct iwl_tof_responder_config_cmd_v8 or47* &struct iwl_tof_responder_config_cmd_v948*/49TOF_RESPONDER_CONFIG_CMD = 0x4,50/**51* @TOF_RESPONDER_DYN_CONFIG_CMD: FTM dynamic configuration,52* uses &struct iwl_tof_responder_dyn_config_cmd53*/54TOF_RESPONDER_DYN_CONFIG_CMD = 0x5,55/**56* @CSI_HEADER_NOTIFICATION: CSI header57*/58CSI_HEADER_NOTIFICATION = 0xFA,59/**60* @CSI_CHUNKS_NOTIFICATION: CSI chunk,61* uses &struct iwl_csi_chunk_notification62*/63CSI_CHUNKS_NOTIFICATION = 0xFB,64/**65* @TOF_LC_NOTIF: used for LCI/civic location, contains just66* the action frame67*/68TOF_LC_NOTIF = 0xFC,69/**70* @TOF_RESPONDER_STATS: FTM responder statistics notification,71* uses &struct iwl_ftm_responder_stats72*/73TOF_RESPONDER_STATS = 0xFD,74/**75* @TOF_MCSI_DEBUG_NOTIF: MCSI debug notification, uses76* &struct iwl_tof_mcsi_notif77*/78TOF_MCSI_DEBUG_NOTIF = 0xFE,79/**80* @TOF_RANGE_RESPONSE_NOTIF: ranging response, using one of81* &struct iwl_tof_range_rsp_ntfy_v5,82* &struct iwl_tof_range_rsp_ntfy_v6,83* &struct iwl_tof_range_rsp_ntfy_v7 or84* &struct iwl_tof_range_rsp_ntfy_v885*/86TOF_RANGE_RESPONSE_NOTIF = 0xFF,87};8889/**90* struct iwl_tof_config_cmd - ToF configuration91* @tof_disabled: indicates if ToF is disabled (or not)92* @one_sided_disabled: indicates if one-sided is disabled (or not)93* @is_debug_mode: indiciates if debug mode is active94* @is_buf_required: indicates if channel estimation buffer is required95*/96struct iwl_tof_config_cmd {97u8 tof_disabled;98u8 one_sided_disabled;99u8 is_debug_mode;100u8 is_buf_required;101} __packed;102103/**104* enum iwl_tof_bandwidth - values for iwl_tof_range_req_ap_entry.bandwidth105* @IWL_TOF_BW_20_LEGACY: 20 MHz non-HT106* @IWL_TOF_BW_20_HT: 20 MHz HT107* @IWL_TOF_BW_40: 40 MHz108* @IWL_TOF_BW_80: 80 MHz109* @IWL_TOF_BW_160: 160 MHz110* @IWL_TOF_BW_NUM: number of tof bandwidths111*/112enum iwl_tof_bandwidth {113IWL_TOF_BW_20_LEGACY,114IWL_TOF_BW_20_HT,115IWL_TOF_BW_40,116IWL_TOF_BW_80,117IWL_TOF_BW_160,118IWL_TOF_BW_NUM,119}; /* LOCAT_BW_TYPE_E */120121/*122* enum iwl_tof_algo_type - Algorithym type for range measurement request123*/124enum iwl_tof_algo_type {125IWL_TOF_ALGO_TYPE_MAX_LIKE = 0,126IWL_TOF_ALGO_TYPE_LINEAR_REG = 1,127IWL_TOF_ALGO_TYPE_FFT = 2,128129/* Keep last */130IWL_TOF_ALGO_TYPE_INVALID,131}; /* ALGO_TYPE_E */132133/*134* enum iwl_tof_mcsi_ntfy - Enable/Disable MCSI notifications135*/136enum iwl_tof_mcsi_enable {137IWL_TOF_MCSI_DISABLED = 0,138IWL_TOF_MCSI_ENABLED = 1,139}; /* MCSI_ENABLE_E */140141/**142* enum iwl_tof_responder_cmd_valid_field - valid fields in the responder cfg143* @IWL_TOF_RESPONDER_CMD_VALID_CHAN_INFO: channel info is valid144* @IWL_TOF_RESPONDER_CMD_VALID_TOA_OFFSET: ToA offset is valid145* @IWL_TOF_RESPONDER_CMD_VALID_COMMON_CALIB: common calibration mode is valid146* @IWL_TOF_RESPONDER_CMD_VALID_SPECIFIC_CALIB: spefici calibration mode is147* valid148* @IWL_TOF_RESPONDER_CMD_VALID_BSSID: BSSID is valid149* @IWL_TOF_RESPONDER_CMD_VALID_TX_ANT: TX antenna is valid150* @IWL_TOF_RESPONDER_CMD_VALID_ALGO_TYPE: algorithm type is valid151* @IWL_TOF_RESPONDER_CMD_VALID_NON_ASAP_SUPPORT: non-ASAP support is valid152* @IWL_TOF_RESPONDER_CMD_VALID_STATISTICS_REPORT_SUPPORT: statistics report153* support is valid154* @IWL_TOF_RESPONDER_CMD_VALID_MCSI_NOTIF_SUPPORT: MCSI notification support155* is valid156* @IWL_TOF_RESPONDER_CMD_VALID_FAST_ALGO_SUPPORT: fast algorithm support157* is valid158* @IWL_TOF_RESPONDER_CMD_VALID_RETRY_ON_ALGO_FAIL: retry on algorithm failure159* is valid160* @IWL_TOF_RESPONDER_CMD_VALID_STA_ID: station ID is valid161* @IWL_TOF_RESPONDER_CMD_VALID_NDP_SUPPORT: enable/disable NDP ranging support162* is valid163* @IWL_TOF_RESPONDER_CMD_VALID_NDP_PARAMS: NDP parameters are valid164* @IWL_TOF_RESPONDER_CMD_VALID_LMR_FEEDBACK: LMR feedback support is valid165* @IWL_TOF_RESPONDER_CMD_VALID_SESSION_ID: session id flag is valid166* @IWL_TOF_RESPONDER_CMD_VALID_BSS_COLOR: the bss_color field is valid167* @IWL_TOF_RESPONDER_CMD_VALID_MIN_MAX_TIME_BETWEEN_MSR: the168* min_time_between_msr and max_time_between_msr fields are valid169*/170enum iwl_tof_responder_cmd_valid_field {171IWL_TOF_RESPONDER_CMD_VALID_CHAN_INFO = BIT(0),172IWL_TOF_RESPONDER_CMD_VALID_TOA_OFFSET = BIT(1),173IWL_TOF_RESPONDER_CMD_VALID_COMMON_CALIB = BIT(2),174IWL_TOF_RESPONDER_CMD_VALID_SPECIFIC_CALIB = BIT(3),175IWL_TOF_RESPONDER_CMD_VALID_BSSID = BIT(4),176IWL_TOF_RESPONDER_CMD_VALID_TX_ANT = BIT(5),177IWL_TOF_RESPONDER_CMD_VALID_ALGO_TYPE = BIT(6),178IWL_TOF_RESPONDER_CMD_VALID_NON_ASAP_SUPPORT = BIT(7),179IWL_TOF_RESPONDER_CMD_VALID_STATISTICS_REPORT_SUPPORT = BIT(8),180IWL_TOF_RESPONDER_CMD_VALID_MCSI_NOTIF_SUPPORT = BIT(9),181IWL_TOF_RESPONDER_CMD_VALID_FAST_ALGO_SUPPORT = BIT(10),182IWL_TOF_RESPONDER_CMD_VALID_RETRY_ON_ALGO_FAIL = BIT(11),183IWL_TOF_RESPONDER_CMD_VALID_STA_ID = BIT(12),184IWL_TOF_RESPONDER_CMD_VALID_NDP_SUPPORT = BIT(22),185IWL_TOF_RESPONDER_CMD_VALID_NDP_PARAMS = BIT(23),186IWL_TOF_RESPONDER_CMD_VALID_LMR_FEEDBACK = BIT(24),187IWL_TOF_RESPONDER_CMD_VALID_SESSION_ID = BIT(25),188IWL_TOF_RESPONDER_CMD_VALID_BSS_COLOR = BIT(26),189IWL_TOF_RESPONDER_CMD_VALID_MIN_MAX_TIME_BETWEEN_MSR = BIT(27),190};191192/**193* enum iwl_tof_responder_cfg_flags - responder configuration flags194* @IWL_TOF_RESPONDER_FLAGS_NON_ASAP_SUPPORT: non-ASAP support195* @IWL_TOF_RESPONDER_FLAGS_REPORT_STATISTICS: report statistics196* @IWL_TOF_RESPONDER_FLAGS_REPORT_MCSI: report MCSI197* @IWL_TOF_RESPONDER_FLAGS_ALGO_TYPE: algorithm type198* @IWL_TOF_RESPONDER_FLAGS_TOA_OFFSET_MODE: ToA offset mode199* @IWL_TOF_RESPONDER_FLAGS_COMMON_CALIB_MODE: common calibration mode200* @IWL_TOF_RESPONDER_FLAGS_SPECIFIC_CALIB_MODE: specific calibration mode201* @IWL_TOF_RESPONDER_FLAGS_FAST_ALGO_SUPPORT: fast algorithm support202* @IWL_TOF_RESPONDER_FLAGS_RETRY_ON_ALGO_FAIL: retry on algorithm fail203* @IWL_TOF_RESPONDER_FLAGS_FTM_TX_ANT: TX antenna mask204* @IWL_TOF_RESPONDER_FLAGS_NDP_SUPPORT: support NDP ranging205* @IWL_TOF_RESPONDER_FLAGS_LMR_FEEDBACK: request for LMR feedback if the206* initiator supports it207* @IWL_TOF_RESPONDER_FLAGS_SESSION_ID: send the session id in the initial FTM208* frame.209*/210enum iwl_tof_responder_cfg_flags {211IWL_TOF_RESPONDER_FLAGS_NON_ASAP_SUPPORT = BIT(0),212IWL_TOF_RESPONDER_FLAGS_REPORT_STATISTICS = BIT(1),213IWL_TOF_RESPONDER_FLAGS_REPORT_MCSI = BIT(2),214IWL_TOF_RESPONDER_FLAGS_ALGO_TYPE = BIT(3) | BIT(4) | BIT(5),215IWL_TOF_RESPONDER_FLAGS_TOA_OFFSET_MODE = BIT(6),216IWL_TOF_RESPONDER_FLAGS_COMMON_CALIB_MODE = BIT(7),217IWL_TOF_RESPONDER_FLAGS_SPECIFIC_CALIB_MODE = BIT(8),218IWL_TOF_RESPONDER_FLAGS_FAST_ALGO_SUPPORT = BIT(9),219IWL_TOF_RESPONDER_FLAGS_RETRY_ON_ALGO_FAIL = BIT(10),220IWL_TOF_RESPONDER_FLAGS_FTM_TX_ANT = RATE_MCS_ANT_AB_MSK,221IWL_TOF_RESPONDER_FLAGS_NDP_SUPPORT = BIT(24),222IWL_TOF_RESPONDER_FLAGS_LMR_FEEDBACK = BIT(25),223IWL_TOF_RESPONDER_FLAGS_SESSION_ID = BIT(27),224};225226/**227* struct iwl_tof_responder_config_cmd_v6 - ToF AP mode (for debug)228* @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field229* @responder_cfg_flags: &iwl_tof_responder_cfg_flags230* @bandwidth: current AP Bandwidth: &enum iwl_tof_bandwidth231* @rate: current AP rate232* @channel_num: current AP Channel233* @ctrl_ch_position: coding of the control channel position relative to234* the center frequency, see iwl_mvm_get_ctrl_pos()235* @sta_id: index of the AP STA when in AP mode236* @reserved1: reserved237* @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug238* purposes, simulating station movement by adding various values239* to this field240* @common_calib: XVT: common calibration value241* @specific_calib: XVT: specific calibration value242* @bssid: Current AP BSSID243* @reserved2: reserved244*/245struct iwl_tof_responder_config_cmd_v6 {246__le32 cmd_valid_fields;247__le32 responder_cfg_flags;248u8 bandwidth;249u8 rate;250u8 channel_num;251u8 ctrl_ch_position;252u8 sta_id;253u8 reserved1;254__le16 toa_offset;255__le16 common_calib;256__le16 specific_calib;257u8 bssid[ETH_ALEN];258__le16 reserved2;259} __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_6 */260261/**262* struct iwl_tof_responder_config_cmd_v7 - ToF AP mode (for debug)263* @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field264* @responder_cfg_flags: &iwl_tof_responder_cfg_flags265* @format_bw: bits 0 - 3: &enum iwl_location_frame_format.266* bits 4 - 7: &enum iwl_location_bw.267* @rate: current AP rate268* @channel_num: current AP Channel269* @ctrl_ch_position: coding of the control channel position relative to270* the center frequency, see iwl_mvm_get_ctrl_pos()271* @sta_id: index of the AP STA when in AP mode272* @reserved1: reserved273* @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug274* purposes, simulating station movement by adding various values275* to this field276* @common_calib: XVT: common calibration value277* @specific_calib: XVT: specific calibration value278* @bssid: Current AP BSSID279* @reserved2: reserved280*/281struct iwl_tof_responder_config_cmd_v7 {282__le32 cmd_valid_fields;283__le32 responder_cfg_flags;284u8 format_bw;285u8 rate;286u8 channel_num;287u8 ctrl_ch_position;288u8 sta_id;289u8 reserved1;290__le16 toa_offset;291__le16 common_calib;292__le16 specific_calib;293u8 bssid[ETH_ALEN];294__le16 reserved2;295} __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_7 */296297#define IWL_RESPONDER_STS_POS 3298#define IWL_RESPONDER_TOTAL_LTF_POS 6299300/**301* struct iwl_tof_responder_config_cmd_v8 - ToF AP mode (for debug)302* @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field303* @responder_cfg_flags: &iwl_tof_responder_cfg_flags304* @format_bw: bits 0 - 3: &enum iwl_location_frame_format.305* bits 4 - 7: &enum iwl_location_bw.306* @rate: current AP rate307* @channel_num: current AP Channel308* @ctrl_ch_position: coding of the control channel position relative to309* the center frequency, see iwl_mvm_get_ctrl_pos()310* @sta_id: index of the AP STA when in AP mode311* @reserved1: reserved312* @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug313* purposes, simulating station movement by adding various values314* to this field315* @common_calib: XVT: common calibration value316* @specific_calib: XVT: specific calibration value317* @bssid: Current AP BSSID318* @r2i_ndp_params: parameters for R2I NDP.319* bits 0 - 2: max number of LTF repetitions320* bits 3 - 5: max number of spatial streams (supported values are < 2)321* bits 6 - 7: max number of total LTFs see322* &enum ieee80211_range_params_max_total_ltf323* @i2r_ndp_params: parameters for I2R NDP.324* bits 0 - 2: max number of LTF repetitions325* bits 3 - 5: max number of spatial streams326* bits 6 - 7: max number of total LTFs see327* &enum ieee80211_range_params_max_total_ltf328*/329struct iwl_tof_responder_config_cmd_v8 {330__le32 cmd_valid_fields;331__le32 responder_cfg_flags;332u8 format_bw;333u8 rate;334u8 channel_num;335u8 ctrl_ch_position;336u8 sta_id;337u8 reserved1;338__le16 toa_offset;339__le16 common_calib;340__le16 specific_calib;341u8 bssid[ETH_ALEN];342u8 r2i_ndp_params;343u8 i2r_ndp_params;344} __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_8 */345346/**347* struct iwl_tof_responder_config_cmd_v9 - ToF AP mode (for debug)348* @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field349* @responder_cfg_flags: &iwl_tof_responder_cfg_flags350* @format_bw: bits 0 - 3: &enum iwl_location_frame_format.351* bits 4 - 7: &enum iwl_location_bw.352* @bss_color: current AP bss_color353* @channel_num: current AP Channel354* @ctrl_ch_position: coding of the control channel position relative to355* the center frequency, see iwl_mvm_get_ctrl_pos()356* @sta_id: index of the AP STA when in AP mode357* @reserved1: reserved358* @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug359* purposes, simulating station movement by adding various values360* to this field361* @common_calib: XVT: common calibration value362* @specific_calib: XVT: specific calibration value363* @bssid: Current AP BSSID364* @r2i_ndp_params: parameters for R2I NDP.365* bits 0 - 2: max number of LTF repetitions366* bits 3 - 5: max number of spatial streams (supported values are < 2)367* bits 6 - 7: max number of total LTFs see368* &enum ieee80211_range_params_max_total_ltf369* @i2r_ndp_params: parameters for I2R NDP.370* bits 0 - 2: max number of LTF repetitions371* bits 3 - 5: max number of spatial streams372* bits 6 - 7: max number of total LTFs see373* &enum ieee80211_range_params_max_total_ltf374* @min_time_between_msr: for non trigger based NDP ranging, minimum time375* between measurements in milliseconds.376* @max_time_between_msr: for non trigger based NDP ranging, maximum time377* between measurements in milliseconds.378*/379struct iwl_tof_responder_config_cmd_v9 {380__le32 cmd_valid_fields;381__le32 responder_cfg_flags;382u8 format_bw;383u8 bss_color;384u8 channel_num;385u8 ctrl_ch_position;386u8 sta_id;387u8 reserved1;388__le16 toa_offset;389__le16 common_calib;390__le16 specific_calib;391u8 bssid[ETH_ALEN];392u8 r2i_ndp_params;393u8 i2r_ndp_params;394__le16 min_time_between_msr;395__le16 max_time_between_msr;396} __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_8 */397398/**399* struct iwl_tof_responder_config_cmd - ToF AP mode400* @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field401* @responder_cfg_flags: &iwl_tof_responder_cfg_flags402* @format_bw: bits 0 - 3: &enum iwl_location_frame_format.403* bits 4 - 7: &enum iwl_location_bw.404* @bss_color: current AP bss_color405* @channel_num: current AP Channel406* @ctrl_ch_position: coding of the control channel position relative to407* the center frequency, see iwl_mvm_get_ctrl_pos()408* @sta_id: index of the AP STA when in AP mode409* @band: current AP band410* @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug411* purposes, simulating station movement by adding various values412* to this field413* @common_calib: XVT: common calibration value414* @specific_calib: XVT: specific calibration value415* @bssid: Current AP BSSID416* @r2i_ndp_params: parameters for R2I NDP.417* bits 0 - 2: max number of LTF repetitions418* bits 3 - 5: max number of spatial streams (supported values are < 2)419* bits 6 - 7: max number of total LTFs see420* &enum ieee80211_range_params_max_total_ltf421* @i2r_ndp_params: parameters for I2R NDP.422* bits 0 - 2: max number of LTF repetitions423* bits 3 - 5: max number of spatial streams424* bits 6 - 7: max number of total LTFs see425* &enum ieee80211_range_params_max_total_ltf426* @min_time_between_msr: for non trigger based NDP ranging, minimum time427* between measurements in milliseconds.428* @max_time_between_msr: for non trigger based NDP ranging, maximum time429* between measurements in milliseconds.430*/431struct iwl_tof_responder_config_cmd {432__le32 cmd_valid_fields;433__le32 responder_cfg_flags;434u8 format_bw;435u8 bss_color;436u8 channel_num;437u8 ctrl_ch_position;438u8 sta_id;439u8 band;440__le16 toa_offset;441__le16 common_calib;442__le16 specific_calib;443u8 bssid[ETH_ALEN];444u8 r2i_ndp_params;445u8 i2r_ndp_params;446__le16 min_time_between_msr;447__le16 max_time_between_msr;448} __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_10 */449450#define IWL_LCI_CIVIC_IE_MAX_SIZE 400451452/**453* struct iwl_tof_responder_dyn_config_cmd_v2 - Dynamic responder settings454* @lci_len: The length of the 1st (LCI) part in the @lci_civic buffer455* @civic_len: The length of the 2nd (CIVIC) part in the @lci_civic buffer456* @lci_civic: The LCI/CIVIC buffer. LCI data (if exists) comes first, then, if457* needed, 0-padding such that the next part is dword-aligned, then CIVIC458* data (if exists) follows, and then 0-padding again to complete a459* 4-multiple long buffer.460*/461struct iwl_tof_responder_dyn_config_cmd_v2 {462__le32 lci_len;463__le32 civic_len;464u8 lci_civic[];465} __packed; /* TOF_RESPONDER_DYN_CONFIG_CMD_API_S_VER_2 */466467#define IWL_LCI_MAX_SIZE 160468#define IWL_CIVIC_MAX_SIZE 160469#define HLTK_11AZ_LEN 32470471/**472* enum iwl_responder_dyn_cfg_valid_flags - valid flags for dyn_config_cmd473* @IWL_RESPONDER_DYN_CFG_VALID_LCI: LCI data is valid474* @IWL_RESPONDER_DYN_CFG_VALID_CIVIC: Civic data is valid475* @IWL_RESPONDER_DYN_CFG_VALID_PASN_STA: the pasn_addr, HLTK and cipher fields476* are valid.477*/478enum iwl_responder_dyn_cfg_valid_flags {479IWL_RESPONDER_DYN_CFG_VALID_LCI = BIT(0),480IWL_RESPONDER_DYN_CFG_VALID_CIVIC = BIT(1),481IWL_RESPONDER_DYN_CFG_VALID_PASN_STA = BIT(2),482};483484/**485* struct iwl_tof_responder_dyn_config_cmd - Dynamic responder settings486* @cipher: The negotiated cipher. see &enum iwl_location_cipher.487* @valid_flags: flags indicating which fields in the command are valid. see488* &enum iwl_responder_dyn_cfg_valid_flags.489* @lci_len: length of the LCI data in bytes490* @civic_len: length of the Civic data in bytes491* @lci_buf: the LCI buffer492* @civic_buf: the Civic buffer493* @hltk_buf: HLTK for secure LTF bits generation for the specified station494* @addr: mac address of the station for which to use the HLTK495* @reserved: for alignment496*/497struct iwl_tof_responder_dyn_config_cmd {498u8 cipher;499u8 valid_flags;500u8 lci_len;501u8 civic_len;502u8 lci_buf[IWL_LCI_MAX_SIZE];503u8 civic_buf[IWL_LCI_MAX_SIZE];504u8 hltk_buf[HLTK_11AZ_LEN];505u8 addr[ETH_ALEN];506u8 reserved[2];507} __packed; /* TOF_RESPONDER_DYN_CONFIG_CMD_API_S_VER_3 */508509/**510* struct iwl_tof_range_req_ext_cmd - extended range req for WLS511* @tsf_timer_offset_msec: the recommended time offset (mSec) from the AP's TSF512* @reserved: reserved513* @min_delta_ftm: Minimal time between two consecutive measurements,514* in units of 100us. 0 means no preference by station515* @ftm_format_and_bw20M: FTM Channel Spacing/Format for 20MHz: recommended516* value be sent to the AP517* @ftm_format_and_bw40M: FTM Channel Spacing/Format for 40MHz: recommended518* value to be sent to the AP519* @ftm_format_and_bw80M: FTM Channel Spacing/Format for 80MHz: recommended520* value to be sent to the AP521*/522struct iwl_tof_range_req_ext_cmd {523__le16 tsf_timer_offset_msec;524__le16 reserved;525u8 min_delta_ftm;526u8 ftm_format_and_bw20M;527u8 ftm_format_and_bw40M;528u8 ftm_format_and_bw80M;529} __packed;530531/**532* enum iwl_tof_location_query - values for query bitmap533* @IWL_TOF_LOC_LCI: query LCI534* @IWL_TOF_LOC_CIVIC: query civic535*/536enum iwl_tof_location_query {537IWL_TOF_LOC_LCI = 0x01,538IWL_TOF_LOC_CIVIC = 0x02,539};540541/**542* struct iwl_tof_range_req_ap_entry_v2 - AP configuration parameters543* @channel_num: Current AP Channel544* @bandwidth: Current AP Bandwidth. One of iwl_tof_bandwidth.545* @tsf_delta_direction: TSF relatively to the subject AP546* @ctrl_ch_position: Coding of the control channel position relative to the547* center frequency, see iwl_mvm_get_ctrl_pos().548* @bssid: AP's BSSID549* @measure_type: Measurement type: 0 - two sided, 1 - One sided550* @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of the551* number of measurement iterations (min 2^0 = 1, max 2^14)552* @burst_period: Recommended value to be sent to the AP. Measurement553* periodicity In units of 100ms. ignored if num_of_bursts = 0554* @samples_per_burst: 2-sided: the number of FTMs pairs in single Burst (1-31);555* 1-sided: how many rts/cts pairs should be used per burst.556* @retries_per_sample: Max number of retries that the LMAC should send557* in case of no replies by the AP.558* @tsf_delta: TSF Delta in units of microseconds.559* The difference between the AP TSF and the device local clock.560* @location_req: Location Request Bit[0] LCI should be sent in the FTMR;561* Bit[1] Civic should be sent in the FTMR562* @asap_mode: 0 - non asap mode, 1 - asap mode (not relevant for one sided)563* @enable_dyn_ack: Enable Dynamic ACK BW.564* 0: Initiator interact with regular AP;565* 1: Initiator interact with Responder machine: need to send the566* Initiator Acks with HT 40MHz / 80MHz, since the Responder should567* use it for its ch est measurement (this flag will be set when we568* configure the opposite machine to be Responder).569* @rssi: Last received value570* legal values: -128-0 (0x7f). above 0x0 indicating an invalid value.571* @algo_type: &enum iwl_tof_algo_type572* @notify_mcsi: &enum iwl_tof_mcsi_ntfy.573* @reserved: For alignment and future use574*/575struct iwl_tof_range_req_ap_entry_v2 {576u8 channel_num;577u8 bandwidth;578u8 tsf_delta_direction;579u8 ctrl_ch_position;580u8 bssid[ETH_ALEN];581u8 measure_type;582u8 num_of_bursts;583__le16 burst_period;584u8 samples_per_burst;585u8 retries_per_sample;586__le32 tsf_delta;587u8 location_req;588u8 asap_mode;589u8 enable_dyn_ack;590s8 rssi;591u8 algo_type;592u8 notify_mcsi;593__le16 reserved;594} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_2 */595596/**597* enum iwl_initiator_ap_flags - per responder FTM configuration flags598* @IWL_INITIATOR_AP_FLAGS_ASAP: Request for ASAP measurement.599* @IWL_INITIATOR_AP_FLAGS_LCI_REQUEST: Request for LCI information600* @IWL_INITIATOR_AP_FLAGS_CIVIC_REQUEST: Request for CIVIC information601* @IWL_INITIATOR_AP_FLAGS_DYN_ACK: Send HT/VHT ack for FTM frames. If not set,602* 20Mhz dup acks will be sent.603* @IWL_INITIATOR_AP_FLAGS_ALGO_LR: Use LR algo type for rtt calculation.604* Default algo type is ML.605* @IWL_INITIATOR_AP_FLAGS_ALGO_FFT: Use FFT algo type for rtt calculation.606* Default algo type is ML.607* @IWL_INITIATOR_AP_FLAGS_MCSI_REPORT: Send the MCSI for each FTM frame to the608* driver.609* @IWL_INITIATOR_AP_FLAGS_NON_TB: Use non trigger based flow610* @IWL_INITIATOR_AP_FLAGS_TB: Use trigger based flow611* @IWL_INITIATOR_AP_FLAGS_SECURED: request secure LTF measurement612* @IWL_INITIATOR_AP_FLAGS_LMR_FEEDBACK: Send LMR feedback613* @IWL_INITIATOR_AP_FLAGS_USE_CALIB: Use calibration values from the request614* instead of fw internal values.615* @IWL_INITIATOR_AP_FLAGS_PMF: request to protect the negotiation and LMR616* frames with protected management frames.617* @IWL_INITIATOR_AP_FLAGS_TERMINATE_ON_LMR_FEEDBACK: terminate the session if618* the responder asked for LMR feedback although the initiator did not set619* the LMR feedback bit in the FTM request. If not set, the initiator will620* continue with the session and will provide the LMR feedback.621* @IWL_INITIATOR_AP_FLAGS_TEST_INCORRECT_SAC: send an incorrect SAC in the622* first NDP exchange. This is used for testing.623* @IWL_INITIATOR_AP_FLAGS_TEST_BAD_SLTF: use incorrect secure LTF tx key. This624* is used for testing. Only supported from version 15 of the range request625* command.626*/627enum iwl_initiator_ap_flags {628IWL_INITIATOR_AP_FLAGS_ASAP = BIT(1),629IWL_INITIATOR_AP_FLAGS_LCI_REQUEST = BIT(2),630IWL_INITIATOR_AP_FLAGS_CIVIC_REQUEST = BIT(3),631IWL_INITIATOR_AP_FLAGS_DYN_ACK = BIT(4),632IWL_INITIATOR_AP_FLAGS_ALGO_LR = BIT(5),633IWL_INITIATOR_AP_FLAGS_ALGO_FFT = BIT(6),634IWL_INITIATOR_AP_FLAGS_MCSI_REPORT = BIT(8),635IWL_INITIATOR_AP_FLAGS_NON_TB = BIT(9),636IWL_INITIATOR_AP_FLAGS_TB = BIT(10),637IWL_INITIATOR_AP_FLAGS_SECURED = BIT(11),638IWL_INITIATOR_AP_FLAGS_LMR_FEEDBACK = BIT(12),639IWL_INITIATOR_AP_FLAGS_USE_CALIB = BIT(13),640IWL_INITIATOR_AP_FLAGS_PMF = BIT(14),641IWL_INITIATOR_AP_FLAGS_TERMINATE_ON_LMR_FEEDBACK = BIT(15),642IWL_INITIATOR_AP_FLAGS_TEST_INCORRECT_SAC = BIT(16),643IWL_INITIATOR_AP_FLAGS_TEST_BAD_SLTF = BIT(17),644};645646/**647* struct iwl_tof_range_req_ap_entry_v3 - AP configuration parameters648* @initiator_ap_flags: see &enum iwl_initiator_ap_flags.649* @channel_num: AP Channel number650* @bandwidth: AP bandwidth. One of iwl_tof_bandwidth.651* @ctrl_ch_position: Coding of the control channel position relative to the652* center frequency, see iwl_mvm_get_ctrl_pos().653* @ftmr_max_retries: Max number of retries to send the FTMR in case of no654* reply from the AP.655* @bssid: AP's BSSID656* @burst_period: Recommended value to be sent to the AP. Measurement657* periodicity In units of 100ms. ignored if num_of_bursts_exp = 0658* @samples_per_burst: the number of FTMs pairs in single Burst (1-31);659* @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of660* the number of measurement iterations (min 2^0 = 1, max 2^14)661* @reserved: For alignment and future use662* @tsf_delta: not in use663*/664struct iwl_tof_range_req_ap_entry_v3 {665__le32 initiator_ap_flags;666u8 channel_num;667u8 bandwidth;668u8 ctrl_ch_position;669u8 ftmr_max_retries;670u8 bssid[ETH_ALEN];671__le16 burst_period;672u8 samples_per_burst;673u8 num_of_bursts;674__le16 reserved;675__le32 tsf_delta;676} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_3 */677678/**679* enum iwl_location_frame_format - location frame formats680* @IWL_LOCATION_FRAME_FORMAT_LEGACY: legacy681* @IWL_LOCATION_FRAME_FORMAT_HT: HT682* @IWL_LOCATION_FRAME_FORMAT_VHT: VHT683* @IWL_LOCATION_FRAME_FORMAT_HE: HE684*/685enum iwl_location_frame_format {686IWL_LOCATION_FRAME_FORMAT_LEGACY,687IWL_LOCATION_FRAME_FORMAT_HT,688IWL_LOCATION_FRAME_FORMAT_VHT,689IWL_LOCATION_FRAME_FORMAT_HE,690};691692/**693* enum iwl_location_bw - location bandwidth selection694* @IWL_LOCATION_BW_20MHZ: 20MHz695* @IWL_LOCATION_BW_40MHZ: 40MHz696* @IWL_LOCATION_BW_80MHZ: 80MHz697* @IWL_LOCATION_BW_160MHZ: 160MHz698*/699enum iwl_location_bw {700IWL_LOCATION_BW_20MHZ,701IWL_LOCATION_BW_40MHZ,702IWL_LOCATION_BW_80MHZ,703IWL_LOCATION_BW_160MHZ,704};705706#define TK_11AZ_LEN 32707708#define LOCATION_BW_POS 4709710/**711* struct iwl_tof_range_req_ap_entry_v4 - AP configuration parameters712* @initiator_ap_flags: see &enum iwl_initiator_ap_flags.713* @channel_num: AP Channel number714* @format_bw: bits 0 - 3: &enum iwl_location_frame_format.715* bits 4 - 7: &enum iwl_location_bw.716* @ctrl_ch_position: Coding of the control channel position relative to the717* center frequency, see iwl_mvm_get_ctrl_pos().718* @ftmr_max_retries: Max number of retries to send the FTMR in case of no719* reply from the AP.720* @bssid: AP's BSSID721* @burst_period: Recommended value to be sent to the AP. Measurement722* periodicity In units of 100ms. ignored if num_of_bursts_exp = 0723* @samples_per_burst: the number of FTMs pairs in single Burst (1-31);724* @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of725* the number of measurement iterations (min 2^0 = 1, max 2^14)726* @reserved: For alignment and future use727* @hltk: HLTK to be used for secured 11az measurement728* @tk: TK to be used for secured 11az measurement729*/730struct iwl_tof_range_req_ap_entry_v4 {731__le32 initiator_ap_flags;732u8 channel_num;733u8 format_bw;734u8 ctrl_ch_position;735u8 ftmr_max_retries;736u8 bssid[ETH_ALEN];737__le16 burst_period;738u8 samples_per_burst;739u8 num_of_bursts;740__le16 reserved;741u8 hltk[HLTK_11AZ_LEN];742u8 tk[TK_11AZ_LEN];743} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_4 */744745/**746* enum iwl_location_cipher - location cipher selection747* @IWL_LOCATION_CIPHER_CCMP_128: CCMP 128748* @IWL_LOCATION_CIPHER_GCMP_128: GCMP 128749* @IWL_LOCATION_CIPHER_GCMP_256: GCMP 256750* @IWL_LOCATION_CIPHER_INVALID: security is not used.751* @IWL_LOCATION_CIPHER_MAX: maximum value for this enum.752*/753enum iwl_location_cipher {754IWL_LOCATION_CIPHER_CCMP_128,755IWL_LOCATION_CIPHER_GCMP_128,756IWL_LOCATION_CIPHER_GCMP_256,757IWL_LOCATION_CIPHER_INVALID,758IWL_LOCATION_CIPHER_MAX,759};760761/**762* struct iwl_tof_range_req_ap_entry_v6 - AP configuration parameters763* @initiator_ap_flags: see &enum iwl_initiator_ap_flags.764* @channel_num: AP Channel number765* @format_bw: bits 0 - 3: &enum iwl_location_frame_format.766* bits 4 - 7: &enum iwl_location_bw.767* @ctrl_ch_position: Coding of the control channel position relative to the768* center frequency, see iwl_mvm_get_ctrl_pos().769* @ftmr_max_retries: Max number of retries to send the FTMR in case of no770* reply from the AP.771* @bssid: AP's BSSID772* @burst_period: Recommended value to be sent to the AP. Measurement773* periodicity In units of 100ms. ignored if num_of_bursts_exp = 0774* @samples_per_burst: the number of FTMs pairs in single Burst (1-31);775* @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of776* the number of measurement iterations (min 2^0 = 1, max 2^14)777* @sta_id: the station id of the AP. Only relevant when associated to the AP,778* otherwise should be set to &IWL_INVALID_STA.779* @cipher: pairwise cipher suite for secured measurement.780* &enum iwl_location_cipher.781* @hltk: HLTK to be used for secured 11az measurement782* @tk: TK to be used for secured 11az measurement783* @calib: An array of calibration values per FTM rx bandwidth.784* If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the785* calibration value that corresponds to the rx bandwidth of the FTM786* frame.787* @beacon_interval: beacon interval of the AP in TUs. Only required if788* &IWL_INITIATOR_AP_FLAGS_TB is set.789*/790struct iwl_tof_range_req_ap_entry_v6 {791__le32 initiator_ap_flags;792u8 channel_num;793u8 format_bw;794u8 ctrl_ch_position;795u8 ftmr_max_retries;796u8 bssid[ETH_ALEN];797__le16 burst_period;798u8 samples_per_burst;799u8 num_of_bursts;800u8 sta_id;801u8 cipher;802u8 hltk[HLTK_11AZ_LEN];803u8 tk[TK_11AZ_LEN];804__le16 calib[IWL_TOF_BW_NUM];805__le16 beacon_interval;806} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_6 */807808/**809* struct iwl_tof_range_req_ap_entry_v7 - AP configuration parameters810* @initiator_ap_flags: see &enum iwl_initiator_ap_flags.811* @channel_num: AP Channel number812* @format_bw: bits 0 - 3: &enum iwl_location_frame_format.813* bits 4 - 7: &enum iwl_location_bw.814* @ctrl_ch_position: Coding of the control channel position relative to the815* center frequency, see iwl_mvm_get_ctrl_pos().816* @ftmr_max_retries: Max number of retries to send the FTMR in case of no817* reply from the AP.818* @bssid: AP's BSSID819* @burst_period: Recommended value to be sent to the AP. Measurement820* periodicity In units of 100ms. ignored if num_of_bursts_exp = 0821* @samples_per_burst: the number of FTMs pairs in single Burst (1-31);822* @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of823* the number of measurement iterations (min 2^0 = 1, max 2^14)824* @sta_id: the station id of the AP. Only relevant when associated to the AP,825* otherwise should be set to &IWL_INVALID_STA.826* @cipher: pairwise cipher suite for secured measurement.827* &enum iwl_location_cipher.828* @hltk: HLTK to be used for secured 11az measurement829* @tk: TK to be used for secured 11az measurement830* @calib: An array of calibration values per FTM rx bandwidth.831* If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the832* calibration value that corresponds to the rx bandwidth of the FTM833* frame.834* @beacon_interval: beacon interval of the AP in TUs. Only required if835* &IWL_INITIATOR_AP_FLAGS_TB is set.836* @rx_pn: the next expected PN for protected management frames Rx. LE byte837* order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id838* is set to &IWL_INVALID_STA.839* @tx_pn: the next PN to use for protected management frames Tx. LE byte840* order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id841* is set to &IWL_INVALID_STA.842*/843struct iwl_tof_range_req_ap_entry_v7 {844__le32 initiator_ap_flags;845u8 channel_num;846u8 format_bw;847u8 ctrl_ch_position;848u8 ftmr_max_retries;849u8 bssid[ETH_ALEN];850__le16 burst_period;851u8 samples_per_burst;852u8 num_of_bursts;853u8 sta_id;854u8 cipher;855u8 hltk[HLTK_11AZ_LEN];856u8 tk[TK_11AZ_LEN];857__le16 calib[IWL_TOF_BW_NUM];858__le16 beacon_interval;859u8 rx_pn[IEEE80211_CCMP_PN_LEN];860u8 tx_pn[IEEE80211_CCMP_PN_LEN];861} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_7 */862863#define IWL_LOCATION_MAX_STS_POS 3864#define IWL_LOCATION_TOTAL_LTF_POS 6865866/**867* struct iwl_tof_range_req_ap_entry_v8 - AP configuration parameters868* @initiator_ap_flags: see &enum iwl_initiator_ap_flags.869* @channel_num: AP Channel number870* @format_bw: bits 0 - 3: &enum iwl_location_frame_format.871* bits 4 - 7: &enum iwl_location_bw.872* @ctrl_ch_position: Coding of the control channel position relative to the873* center frequency, see iwl_mvm_get_ctrl_pos().874* @ftmr_max_retries: Max number of retries to send the FTMR in case of no875* reply from the AP.876* @bssid: AP's BSSID877* @burst_period: Recommended value to be sent to the AP. Measurement878* periodicity In units of 100ms. ignored if num_of_bursts_exp = 0879* @samples_per_burst: the number of FTMs pairs in single Burst (1-31);880* @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of881* the number of measurement iterations (min 2^0 = 1, max 2^14)882* @sta_id: the station id of the AP. Only relevant when associated to the AP,883* otherwise should be set to &IWL_INVALID_STA.884* @cipher: pairwise cipher suite for secured measurement.885* &enum iwl_location_cipher.886* @hltk: HLTK to be used for secured 11az measurement887* @tk: TK to be used for secured 11az measurement888* @calib: An array of calibration values per FTM rx bandwidth.889* If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the890* calibration value that corresponds to the rx bandwidth of the FTM891* frame.892* @beacon_interval: beacon interval of the AP in TUs. Only required if893* &IWL_INITIATOR_AP_FLAGS_TB is set.894* @rx_pn: the next expected PN for protected management frames Rx. LE byte895* order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id896* is set to &IWL_INVALID_STA.897* @tx_pn: the next PN to use for protected management frames Tx. LE byte898* order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id899* is set to &IWL_INVALID_STA.900* @r2i_ndp_params: parameters for R2I NDP ranging negotiation.901* bits 0 - 2: max LTF repetitions902* bits 3 - 5: max number of spatial streams903* bits 6 - 7: reserved904* @i2r_ndp_params: parameters for I2R NDP ranging negotiation.905* bits 0 - 2: max LTF repetitions906* bits 3 - 5: max number of spatial streams (supported values are < 2)907* bits 6 - 7: reserved908* @r2i_max_total_ltf: R2I Max Total LTFs for NDP ranging negotiation.909* One of &enum ieee80211_range_params_max_total_ltf.910* @i2r_max_total_ltf: I2R Max Total LTFs for NDP ranging negotiation.911* One of &enum ieee80211_range_params_max_total_ltf.912*/913struct iwl_tof_range_req_ap_entry_v8 {914__le32 initiator_ap_flags;915u8 channel_num;916u8 format_bw;917u8 ctrl_ch_position;918u8 ftmr_max_retries;919u8 bssid[ETH_ALEN];920__le16 burst_period;921u8 samples_per_burst;922u8 num_of_bursts;923u8 sta_id;924u8 cipher;925u8 hltk[HLTK_11AZ_LEN];926u8 tk[TK_11AZ_LEN];927__le16 calib[IWL_TOF_BW_NUM];928__le16 beacon_interval;929u8 rx_pn[IEEE80211_CCMP_PN_LEN];930u8 tx_pn[IEEE80211_CCMP_PN_LEN];931u8 r2i_ndp_params;932u8 i2r_ndp_params;933u8 r2i_max_total_ltf;934u8 i2r_max_total_ltf;935} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_8 */936937/**938* struct iwl_tof_range_req_ap_entry_v9 - AP configuration parameters939* @initiator_ap_flags: see &enum iwl_initiator_ap_flags.940* @channel_num: AP Channel number941* @format_bw: bits 0 - 3: &enum iwl_location_frame_format.942* bits 4 - 7: &enum iwl_location_bw.943* @ctrl_ch_position: Coding of the control channel position relative to the944* center frequency, see iwl_mvm_get_ctrl_pos().945* @ftmr_max_retries: Max number of retries to send the FTMR in case of no946* reply from the AP.947* @bssid: AP's BSSID948* @burst_period: For EDCA based ranging: Recommended value to be sent to the949* AP. Measurement periodicity In units of 100ms. ignored if950* num_of_bursts_exp = 0.951* For non trigger based NDP ranging, the maximum time between952* measurements in units of milliseconds.953* @samples_per_burst: the number of FTMs pairs in single Burst (1-31);954* @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of955* the number of measurement iterations (min 2^0 = 1, max 2^14)956* @sta_id: the station id of the AP. Only relevant when associated to the AP,957* otherwise should be set to &IWL_INVALID_STA.958* @cipher: pairwise cipher suite for secured measurement.959* &enum iwl_location_cipher.960* @hltk: HLTK to be used for secured 11az measurement961* @tk: TK to be used for secured 11az measurement962* @calib: An array of calibration values per FTM rx bandwidth.963* If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the964* calibration value that corresponds to the rx bandwidth of the FTM965* frame.966* @beacon_interval: beacon interval of the AP in TUs. Only required if967* &IWL_INITIATOR_AP_FLAGS_TB is set.968* @bss_color: the BSS color of the responder. Only valid if969* &IWL_INITIATOR_AP_FLAGS_TB or &IWL_INITIATOR_AP_FLAGS_NON_TB is set.970* @rx_pn: the next expected PN for protected management frames Rx. LE byte971* order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id972* is set to &IWL_INVALID_STA.973* @tx_pn: the next PN to use for protected management frames Tx. LE byte974* order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id975* is set to &IWL_INVALID_STA.976* @r2i_ndp_params: parameters for R2I NDP ranging negotiation.977* bits 0 - 2: max LTF repetitions978* bits 3 - 5: max number of spatial streams979* bits 6 - 7: reserved980* @i2r_ndp_params: parameters for I2R NDP ranging negotiation.981* bits 0 - 2: max LTF repetitions982* bits 3 - 5: max number of spatial streams (supported values are < 2)983* bits 6 - 7: reserved984* @r2i_max_total_ltf: R2I Max Total LTFs for NDP ranging negotiation.985* One of &enum ieee80211_range_params_max_total_ltf.986* @i2r_max_total_ltf: I2R Max Total LTFs for NDP ranging negotiation.987* One of &enum ieee80211_range_params_max_total_ltf.988* @bss_color: the BSS color of the responder. Only valid if989* &IWL_INITIATOR_AP_FLAGS_NON_TB or &IWL_INITIATOR_AP_FLAGS_TB is set.990* @band: 0 for 5.2 GHz, 1 for 2.4 GHz, 2 for 6GHz991* @min_time_between_msr: For non trigger based NDP ranging, the minimum time992* between measurements in units of milliseconds993*/994struct iwl_tof_range_req_ap_entry_v9 {995__le32 initiator_ap_flags;996u8 channel_num;997u8 format_bw;998u8 ctrl_ch_position;999u8 ftmr_max_retries;1000u8 bssid[ETH_ALEN];1001__le16 burst_period;1002u8 samples_per_burst;1003u8 num_of_bursts;1004u8 sta_id;1005u8 cipher;1006u8 hltk[HLTK_11AZ_LEN];1007u8 tk[TK_11AZ_LEN];1008__le16 calib[IWL_TOF_BW_NUM];1009u16 beacon_interval;1010u8 rx_pn[IEEE80211_CCMP_PN_LEN];1011u8 tx_pn[IEEE80211_CCMP_PN_LEN];1012u8 r2i_ndp_params;1013u8 i2r_ndp_params;1014u8 r2i_max_total_ltf;1015u8 i2r_max_total_ltf;1016u8 bss_color;1017u8 band;1018__le16 min_time_between_msr;1019} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_9 */10201021/**1022* struct iwl_tof_range_req_ap_entry - AP configuration parameters1023* @initiator_ap_flags: see &enum iwl_initiator_ap_flags.1024* @band: 0 for 5.2 GHz, 1 for 2.4 GHz, 2 for 6GHz1025* @channel_num: AP Channel number1026* @format_bw: bits 0 - 3: &enum iwl_location_frame_format.1027* bits 4 - 7: &enum iwl_location_bw.1028* @ctrl_ch_position: Coding of the control channel position relative to the1029* center frequency, see iwl_mvm_get_ctrl_pos().1030* @bssid: AP's BSSID1031* @burst_period: For EDCA based ranging: Recommended value to be sent to the1032* AP. Measurement periodicity In units of 100ms. ignored if1033* num_of_bursts_exp = 0.1034* For non trigger based NDP ranging, the maximum time between1035* measurements in units of milliseconds.1036* @samples_per_burst: the number of FTMs pairs in single Burst (1-31);1037* @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of1038* the number of measurement iterations (min 2^0 = 1, max 2^14)1039* @sta_id: the station id of the AP. Only relevant when associated to the AP,1040* otherwise should be set to &IWL_INVALID_STA.1041* @cipher: pairwise cipher suite for secured measurement.1042* &enum iwl_location_cipher.1043* @hltk: HLTK to be used for secured 11az measurement1044* @tk: TK to be used for secured 11az measurement1045* @calib: An array of calibration values per FTM rx bandwidth.1046* If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the1047* calibration value that corresponds to the rx bandwidth of the FTM1048* frame.1049* @beacon_interval: beacon interval of the AP in TUs. Only required if1050* &IWL_INITIATOR_AP_FLAGS_TB is set.1051* @rx_pn: the next expected PN for protected management frames Rx. LE byte1052* order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id1053* is set to &IWL_INVALID_STA.1054* @tx_pn: the next PN to use for protected management frames Tx. LE byte1055* order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id1056* is set to &IWL_INVALID_STA.1057* @r2i_ndp_params: parameters for R2I NDP ranging negotiation.1058* bits 0 - 2: max LTF repetitions1059* bits 3 - 5: max number of spatial streams1060* bits 6 - 7: max total LTFs. One of1061* &enum ieee80211_range_params_max_total_ltf.1062* @i2r_ndp_params: parameters for I2R NDP ranging negotiation.1063* bits 0 - 2: max LTF repetitions1064* bits 3 - 5: max number of spatial streams (supported values are < 2)1065* bits 6 - 7: max total LTFs. One of1066* &enum ieee80211_range_params_max_total_ltf.1067* @min_time_between_msr: For non trigger based NDP ranging, the minimum time1068* between measurements in units of milliseconds1069*/1070struct iwl_tof_range_req_ap_entry {1071__le32 initiator_ap_flags;1072u8 band;1073u8 channel_num;1074u8 format_bw;1075u8 ctrl_ch_position;1076u8 bssid[ETH_ALEN];1077__le16 burst_period;1078u8 samples_per_burst;1079u8 num_of_bursts;1080u8 sta_id;1081u8 cipher;1082u8 hltk[HLTK_11AZ_LEN];1083u8 tk[TK_11AZ_LEN];1084__le16 calib[IWL_TOF_BW_NUM];1085__le16 beacon_interval;1086u8 rx_pn[IEEE80211_CCMP_PN_LEN];1087u8 tx_pn[IEEE80211_CCMP_PN_LEN];1088u8 r2i_ndp_params;1089u8 i2r_ndp_params;1090__le16 min_time_between_msr;1091} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_9 */10921093/**1094* enum iwl_tof_response_mode1095* @IWL_MVM_TOF_RESPONSE_ASAP: report each AP measurement separately as soon as1096* possible (not supported for this release)1097* @IWL_MVM_TOF_RESPONSE_TIMEOUT: report all AP measurements as a batch upon1098* timeout expiration1099* @IWL_MVM_TOF_RESPONSE_COMPLETE: report all AP measurements as a batch at the1100* earlier of: measurements completion / timeout1101* expiration.1102*/1103enum iwl_tof_response_mode {1104IWL_MVM_TOF_RESPONSE_ASAP,1105IWL_MVM_TOF_RESPONSE_TIMEOUT,1106IWL_MVM_TOF_RESPONSE_COMPLETE,1107};11081109/**1110* enum iwl_tof_initiator_flags1111*1112* @IWL_TOF_INITIATOR_FLAGS_FAST_ALGO_DISABLED: disable fast algo, meaning run1113* the algo on ant A+B, instead of only one of them.1114* @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_A: open RX antenna A for FTMs RX1115* @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_B: open RX antenna B for FTMs RX1116* @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_C: open RX antenna C for FTMs RX1117* @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A: use antenna A fo TX ACKs during FTM1118* @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B: use antenna B fo TX ACKs during FTM1119* @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C: use antenna C fo TX ACKs during FTM1120* @IWL_TOF_INITIATOR_FLAGS_MACADDR_RANDOM: use random mac address for FTM1121* @IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB: use the specific calib value from1122* the range request command1123* @IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB: use the common calib value from the1124* ragne request command1125* @IWL_TOF_INITIATOR_FLAGS_NON_ASAP_SUPPORT: support non-asap measurements1126*/1127enum iwl_tof_initiator_flags {1128IWL_TOF_INITIATOR_FLAGS_FAST_ALGO_DISABLED = BIT(0),1129IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_A = BIT(1),1130IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_B = BIT(2),1131IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_C = BIT(3),1132IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A = BIT(4),1133IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B = BIT(5),1134IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C = BIT(6),1135IWL_TOF_INITIATOR_FLAGS_MACADDR_RANDOM = BIT(7),1136IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB = BIT(15),1137IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB = BIT(16),1138IWL_TOF_INITIATOR_FLAGS_NON_ASAP_SUPPORT = BIT(20),1139}; /* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */11401141#define IWL_TOF_MAX_APS 51142#define IWL_MVM_TOF_MAX_TWO_SIDED_APS 511431144/**1145* struct iwl_tof_range_req_cmd_v5 - start measurement cmd1146* @initiator_flags: see flags @ iwl_tof_initiator_flags1147* @request_id: A Token incremented per request. The same Token will be1148* sent back in the range response1149* @initiator: 0- NW initiated, 1 - Client Initiated1150* @one_sided_los_disable: '0'- run ML-Algo for both ToF/OneSided,1151* '1' - run ML-Algo for ToF only1152* @req_timeout: Requested timeout of the response in units of 100ms.1153* This is equivalent to the session time configured to the1154* LMAC in Initiator Request1155* @report_policy: Supported partially for this release: For current release -1156* the range report will be uploaded as a batch when ready or1157* when the session is done (successfully / partially).1158* one of iwl_tof_response_mode.1159* @reserved0: reserved1160* @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)1161* @macaddr_random: '0' Use default source MAC address (i.e. p2_p),1162* '1' Use MAC Address randomization according to the below1163* @range_req_bssid: ranging request BSSID1164* @macaddr_template: MAC address template to use for non-randomized bits1165* @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.1166* Bits set to 1 shall be randomized by the UMAC1167* @ftm_rx_chains: Rx chain to open to receive Responder's FTMs (XVT)1168* @ftm_tx_chains: Tx chain to send the ack to the Responder FTM (XVT)1169* @common_calib: The common calib value to inject to this measurement calc1170* @specific_calib: The specific calib value to inject to this measurement calc1171* @ap: per-AP request data1172*/1173struct iwl_tof_range_req_cmd_v5 {1174__le32 initiator_flags;1175u8 request_id;1176u8 initiator;1177u8 one_sided_los_disable;1178u8 req_timeout;1179u8 report_policy;1180u8 reserved0;1181u8 num_of_ap;1182u8 macaddr_random;1183u8 range_req_bssid[ETH_ALEN];1184u8 macaddr_template[ETH_ALEN];1185u8 macaddr_mask[ETH_ALEN];1186u8 ftm_rx_chains;1187u8 ftm_tx_chains;1188__le16 common_calib;1189__le16 specific_calib;1190struct iwl_tof_range_req_ap_entry_v2 ap[IWL_TOF_MAX_APS];1191} __packed;1192/* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */11931194/**1195* struct iwl_tof_range_req_cmd_v7 - start measurement cmd1196* @initiator_flags: see flags @ iwl_tof_initiator_flags1197* @request_id: A Token incremented per request. The same Token will be1198* sent back in the range response1199* @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)1200* @range_req_bssid: ranging request BSSID1201* @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.1202* Bits set to 1 shall be randomized by the UMAC1203* @macaddr_template: MAC address template to use for non-randomized bits1204* @req_timeout_ms: Requested timeout of the response in units of milliseconds.1205* This is the session time for completing the measurement.1206* @tsf_mac_id: report the measurement start time for each ap in terms of the1207* TSF of this mac id. 0xff to disable TSF reporting.1208* @common_calib: The common calib value to inject to this measurement calc1209* @specific_calib: The specific calib value to inject to this measurement calc1210* @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.1211*/1212struct iwl_tof_range_req_cmd_v7 {1213__le32 initiator_flags;1214u8 request_id;1215u8 num_of_ap;1216u8 range_req_bssid[ETH_ALEN];1217u8 macaddr_mask[ETH_ALEN];1218u8 macaddr_template[ETH_ALEN];1219__le32 req_timeout_ms;1220__le32 tsf_mac_id;1221__le16 common_calib;1222__le16 specific_calib;1223struct iwl_tof_range_req_ap_entry_v3 ap[IWL_TOF_MAX_APS];1224} __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_7 */12251226/**1227* struct iwl_tof_range_req_cmd_v8 - start measurement cmd1228* @initiator_flags: see flags @ iwl_tof_initiator_flags1229* @request_id: A Token incremented per request. The same Token will be1230* sent back in the range response1231* @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)1232* @range_req_bssid: ranging request BSSID1233* @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.1234* Bits set to 1 shall be randomized by the UMAC1235* @macaddr_template: MAC address template to use for non-randomized bits1236* @req_timeout_ms: Requested timeout of the response in units of milliseconds.1237* This is the session time for completing the measurement.1238* @tsf_mac_id: report the measurement start time for each ap in terms of the1239* TSF of this mac id. 0xff to disable TSF reporting.1240* @common_calib: The common calib value to inject to this measurement calc1241* @specific_calib: The specific calib value to inject to this measurement calc1242* @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.1243*/1244struct iwl_tof_range_req_cmd_v8 {1245__le32 initiator_flags;1246u8 request_id;1247u8 num_of_ap;1248u8 range_req_bssid[ETH_ALEN];1249u8 macaddr_mask[ETH_ALEN];1250u8 macaddr_template[ETH_ALEN];1251__le32 req_timeout_ms;1252__le32 tsf_mac_id;1253__le16 common_calib;1254__le16 specific_calib;1255struct iwl_tof_range_req_ap_entry_v4 ap[IWL_TOF_MAX_APS];1256} __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_8 */12571258/**1259* struct iwl_tof_range_req_cmd_v9 - start measurement cmd1260* @initiator_flags: see flags @ iwl_tof_initiator_flags1261* @request_id: A Token incremented per request. The same Token will be1262* sent back in the range response1263* @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)1264* @range_req_bssid: ranging request BSSID1265* @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.1266* Bits set to 1 shall be randomized by the UMAC1267* @macaddr_template: MAC address template to use for non-randomized bits1268* @req_timeout_ms: Requested timeout of the response in units of milliseconds.1269* This is the session time for completing the measurement.1270* @tsf_mac_id: report the measurement start time for each ap in terms of the1271* TSF of this mac id. 0xff to disable TSF reporting.1272* @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.1273*/1274struct iwl_tof_range_req_cmd_v9 {1275__le32 initiator_flags;1276u8 request_id;1277u8 num_of_ap;1278u8 range_req_bssid[ETH_ALEN];1279u8 macaddr_mask[ETH_ALEN];1280u8 macaddr_template[ETH_ALEN];1281__le32 req_timeout_ms;1282__le32 tsf_mac_id;1283struct iwl_tof_range_req_ap_entry_v6 ap[IWL_TOF_MAX_APS];1284} __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_9 */12851286/**1287* struct iwl_tof_range_req_cmd_v11 - start measurement cmd1288* @initiator_flags: see flags @ iwl_tof_initiator_flags1289* @request_id: A Token incremented per request. The same Token will be1290* sent back in the range response1291* @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)1292* @range_req_bssid: ranging request BSSID1293* @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.1294* Bits set to 1 shall be randomized by the UMAC1295* @macaddr_template: MAC address template to use for non-randomized bits1296* @req_timeout_ms: Requested timeout of the response in units of milliseconds.1297* This is the session time for completing the measurement.1298* @tsf_mac_id: report the measurement start time for each ap in terms of the1299* TSF of this mac id. 0xff to disable TSF reporting.1300* @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.1301*/1302struct iwl_tof_range_req_cmd_v11 {1303__le32 initiator_flags;1304u8 request_id;1305u8 num_of_ap;1306u8 range_req_bssid[ETH_ALEN];1307u8 macaddr_mask[ETH_ALEN];1308u8 macaddr_template[ETH_ALEN];1309__le32 req_timeout_ms;1310__le32 tsf_mac_id;1311struct iwl_tof_range_req_ap_entry_v7 ap[IWL_TOF_MAX_APS];1312} __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_11 */13131314/**1315* struct iwl_tof_range_req_cmd_v12 - start measurement cmd1316* @initiator_flags: see flags @ iwl_tof_initiator_flags1317* @request_id: A Token incremented per request. The same Token will be1318* sent back in the range response1319* @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)1320* @range_req_bssid: ranging request BSSID1321* @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.1322* Bits set to 1 shall be randomized by the UMAC1323* @macaddr_template: MAC address template to use for non-randomized bits1324* @req_timeout_ms: Requested timeout of the response in units of milliseconds.1325* This is the session time for completing the measurement.1326* @tsf_mac_id: report the measurement start time for each ap in terms of the1327* TSF of this mac id. 0xff to disable TSF reporting.1328* @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.1329*/1330struct iwl_tof_range_req_cmd_v12 {1331__le32 initiator_flags;1332u8 request_id;1333u8 num_of_ap;1334u8 range_req_bssid[ETH_ALEN];1335u8 macaddr_mask[ETH_ALEN];1336u8 macaddr_template[ETH_ALEN];1337__le32 req_timeout_ms;1338__le32 tsf_mac_id;1339struct iwl_tof_range_req_ap_entry_v8 ap[IWL_TOF_MAX_APS];1340} __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_12 */13411342/**1343* struct iwl_tof_range_req_cmd_v13 - start measurement cmd1344* @initiator_flags: see flags @ iwl_tof_initiator_flags1345* @request_id: A Token incremented per request. The same Token will be1346* sent back in the range response1347* @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)1348* @range_req_bssid: ranging request BSSID1349* @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.1350* Bits set to 1 shall be randomized by the UMAC1351* @macaddr_template: MAC address template to use for non-randomized bits1352* @req_timeout_ms: Requested timeout of the response in units of milliseconds.1353* This is the session time for completing the measurement.1354* @tsf_mac_id: report the measurement start time for each ap in terms of the1355* TSF of this mac id. 0xff to disable TSF reporting.1356* @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v9.1357*/1358struct iwl_tof_range_req_cmd_v13 {1359__le32 initiator_flags;1360u8 request_id;1361u8 num_of_ap;1362u8 range_req_bssid[ETH_ALEN];1363u8 macaddr_mask[ETH_ALEN];1364u8 macaddr_template[ETH_ALEN];1365__le32 req_timeout_ms;1366__le32 tsf_mac_id;1367struct iwl_tof_range_req_ap_entry_v9 ap[IWL_TOF_MAX_APS];1368} __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_13 */13691370/**1371* struct iwl_tof_range_req_cmd - start measurement cmd1372* @initiator_flags: see flags @ iwl_tof_initiator_flags1373* @request_id: A Token incremented per request. The same Token will be1374* sent back in the range response1375* @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)1376* @range_req_bssid: ranging request BSSID1377* @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.1378* Bits set to 1 shall be randomized by the UMAC1379* @macaddr_template: MAC address template to use for non-randomized bits1380* @req_timeout_ms: Requested timeout of the response in units of milliseconds.1381* This is the session time for completing the measurement.1382* @tsf_mac_id: report the measurement start time for each ap in terms of the1383* TSF of this mac id. 0xff to disable TSF reporting.1384* @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry.1385*/1386struct iwl_tof_range_req_cmd {1387__le32 initiator_flags;1388u8 request_id;1389u8 num_of_ap;1390u8 range_req_bssid[ETH_ALEN];1391u8 macaddr_mask[ETH_ALEN];1392u8 macaddr_template[ETH_ALEN];1393__le32 req_timeout_ms;1394__le32 tsf_mac_id;1395struct iwl_tof_range_req_ap_entry ap[IWL_TOF_MAX_APS];1396} __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_15 */13971398/*1399* enum iwl_tof_range_request_status - status of the sent request1400* @IWL_TOF_RANGE_REQUEST_STATUS_SUCCESSFUL - FW successfully received the1401* request1402* @IWL_TOF_RANGE_REQUEST_STATUS_BUSY - FW is busy with a previous request, the1403* sent request will not be handled1404*/1405enum iwl_tof_range_request_status {1406IWL_TOF_RANGE_REQUEST_STATUS_SUCCESS,1407IWL_TOF_RANGE_REQUEST_STATUS_BUSY,1408};14091410/**1411* enum iwl_tof_entry_status1412*1413* @IWL_TOF_ENTRY_SUCCESS: successful measurement.1414* @IWL_TOF_ENTRY_GENERAL_FAILURE: General failure.1415* @IWL_TOF_ENTRY_NO_RESPONSE: Responder didn't reply to the request.1416* @IWL_TOF_ENTRY_REQUEST_REJECTED: Responder rejected the request.1417* @IWL_TOF_ENTRY_NOT_SCHEDULED: Time event was scheduled but not called yet.1418* @IWL_TOF_ENTRY_TIMING_MEASURE_TIMEOUT: Time event triggered but no1419* measurement was completed.1420* @IWL_TOF_ENTRY_TARGET_DIFF_CH_CANNOT_CHANGE: No range due inability to switch1421* from the primary channel.1422* @IWL_TOF_ENTRY_RANGE_NOT_SUPPORTED: Device doesn't support FTM.1423* @IWL_TOF_ENTRY_REQUEST_ABORT_UNKNOWN_REASON: Request aborted due to unknown1424* reason.1425* @IWL_TOF_ENTRY_LOCATION_INVALID_T1_T4_TIME_STAMP: Failure due to invalid1426* T1/T4.1427* @IWL_TOF_ENTRY_11MC_PROTOCOL_FAILURE: Failure due to invalid FTM frame1428* structure.1429* @IWL_TOF_ENTRY_REQUEST_CANNOT_SCHED: Request cannot be scheduled.1430* @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE: Responder cannot serve the1431* initiator for some period, period supplied in @refusal_period.1432* @IWL_TOF_ENTRY_BAD_REQUEST_ARGS: Bad request arguments.1433* @IWL_TOF_ENTRY_WIFI_NOT_ENABLED: Wifi not enabled.1434* @IWL_TOF_ENTRY_RESPONDER_OVERRIDE_PARAMS: Responder override the original1435* parameters within the current session.1436*/1437enum iwl_tof_entry_status {1438IWL_TOF_ENTRY_SUCCESS = 0,1439IWL_TOF_ENTRY_GENERAL_FAILURE = 1,1440IWL_TOF_ENTRY_NO_RESPONSE = 2,1441IWL_TOF_ENTRY_REQUEST_REJECTED = 3,1442IWL_TOF_ENTRY_NOT_SCHEDULED = 4,1443IWL_TOF_ENTRY_TIMING_MEASURE_TIMEOUT = 5,1444IWL_TOF_ENTRY_TARGET_DIFF_CH_CANNOT_CHANGE = 6,1445IWL_TOF_ENTRY_RANGE_NOT_SUPPORTED = 7,1446IWL_TOF_ENTRY_REQUEST_ABORT_UNKNOWN_REASON = 8,1447IWL_TOF_ENTRY_LOCATION_INVALID_T1_T4_TIME_STAMP = 9,1448IWL_TOF_ENTRY_11MC_PROTOCOL_FAILURE = 10,1449IWL_TOF_ENTRY_REQUEST_CANNOT_SCHED = 11,1450IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE = 12,1451IWL_TOF_ENTRY_BAD_REQUEST_ARGS = 13,1452IWL_TOF_ENTRY_WIFI_NOT_ENABLED = 14,1453IWL_TOF_ENTRY_RESPONDER_OVERRIDE_PARAMS = 15,1454}; /* LOCATION_RANGE_RSP_AP_ENTRY_NTFY_API_S_VER_2 */14551456/**1457* struct iwl_tof_range_rsp_ap_entry_ntfy_v3 - AP parameters (response)1458* @bssid: BSSID of the AP1459* @measure_status: current APs measurement status, one of1460* &enum iwl_tof_entry_status.1461* @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz1462* @rtt: The Round Trip Time that took for the last measurement for1463* current AP [pSec]1464* @rtt_variance: The Variance of the RTT values measured for current AP1465* @rtt_spread: The Difference between the maximum and the minimum RTT1466* values measured for current AP in the current session [pSec]1467* @rssi: RSSI as uploaded in the Channel Estimation notification1468* @rssi_spread: The Difference between the maximum and the minimum RSSI values1469* measured for current AP in the current session1470* @reserved: reserved1471* @refusal_period: refusal period in case of1472* @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]1473* @range: Measured range [cm]1474* @range_variance: Measured range variance [cm]1475* @timestamp: The GP2 Clock [usec] where Channel Estimation notification was1476* uploaded by the LMAC1477* @t2t3_initiator: as calculated from the algo in the initiator1478* @t1t4_responder: as calculated from the algo in the responder1479* @common_calib: Calib val that was used in for this AP measurement1480* @specific_calib: val that was used in for this AP measurement1481* @papd_calib_output: The result of the tof papd calibration that was injected1482* into the algorithm.1483*/1484struct iwl_tof_range_rsp_ap_entry_ntfy_v3 {1485u8 bssid[ETH_ALEN];1486u8 measure_status;1487u8 measure_bw;1488__le32 rtt;1489__le32 rtt_variance;1490__le32 rtt_spread;1491s8 rssi;1492u8 rssi_spread;1493u8 reserved;1494u8 refusal_period;1495__le32 range;1496__le32 range_variance;1497__le32 timestamp;1498__le32 t2t3_initiator;1499__le32 t1t4_responder;1500__le16 common_calib;1501__le16 specific_calib;1502__le32 papd_calib_output;1503} __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_3 */15041505/**1506* struct iwl_tof_range_rsp_ap_entry_ntfy_v4 - AP parameters (response)1507* @bssid: BSSID of the AP1508* @measure_status: current APs measurement status, one of1509* &enum iwl_tof_entry_status.1510* @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz1511* @rtt: The Round Trip Time that took for the last measurement for1512* current AP [pSec]1513* @rtt_variance: The Variance of the RTT values measured for current AP1514* @rtt_spread: The Difference between the maximum and the minimum RTT1515* values measured for current AP in the current session [pSec]1516* @rssi: RSSI as uploaded in the Channel Estimation notification1517* @rssi_spread: The Difference between the maximum and the minimum RSSI values1518* measured for current AP in the current session1519* @last_burst: 1 if no more FTM sessions are scheduled for this responder1520* @refusal_period: refusal period in case of1521* @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]1522* @timestamp: The GP2 Clock [usec] where Channel Estimation notification was1523* uploaded by the LMAC1524* @start_tsf: measurement start time in TSF of the mac specified in the range1525* request1526* @rx_rate_n_flags: rate and flags of the last FTM frame received from this1527* responder1528* @tx_rate_n_flags: rate and flags of the last ack sent to this responder1529* @t2t3_initiator: as calculated from the algo in the initiator1530* @t1t4_responder: as calculated from the algo in the responder1531* @common_calib: Calib val that was used in for this AP measurement1532* @specific_calib: val that was used in for this AP measurement1533* @papd_calib_output: The result of the tof papd calibration that was injected1534* into the algorithm.1535*/1536struct iwl_tof_range_rsp_ap_entry_ntfy_v4 {1537u8 bssid[ETH_ALEN];1538u8 measure_status;1539u8 measure_bw;1540__le32 rtt;1541__le32 rtt_variance;1542__le32 rtt_spread;1543s8 rssi;1544u8 rssi_spread;1545u8 last_burst;1546u8 refusal_period;1547__le32 timestamp;1548__le32 start_tsf;1549__le32 rx_rate_n_flags;1550__le32 tx_rate_n_flags;1551__le32 t2t3_initiator;1552__le32 t1t4_responder;1553__le16 common_calib;1554__le16 specific_calib;1555__le32 papd_calib_output;1556} __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_4 */15571558/**1559* struct iwl_tof_range_rsp_ap_entry_ntfy_v5 - AP parameters (response)1560* @bssid: BSSID of the AP1561* @measure_status: current APs measurement status, one of1562* &enum iwl_tof_entry_status.1563* @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz1564* @rtt: The Round Trip Time that took for the last measurement for1565* current AP [pSec]1566* @rtt_variance: The Variance of the RTT values measured for current AP1567* @rtt_spread: The Difference between the maximum and the minimum RTT1568* values measured for current AP in the current session [pSec]1569* @rssi: RSSI as uploaded in the Channel Estimation notification1570* @rssi_spread: The Difference between the maximum and the minimum RSSI values1571* measured for current AP in the current session1572* @last_burst: 1 if no more FTM sessions are scheduled for this responder1573* @refusal_period: refusal period in case of1574* @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]1575* @timestamp: The GP2 Clock [usec] where Channel Estimation notification was1576* uploaded by the LMAC1577* @start_tsf: measurement start time in TSF of the mac specified in the range1578* request1579* @rx_rate_n_flags: rate and flags of the last FTM frame received from this1580* responder1581* @tx_rate_n_flags: rate and flags of the last ack sent to this responder1582* @t2t3_initiator: as calculated from the algo in the initiator1583* @t1t4_responder: as calculated from the algo in the responder1584* @common_calib: Calib val that was used in for this AP measurement1585* @specific_calib: val that was used in for this AP measurement1586* @papd_calib_output: The result of the tof papd calibration that was injected1587* into the algorithm.1588* @rttConfidence: a value between 0 - 31 that represents the rtt accuracy.1589* @reserved: for alignment1590*/1591struct iwl_tof_range_rsp_ap_entry_ntfy_v5 {1592u8 bssid[ETH_ALEN];1593u8 measure_status;1594u8 measure_bw;1595__le32 rtt;1596__le32 rtt_variance;1597__le32 rtt_spread;1598s8 rssi;1599u8 rssi_spread;1600u8 last_burst;1601u8 refusal_period;1602__le32 timestamp;1603__le32 start_tsf;1604__le32 rx_rate_n_flags;1605__le32 tx_rate_n_flags;1606__le32 t2t3_initiator;1607__le32 t1t4_responder;1608__le16 common_calib;1609__le16 specific_calib;1610__le32 papd_calib_output;1611u8 rttConfidence;1612u8 reserved[3];1613} __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_5 */16141615/**1616* struct iwl_tof_range_rsp_ap_entry_ntfy_v7 - AP parameters (response)1617* @bssid: BSSID of the AP1618* @measure_status: current APs measurement status, one of1619* &enum iwl_tof_entry_status.1620* @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz1621* @rtt: The Round Trip Time that took for the last measurement for1622* current AP [pSec]1623* @rtt_variance: The Variance of the RTT values measured for current AP1624* @rtt_spread: The Difference between the maximum and the minimum RTT1625* values measured for current AP in the current session [pSec]1626* @rssi: RSSI as uploaded in the Channel Estimation notification1627* @rssi_spread: The Difference between the maximum and the minimum RSSI values1628* measured for current AP in the current session1629* @last_burst: 1 if no more FTM sessions are scheduled for this responder1630* @refusal_period: refusal period in case of1631* @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]1632* @timestamp: The GP2 Clock [usec] where Channel Estimation notification was1633* uploaded by the LMAC1634* @start_tsf: measurement start time in TSF of the mac specified in the range1635* request1636* @rx_rate_n_flags: rate and flags of the last FTM frame received from this1637* responder1638* @tx_rate_n_flags: rate and flags of the last ack sent to this responder1639* @t2t3_initiator: as calculated from the algo in the initiator1640* @t1t4_responder: as calculated from the algo in the responder1641* @common_calib: Calib val that was used in for this AP measurement1642* @specific_calib: val that was used in for this AP measurement1643* @papd_calib_output: The result of the tof papd calibration that was injected1644* into the algorithm.1645* @rttConfidence: a value between 0 - 31 that represents the rtt accuracy.1646* @reserved: for alignment1647* @rx_pn: the last PN used for this responder Rx in case PMF is configured in1648* LE byte order.1649* @tx_pn: the last PN used for this responder Tx in case PMF is configured in1650* LE byte order.1651*/1652struct iwl_tof_range_rsp_ap_entry_ntfy_v7 {1653u8 bssid[ETH_ALEN];1654u8 measure_status;1655u8 measure_bw;1656__le32 rtt;1657__le32 rtt_variance;1658__le32 rtt_spread;1659s8 rssi;1660u8 rssi_spread;1661u8 last_burst;1662u8 refusal_period;1663__le32 timestamp;1664__le32 start_tsf;1665__le32 rx_rate_n_flags;1666__le32 tx_rate_n_flags;1667__le32 t2t3_initiator;1668__le32 t1t4_responder;1669__le16 common_calib;1670__le16 specific_calib;1671__le32 papd_calib_output;1672u8 rttConfidence;1673u8 reserved[3];1674u8 rx_pn[IEEE80211_CCMP_PN_LEN];1675u8 tx_pn[IEEE80211_CCMP_PN_LEN];1676} __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_6,1677LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_7 */16781679/**1680* struct iwl_tof_range_rsp_ap_entry_ntfy - AP parameters (response)1681* @bssid: BSSID of the AP1682* @measure_status: current APs measurement status, one of1683* &enum iwl_tof_entry_status.1684* @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz1685* @rtt: The Round Trip Time that took for the last measurement for1686* current AP [pSec]1687* @rtt_variance: The Variance of the RTT values measured for current AP1688* @rtt_spread: The Difference between the maximum and the minimum RTT1689* values measured for current AP in the current session [pSec]1690* @rssi: RSSI as uploaded in the Channel Estimation notification1691* @rssi_spread: The Difference between the maximum and the minimum RSSI values1692* measured for current AP in the current session1693* @last_burst: 1 if no more FTM sessions are scheduled for this responder1694* @refusal_period: refusal period in case of1695* @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]1696* @timestamp: The GP2 Clock [usec] where Channel Estimation notification was1697* uploaded by the LMAC1698* @start_tsf: measurement start time in TSF of the mac specified in the range1699* request1700* @reserved1: reserved, for backwards compatibility1701* @t2t3_initiator: as calculated from the algo in the initiator1702* @t1t4_responder: as calculated from the algo in the responder1703* @common_calib: Calib val that was used in for this AP measurement1704* @specific_calib: val that was used in for this AP measurement1705* @papd_calib_output: The result of the tof papd calibration that was injected1706* into the algorithm.1707* @rttConfidence: a value between 0 - 31 that represents the rtt accuracy.1708* @reserved: for alignment1709* @rx_pn: the last PN used for this responder Rx in case PMF is configured in1710* LE byte order.1711* @tx_pn: the last PN used for this responder Tx in case PMF is configured in1712* LE byte order.1713*/1714struct iwl_tof_range_rsp_ap_entry_ntfy {1715u8 bssid[ETH_ALEN];1716u8 measure_status;1717u8 measure_bw;1718__le32 rtt;1719__le32 rtt_variance;1720__le32 rtt_spread;1721s8 rssi;1722u8 rssi_spread;1723u8 last_burst;1724u8 refusal_period;1725__le32 timestamp;1726__le32 start_tsf;1727__le32 reserved1[2];1728__le32 t2t3_initiator;1729__le32 t1t4_responder;1730__le16 common_calib;1731__le16 specific_calib;1732__le32 papd_calib_output;1733u8 rttConfidence;1734u8 reserved[3];1735u8 rx_pn[IEEE80211_CCMP_PN_LEN];1736u8 tx_pn[IEEE80211_CCMP_PN_LEN];1737} __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_8 */17381739/**1740* enum iwl_tof_response_status - tof response status1741*1742* @IWL_TOF_RESPONSE_SUCCESS: successful range.1743* @IWL_TOF_RESPONSE_TIMEOUT: request aborted due to timeout expiration.1744* partial result of ranges done so far is included in the response.1745* @IWL_TOF_RESPONSE_ABORTED: Measurement aborted by command.1746* @IWL_TOF_RESPONSE_FAILED: Measurement request command failed.1747*/1748enum iwl_tof_response_status {1749IWL_TOF_RESPONSE_SUCCESS = 0,1750IWL_TOF_RESPONSE_TIMEOUT = 1,1751IWL_TOF_RESPONSE_ABORTED = 4,1752IWL_TOF_RESPONSE_FAILED = 5,1753}; /* LOCATION_RNG_RSP_STATUS */17541755/**1756* struct iwl_tof_range_rsp_ntfy_v5 - ranging response notification1757* @request_id: A Token ID of the corresponding Range request1758* @request_status: status of current measurement session, one of1759* &enum iwl_tof_response_status.1760* @last_in_batch: reprot policy (when not all responses are uploaded at once)1761* @num_of_aps: Number of APs to measure (error if > IWL_TOF_MAX_APS)1762* @ap: per-AP data1763*/1764struct iwl_tof_range_rsp_ntfy_v5 {1765u8 request_id;1766u8 request_status;1767u8 last_in_batch;1768u8 num_of_aps;1769struct iwl_tof_range_rsp_ap_entry_ntfy_v3 ap[IWL_TOF_MAX_APS];1770} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_5 */17711772/**1773* struct iwl_tof_range_rsp_ntfy_v6 - ranging response notification1774* @request_id: A Token ID of the corresponding Range request1775* @num_of_aps: Number of APs results1776* @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise.1777* @reserved: reserved1778* @ap: per-AP data1779*/1780struct iwl_tof_range_rsp_ntfy_v6 {1781u8 request_id;1782u8 num_of_aps;1783u8 last_report;1784u8 reserved;1785struct iwl_tof_range_rsp_ap_entry_ntfy_v4 ap[IWL_TOF_MAX_APS];1786} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_6 */17871788/**1789* struct iwl_tof_range_rsp_ntfy_v7 - ranging response notification1790* @request_id: A Token ID of the corresponding Range request1791* @num_of_aps: Number of APs results1792* @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise.1793* @reserved: reserved1794* @ap: per-AP data1795*/1796struct iwl_tof_range_rsp_ntfy_v7 {1797u8 request_id;1798u8 num_of_aps;1799u8 last_report;1800u8 reserved;1801struct iwl_tof_range_rsp_ap_entry_ntfy_v5 ap[IWL_TOF_MAX_APS];1802} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_7 */18031804/**1805* struct iwl_tof_range_rsp_ntfy_v9 - ranging response notification1806* @request_id: A Token ID of the corresponding Range request1807* @num_of_aps: Number of APs results1808* @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise.1809* @reserved: reserved1810* @ap: per-AP data1811*/1812struct iwl_tof_range_rsp_ntfy_v9 {1813u8 request_id;1814u8 num_of_aps;1815u8 last_report;1816u8 reserved;1817struct iwl_tof_range_rsp_ap_entry_ntfy_v7 ap[IWL_TOF_MAX_APS];1818} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_8,1819* LOCATION_RANGE_RSP_NTFY_API_S_VER_91820*/18211822/**1823* struct iwl_tof_range_rsp_ntfy - ranging response notification1824* @request_id: A Token ID of the corresponding Range request1825* @num_of_aps: Number of APs results1826* @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise.1827* @reserved: reserved1828* @ap: per-AP data1829*/1830struct iwl_tof_range_rsp_ntfy {1831u8 request_id;1832u8 num_of_aps;1833u8 last_report;1834u8 reserved;1835struct iwl_tof_range_rsp_ap_entry_ntfy ap[IWL_TOF_MAX_APS];1836} __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_10 */18371838#define IWL_MVM_TOF_MCSI_BUF_SIZE (245)1839/**1840* struct iwl_tof_mcsi_notif - used for debug1841* @token: token ID for the current session1842* @role: '0' - initiator, '1' - responder1843* @reserved: reserved1844* @initiator_bssid: initiator machine1845* @responder_bssid: responder machine1846* @mcsi_buffer: debug data1847*/1848struct iwl_tof_mcsi_notif {1849u8 token;1850u8 role;1851__le16 reserved;1852u8 initiator_bssid[ETH_ALEN];1853u8 responder_bssid[ETH_ALEN];1854u8 mcsi_buffer[IWL_MVM_TOF_MCSI_BUF_SIZE * 4];1855} __packed;18561857/**1858* struct iwl_tof_range_abort_cmd1859* @request_id: corresponds to a range request1860* @reserved: reserved1861*/1862struct iwl_tof_range_abort_cmd {1863u8 request_id;1864u8 reserved[3];1865} __packed;18661867enum ftm_responder_stats_flags {1868FTM_RESP_STAT_NON_ASAP_STARTED = BIT(0),1869FTM_RESP_STAT_NON_ASAP_IN_WIN = BIT(1),1870FTM_RESP_STAT_NON_ASAP_OUT_WIN = BIT(2),1871FTM_RESP_STAT_TRIGGER_DUP = BIT(3),1872FTM_RESP_STAT_DUP = BIT(4),1873FTM_RESP_STAT_DUP_IN_WIN = BIT(5),1874FTM_RESP_STAT_DUP_OUT_WIN = BIT(6),1875FTM_RESP_STAT_SCHED_SUCCESS = BIT(7),1876FTM_RESP_STAT_ASAP_REQ = BIT(8),1877FTM_RESP_STAT_NON_ASAP_REQ = BIT(9),1878FTM_RESP_STAT_ASAP_RESP = BIT(10),1879FTM_RESP_STAT_NON_ASAP_RESP = BIT(11),1880FTM_RESP_STAT_FAIL_INITIATOR_INACTIVE = BIT(12),1881FTM_RESP_STAT_FAIL_INITIATOR_OUT_WIN = BIT(13),1882FTM_RESP_STAT_FAIL_INITIATOR_RETRY_LIM = BIT(14),1883FTM_RESP_STAT_FAIL_NEXT_SERVED = BIT(15),1884FTM_RESP_STAT_FAIL_TRIGGER_ERR = BIT(16),1885FTM_RESP_STAT_FAIL_GC = BIT(17),1886FTM_RESP_STAT_SUCCESS = BIT(18),1887FTM_RESP_STAT_INTEL_IE = BIT(19),1888FTM_RESP_STAT_INITIATOR_ACTIVE = BIT(20),1889FTM_RESP_STAT_MEASUREMENTS_AVAILABLE = BIT(21),1890FTM_RESP_STAT_TRIGGER_UNKNOWN = BIT(22),1891FTM_RESP_STAT_PROCESS_FAIL = BIT(23),1892FTM_RESP_STAT_ACK = BIT(24),1893FTM_RESP_STAT_NACK = BIT(25),1894FTM_RESP_STAT_INVALID_INITIATOR_ID = BIT(26),1895FTM_RESP_STAT_TIMER_MIN_DELTA = BIT(27),1896FTM_RESP_STAT_INITIATOR_REMOVED = BIT(28),1897FTM_RESP_STAT_INITIATOR_ADDED = BIT(29),1898FTM_RESP_STAT_ERR_LIST_FULL = BIT(30),1899FTM_RESP_STAT_INITIATOR_SCHED_NOW = BIT(31),1900}; /* RESP_IND_E */19011902/**1903* struct iwl_ftm_responder_stats - FTM responder statistics1904* @addr: initiator address1905* @success_ftm: number of successful ftm frames1906* @ftm_per_burst: num of FTM frames that were received1907* @flags: &enum ftm_responder_stats_flags1908* @duration: actual duration of FTM1909* @allocated_duration: time that was allocated for this FTM session1910* @bw: FTM request bandwidth1911* @rate: FTM request rate1912* @reserved: for alingment and future use1913*/1914struct iwl_ftm_responder_stats {1915u8 addr[ETH_ALEN];1916u8 success_ftm;1917u8 ftm_per_burst;1918__le32 flags;1919__le32 duration;1920__le32 allocated_duration;1921u8 bw;1922u8 rate;1923__le16 reserved;1924} __packed; /* TOF_RESPONDER_STATISTICS_NTFY_S_VER_2 */19251926#define IWL_CSI_MAX_EXPECTED_CHUNKS 1619271928#define IWL_CSI_CHUNK_CTL_NUM_MASK_VER_1 0x00031929#define IWL_CSI_CHUNK_CTL_IDX_MASK_VER_1 0x000c19301931#define IWL_CSI_CHUNK_CTL_NUM_MASK_VER_2 0x00ff1932#define IWL_CSI_CHUNK_CTL_IDX_MASK_VER_2 0xff0019331934struct iwl_csi_chunk_notification {1935__le32 token;1936__le16 seq;1937__le16 ctl;1938__le32 size;1939u8 data[];1940} __packed; /* CSI_CHUNKS_HDR_NTFY_API_S_VER_1/VER_2 */19411942#endif /* __iwl_fw_api_location_h__ */194319441945