1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (C) 2015-2017 Intel Deutschland GmbH
4 * Copyright (C) 2018-2022 Intel Corporation
5 * Copyright (C) 2024 Intel Corporation
7 #ifndef __iwl_fw_api_location_h__
8 #define __iwl_fw_api_location_h__
11 * enum iwl_location_subcmd_ids - location group command IDs
13 enum iwl_location_subcmd_ids {
15 * @TOF_RANGE_REQ_CMD: TOF ranging request,
16 * uses one of &struct iwl_tof_range_req_cmd_v5,
17 * &struct iwl_tof_range_req_cmd_v7,
18 * &struct iwl_tof_range_req_cmd_v8,
19 * &struct iwl_tof_range_req_cmd_v9,
20 * &struct iwl_tof_range_req_cmd_v11,
21 * &struct iwl_tof_range_req_cmd_v7
23 TOF_RANGE_REQ_CMD = 0x0,
25 * @TOF_CONFIG_CMD: TOF configuration, uses &struct iwl_tof_config_cmd
29 * @TOF_RANGE_ABORT_CMD: abort ongoing ranging, uses
30 * &struct iwl_tof_range_abort_cmd
32 TOF_RANGE_ABORT_CMD = 0x2,
34 * @TOF_RANGE_REQ_EXT_CMD: TOF extended ranging config,
35 * uses &struct iwl_tof_range_req_ext_cmd
37 TOF_RANGE_REQ_EXT_CMD = 0x3,
39 * @TOF_RESPONDER_CONFIG_CMD: FTM responder configuration, one of
40 * &struct iwl_tof_responder_config_cmd_v6,
41 * &struct iwl_tof_responder_config_cmd_v7,
42 * &struct iwl_tof_responder_config_cmd_v8 or
43 * &struct iwl_tof_responder_config_cmd_v9
45 TOF_RESPONDER_CONFIG_CMD = 0x4,
47 * @TOF_RESPONDER_DYN_CONFIG_CMD: FTM dynamic configuration,
48 * uses &struct iwl_tof_responder_dyn_config_cmd
50 TOF_RESPONDER_DYN_CONFIG_CMD = 0x5,
52 * @CSI_HEADER_NOTIFICATION: CSI header
54 CSI_HEADER_NOTIFICATION = 0xFA,
56 * @CSI_CHUNKS_NOTIFICATION: CSI chunk,
57 * uses &struct iwl_csi_chunk_notification
59 CSI_CHUNKS_NOTIFICATION = 0xFB,
61 * @TOF_LC_NOTIF: used for LCI/civic location, contains just
66 * @TOF_RESPONDER_STATS: FTM responder statistics notification,
67 * uses &struct iwl_ftm_responder_stats
69 TOF_RESPONDER_STATS = 0xFD,
71 * @TOF_MCSI_DEBUG_NOTIF: MCSI debug notification, uses
72 * &struct iwl_tof_mcsi_notif
74 TOF_MCSI_DEBUG_NOTIF = 0xFE,
76 * @TOF_RANGE_RESPONSE_NOTIF: ranging response, using one of
77 * &struct iwl_tof_range_rsp_ntfy_v5,
78 * &struct iwl_tof_range_rsp_ntfy_v6,
79 * &struct iwl_tof_range_rsp_ntfy_v7 or
80 * &struct iwl_tof_range_rsp_ntfy_v8
82 TOF_RANGE_RESPONSE_NOTIF = 0xFF,
86 * struct iwl_tof_config_cmd - ToF configuration
87 * @tof_disabled: indicates if ToF is disabled (or not)
88 * @one_sided_disabled: indicates if one-sided is disabled (or not)
89 * @is_debug_mode: indiciates if debug mode is active
90 * @is_buf_required: indicates if channel estimation buffer is required
92 struct iwl_tof_config_cmd {
94 u8 one_sided_disabled;
100 * enum iwl_tof_bandwidth - values for iwl_tof_range_req_ap_entry.bandwidth
101 * @IWL_TOF_BW_20_LEGACY: 20 MHz non-HT
102 * @IWL_TOF_BW_20_HT: 20 MHz HT
103 * @IWL_TOF_BW_40: 40 MHz
104 * @IWL_TOF_BW_80: 80 MHz
105 * @IWL_TOF_BW_160: 160 MHz
106 * @IWL_TOF_BW_NUM: number of tof bandwidths
108 enum iwl_tof_bandwidth {
109 IWL_TOF_BW_20_LEGACY,
115 }; /* LOCAT_BW_TYPE_E */
118 * enum iwl_tof_algo_type - Algorithym type for range measurement request
120 enum iwl_tof_algo_type {
121 IWL_TOF_ALGO_TYPE_MAX_LIKE = 0,
122 IWL_TOF_ALGO_TYPE_LINEAR_REG = 1,
123 IWL_TOF_ALGO_TYPE_FFT = 2,
126 IWL_TOF_ALGO_TYPE_INVALID,
130 * enum iwl_tof_mcsi_ntfy - Enable/Disable MCSI notifications
132 enum iwl_tof_mcsi_enable {
133 IWL_TOF_MCSI_DISABLED = 0,
134 IWL_TOF_MCSI_ENABLED = 1,
135 }; /* MCSI_ENABLE_E */
138 * enum iwl_tof_responder_cmd_valid_field - valid fields in the responder cfg
139 * @IWL_TOF_RESPONDER_CMD_VALID_CHAN_INFO: channel info is valid
140 * @IWL_TOF_RESPONDER_CMD_VALID_TOA_OFFSET: ToA offset is valid
141 * @IWL_TOF_RESPONDER_CMD_VALID_COMMON_CALIB: common calibration mode is valid
142 * @IWL_TOF_RESPONDER_CMD_VALID_SPECIFIC_CALIB: spefici calibration mode is
144 * @IWL_TOF_RESPONDER_CMD_VALID_BSSID: BSSID is valid
145 * @IWL_TOF_RESPONDER_CMD_VALID_TX_ANT: TX antenna is valid
146 * @IWL_TOF_RESPONDER_CMD_VALID_ALGO_TYPE: algorithm type is valid
147 * @IWL_TOF_RESPONDER_CMD_VALID_NON_ASAP_SUPPORT: non-ASAP support is valid
148 * @IWL_TOF_RESPONDER_CMD_VALID_STATISTICS_REPORT_SUPPORT: statistics report
150 * @IWL_TOF_RESPONDER_CMD_VALID_MCSI_NOTIF_SUPPORT: MCSI notification support
152 * @IWL_TOF_RESPONDER_CMD_VALID_FAST_ALGO_SUPPORT: fast algorithm support
154 * @IWL_TOF_RESPONDER_CMD_VALID_RETRY_ON_ALGO_FAIL: retry on algorithm failure
156 * @IWL_TOF_RESPONDER_CMD_VALID_STA_ID: station ID is valid
157 * @IWL_TOF_RESPONDER_CMD_VALID_NDP_SUPPORT: enable/disable NDP ranging support
159 * @IWL_TOF_RESPONDER_CMD_VALID_NDP_PARAMS: NDP parameters are valid
160 * @IWL_TOF_RESPONDER_CMD_VALID_LMR_FEEDBACK: LMR feedback support is valid
161 * @IWL_TOF_RESPONDER_CMD_VALID_SESSION_ID: session id flag is valid
162 * @IWL_TOF_RESPONDER_CMD_VALID_BSS_COLOR: the bss_color field is valid
163 * @IWL_TOF_RESPONDER_CMD_VALID_MIN_MAX_TIME_BETWEEN_MSR: the
164 * min_time_between_msr and max_time_between_msr fields are valid
166 enum iwl_tof_responder_cmd_valid_field {
167 IWL_TOF_RESPONDER_CMD_VALID_CHAN_INFO = BIT(0),
168 IWL_TOF_RESPONDER_CMD_VALID_TOA_OFFSET = BIT(1),
169 IWL_TOF_RESPONDER_CMD_VALID_COMMON_CALIB = BIT(2),
170 IWL_TOF_RESPONDER_CMD_VALID_SPECIFIC_CALIB = BIT(3),
171 IWL_TOF_RESPONDER_CMD_VALID_BSSID = BIT(4),
172 IWL_TOF_RESPONDER_CMD_VALID_TX_ANT = BIT(5),
173 IWL_TOF_RESPONDER_CMD_VALID_ALGO_TYPE = BIT(6),
174 IWL_TOF_RESPONDER_CMD_VALID_NON_ASAP_SUPPORT = BIT(7),
175 IWL_TOF_RESPONDER_CMD_VALID_STATISTICS_REPORT_SUPPORT = BIT(8),
176 IWL_TOF_RESPONDER_CMD_VALID_MCSI_NOTIF_SUPPORT = BIT(9),
177 IWL_TOF_RESPONDER_CMD_VALID_FAST_ALGO_SUPPORT = BIT(10),
178 IWL_TOF_RESPONDER_CMD_VALID_RETRY_ON_ALGO_FAIL = BIT(11),
179 IWL_TOF_RESPONDER_CMD_VALID_STA_ID = BIT(12),
180 IWL_TOF_RESPONDER_CMD_VALID_NDP_SUPPORT = BIT(22),
181 IWL_TOF_RESPONDER_CMD_VALID_NDP_PARAMS = BIT(23),
182 IWL_TOF_RESPONDER_CMD_VALID_LMR_FEEDBACK = BIT(24),
183 IWL_TOF_RESPONDER_CMD_VALID_SESSION_ID = BIT(25),
184 IWL_TOF_RESPONDER_CMD_VALID_BSS_COLOR = BIT(26),
185 IWL_TOF_RESPONDER_CMD_VALID_MIN_MAX_TIME_BETWEEN_MSR = BIT(27),
189 * enum iwl_tof_responder_cfg_flags - responder configuration flags
190 * @IWL_TOF_RESPONDER_FLAGS_NON_ASAP_SUPPORT: non-ASAP support
191 * @IWL_TOF_RESPONDER_FLAGS_REPORT_STATISTICS: report statistics
192 * @IWL_TOF_RESPONDER_FLAGS_REPORT_MCSI: report MCSI
193 * @IWL_TOF_RESPONDER_FLAGS_ALGO_TYPE: algorithm type
194 * @IWL_TOF_RESPONDER_FLAGS_TOA_OFFSET_MODE: ToA offset mode
195 * @IWL_TOF_RESPONDER_FLAGS_COMMON_CALIB_MODE: common calibration mode
196 * @IWL_TOF_RESPONDER_FLAGS_SPECIFIC_CALIB_MODE: specific calibration mode
197 * @IWL_TOF_RESPONDER_FLAGS_FAST_ALGO_SUPPORT: fast algorithm support
198 * @IWL_TOF_RESPONDER_FLAGS_RETRY_ON_ALGO_FAIL: retry on algorithm fail
199 * @IWL_TOF_RESPONDER_FLAGS_FTM_TX_ANT: TX antenna mask
200 * @IWL_TOF_RESPONDER_FLAGS_NDP_SUPPORT: support NDP ranging
201 * @IWL_TOF_RESPONDER_FLAGS_LMR_FEEDBACK: request for LMR feedback if the
202 * initiator supports it
203 * @IWL_TOF_RESPONDER_FLAGS_SESSION_ID: send the session id in the initial FTM
206 enum iwl_tof_responder_cfg_flags {
207 IWL_TOF_RESPONDER_FLAGS_NON_ASAP_SUPPORT = BIT(0),
208 IWL_TOF_RESPONDER_FLAGS_REPORT_STATISTICS = BIT(1),
209 IWL_TOF_RESPONDER_FLAGS_REPORT_MCSI = BIT(2),
210 IWL_TOF_RESPONDER_FLAGS_ALGO_TYPE = BIT(3) | BIT(4) | BIT(5),
211 IWL_TOF_RESPONDER_FLAGS_TOA_OFFSET_MODE = BIT(6),
212 IWL_TOF_RESPONDER_FLAGS_COMMON_CALIB_MODE = BIT(7),
213 IWL_TOF_RESPONDER_FLAGS_SPECIFIC_CALIB_MODE = BIT(8),
214 IWL_TOF_RESPONDER_FLAGS_FAST_ALGO_SUPPORT = BIT(9),
215 IWL_TOF_RESPONDER_FLAGS_RETRY_ON_ALGO_FAIL = BIT(10),
216 IWL_TOF_RESPONDER_FLAGS_FTM_TX_ANT = RATE_MCS_ANT_AB_MSK,
217 IWL_TOF_RESPONDER_FLAGS_NDP_SUPPORT = BIT(24),
218 IWL_TOF_RESPONDER_FLAGS_LMR_FEEDBACK = BIT(25),
219 IWL_TOF_RESPONDER_FLAGS_SESSION_ID = BIT(27),
223 * struct iwl_tof_responder_config_cmd_v6 - ToF AP mode (for debug)
224 * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field
225 * @responder_cfg_flags: &iwl_tof_responder_cfg_flags
226 * @bandwidth: current AP Bandwidth: &enum iwl_tof_bandwidth
227 * @rate: current AP rate
228 * @channel_num: current AP Channel
229 * @ctrl_ch_position: coding of the control channel position relative to
230 * the center frequency, see iwl_mvm_get_ctrl_pos()
231 * @sta_id: index of the AP STA when in AP mode
232 * @reserved1: reserved
233 * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug
234 * purposes, simulating station movement by adding various values
236 * @common_calib: XVT: common calibration value
237 * @specific_calib: XVT: specific calibration value
238 * @bssid: Current AP BSSID
239 * @reserved2: reserved
241 struct iwl_tof_responder_config_cmd_v6 {
242 __le32 cmd_valid_fields;
243 __le32 responder_cfg_flags;
252 __le16 specific_calib;
255 } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_6 */
258 * struct iwl_tof_responder_config_cmd_v7 - ToF AP mode (for debug)
259 * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field
260 * @responder_cfg_flags: &iwl_tof_responder_cfg_flags
261 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
262 * bits 4 - 7: &enum iwl_location_bw.
263 * @rate: current AP rate
264 * @channel_num: current AP Channel
265 * @ctrl_ch_position: coding of the control channel position relative to
266 * the center frequency, see iwl_mvm_get_ctrl_pos()
267 * @sta_id: index of the AP STA when in AP mode
268 * @reserved1: reserved
269 * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug
270 * purposes, simulating station movement by adding various values
272 * @common_calib: XVT: common calibration value
273 * @specific_calib: XVT: specific calibration value
274 * @bssid: Current AP BSSID
275 * @reserved2: reserved
277 struct iwl_tof_responder_config_cmd_v7 {
278 __le32 cmd_valid_fields;
279 __le32 responder_cfg_flags;
288 __le16 specific_calib;
291 } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_7 */
293 #define IWL_RESPONDER_STS_POS 3
294 #define IWL_RESPONDER_TOTAL_LTF_POS 6
297 * struct iwl_tof_responder_config_cmd_v8 - ToF AP mode (for debug)
298 * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field
299 * @responder_cfg_flags: &iwl_tof_responder_cfg_flags
300 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
301 * bits 4 - 7: &enum iwl_location_bw.
302 * @rate: current AP rate
303 * @channel_num: current AP Channel
304 * @ctrl_ch_position: coding of the control channel position relative to
305 * the center frequency, see iwl_mvm_get_ctrl_pos()
306 * @sta_id: index of the AP STA when in AP mode
307 * @reserved1: reserved
308 * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug
309 * purposes, simulating station movement by adding various values
311 * @common_calib: XVT: common calibration value
312 * @specific_calib: XVT: specific calibration value
313 * @bssid: Current AP BSSID
314 * @r2i_ndp_params: parameters for R2I NDP.
315 * bits 0 - 2: max number of LTF repetitions
316 * bits 3 - 5: max number of spatial streams (supported values are < 2)
317 * bits 6 - 7: max number of total LTFs see
318 * &enum ieee80211_range_params_max_total_ltf
319 * @i2r_ndp_params: parameters for I2R NDP.
320 * bits 0 - 2: max number of LTF repetitions
321 * bits 3 - 5: max number of spatial streams
322 * bits 6 - 7: max number of total LTFs see
323 * &enum ieee80211_range_params_max_total_ltf
325 struct iwl_tof_responder_config_cmd_v8 {
326 __le32 cmd_valid_fields;
327 __le32 responder_cfg_flags;
336 __le16 specific_calib;
340 } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_8 */
343 * struct iwl_tof_responder_config_cmd_v9 - ToF AP mode (for debug)
344 * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field
345 * @responder_cfg_flags: &iwl_tof_responder_cfg_flags
346 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
347 * bits 4 - 7: &enum iwl_location_bw.
348 * @bss_color: current AP bss_color
349 * @channel_num: current AP Channel
350 * @ctrl_ch_position: coding of the control channel position relative to
351 * the center frequency, see iwl_mvm_get_ctrl_pos()
352 * @sta_id: index of the AP STA when in AP mode
353 * @reserved1: reserved
354 * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug
355 * purposes, simulating station movement by adding various values
357 * @common_calib: XVT: common calibration value
358 * @specific_calib: XVT: specific calibration value
359 * @bssid: Current AP BSSID
360 * @r2i_ndp_params: parameters for R2I NDP.
361 * bits 0 - 2: max number of LTF repetitions
362 * bits 3 - 5: max number of spatial streams (supported values are < 2)
363 * bits 6 - 7: max number of total LTFs see
364 * &enum ieee80211_range_params_max_total_ltf
365 * @i2r_ndp_params: parameters for I2R NDP.
366 * bits 0 - 2: max number of LTF repetitions
367 * bits 3 - 5: max number of spatial streams
368 * bits 6 - 7: max number of total LTFs see
369 * &enum ieee80211_range_params_max_total_ltf
370 * @min_time_between_msr: for non trigger based NDP ranging, minimum time
371 * between measurements in milliseconds.
372 * @max_time_between_msr: for non trigger based NDP ranging, maximum time
373 * between measurements in milliseconds.
375 struct iwl_tof_responder_config_cmd_v9 {
376 __le32 cmd_valid_fields;
377 __le32 responder_cfg_flags;
386 __le16 specific_calib;
390 __le16 min_time_between_msr;
391 __le16 max_time_between_msr;
392 } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_8 */
395 * struct iwl_tof_responder_config_cmd - ToF AP mode
396 * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field
397 * @responder_cfg_flags: &iwl_tof_responder_cfg_flags
398 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
399 * bits 4 - 7: &enum iwl_location_bw.
400 * @bss_color: current AP bss_color
401 * @channel_num: current AP Channel
402 * @ctrl_ch_position: coding of the control channel position relative to
403 * the center frequency, see iwl_mvm_get_ctrl_pos()
404 * @sta_id: index of the AP STA when in AP mode
405 * @band: current AP band
406 * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug
407 * purposes, simulating station movement by adding various values
409 * @common_calib: XVT: common calibration value
410 * @specific_calib: XVT: specific calibration value
411 * @bssid: Current AP BSSID
412 * @r2i_ndp_params: parameters for R2I NDP.
413 * bits 0 - 2: max number of LTF repetitions
414 * bits 3 - 5: max number of spatial streams (supported values are < 2)
415 * bits 6 - 7: max number of total LTFs see
416 * &enum ieee80211_range_params_max_total_ltf
417 * @i2r_ndp_params: parameters for I2R NDP.
418 * bits 0 - 2: max number of LTF repetitions
419 * bits 3 - 5: max number of spatial streams
420 * bits 6 - 7: max number of total LTFs see
421 * &enum ieee80211_range_params_max_total_ltf
422 * @min_time_between_msr: for non trigger based NDP ranging, minimum time
423 * between measurements in milliseconds.
424 * @max_time_between_msr: for non trigger based NDP ranging, maximum time
425 * between measurements in milliseconds.
427 struct iwl_tof_responder_config_cmd {
428 __le32 cmd_valid_fields;
429 __le32 responder_cfg_flags;
438 __le16 specific_calib;
442 __le16 min_time_between_msr;
443 __le16 max_time_between_msr;
444 } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_10 */
446 #define IWL_LCI_CIVIC_IE_MAX_SIZE 400
449 * struct iwl_tof_responder_dyn_config_cmd_v2 - Dynamic responder settings
450 * @lci_len: The length of the 1st (LCI) part in the @lci_civic buffer
451 * @civic_len: The length of the 2nd (CIVIC) part in the @lci_civic buffer
452 * @lci_civic: The LCI/CIVIC buffer. LCI data (if exists) comes first, then, if
453 * needed, 0-padding such that the next part is dword-aligned, then CIVIC
454 * data (if exists) follows, and then 0-padding again to complete a
455 * 4-multiple long buffer.
457 struct iwl_tof_responder_dyn_config_cmd_v2 {
461 } __packed; /* TOF_RESPONDER_DYN_CONFIG_CMD_API_S_VER_2 */
463 #define IWL_LCI_MAX_SIZE 160
464 #define IWL_CIVIC_MAX_SIZE 160
465 #define HLTK_11AZ_LEN 32
468 * enum iwl_responder_dyn_cfg_valid_flags - valid flags for dyn_config_cmd
469 * @IWL_RESPONDER_DYN_CFG_VALID_LCI: LCI data is valid
470 * @IWL_RESPONDER_DYN_CFG_VALID_CIVIC: Civic data is valid
471 * @IWL_RESPONDER_DYN_CFG_VALID_PASN_STA: the pasn_addr, HLTK and cipher fields
474 enum iwl_responder_dyn_cfg_valid_flags {
475 IWL_RESPONDER_DYN_CFG_VALID_LCI = BIT(0),
476 IWL_RESPONDER_DYN_CFG_VALID_CIVIC = BIT(1),
477 IWL_RESPONDER_DYN_CFG_VALID_PASN_STA = BIT(2),
481 * struct iwl_tof_responder_dyn_config_cmd - Dynamic responder settings
482 * @cipher: The negotiated cipher. see &enum iwl_location_cipher.
483 * @valid_flags: flags indicating which fields in the command are valid. see
484 * &enum iwl_responder_dyn_cfg_valid_flags.
485 * @lci_len: length of the LCI data in bytes
486 * @civic_len: length of the Civic data in bytes
487 * @lci_buf: the LCI buffer
488 * @civic_buf: the Civic buffer
489 * @hltk_buf: HLTK for secure LTF bits generation for the specified station
490 * @addr: mac address of the station for which to use the HLTK
491 * @reserved: for alignment
493 struct iwl_tof_responder_dyn_config_cmd {
498 u8 lci_buf[IWL_LCI_MAX_SIZE];
499 u8 civic_buf[IWL_LCI_MAX_SIZE];
500 u8 hltk_buf[HLTK_11AZ_LEN];
503 } __packed; /* TOF_RESPONDER_DYN_CONFIG_CMD_API_S_VER_3 */
506 * struct iwl_tof_range_req_ext_cmd - extended range req for WLS
507 * @tsf_timer_offset_msec: the recommended time offset (mSec) from the AP's TSF
508 * @reserved: reserved
509 * @min_delta_ftm: Minimal time between two consecutive measurements,
510 * in units of 100us. 0 means no preference by station
511 * @ftm_format_and_bw20M: FTM Channel Spacing/Format for 20MHz: recommended
512 * value be sent to the AP
513 * @ftm_format_and_bw40M: FTM Channel Spacing/Format for 40MHz: recommended
514 * value to be sent to the AP
515 * @ftm_format_and_bw80M: FTM Channel Spacing/Format for 80MHz: recommended
516 * value to be sent to the AP
518 struct iwl_tof_range_req_ext_cmd {
519 __le16 tsf_timer_offset_msec;
522 u8 ftm_format_and_bw20M;
523 u8 ftm_format_and_bw40M;
524 u8 ftm_format_and_bw80M;
528 * enum iwl_tof_location_query - values for query bitmap
529 * @IWL_TOF_LOC_LCI: query LCI
530 * @IWL_TOF_LOC_CIVIC: query civic
532 enum iwl_tof_location_query {
533 IWL_TOF_LOC_LCI = 0x01,
534 IWL_TOF_LOC_CIVIC = 0x02,
538 * struct iwl_tof_range_req_ap_entry_v2 - AP configuration parameters
539 * @channel_num: Current AP Channel
540 * @bandwidth: Current AP Bandwidth. One of iwl_tof_bandwidth.
541 * @tsf_delta_direction: TSF relatively to the subject AP
542 * @ctrl_ch_position: Coding of the control channel position relative to the
543 * center frequency, see iwl_mvm_get_ctrl_pos().
545 * @measure_type: Measurement type: 0 - two sided, 1 - One sided
546 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of the
547 * number of measurement iterations (min 2^0 = 1, max 2^14)
548 * @burst_period: Recommended value to be sent to the AP. Measurement
549 * periodicity In units of 100ms. ignored if num_of_bursts = 0
550 * @samples_per_burst: 2-sided: the number of FTMs pairs in single Burst (1-31);
551 * 1-sided: how many rts/cts pairs should be used per burst.
552 * @retries_per_sample: Max number of retries that the LMAC should send
553 * in case of no replies by the AP.
554 * @tsf_delta: TSF Delta in units of microseconds.
555 * The difference between the AP TSF and the device local clock.
556 * @location_req: Location Request Bit[0] LCI should be sent in the FTMR;
557 * Bit[1] Civic should be sent in the FTMR
558 * @asap_mode: 0 - non asap mode, 1 - asap mode (not relevant for one sided)
559 * @enable_dyn_ack: Enable Dynamic ACK BW.
560 * 0: Initiator interact with regular AP;
561 * 1: Initiator interact with Responder machine: need to send the
562 * Initiator Acks with HT 40MHz / 80MHz, since the Responder should
563 * use it for its ch est measurement (this flag will be set when we
564 * configure the opposite machine to be Responder).
565 * @rssi: Last received value
566 * legal values: -128-0 (0x7f). above 0x0 indicating an invalid value.
567 * @algo_type: &enum iwl_tof_algo_type
568 * @notify_mcsi: &enum iwl_tof_mcsi_ntfy.
569 * @reserved: For alignment and future use
571 struct iwl_tof_range_req_ap_entry_v2 {
574 u8 tsf_delta_direction;
580 u8 samples_per_burst;
581 u8 retries_per_sample;
590 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_2 */
593 * enum iwl_initiator_ap_flags - per responder FTM configuration flags
594 * @IWL_INITIATOR_AP_FLAGS_ASAP: Request for ASAP measurement.
595 * @IWL_INITIATOR_AP_FLAGS_LCI_REQUEST: Request for LCI information
596 * @IWL_INITIATOR_AP_FLAGS_CIVIC_REQUEST: Request for CIVIC information
597 * @IWL_INITIATOR_AP_FLAGS_DYN_ACK: Send HT/VHT ack for FTM frames. If not set,
598 * 20Mhz dup acks will be sent.
599 * @IWL_INITIATOR_AP_FLAGS_ALGO_LR: Use LR algo type for rtt calculation.
600 * Default algo type is ML.
601 * @IWL_INITIATOR_AP_FLAGS_ALGO_FFT: Use FFT algo type for rtt calculation.
602 * Default algo type is ML.
603 * @IWL_INITIATOR_AP_FLAGS_MCSI_REPORT: Send the MCSI for each FTM frame to the
605 * @IWL_INITIATOR_AP_FLAGS_NON_TB: Use non trigger based flow
606 * @IWL_INITIATOR_AP_FLAGS_TB: Use trigger based flow
607 * @IWL_INITIATOR_AP_FLAGS_SECURED: request secure LTF measurement
608 * @IWL_INITIATOR_AP_FLAGS_LMR_FEEDBACK: Send LMR feedback
609 * @IWL_INITIATOR_AP_FLAGS_USE_CALIB: Use calibration values from the request
610 * instead of fw internal values.
611 * @IWL_INITIATOR_AP_FLAGS_PMF: request to protect the negotiation and LMR
612 * frames with protected management frames.
613 * @IWL_INITIATOR_AP_FLAGS_TERMINATE_ON_LMR_FEEDBACK: terminate the session if
614 * the responder asked for LMR feedback although the initiator did not set
615 * the LMR feedback bit in the FTM request. If not set, the initiator will
616 * continue with the session and will provide the LMR feedback.
617 * @IWL_INITIATOR_AP_FLAGS_TEST_INCORRECT_SAC: send an incorrect SAC in the
618 * first NDP exchange. This is used for testing.
619 * @IWL_INITIATOR_AP_FLAGS_TEST_BAD_SLTF: use incorrect secure LTF tx key. This
620 * is used for testing. Only supported from version 15 of the range request
623 enum iwl_initiator_ap_flags {
624 IWL_INITIATOR_AP_FLAGS_ASAP = BIT(1),
625 IWL_INITIATOR_AP_FLAGS_LCI_REQUEST = BIT(2),
626 IWL_INITIATOR_AP_FLAGS_CIVIC_REQUEST = BIT(3),
627 IWL_INITIATOR_AP_FLAGS_DYN_ACK = BIT(4),
628 IWL_INITIATOR_AP_FLAGS_ALGO_LR = BIT(5),
629 IWL_INITIATOR_AP_FLAGS_ALGO_FFT = BIT(6),
630 IWL_INITIATOR_AP_FLAGS_MCSI_REPORT = BIT(8),
631 IWL_INITIATOR_AP_FLAGS_NON_TB = BIT(9),
632 IWL_INITIATOR_AP_FLAGS_TB = BIT(10),
633 IWL_INITIATOR_AP_FLAGS_SECURED = BIT(11),
634 IWL_INITIATOR_AP_FLAGS_LMR_FEEDBACK = BIT(12),
635 IWL_INITIATOR_AP_FLAGS_USE_CALIB = BIT(13),
636 IWL_INITIATOR_AP_FLAGS_PMF = BIT(14),
637 IWL_INITIATOR_AP_FLAGS_TERMINATE_ON_LMR_FEEDBACK = BIT(15),
638 IWL_INITIATOR_AP_FLAGS_TEST_INCORRECT_SAC = BIT(16),
639 IWL_INITIATOR_AP_FLAGS_TEST_BAD_SLTF = BIT(17),
643 * struct iwl_tof_range_req_ap_entry_v3 - AP configuration parameters
644 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
645 * @channel_num: AP Channel number
646 * @bandwidth: AP bandwidth. One of iwl_tof_bandwidth.
647 * @ctrl_ch_position: Coding of the control channel position relative to the
648 * center frequency, see iwl_mvm_get_ctrl_pos().
649 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
652 * @burst_period: Recommended value to be sent to the AP. Measurement
653 * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0
654 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
655 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
656 * the number of measurement iterations (min 2^0 = 1, max 2^14)
657 * @reserved: For alignment and future use
658 * @tsf_delta: not in use
660 struct iwl_tof_range_req_ap_entry_v3 {
661 __le32 initiator_ap_flags;
668 u8 samples_per_burst;
672 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_3 */
675 * enum iwl_location_frame_format - location frame formats
676 * @IWL_LOCATION_FRAME_FORMAT_LEGACY: legacy
677 * @IWL_LOCATION_FRAME_FORMAT_HT: HT
678 * @IWL_LOCATION_FRAME_FORMAT_VHT: VHT
679 * @IWL_LOCATION_FRAME_FORMAT_HE: HE
681 enum iwl_location_frame_format {
682 IWL_LOCATION_FRAME_FORMAT_LEGACY,
683 IWL_LOCATION_FRAME_FORMAT_HT,
684 IWL_LOCATION_FRAME_FORMAT_VHT,
685 IWL_LOCATION_FRAME_FORMAT_HE,
689 * enum iwl_location_bw - location bandwidth selection
690 * @IWL_LOCATION_BW_20MHZ: 20MHz
691 * @IWL_LOCATION_BW_40MHZ: 40MHz
692 * @IWL_LOCATION_BW_80MHZ: 80MHz
693 * @IWL_LOCATION_BW_160MHZ: 160MHz
695 enum iwl_location_bw {
696 IWL_LOCATION_BW_20MHZ,
697 IWL_LOCATION_BW_40MHZ,
698 IWL_LOCATION_BW_80MHZ,
699 IWL_LOCATION_BW_160MHZ,
702 #define TK_11AZ_LEN 32
704 #define LOCATION_BW_POS 4
707 * struct iwl_tof_range_req_ap_entry_v4 - AP configuration parameters
708 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
709 * @channel_num: AP Channel number
710 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
711 * bits 4 - 7: &enum iwl_location_bw.
712 * @ctrl_ch_position: Coding of the control channel position relative to the
713 * center frequency, see iwl_mvm_get_ctrl_pos().
714 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
717 * @burst_period: Recommended value to be sent to the AP. Measurement
718 * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0
719 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
720 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
721 * the number of measurement iterations (min 2^0 = 1, max 2^14)
722 * @reserved: For alignment and future use
723 * @hltk: HLTK to be used for secured 11az measurement
724 * @tk: TK to be used for secured 11az measurement
726 struct iwl_tof_range_req_ap_entry_v4 {
727 __le32 initiator_ap_flags;
734 u8 samples_per_burst;
737 u8 hltk[HLTK_11AZ_LEN];
739 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_4 */
742 * enum iwl_location_cipher - location cipher selection
743 * @IWL_LOCATION_CIPHER_CCMP_128: CCMP 128
744 * @IWL_LOCATION_CIPHER_GCMP_128: GCMP 128
745 * @IWL_LOCATION_CIPHER_GCMP_256: GCMP 256
746 * @IWL_LOCATION_CIPHER_INVALID: security is not used.
747 * @IWL_LOCATION_CIPHER_MAX: maximum value for this enum.
749 enum iwl_location_cipher {
750 IWL_LOCATION_CIPHER_CCMP_128,
751 IWL_LOCATION_CIPHER_GCMP_128,
752 IWL_LOCATION_CIPHER_GCMP_256,
753 IWL_LOCATION_CIPHER_INVALID,
754 IWL_LOCATION_CIPHER_MAX,
758 * struct iwl_tof_range_req_ap_entry_v6 - AP configuration parameters
759 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
760 * @channel_num: AP Channel number
761 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
762 * bits 4 - 7: &enum iwl_location_bw.
763 * @ctrl_ch_position: Coding of the control channel position relative to the
764 * center frequency, see iwl_mvm_get_ctrl_pos().
765 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
768 * @burst_period: Recommended value to be sent to the AP. Measurement
769 * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0
770 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
771 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
772 * the number of measurement iterations (min 2^0 = 1, max 2^14)
773 * @sta_id: the station id of the AP. Only relevant when associated to the AP,
774 * otherwise should be set to &IWL_INVALID_STA.
775 * @cipher: pairwise cipher suite for secured measurement.
776 * &enum iwl_location_cipher.
777 * @hltk: HLTK to be used for secured 11az measurement
778 * @tk: TK to be used for secured 11az measurement
779 * @calib: An array of calibration values per FTM rx bandwidth.
780 * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the
781 * calibration value that corresponds to the rx bandwidth of the FTM
783 * @beacon_interval: beacon interval of the AP in TUs. Only required if
784 * &IWL_INITIATOR_AP_FLAGS_TB is set.
786 struct iwl_tof_range_req_ap_entry_v6 {
787 __le32 initiator_ap_flags;
794 u8 samples_per_burst;
798 u8 hltk[HLTK_11AZ_LEN];
800 __le16 calib[IWL_TOF_BW_NUM];
801 __le16 beacon_interval;
802 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_6 */
805 * struct iwl_tof_range_req_ap_entry_v7 - AP configuration parameters
806 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
807 * @channel_num: AP Channel number
808 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
809 * bits 4 - 7: &enum iwl_location_bw.
810 * @ctrl_ch_position: Coding of the control channel position relative to the
811 * center frequency, see iwl_mvm_get_ctrl_pos().
812 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
815 * @burst_period: Recommended value to be sent to the AP. Measurement
816 * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0
817 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
818 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
819 * the number of measurement iterations (min 2^0 = 1, max 2^14)
820 * @sta_id: the station id of the AP. Only relevant when associated to the AP,
821 * otherwise should be set to &IWL_INVALID_STA.
822 * @cipher: pairwise cipher suite for secured measurement.
823 * &enum iwl_location_cipher.
824 * @hltk: HLTK to be used for secured 11az measurement
825 * @tk: TK to be used for secured 11az measurement
826 * @calib: An array of calibration values per FTM rx bandwidth.
827 * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the
828 * calibration value that corresponds to the rx bandwidth of the FTM
830 * @beacon_interval: beacon interval of the AP in TUs. Only required if
831 * &IWL_INITIATOR_AP_FLAGS_TB is set.
832 * @rx_pn: the next expected PN for protected management frames Rx. LE byte
833 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
834 * is set to &IWL_INVALID_STA.
835 * @tx_pn: the next PN to use for protected management frames Tx. LE byte
836 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
837 * is set to &IWL_INVALID_STA.
839 struct iwl_tof_range_req_ap_entry_v7 {
840 __le32 initiator_ap_flags;
847 u8 samples_per_burst;
851 u8 hltk[HLTK_11AZ_LEN];
853 __le16 calib[IWL_TOF_BW_NUM];
854 __le16 beacon_interval;
855 u8 rx_pn[IEEE80211_CCMP_PN_LEN];
856 u8 tx_pn[IEEE80211_CCMP_PN_LEN];
857 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_7 */
859 #define IWL_LOCATION_MAX_STS_POS 3
860 #define IWL_LOCATION_TOTAL_LTF_POS 6
863 * struct iwl_tof_range_req_ap_entry_v8 - AP configuration parameters
864 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
865 * @channel_num: AP Channel number
866 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
867 * bits 4 - 7: &enum iwl_location_bw.
868 * @ctrl_ch_position: Coding of the control channel position relative to the
869 * center frequency, see iwl_mvm_get_ctrl_pos().
870 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
873 * @burst_period: Recommended value to be sent to the AP. Measurement
874 * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0
875 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
876 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
877 * the number of measurement iterations (min 2^0 = 1, max 2^14)
878 * @sta_id: the station id of the AP. Only relevant when associated to the AP,
879 * otherwise should be set to &IWL_INVALID_STA.
880 * @cipher: pairwise cipher suite for secured measurement.
881 * &enum iwl_location_cipher.
882 * @hltk: HLTK to be used for secured 11az measurement
883 * @tk: TK to be used for secured 11az measurement
884 * @calib: An array of calibration values per FTM rx bandwidth.
885 * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the
886 * calibration value that corresponds to the rx bandwidth of the FTM
888 * @beacon_interval: beacon interval of the AP in TUs. Only required if
889 * &IWL_INITIATOR_AP_FLAGS_TB is set.
890 * @rx_pn: the next expected PN for protected management frames Rx. LE byte
891 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
892 * is set to &IWL_INVALID_STA.
893 * @tx_pn: the next PN to use for protected management frames Tx. LE byte
894 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
895 * is set to &IWL_INVALID_STA.
896 * @r2i_ndp_params: parameters for R2I NDP ranging negotiation.
897 * bits 0 - 2: max LTF repetitions
898 * bits 3 - 5: max number of spatial streams
899 * bits 6 - 7: reserved
900 * @i2r_ndp_params: parameters for I2R NDP ranging negotiation.
901 * bits 0 - 2: max LTF repetitions
902 * bits 3 - 5: max number of spatial streams (supported values are < 2)
903 * bits 6 - 7: reserved
904 * @r2i_max_total_ltf: R2I Max Total LTFs for NDP ranging negotiation.
905 * One of &enum ieee80211_range_params_max_total_ltf.
906 * @i2r_max_total_ltf: I2R Max Total LTFs for NDP ranging negotiation.
907 * One of &enum ieee80211_range_params_max_total_ltf.
909 struct iwl_tof_range_req_ap_entry_v8 {
910 __le32 initiator_ap_flags;
917 u8 samples_per_burst;
921 u8 hltk[HLTK_11AZ_LEN];
923 __le16 calib[IWL_TOF_BW_NUM];
924 __le16 beacon_interval;
925 u8 rx_pn[IEEE80211_CCMP_PN_LEN];
926 u8 tx_pn[IEEE80211_CCMP_PN_LEN];
929 u8 r2i_max_total_ltf;
930 u8 i2r_max_total_ltf;
931 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_8 */
934 * struct iwl_tof_range_req_ap_entry_v9 - AP configuration parameters
935 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
936 * @channel_num: AP Channel number
937 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
938 * bits 4 - 7: &enum iwl_location_bw.
939 * @ctrl_ch_position: Coding of the control channel position relative to the
940 * center frequency, see iwl_mvm_get_ctrl_pos().
941 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
944 * @burst_period: For EDCA based ranging: Recommended value to be sent to the
945 * AP. Measurement periodicity In units of 100ms. ignored if
946 * num_of_bursts_exp = 0.
947 * For non trigger based NDP ranging, the maximum time between
948 * measurements in units of milliseconds.
949 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
950 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
951 * the number of measurement iterations (min 2^0 = 1, max 2^14)
952 * @sta_id: the station id of the AP. Only relevant when associated to the AP,
953 * otherwise should be set to &IWL_INVALID_STA.
954 * @cipher: pairwise cipher suite for secured measurement.
955 * &enum iwl_location_cipher.
956 * @hltk: HLTK to be used for secured 11az measurement
957 * @tk: TK to be used for secured 11az measurement
958 * @calib: An array of calibration values per FTM rx bandwidth.
959 * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the
960 * calibration value that corresponds to the rx bandwidth of the FTM
962 * @beacon_interval: beacon interval of the AP in TUs. Only required if
963 * &IWL_INITIATOR_AP_FLAGS_TB is set.
964 * @bss_color: the BSS color of the responder. Only valid if
965 * &IWL_INITIATOR_AP_FLAGS_TB or &IWL_INITIATOR_AP_FLAGS_NON_TB is set.
966 * @rx_pn: the next expected PN for protected management frames Rx. LE byte
967 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
968 * is set to &IWL_INVALID_STA.
969 * @tx_pn: the next PN to use for protected management frames Tx. LE byte
970 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
971 * is set to &IWL_INVALID_STA.
972 * @r2i_ndp_params: parameters for R2I NDP ranging negotiation.
973 * bits 0 - 2: max LTF repetitions
974 * bits 3 - 5: max number of spatial streams
975 * bits 6 - 7: reserved
976 * @i2r_ndp_params: parameters for I2R NDP ranging negotiation.
977 * bits 0 - 2: max LTF repetitions
978 * bits 3 - 5: max number of spatial streams (supported values are < 2)
979 * bits 6 - 7: reserved
980 * @r2i_max_total_ltf: R2I Max Total LTFs for NDP ranging negotiation.
981 * One of &enum ieee80211_range_params_max_total_ltf.
982 * @i2r_max_total_ltf: I2R Max Total LTFs for NDP ranging negotiation.
983 * One of &enum ieee80211_range_params_max_total_ltf.
984 * @bss_color: the BSS color of the responder. Only valid if
985 * &IWL_INITIATOR_AP_FLAGS_NON_TB or &IWL_INITIATOR_AP_FLAGS_TB is set.
986 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz, 2 for 6GHz
987 * @min_time_between_msr: For non trigger based NDP ranging, the minimum time
988 * between measurements in units of milliseconds
990 struct iwl_tof_range_req_ap_entry_v9 {
991 __le32 initiator_ap_flags;
998 u8 samples_per_burst;
1002 u8 hltk[HLTK_11AZ_LEN];
1004 __le16 calib[IWL_TOF_BW_NUM];
1005 u16 beacon_interval;
1006 u8 rx_pn[IEEE80211_CCMP_PN_LEN];
1007 u8 tx_pn[IEEE80211_CCMP_PN_LEN];
1010 u8 r2i_max_total_ltf;
1011 u8 i2r_max_total_ltf;
1014 __le16 min_time_between_msr;
1015 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_9 */
1018 * struct iwl_tof_range_req_ap_entry_v10 - AP configuration parameters
1019 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
1020 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz, 2 for 6GHz
1021 * @channel_num: AP Channel number
1022 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
1023 * bits 4 - 7: &enum iwl_location_bw.
1024 * @ctrl_ch_position: Coding of the control channel position relative to the
1025 * center frequency, see iwl_mvm_get_ctrl_pos().
1026 * @bssid: AP's BSSID
1027 * @burst_period: For EDCA based ranging: Recommended value to be sent to the
1028 * AP. Measurement periodicity In units of 100ms. ignored if
1029 * num_of_bursts_exp = 0.
1030 * For non trigger based NDP ranging, the maximum time between
1031 * measurements in units of milliseconds.
1032 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
1033 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
1034 * the number of measurement iterations (min 2^0 = 1, max 2^14)
1035 * @sta_id: the station id of the AP. Only relevant when associated to the AP,
1036 * otherwise should be set to &IWL_INVALID_STA.
1037 * @cipher: pairwise cipher suite for secured measurement.
1038 * &enum iwl_location_cipher.
1039 * @hltk: HLTK to be used for secured 11az measurement
1040 * @tk: TK to be used for secured 11az measurement
1041 * @calib: An array of calibration values per FTM rx bandwidth.
1042 * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the
1043 * calibration value that corresponds to the rx bandwidth of the FTM
1045 * @beacon_interval: beacon interval of the AP in TUs. Only required if
1046 * &IWL_INITIATOR_AP_FLAGS_TB is set.
1047 * @rx_pn: the next expected PN for protected management frames Rx. LE byte
1048 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
1049 * is set to &IWL_INVALID_STA.
1050 * @tx_pn: the next PN to use for protected management frames Tx. LE byte
1051 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
1052 * is set to &IWL_INVALID_STA.
1053 * @r2i_ndp_params: parameters for R2I NDP ranging negotiation.
1054 * bits 0 - 2: max LTF repetitions
1055 * bits 3 - 5: max number of spatial streams
1056 * bits 6 - 7: max total LTFs. One of
1057 * &enum ieee80211_range_params_max_total_ltf.
1058 * @i2r_ndp_params: parameters for I2R NDP ranging negotiation.
1059 * bits 0 - 2: max LTF repetitions
1060 * bits 3 - 5: max number of spatial streams (supported values are < 2)
1061 * bits 6 - 7: max total LTFs. One of
1062 * &enum ieee80211_range_params_max_total_ltf.
1063 * @min_time_between_msr: For non trigger based NDP ranging, the minimum time
1064 * between measurements in units of milliseconds
1066 struct iwl_tof_range_req_ap_entry_v10 {
1067 __le32 initiator_ap_flags;
1071 u8 ctrl_ch_position;
1073 __le16 burst_period;
1074 u8 samples_per_burst;
1078 u8 hltk[HLTK_11AZ_LEN];
1080 __le16 calib[IWL_TOF_BW_NUM];
1081 __le16 beacon_interval;
1082 u8 rx_pn[IEEE80211_CCMP_PN_LEN];
1083 u8 tx_pn[IEEE80211_CCMP_PN_LEN];
1086 __le16 min_time_between_msr;
1087 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_9 */
1090 * enum iwl_tof_response_mode
1091 * @IWL_MVM_TOF_RESPONSE_ASAP: report each AP measurement separately as soon as
1092 * possible (not supported for this release)
1093 * @IWL_MVM_TOF_RESPONSE_TIMEOUT: report all AP measurements as a batch upon
1094 * timeout expiration
1095 * @IWL_MVM_TOF_RESPONSE_COMPLETE: report all AP measurements as a batch at the
1096 * earlier of: measurements completion / timeout
1099 enum iwl_tof_response_mode {
1100 IWL_MVM_TOF_RESPONSE_ASAP,
1101 IWL_MVM_TOF_RESPONSE_TIMEOUT,
1102 IWL_MVM_TOF_RESPONSE_COMPLETE,
1106 * enum iwl_tof_initiator_flags
1108 * @IWL_TOF_INITIATOR_FLAGS_FAST_ALGO_DISABLED: disable fast algo, meaning run
1109 * the algo on ant A+B, instead of only one of them.
1110 * @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_A: open RX antenna A for FTMs RX
1111 * @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_B: open RX antenna B for FTMs RX
1112 * @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_C: open RX antenna C for FTMs RX
1113 * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A: use antenna A fo TX ACKs during FTM
1114 * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B: use antenna B fo TX ACKs during FTM
1115 * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C: use antenna C fo TX ACKs during FTM
1116 * @IWL_TOF_INITIATOR_FLAGS_MACADDR_RANDOM: use random mac address for FTM
1117 * @IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB: use the specific calib value from
1118 * the range request command
1119 * @IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB: use the common calib value from the
1120 * ragne request command
1121 * @IWL_TOF_INITIATOR_FLAGS_NON_ASAP_SUPPORT: support non-asap measurements
1123 enum iwl_tof_initiator_flags {
1124 IWL_TOF_INITIATOR_FLAGS_FAST_ALGO_DISABLED = BIT(0),
1125 IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_A = BIT(1),
1126 IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_B = BIT(2),
1127 IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_C = BIT(3),
1128 IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A = BIT(4),
1129 IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B = BIT(5),
1130 IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C = BIT(6),
1131 IWL_TOF_INITIATOR_FLAGS_MACADDR_RANDOM = BIT(7),
1132 IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB = BIT(15),
1133 IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB = BIT(16),
1134 IWL_TOF_INITIATOR_FLAGS_NON_ASAP_SUPPORT = BIT(20),
1135 }; /* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */
1137 #define IWL_MVM_TOF_MAX_APS 5
1138 #define IWL_MVM_TOF_MAX_TWO_SIDED_APS 5
1141 * struct iwl_tof_range_req_cmd_v5 - start measurement cmd
1142 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1143 * @request_id: A Token incremented per request. The same Token will be
1144 * sent back in the range response
1145 * @initiator: 0- NW initiated, 1 - Client Initiated
1146 * @one_sided_los_disable: '0'- run ML-Algo for both ToF/OneSided,
1147 * '1' - run ML-Algo for ToF only
1148 * @req_timeout: Requested timeout of the response in units of 100ms.
1149 * This is equivalent to the session time configured to the
1150 * LMAC in Initiator Request
1151 * @report_policy: Supported partially for this release: For current release -
1152 * the range report will be uploaded as a batch when ready or
1153 * when the session is done (successfully / partially).
1154 * one of iwl_tof_response_mode.
1155 * @reserved0: reserved
1156 * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS)
1157 * @macaddr_random: '0' Use default source MAC address (i.e. p2_p),
1158 * '1' Use MAC Address randomization according to the below
1159 * @range_req_bssid: ranging request BSSID
1160 * @macaddr_template: MAC address template to use for non-randomized bits
1161 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1162 * Bits set to 1 shall be randomized by the UMAC
1163 * @ftm_rx_chains: Rx chain to open to receive Responder's FTMs (XVT)
1164 * @ftm_tx_chains: Tx chain to send the ack to the Responder FTM (XVT)
1165 * @common_calib: The common calib value to inject to this measurement calc
1166 * @specific_calib: The specific calib value to inject to this measurement calc
1167 * @ap: per-AP request data
1169 struct iwl_tof_range_req_cmd_v5 {
1170 __le32 initiator_flags;
1173 u8 one_sided_los_disable;
1179 u8 range_req_bssid[ETH_ALEN];
1180 u8 macaddr_template[ETH_ALEN];
1181 u8 macaddr_mask[ETH_ALEN];
1184 __le16 common_calib;
1185 __le16 specific_calib;
1186 struct iwl_tof_range_req_ap_entry_v2 ap[IWL_MVM_TOF_MAX_APS];
1188 /* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */
1191 * struct iwl_tof_range_req_cmd_v7 - start measurement cmd
1192 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1193 * @request_id: A Token incremented per request. The same Token will be
1194 * sent back in the range response
1195 * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS)
1196 * @range_req_bssid: ranging request BSSID
1197 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1198 * Bits set to 1 shall be randomized by the UMAC
1199 * @macaddr_template: MAC address template to use for non-randomized bits
1200 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1201 * This is the session time for completing the measurement.
1202 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1203 * TSF of this mac id. 0xff to disable TSF reporting.
1204 * @common_calib: The common calib value to inject to this measurement calc
1205 * @specific_calib: The specific calib value to inject to this measurement calc
1206 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.
1208 struct iwl_tof_range_req_cmd_v7 {
1209 __le32 initiator_flags;
1212 u8 range_req_bssid[ETH_ALEN];
1213 u8 macaddr_mask[ETH_ALEN];
1214 u8 macaddr_template[ETH_ALEN];
1215 __le32 req_timeout_ms;
1217 __le16 common_calib;
1218 __le16 specific_calib;
1219 struct iwl_tof_range_req_ap_entry_v3 ap[IWL_MVM_TOF_MAX_APS];
1220 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_7 */
1223 * struct iwl_tof_range_req_cmd_v8 - start measurement cmd
1224 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1225 * @request_id: A Token incremented per request. The same Token will be
1226 * sent back in the range response
1227 * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS)
1228 * @range_req_bssid: ranging request BSSID
1229 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1230 * Bits set to 1 shall be randomized by the UMAC
1231 * @macaddr_template: MAC address template to use for non-randomized bits
1232 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1233 * This is the session time for completing the measurement.
1234 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1235 * TSF of this mac id. 0xff to disable TSF reporting.
1236 * @common_calib: The common calib value to inject to this measurement calc
1237 * @specific_calib: The specific calib value to inject to this measurement calc
1238 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.
1240 struct iwl_tof_range_req_cmd_v8 {
1241 __le32 initiator_flags;
1244 u8 range_req_bssid[ETH_ALEN];
1245 u8 macaddr_mask[ETH_ALEN];
1246 u8 macaddr_template[ETH_ALEN];
1247 __le32 req_timeout_ms;
1249 __le16 common_calib;
1250 __le16 specific_calib;
1251 struct iwl_tof_range_req_ap_entry_v4 ap[IWL_MVM_TOF_MAX_APS];
1252 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_8 */
1255 * struct iwl_tof_range_req_cmd_v9 - start measurement cmd
1256 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1257 * @request_id: A Token incremented per request. The same Token will be
1258 * sent back in the range response
1259 * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS)
1260 * @range_req_bssid: ranging request BSSID
1261 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1262 * Bits set to 1 shall be randomized by the UMAC
1263 * @macaddr_template: MAC address template to use for non-randomized bits
1264 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1265 * This is the session time for completing the measurement.
1266 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1267 * TSF of this mac id. 0xff to disable TSF reporting.
1268 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.
1270 struct iwl_tof_range_req_cmd_v9 {
1271 __le32 initiator_flags;
1274 u8 range_req_bssid[ETH_ALEN];
1275 u8 macaddr_mask[ETH_ALEN];
1276 u8 macaddr_template[ETH_ALEN];
1277 __le32 req_timeout_ms;
1279 struct iwl_tof_range_req_ap_entry_v6 ap[IWL_MVM_TOF_MAX_APS];
1280 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_9 */
1283 * struct iwl_tof_range_req_cmd_v11 - start measurement cmd
1284 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1285 * @request_id: A Token incremented per request. The same Token will be
1286 * sent back in the range response
1287 * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS)
1288 * @range_req_bssid: ranging request BSSID
1289 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1290 * Bits set to 1 shall be randomized by the UMAC
1291 * @macaddr_template: MAC address template to use for non-randomized bits
1292 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1293 * This is the session time for completing the measurement.
1294 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1295 * TSF of this mac id. 0xff to disable TSF reporting.
1296 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.
1298 struct iwl_tof_range_req_cmd_v11 {
1299 __le32 initiator_flags;
1302 u8 range_req_bssid[ETH_ALEN];
1303 u8 macaddr_mask[ETH_ALEN];
1304 u8 macaddr_template[ETH_ALEN];
1305 __le32 req_timeout_ms;
1307 struct iwl_tof_range_req_ap_entry_v7 ap[IWL_MVM_TOF_MAX_APS];
1308 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_11 */
1311 * struct iwl_tof_range_req_cmd_v12 - start measurement cmd
1312 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1313 * @request_id: A Token incremented per request. The same Token will be
1314 * sent back in the range response
1315 * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS)
1316 * @range_req_bssid: ranging request BSSID
1317 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1318 * Bits set to 1 shall be randomized by the UMAC
1319 * @macaddr_template: MAC address template to use for non-randomized bits
1320 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1321 * This is the session time for completing the measurement.
1322 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1323 * TSF of this mac id. 0xff to disable TSF reporting.
1324 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.
1326 struct iwl_tof_range_req_cmd_v12 {
1327 __le32 initiator_flags;
1330 u8 range_req_bssid[ETH_ALEN];
1331 u8 macaddr_mask[ETH_ALEN];
1332 u8 macaddr_template[ETH_ALEN];
1333 __le32 req_timeout_ms;
1335 struct iwl_tof_range_req_ap_entry_v8 ap[IWL_MVM_TOF_MAX_APS];
1336 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_12 */
1339 * struct iwl_tof_range_req_cmd_v13 - start measurement cmd
1340 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1341 * @request_id: A Token incremented per request. The same Token will be
1342 * sent back in the range response
1343 * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS)
1344 * @range_req_bssid: ranging request BSSID
1345 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1346 * Bits set to 1 shall be randomized by the UMAC
1347 * @macaddr_template: MAC address template to use for non-randomized bits
1348 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1349 * This is the session time for completing the measurement.
1350 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1351 * TSF of this mac id. 0xff to disable TSF reporting.
1352 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v9.
1354 struct iwl_tof_range_req_cmd_v13 {
1355 __le32 initiator_flags;
1358 u8 range_req_bssid[ETH_ALEN];
1359 u8 macaddr_mask[ETH_ALEN];
1360 u8 macaddr_template[ETH_ALEN];
1361 __le32 req_timeout_ms;
1363 struct iwl_tof_range_req_ap_entry_v9 ap[IWL_MVM_TOF_MAX_APS];
1364 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_13 */
1367 * struct iwl_tof_range_req_cmd_v14 - start measurement cmd
1368 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1369 * @request_id: A Token incremented per request. The same Token will be
1370 * sent back in the range response
1371 * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS)
1372 * @range_req_bssid: ranging request BSSID
1373 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1374 * Bits set to 1 shall be randomized by the UMAC
1375 * @macaddr_template: MAC address template to use for non-randomized bits
1376 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1377 * This is the session time for completing the measurement.
1378 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1379 * TSF of this mac id. 0xff to disable TSF reporting.
1380 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v10.
1382 struct iwl_tof_range_req_cmd_v14 {
1383 __le32 initiator_flags;
1386 u8 range_req_bssid[ETH_ALEN];
1387 u8 macaddr_mask[ETH_ALEN];
1388 u8 macaddr_template[ETH_ALEN];
1389 __le32 req_timeout_ms;
1391 struct iwl_tof_range_req_ap_entry_v10 ap[IWL_MVM_TOF_MAX_APS];
1392 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_13 */
1395 * enum iwl_tof_range_request_status - status of the sent request
1396 * @IWL_TOF_RANGE_REQUEST_STATUS_SUCCESSFUL - FW successfully received the
1398 * @IWL_TOF_RANGE_REQUEST_STATUS_BUSY - FW is busy with a previous request, the
1399 * sent request will not be handled
1401 enum iwl_tof_range_request_status {
1402 IWL_TOF_RANGE_REQUEST_STATUS_SUCCESS,
1403 IWL_TOF_RANGE_REQUEST_STATUS_BUSY,
1407 * enum iwl_tof_entry_status
1409 * @IWL_TOF_ENTRY_SUCCESS: successful measurement.
1410 * @IWL_TOF_ENTRY_GENERAL_FAILURE: General failure.
1411 * @IWL_TOF_ENTRY_NO_RESPONSE: Responder didn't reply to the request.
1412 * @IWL_TOF_ENTRY_REQUEST_REJECTED: Responder rejected the request.
1413 * @IWL_TOF_ENTRY_NOT_SCHEDULED: Time event was scheduled but not called yet.
1414 * @IWL_TOF_ENTRY_TIMING_MEASURE_TIMEOUT: Time event triggered but no
1415 * measurement was completed.
1416 * @IWL_TOF_ENTRY_TARGET_DIFF_CH_CANNOT_CHANGE: No range due inability to switch
1417 * from the primary channel.
1418 * @IWL_TOF_ENTRY_RANGE_NOT_SUPPORTED: Device doesn't support FTM.
1419 * @IWL_TOF_ENTRY_REQUEST_ABORT_UNKNOWN_REASON: Request aborted due to unknown
1421 * @IWL_TOF_ENTRY_LOCATION_INVALID_T1_T4_TIME_STAMP: Failure due to invalid
1423 * @IWL_TOF_ENTRY_11MC_PROTOCOL_FAILURE: Failure due to invalid FTM frame
1425 * @IWL_TOF_ENTRY_REQUEST_CANNOT_SCHED: Request cannot be scheduled.
1426 * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE: Responder cannot serve the
1427 * initiator for some period, period supplied in @refusal_period.
1428 * @IWL_TOF_ENTRY_BAD_REQUEST_ARGS: Bad request arguments.
1429 * @IWL_TOF_ENTRY_WIFI_NOT_ENABLED: Wifi not enabled.
1430 * @IWL_TOF_ENTRY_RESPONDER_OVERRIDE_PARAMS: Responder override the original
1431 * parameters within the current session.
1433 enum iwl_tof_entry_status {
1434 IWL_TOF_ENTRY_SUCCESS = 0,
1435 IWL_TOF_ENTRY_GENERAL_FAILURE = 1,
1436 IWL_TOF_ENTRY_NO_RESPONSE = 2,
1437 IWL_TOF_ENTRY_REQUEST_REJECTED = 3,
1438 IWL_TOF_ENTRY_NOT_SCHEDULED = 4,
1439 IWL_TOF_ENTRY_TIMING_MEASURE_TIMEOUT = 5,
1440 IWL_TOF_ENTRY_TARGET_DIFF_CH_CANNOT_CHANGE = 6,
1441 IWL_TOF_ENTRY_RANGE_NOT_SUPPORTED = 7,
1442 IWL_TOF_ENTRY_REQUEST_ABORT_UNKNOWN_REASON = 8,
1443 IWL_TOF_ENTRY_LOCATION_INVALID_T1_T4_TIME_STAMP = 9,
1444 IWL_TOF_ENTRY_11MC_PROTOCOL_FAILURE = 10,
1445 IWL_TOF_ENTRY_REQUEST_CANNOT_SCHED = 11,
1446 IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE = 12,
1447 IWL_TOF_ENTRY_BAD_REQUEST_ARGS = 13,
1448 IWL_TOF_ENTRY_WIFI_NOT_ENABLED = 14,
1449 IWL_TOF_ENTRY_RESPONDER_OVERRIDE_PARAMS = 15,
1450 }; /* LOCATION_RANGE_RSP_AP_ENTRY_NTFY_API_S_VER_2 */
1453 * struct iwl_tof_range_rsp_ap_entry_ntfy_v3 - AP parameters (response)
1454 * @bssid: BSSID of the AP
1455 * @measure_status: current APs measurement status, one of
1456 * &enum iwl_tof_entry_status.
1457 * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz
1458 * @rtt: The Round Trip Time that took for the last measurement for
1460 * @rtt_variance: The Variance of the RTT values measured for current AP
1461 * @rtt_spread: The Difference between the maximum and the minimum RTT
1462 * values measured for current AP in the current session [pSec]
1463 * @rssi: RSSI as uploaded in the Channel Estimation notification
1464 * @rssi_spread: The Difference between the maximum and the minimum RSSI values
1465 * measured for current AP in the current session
1466 * @reserved: reserved
1467 * @refusal_period: refusal period in case of
1468 * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]
1469 * @range: Measured range [cm]
1470 * @range_variance: Measured range variance [cm]
1471 * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was
1472 * uploaded by the LMAC
1473 * @t2t3_initiator: as calculated from the algo in the initiator
1474 * @t1t4_responder: as calculated from the algo in the responder
1475 * @common_calib: Calib val that was used in for this AP measurement
1476 * @specific_calib: val that was used in for this AP measurement
1477 * @papd_calib_output: The result of the tof papd calibration that was injected
1478 * into the algorithm.
1480 struct iwl_tof_range_rsp_ap_entry_ntfy_v3 {
1485 __le32 rtt_variance;
1492 __le32 range_variance;
1494 __le32 t2t3_initiator;
1495 __le32 t1t4_responder;
1496 __le16 common_calib;
1497 __le16 specific_calib;
1498 __le32 papd_calib_output;
1499 } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_3 */
1502 * struct iwl_tof_range_rsp_ap_entry_ntfy_v4 - AP parameters (response)
1503 * @bssid: BSSID of the AP
1504 * @measure_status: current APs measurement status, one of
1505 * &enum iwl_tof_entry_status.
1506 * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz
1507 * @rtt: The Round Trip Time that took for the last measurement for
1509 * @rtt_variance: The Variance of the RTT values measured for current AP
1510 * @rtt_spread: The Difference between the maximum and the minimum RTT
1511 * values measured for current AP in the current session [pSec]
1512 * @rssi: RSSI as uploaded in the Channel Estimation notification
1513 * @rssi_spread: The Difference between the maximum and the minimum RSSI values
1514 * measured for current AP in the current session
1515 * @last_burst: 1 if no more FTM sessions are scheduled for this responder
1516 * @refusal_period: refusal period in case of
1517 * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]
1518 * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was
1519 * uploaded by the LMAC
1520 * @start_tsf: measurement start time in TSF of the mac specified in the range
1522 * @rx_rate_n_flags: rate and flags of the last FTM frame received from this
1524 * @tx_rate_n_flags: rate and flags of the last ack sent to this responder
1525 * @t2t3_initiator: as calculated from the algo in the initiator
1526 * @t1t4_responder: as calculated from the algo in the responder
1527 * @common_calib: Calib val that was used in for this AP measurement
1528 * @specific_calib: val that was used in for this AP measurement
1529 * @papd_calib_output: The result of the tof papd calibration that was injected
1530 * into the algorithm.
1532 struct iwl_tof_range_rsp_ap_entry_ntfy_v4 {
1537 __le32 rtt_variance;
1545 __le32 rx_rate_n_flags;
1546 __le32 tx_rate_n_flags;
1547 __le32 t2t3_initiator;
1548 __le32 t1t4_responder;
1549 __le16 common_calib;
1550 __le16 specific_calib;
1551 __le32 papd_calib_output;
1552 } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_4 */
1555 * struct iwl_tof_range_rsp_ap_entry_ntfy_v5 - AP parameters (response)
1556 * @bssid: BSSID of the AP
1557 * @measure_status: current APs measurement status, one of
1558 * &enum iwl_tof_entry_status.
1559 * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz
1560 * @rtt: The Round Trip Time that took for the last measurement for
1562 * @rtt_variance: The Variance of the RTT values measured for current AP
1563 * @rtt_spread: The Difference between the maximum and the minimum RTT
1564 * values measured for current AP in the current session [pSec]
1565 * @rssi: RSSI as uploaded in the Channel Estimation notification
1566 * @rssi_spread: The Difference between the maximum and the minimum RSSI values
1567 * measured for current AP in the current session
1568 * @last_burst: 1 if no more FTM sessions are scheduled for this responder
1569 * @refusal_period: refusal period in case of
1570 * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]
1571 * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was
1572 * uploaded by the LMAC
1573 * @start_tsf: measurement start time in TSF of the mac specified in the range
1575 * @rx_rate_n_flags: rate and flags of the last FTM frame received from this
1577 * @tx_rate_n_flags: rate and flags of the last ack sent to this responder
1578 * @t2t3_initiator: as calculated from the algo in the initiator
1579 * @t1t4_responder: as calculated from the algo in the responder
1580 * @common_calib: Calib val that was used in for this AP measurement
1581 * @specific_calib: val that was used in for this AP measurement
1582 * @papd_calib_output: The result of the tof papd calibration that was injected
1583 * into the algorithm.
1584 * @rttConfidence: a value between 0 - 31 that represents the rtt accuracy.
1585 * @reserved: for alignment
1587 struct iwl_tof_range_rsp_ap_entry_ntfy_v5 {
1592 __le32 rtt_variance;
1600 __le32 rx_rate_n_flags;
1601 __le32 tx_rate_n_flags;
1602 __le32 t2t3_initiator;
1603 __le32 t1t4_responder;
1604 __le16 common_calib;
1605 __le16 specific_calib;
1606 __le32 papd_calib_output;
1609 } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_5 */
1612 * struct iwl_tof_range_rsp_ap_entry_ntfy_v6 - AP parameters (response)
1613 * @bssid: BSSID of the AP
1614 * @measure_status: current APs measurement status, one of
1615 * &enum iwl_tof_entry_status.
1616 * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz
1617 * @rtt: The Round Trip Time that took for the last measurement for
1619 * @rtt_variance: The Variance of the RTT values measured for current AP
1620 * @rtt_spread: The Difference between the maximum and the minimum RTT
1621 * values measured for current AP in the current session [pSec]
1622 * @rssi: RSSI as uploaded in the Channel Estimation notification
1623 * @rssi_spread: The Difference between the maximum and the minimum RSSI values
1624 * measured for current AP in the current session
1625 * @last_burst: 1 if no more FTM sessions are scheduled for this responder
1626 * @refusal_period: refusal period in case of
1627 * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]
1628 * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was
1629 * uploaded by the LMAC
1630 * @start_tsf: measurement start time in TSF of the mac specified in the range
1632 * @rx_rate_n_flags: rate and flags of the last FTM frame received from this
1634 * @tx_rate_n_flags: rate and flags of the last ack sent to this responder
1635 * @t2t3_initiator: as calculated from the algo in the initiator
1636 * @t1t4_responder: as calculated from the algo in the responder
1637 * @common_calib: Calib val that was used in for this AP measurement
1638 * @specific_calib: val that was used in for this AP measurement
1639 * @papd_calib_output: The result of the tof papd calibration that was injected
1640 * into the algorithm.
1641 * @rttConfidence: a value between 0 - 31 that represents the rtt accuracy.
1642 * @reserved: for alignment
1643 * @rx_pn: the last PN used for this responder Rx in case PMF is configured in
1645 * @tx_pn: the last PN used for this responder Tx in case PMF is configured in
1648 struct iwl_tof_range_rsp_ap_entry_ntfy_v6 {
1653 __le32 rtt_variance;
1661 __le32 rx_rate_n_flags;
1662 __le32 tx_rate_n_flags;
1663 __le32 t2t3_initiator;
1664 __le32 t1t4_responder;
1665 __le16 common_calib;
1666 __le16 specific_calib;
1667 __le32 papd_calib_output;
1670 u8 rx_pn[IEEE80211_CCMP_PN_LEN];
1671 u8 tx_pn[IEEE80211_CCMP_PN_LEN];
1672 } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_6,
1673 LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_7 */
1677 * enum iwl_tof_response_status - tof response status
1679 * @IWL_TOF_RESPONSE_SUCCESS: successful range.
1680 * @IWL_TOF_RESPONSE_TIMEOUT: request aborted due to timeout expiration.
1681 * partial result of ranges done so far is included in the response.
1682 * @IWL_TOF_RESPONSE_ABORTED: Measurement aborted by command.
1683 * @IWL_TOF_RESPONSE_FAILED: Measurement request command failed.
1685 enum iwl_tof_response_status {
1686 IWL_TOF_RESPONSE_SUCCESS = 0,
1687 IWL_TOF_RESPONSE_TIMEOUT = 1,
1688 IWL_TOF_RESPONSE_ABORTED = 4,
1689 IWL_TOF_RESPONSE_FAILED = 5,
1690 }; /* LOCATION_RNG_RSP_STATUS */
1693 * struct iwl_tof_range_rsp_ntfy_v5 - ranging response notification
1694 * @request_id: A Token ID of the corresponding Range request
1695 * @request_status: status of current measurement session, one of
1696 * &enum iwl_tof_response_status.
1697 * @last_in_batch: reprot policy (when not all responses are uploaded at once)
1698 * @num_of_aps: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS)
1701 struct iwl_tof_range_rsp_ntfy_v5 {
1706 struct iwl_tof_range_rsp_ap_entry_ntfy_v3 ap[IWL_MVM_TOF_MAX_APS];
1707 } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_5 */
1710 * struct iwl_tof_range_rsp_ntfy_v6 - ranging response notification
1711 * @request_id: A Token ID of the corresponding Range request
1712 * @num_of_aps: Number of APs results
1713 * @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise.
1714 * @reserved: reserved
1717 struct iwl_tof_range_rsp_ntfy_v6 {
1722 struct iwl_tof_range_rsp_ap_entry_ntfy_v4 ap[IWL_MVM_TOF_MAX_APS];
1723 } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_6 */
1726 * struct iwl_tof_range_rsp_ntfy_v7 - ranging response notification
1727 * @request_id: A Token ID of the corresponding Range request
1728 * @num_of_aps: Number of APs results
1729 * @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise.
1730 * @reserved: reserved
1733 struct iwl_tof_range_rsp_ntfy_v7 {
1738 struct iwl_tof_range_rsp_ap_entry_ntfy_v5 ap[IWL_MVM_TOF_MAX_APS];
1739 } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_7 */
1742 * struct iwl_tof_range_rsp_ntfy_v8 - ranging response notification
1743 * @request_id: A Token ID of the corresponding Range request
1744 * @num_of_aps: Number of APs results
1745 * @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise.
1746 * @reserved: reserved
1749 struct iwl_tof_range_rsp_ntfy_v8 {
1754 struct iwl_tof_range_rsp_ap_entry_ntfy_v6 ap[IWL_MVM_TOF_MAX_APS];
1755 } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_8,
1756 LOCATION_RANGE_RSP_NTFY_API_S_VER_9 */
1758 #define IWL_MVM_TOF_MCSI_BUF_SIZE (245)
1760 * struct iwl_tof_mcsi_notif - used for debug
1761 * @token: token ID for the current session
1762 * @role: '0' - initiator, '1' - responder
1763 * @reserved: reserved
1764 * @initiator_bssid: initiator machine
1765 * @responder_bssid: responder machine
1766 * @mcsi_buffer: debug data
1768 struct iwl_tof_mcsi_notif {
1772 u8 initiator_bssid[ETH_ALEN];
1773 u8 responder_bssid[ETH_ALEN];
1774 u8 mcsi_buffer[IWL_MVM_TOF_MCSI_BUF_SIZE * 4];
1778 * struct iwl_tof_range_abort_cmd
1779 * @request_id: corresponds to a range request
1780 * @reserved: reserved
1782 struct iwl_tof_range_abort_cmd {
1787 enum ftm_responder_stats_flags {
1788 FTM_RESP_STAT_NON_ASAP_STARTED = BIT(0),
1789 FTM_RESP_STAT_NON_ASAP_IN_WIN = BIT(1),
1790 FTM_RESP_STAT_NON_ASAP_OUT_WIN = BIT(2),
1791 FTM_RESP_STAT_TRIGGER_DUP = BIT(3),
1792 FTM_RESP_STAT_DUP = BIT(4),
1793 FTM_RESP_STAT_DUP_IN_WIN = BIT(5),
1794 FTM_RESP_STAT_DUP_OUT_WIN = BIT(6),
1795 FTM_RESP_STAT_SCHED_SUCCESS = BIT(7),
1796 FTM_RESP_STAT_ASAP_REQ = BIT(8),
1797 FTM_RESP_STAT_NON_ASAP_REQ = BIT(9),
1798 FTM_RESP_STAT_ASAP_RESP = BIT(10),
1799 FTM_RESP_STAT_NON_ASAP_RESP = BIT(11),
1800 FTM_RESP_STAT_FAIL_INITIATOR_INACTIVE = BIT(12),
1801 FTM_RESP_STAT_FAIL_INITIATOR_OUT_WIN = BIT(13),
1802 FTM_RESP_STAT_FAIL_INITIATOR_RETRY_LIM = BIT(14),
1803 FTM_RESP_STAT_FAIL_NEXT_SERVED = BIT(15),
1804 FTM_RESP_STAT_FAIL_TRIGGER_ERR = BIT(16),
1805 FTM_RESP_STAT_FAIL_GC = BIT(17),
1806 FTM_RESP_STAT_SUCCESS = BIT(18),
1807 FTM_RESP_STAT_INTEL_IE = BIT(19),
1808 FTM_RESP_STAT_INITIATOR_ACTIVE = BIT(20),
1809 FTM_RESP_STAT_MEASUREMENTS_AVAILABLE = BIT(21),
1810 FTM_RESP_STAT_TRIGGER_UNKNOWN = BIT(22),
1811 FTM_RESP_STAT_PROCESS_FAIL = BIT(23),
1812 FTM_RESP_STAT_ACK = BIT(24),
1813 FTM_RESP_STAT_NACK = BIT(25),
1814 FTM_RESP_STAT_INVALID_INITIATOR_ID = BIT(26),
1815 FTM_RESP_STAT_TIMER_MIN_DELTA = BIT(27),
1816 FTM_RESP_STAT_INITIATOR_REMOVED = BIT(28),
1817 FTM_RESP_STAT_INITIATOR_ADDED = BIT(29),
1818 FTM_RESP_STAT_ERR_LIST_FULL = BIT(30),
1819 FTM_RESP_STAT_INITIATOR_SCHED_NOW = BIT(31),
1823 * struct iwl_ftm_responder_stats - FTM responder statistics
1824 * @addr: initiator address
1825 * @success_ftm: number of successful ftm frames
1826 * @ftm_per_burst: num of FTM frames that were received
1827 * @flags: &enum ftm_responder_stats_flags
1828 * @duration: actual duration of FTM
1829 * @allocated_duration: time that was allocated for this FTM session
1830 * @bw: FTM request bandwidth
1831 * @rate: FTM request rate
1832 * @reserved: for alingment and future use
1834 struct iwl_ftm_responder_stats {
1840 __le32 allocated_duration;
1844 } __packed; /* TOF_RESPONDER_STATISTICS_NTFY_S_VER_2 */
1846 #define IWL_CSI_MAX_EXPECTED_CHUNKS 16
1848 #define IWL_CSI_CHUNK_CTL_NUM_MASK_VER_1 0x0003
1849 #define IWL_CSI_CHUNK_CTL_IDX_MASK_VER_1 0x000c
1851 #define IWL_CSI_CHUNK_CTL_NUM_MASK_VER_2 0x00ff
1852 #define IWL_CSI_CHUNK_CTL_IDX_MASK_VER_2 0xff00
1854 struct iwl_csi_chunk_notification {
1860 } __packed; /* CSI_CHUNKS_HDR_NTFY_API_S_VER_1/VER_2 */
1862 #endif /* __iwl_fw_api_location_h__ */