Debian Codegraph @

drivers/net/wireless/intel/iwlwifi/fw/api/location.h

raw
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3 * Copyright (C) 2015-2017 Intel Deutschland GmbH
4 * Copyright (C) 2018-2022 Intel Corporation
5 * Copyright (C) 2024-2025 Intel Corporation
6 */
7 #ifndef __iwl_fw_api_location_h__
8 #define __iwl_fw_api_location_h__
9 #include <linux/ieee80211.h>
10 #include <linux/if_ether.h>
11 #include <linux/types.h>
12 #include <linux/bits.h>
13 #include "rs.h"
14
15 /**
16 * enum iwl_location_subcmd_ids - location group command IDs
17 */
18 enum iwl_location_subcmd_ids {
19 /**
20 * @TOF_RANGE_REQ_CMD: TOF ranging request,
21 * uses one of &struct iwl_tof_range_req_cmd_v5,
22 * &struct iwl_tof_range_req_cmd_v7,
23 * &struct iwl_tof_range_req_cmd_v8,
24 * &struct iwl_tof_range_req_cmd_v9,
25 * &struct iwl_tof_range_req_cmd_v11,
26 * &struct iwl_tof_range_req_cmd_v7
27 */
28 TOF_RANGE_REQ_CMD = 0x0,
29 /**
30 * @TOF_CONFIG_CMD: TOF configuration, uses &struct iwl_tof_config_cmd
31 */
32 TOF_CONFIG_CMD = 0x1,
33 /**
34 * @TOF_RANGE_ABORT_CMD: abort ongoing ranging, uses
35 * &struct iwl_tof_range_abort_cmd
36 */
37 TOF_RANGE_ABORT_CMD = 0x2,
38 /**
39 * @TOF_RANGE_REQ_EXT_CMD: TOF extended ranging config,
40 * uses &struct iwl_tof_range_req_ext_cmd
41 */
42 TOF_RANGE_REQ_EXT_CMD = 0x3,
43 /**
44 * @TOF_RESPONDER_CONFIG_CMD: FTM responder configuration, one of
45 * &struct iwl_tof_responder_config_cmd_v6,
46 * &struct iwl_tof_responder_config_cmd_v7,
47 * &struct iwl_tof_responder_config_cmd_v8 or
48 * &struct iwl_tof_responder_config_cmd_v9
49 */
50 TOF_RESPONDER_CONFIG_CMD = 0x4,
51 /**
52 * @TOF_RESPONDER_DYN_CONFIG_CMD: FTM dynamic configuration,
53 * uses &struct iwl_tof_responder_dyn_config_cmd
54 */
55 TOF_RESPONDER_DYN_CONFIG_CMD = 0x5,
56 /**
57 * @CSI_HEADER_NOTIFICATION: CSI header
58 */
59 CSI_HEADER_NOTIFICATION = 0xFA,
60 /**
61 * @CSI_CHUNKS_NOTIFICATION: CSI chunk,
62 * uses &struct iwl_csi_chunk_notification
63 */
64 CSI_CHUNKS_NOTIFICATION = 0xFB,
65 /**
66 * @TOF_LC_NOTIF: used for LCI/civic location, contains just
67 * the action frame
68 */
69 TOF_LC_NOTIF = 0xFC,
70 /**
71 * @TOF_RESPONDER_STATS: FTM responder statistics notification,
72 * uses &struct iwl_ftm_responder_stats
73 */
74 TOF_RESPONDER_STATS = 0xFD,
75 /**
76 * @TOF_MCSI_DEBUG_NOTIF: MCSI debug notification, uses
77 * &struct iwl_tof_mcsi_notif
78 */
79 TOF_MCSI_DEBUG_NOTIF = 0xFE,
80 /**
81 * @TOF_RANGE_RESPONSE_NOTIF: ranging response, using one of
82 * &struct iwl_tof_range_rsp_ntfy_v5,
83 * &struct iwl_tof_range_rsp_ntfy_v6,
84 * &struct iwl_tof_range_rsp_ntfy_v7 or
85 * &struct iwl_tof_range_rsp_ntfy_v8
86 */
87 TOF_RANGE_RESPONSE_NOTIF = 0xFF,
88 };
89
90 /**
91 * struct iwl_tof_config_cmd - ToF configuration
92 * @tof_disabled: indicates if ToF is disabled (or not)
93 * @one_sided_disabled: indicates if one-sided is disabled (or not)
94 * @is_debug_mode: indiciates if debug mode is active
95 * @is_buf_required: indicates if channel estimation buffer is required
96 */
97 struct iwl_tof_config_cmd {
98 u8 tof_disabled;
99 u8 one_sided_disabled;
100 u8 is_debug_mode;
101 u8 is_buf_required;
102 } __packed;
103
104 /**
105 * enum iwl_tof_bandwidth - values for iwl_tof_range_req_ap_entry.bandwidth
106 * @IWL_TOF_BW_20_LEGACY: 20 MHz non-HT
107 * @IWL_TOF_BW_20_HT: 20 MHz HT
108 * @IWL_TOF_BW_40: 40 MHz
109 * @IWL_TOF_BW_80: 80 MHz
110 * @IWL_TOF_BW_160: 160 MHz
111 * @IWL_TOF_BW_NUM: number of tof bandwidths
112 */
113 enum iwl_tof_bandwidth {
114 IWL_TOF_BW_20_LEGACY,
115 IWL_TOF_BW_20_HT,
116 IWL_TOF_BW_40,
117 IWL_TOF_BW_80,
118 IWL_TOF_BW_160,
119 IWL_TOF_BW_NUM,
120 }; /* LOCAT_BW_TYPE_E */
121
122 /*
123 * enum iwl_tof_algo_type - Algorithym type for range measurement request
124 */
125 enum iwl_tof_algo_type {
126 IWL_TOF_ALGO_TYPE_MAX_LIKE = 0,
127 IWL_TOF_ALGO_TYPE_LINEAR_REG = 1,
128 IWL_TOF_ALGO_TYPE_FFT = 2,
129
130 /* Keep last */
131 IWL_TOF_ALGO_TYPE_INVALID,
132 }; /* ALGO_TYPE_E */
133
134 /*
135 * enum iwl_tof_mcsi_ntfy - Enable/Disable MCSI notifications
136 */
137 enum iwl_tof_mcsi_enable {
138 IWL_TOF_MCSI_DISABLED = 0,
139 IWL_TOF_MCSI_ENABLED = 1,
140 }; /* MCSI_ENABLE_E */
141
142 /**
143 * enum iwl_tof_responder_cmd_valid_field - valid fields in the responder cfg
144 * @IWL_TOF_RESPONDER_CMD_VALID_CHAN_INFO: channel info is valid
145 * @IWL_TOF_RESPONDER_CMD_VALID_TOA_OFFSET: ToA offset is valid
146 * @IWL_TOF_RESPONDER_CMD_VALID_COMMON_CALIB: common calibration mode is valid
147 * @IWL_TOF_RESPONDER_CMD_VALID_SPECIFIC_CALIB: spefici calibration mode is
148 * valid
149 * @IWL_TOF_RESPONDER_CMD_VALID_BSSID: BSSID is valid
150 * @IWL_TOF_RESPONDER_CMD_VALID_TX_ANT: TX antenna is valid
151 * @IWL_TOF_RESPONDER_CMD_VALID_ALGO_TYPE: algorithm type is valid
152 * @IWL_TOF_RESPONDER_CMD_VALID_NON_ASAP_SUPPORT: non-ASAP support is valid
153 * @IWL_TOF_RESPONDER_CMD_VALID_STATISTICS_REPORT_SUPPORT: statistics report
154 * support is valid
155 * @IWL_TOF_RESPONDER_CMD_VALID_MCSI_NOTIF_SUPPORT: MCSI notification support
156 * is valid
157 * @IWL_TOF_RESPONDER_CMD_VALID_FAST_ALGO_SUPPORT: fast algorithm support
158 * is valid
159 * @IWL_TOF_RESPONDER_CMD_VALID_RETRY_ON_ALGO_FAIL: retry on algorithm failure
160 * is valid
161 * @IWL_TOF_RESPONDER_CMD_VALID_STA_ID: station ID is valid
162 * @IWL_TOF_RESPONDER_CMD_VALID_NDP_SUPPORT: enable/disable NDP ranging support
163 * is valid
164 * @IWL_TOF_RESPONDER_CMD_VALID_NDP_PARAMS: NDP parameters are valid
165 * @IWL_TOF_RESPONDER_CMD_VALID_LMR_FEEDBACK: LMR feedback support is valid
166 * @IWL_TOF_RESPONDER_CMD_VALID_SESSION_ID: session id flag is valid
167 * @IWL_TOF_RESPONDER_CMD_VALID_BSS_COLOR: the bss_color field is valid
168 * @IWL_TOF_RESPONDER_CMD_VALID_MIN_MAX_TIME_BETWEEN_MSR: the
169 * min_time_between_msr and max_time_between_msr fields are valid
170 */
171 enum iwl_tof_responder_cmd_valid_field {
172 IWL_TOF_RESPONDER_CMD_VALID_CHAN_INFO = BIT(0),
173 IWL_TOF_RESPONDER_CMD_VALID_TOA_OFFSET = BIT(1),
174 IWL_TOF_RESPONDER_CMD_VALID_COMMON_CALIB = BIT(2),
175 IWL_TOF_RESPONDER_CMD_VALID_SPECIFIC_CALIB = BIT(3),
176 IWL_TOF_RESPONDER_CMD_VALID_BSSID = BIT(4),
177 IWL_TOF_RESPONDER_CMD_VALID_TX_ANT = BIT(5),
178 IWL_TOF_RESPONDER_CMD_VALID_ALGO_TYPE = BIT(6),
179 IWL_TOF_RESPONDER_CMD_VALID_NON_ASAP_SUPPORT = BIT(7),
180 IWL_TOF_RESPONDER_CMD_VALID_STATISTICS_REPORT_SUPPORT = BIT(8),
181 IWL_TOF_RESPONDER_CMD_VALID_MCSI_NOTIF_SUPPORT = BIT(9),
182 IWL_TOF_RESPONDER_CMD_VALID_FAST_ALGO_SUPPORT = BIT(10),
183 IWL_TOF_RESPONDER_CMD_VALID_RETRY_ON_ALGO_FAIL = BIT(11),
184 IWL_TOF_RESPONDER_CMD_VALID_STA_ID = BIT(12),
185 IWL_TOF_RESPONDER_CMD_VALID_NDP_SUPPORT = BIT(22),
186 IWL_TOF_RESPONDER_CMD_VALID_NDP_PARAMS = BIT(23),
187 IWL_TOF_RESPONDER_CMD_VALID_LMR_FEEDBACK = BIT(24),
188 IWL_TOF_RESPONDER_CMD_VALID_SESSION_ID = BIT(25),
189 IWL_TOF_RESPONDER_CMD_VALID_BSS_COLOR = BIT(26),
190 IWL_TOF_RESPONDER_CMD_VALID_MIN_MAX_TIME_BETWEEN_MSR = BIT(27),
191 };
192
193 /**
194 * enum iwl_tof_responder_cfg_flags - responder configuration flags
195 * @IWL_TOF_RESPONDER_FLAGS_NON_ASAP_SUPPORT: non-ASAP support
196 * @IWL_TOF_RESPONDER_FLAGS_REPORT_STATISTICS: report statistics
197 * @IWL_TOF_RESPONDER_FLAGS_REPORT_MCSI: report MCSI
198 * @IWL_TOF_RESPONDER_FLAGS_ALGO_TYPE: algorithm type
199 * @IWL_TOF_RESPONDER_FLAGS_TOA_OFFSET_MODE: ToA offset mode
200 * @IWL_TOF_RESPONDER_FLAGS_COMMON_CALIB_MODE: common calibration mode
201 * @IWL_TOF_RESPONDER_FLAGS_SPECIFIC_CALIB_MODE: specific calibration mode
202 * @IWL_TOF_RESPONDER_FLAGS_FAST_ALGO_SUPPORT: fast algorithm support
203 * @IWL_TOF_RESPONDER_FLAGS_RETRY_ON_ALGO_FAIL: retry on algorithm fail
204 * @IWL_TOF_RESPONDER_FLAGS_FTM_TX_ANT: TX antenna mask
205 * @IWL_TOF_RESPONDER_FLAGS_NDP_SUPPORT: support NDP ranging
206 * @IWL_TOF_RESPONDER_FLAGS_LMR_FEEDBACK: request for LMR feedback if the
207 * initiator supports it
208 * @IWL_TOF_RESPONDER_FLAGS_SESSION_ID: send the session id in the initial FTM
209 * frame.
210 */
211 enum iwl_tof_responder_cfg_flags {
212 IWL_TOF_RESPONDER_FLAGS_NON_ASAP_SUPPORT = BIT(0),
213 IWL_TOF_RESPONDER_FLAGS_REPORT_STATISTICS = BIT(1),
214 IWL_TOF_RESPONDER_FLAGS_REPORT_MCSI = BIT(2),
215 IWL_TOF_RESPONDER_FLAGS_ALGO_TYPE = BIT(3) | BIT(4) | BIT(5),
216 IWL_TOF_RESPONDER_FLAGS_TOA_OFFSET_MODE = BIT(6),
217 IWL_TOF_RESPONDER_FLAGS_COMMON_CALIB_MODE = BIT(7),
218 IWL_TOF_RESPONDER_FLAGS_SPECIFIC_CALIB_MODE = BIT(8),
219 IWL_TOF_RESPONDER_FLAGS_FAST_ALGO_SUPPORT = BIT(9),
220 IWL_TOF_RESPONDER_FLAGS_RETRY_ON_ALGO_FAIL = BIT(10),
221 IWL_TOF_RESPONDER_FLAGS_FTM_TX_ANT = RATE_MCS_ANT_AB_MSK,
222 IWL_TOF_RESPONDER_FLAGS_NDP_SUPPORT = BIT(24),
223 IWL_TOF_RESPONDER_FLAGS_LMR_FEEDBACK = BIT(25),
224 IWL_TOF_RESPONDER_FLAGS_SESSION_ID = BIT(27),
225 };
226
227 /**
228 * struct iwl_tof_responder_config_cmd_v6 - ToF AP mode (for debug)
229 * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field
230 * @responder_cfg_flags: &iwl_tof_responder_cfg_flags
231 * @bandwidth: current AP Bandwidth: &enum iwl_tof_bandwidth
232 * @rate: current AP rate
233 * @channel_num: current AP Channel
234 * @ctrl_ch_position: coding of the control channel position relative to
235 * the center frequency, see iwl_mvm_get_ctrl_pos()
236 * @sta_id: index of the AP STA when in AP mode
237 * @reserved1: reserved
238 * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug
239 * purposes, simulating station movement by adding various values
240 * to this field
241 * @common_calib: XVT: common calibration value
242 * @specific_calib: XVT: specific calibration value
243 * @bssid: Current AP BSSID
244 * @reserved2: reserved
245 */
246 struct iwl_tof_responder_config_cmd_v6 {
247 __le32 cmd_valid_fields;
248 __le32 responder_cfg_flags;
249 u8 bandwidth;
250 u8 rate;
251 u8 channel_num;
252 u8 ctrl_ch_position;
253 u8 sta_id;
254 u8 reserved1;
255 __le16 toa_offset;
256 __le16 common_calib;
257 __le16 specific_calib;
258 u8 bssid[ETH_ALEN];
259 __le16 reserved2;
260 } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_6 */
261
262 /**
263 * struct iwl_tof_responder_config_cmd_v7 - ToF AP mode (for debug)
264 * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field
265 * @responder_cfg_flags: &iwl_tof_responder_cfg_flags
266 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
267 * bits 4 - 7: &enum iwl_location_bw.
268 * @rate: current AP rate
269 * @channel_num: current AP Channel
270 * @ctrl_ch_position: coding of the control channel position relative to
271 * the center frequency, see iwl_mvm_get_ctrl_pos()
272 * @sta_id: index of the AP STA when in AP mode
273 * @reserved1: reserved
274 * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug
275 * purposes, simulating station movement by adding various values
276 * to this field
277 * @common_calib: XVT: common calibration value
278 * @specific_calib: XVT: specific calibration value
279 * @bssid: Current AP BSSID
280 * @reserved2: reserved
281 */
282 struct iwl_tof_responder_config_cmd_v7 {
283 __le32 cmd_valid_fields;
284 __le32 responder_cfg_flags;
285 u8 format_bw;
286 u8 rate;
287 u8 channel_num;
288 u8 ctrl_ch_position;
289 u8 sta_id;
290 u8 reserved1;
291 __le16 toa_offset;
292 __le16 common_calib;
293 __le16 specific_calib;
294 u8 bssid[ETH_ALEN];
295 __le16 reserved2;
296 } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_7 */
297
298 #define IWL_RESPONDER_STS_POS 3
299 #define IWL_RESPONDER_TOTAL_LTF_POS 6
300
301 /**
302 * struct iwl_tof_responder_config_cmd_v8 - ToF AP mode (for debug)
303 * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field
304 * @responder_cfg_flags: &iwl_tof_responder_cfg_flags
305 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
306 * bits 4 - 7: &enum iwl_location_bw.
307 * @rate: current AP rate
308 * @channel_num: current AP Channel
309 * @ctrl_ch_position: coding of the control channel position relative to
310 * the center frequency, see iwl_mvm_get_ctrl_pos()
311 * @sta_id: index of the AP STA when in AP mode
312 * @reserved1: reserved
313 * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug
314 * purposes, simulating station movement by adding various values
315 * to this field
316 * @common_calib: XVT: common calibration value
317 * @specific_calib: XVT: specific calibration value
318 * @bssid: Current AP BSSID
319 * @r2i_ndp_params: parameters for R2I NDP.
320 * bits 0 - 2: max number of LTF repetitions
321 * bits 3 - 5: max number of spatial streams (supported values are < 2)
322 * bits 6 - 7: max number of total LTFs see
323 * &enum ieee80211_range_params_max_total_ltf
324 * @i2r_ndp_params: parameters for I2R NDP.
325 * bits 0 - 2: max number of LTF repetitions
326 * bits 3 - 5: max number of spatial streams
327 * bits 6 - 7: max number of total LTFs see
328 * &enum ieee80211_range_params_max_total_ltf
329 */
330 struct iwl_tof_responder_config_cmd_v8 {
331 __le32 cmd_valid_fields;
332 __le32 responder_cfg_flags;
333 u8 format_bw;
334 u8 rate;
335 u8 channel_num;
336 u8 ctrl_ch_position;
337 u8 sta_id;
338 u8 reserved1;
339 __le16 toa_offset;
340 __le16 common_calib;
341 __le16 specific_calib;
342 u8 bssid[ETH_ALEN];
343 u8 r2i_ndp_params;
344 u8 i2r_ndp_params;
345 } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_8 */
346
347 /**
348 * struct iwl_tof_responder_config_cmd_v9 - ToF AP mode (for debug)
349 * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field
350 * @responder_cfg_flags: &iwl_tof_responder_cfg_flags
351 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
352 * bits 4 - 7: &enum iwl_location_bw.
353 * @bss_color: current AP bss_color
354 * @channel_num: current AP Channel
355 * @ctrl_ch_position: coding of the control channel position relative to
356 * the center frequency, see iwl_mvm_get_ctrl_pos()
357 * @sta_id: index of the AP STA when in AP mode
358 * @reserved1: reserved
359 * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug
360 * purposes, simulating station movement by adding various values
361 * to this field
362 * @common_calib: XVT: common calibration value
363 * @specific_calib: XVT: specific calibration value
364 * @bssid: Current AP BSSID
365 * @r2i_ndp_params: parameters for R2I NDP.
366 * bits 0 - 2: max number of LTF repetitions
367 * bits 3 - 5: max number of spatial streams (supported values are < 2)
368 * bits 6 - 7: max number of total LTFs see
369 * &enum ieee80211_range_params_max_total_ltf
370 * @i2r_ndp_params: parameters for I2R NDP.
371 * bits 0 - 2: max number of LTF repetitions
372 * bits 3 - 5: max number of spatial streams
373 * bits 6 - 7: max number of total LTFs see
374 * &enum ieee80211_range_params_max_total_ltf
375 * @min_time_between_msr: for non trigger based NDP ranging, minimum time
376 * between measurements in milliseconds.
377 * @max_time_between_msr: for non trigger based NDP ranging, maximum time
378 * between measurements in milliseconds.
379 */
380 struct iwl_tof_responder_config_cmd_v9 {
381 __le32 cmd_valid_fields;
382 __le32 responder_cfg_flags;
383 u8 format_bw;
384 u8 bss_color;
385 u8 channel_num;
386 u8 ctrl_ch_position;
387 u8 sta_id;
388 u8 reserved1;
389 __le16 toa_offset;
390 __le16 common_calib;
391 __le16 specific_calib;
392 u8 bssid[ETH_ALEN];
393 u8 r2i_ndp_params;
394 u8 i2r_ndp_params;
395 __le16 min_time_between_msr;
396 __le16 max_time_between_msr;
397 } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_8 */
398
399 /**
400 * struct iwl_tof_responder_config_cmd - ToF AP mode
401 * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field
402 * @responder_cfg_flags: &iwl_tof_responder_cfg_flags
403 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
404 * bits 4 - 7: &enum iwl_location_bw.
405 * @bss_color: current AP bss_color
406 * @channel_num: current AP Channel
407 * @ctrl_ch_position: coding of the control channel position relative to
408 * the center frequency, see iwl_mvm_get_ctrl_pos()
409 * @sta_id: index of the AP STA when in AP mode
410 * @band: current AP band
411 * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug
412 * purposes, simulating station movement by adding various values
413 * to this field
414 * @common_calib: XVT: common calibration value
415 * @specific_calib: XVT: specific calibration value
416 * @bssid: Current AP BSSID
417 * @r2i_ndp_params: parameters for R2I NDP.
418 * bits 0 - 2: max number of LTF repetitions
419 * bits 3 - 5: max number of spatial streams (supported values are < 2)
420 * bits 6 - 7: max number of total LTFs see
421 * &enum ieee80211_range_params_max_total_ltf
422 * @i2r_ndp_params: parameters for I2R NDP.
423 * bits 0 - 2: max number of LTF repetitions
424 * bits 3 - 5: max number of spatial streams
425 * bits 6 - 7: max number of total LTFs see
426 * &enum ieee80211_range_params_max_total_ltf
427 * @min_time_between_msr: for non trigger based NDP ranging, minimum time
428 * between measurements in milliseconds.
429 * @max_time_between_msr: for non trigger based NDP ranging, maximum time
430 * between measurements in milliseconds.
431 */
432 struct iwl_tof_responder_config_cmd {
433 __le32 cmd_valid_fields;
434 __le32 responder_cfg_flags;
435 u8 format_bw;
436 u8 bss_color;
437 u8 channel_num;
438 u8 ctrl_ch_position;
439 u8 sta_id;
440 u8 band;
441 __le16 toa_offset;
442 __le16 common_calib;
443 __le16 specific_calib;
444 u8 bssid[ETH_ALEN];
445 u8 r2i_ndp_params;
446 u8 i2r_ndp_params;
447 __le16 min_time_between_msr;
448 __le16 max_time_between_msr;
449 } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_10 */
450
451 #define IWL_LCI_CIVIC_IE_MAX_SIZE 400
452
453 /**
454 * struct iwl_tof_responder_dyn_config_cmd_v2 - Dynamic responder settings
455 * @lci_len: The length of the 1st (LCI) part in the @lci_civic buffer
456 * @civic_len: The length of the 2nd (CIVIC) part in the @lci_civic buffer
457 * @lci_civic: The LCI/CIVIC buffer. LCI data (if exists) comes first, then, if
458 * needed, 0-padding such that the next part is dword-aligned, then CIVIC
459 * data (if exists) follows, and then 0-padding again to complete a
460 * 4-multiple long buffer.
461 */
462 struct iwl_tof_responder_dyn_config_cmd_v2 {
463 __le32 lci_len;
464 __le32 civic_len;
465 u8 lci_civic[];
466 } __packed; /* TOF_RESPONDER_DYN_CONFIG_CMD_API_S_VER_2 */
467
468 #define IWL_LCI_MAX_SIZE 160
469 #define IWL_CIVIC_MAX_SIZE 160
470 #define HLTK_11AZ_LEN 32
471
472 /**
473 * enum iwl_responder_dyn_cfg_valid_flags - valid flags for dyn_config_cmd
474 * @IWL_RESPONDER_DYN_CFG_VALID_LCI: LCI data is valid
475 * @IWL_RESPONDER_DYN_CFG_VALID_CIVIC: Civic data is valid
476 * @IWL_RESPONDER_DYN_CFG_VALID_PASN_STA: the pasn_addr, HLTK and cipher fields
477 * are valid.
478 */
479 enum iwl_responder_dyn_cfg_valid_flags {
480 IWL_RESPONDER_DYN_CFG_VALID_LCI = BIT(0),
481 IWL_RESPONDER_DYN_CFG_VALID_CIVIC = BIT(1),
482 IWL_RESPONDER_DYN_CFG_VALID_PASN_STA = BIT(2),
483 };
484
485 /**
486 * struct iwl_tof_responder_dyn_config_cmd - Dynamic responder settings
487 * @cipher: The negotiated cipher. see &enum iwl_location_cipher.
488 * @valid_flags: flags indicating which fields in the command are valid. see
489 * &enum iwl_responder_dyn_cfg_valid_flags.
490 * @lci_len: length of the LCI data in bytes
491 * @civic_len: length of the Civic data in bytes
492 * @lci_buf: the LCI buffer
493 * @civic_buf: the Civic buffer
494 * @hltk_buf: HLTK for secure LTF bits generation for the specified station
495 * @addr: mac address of the station for which to use the HLTK
496 * @reserved: for alignment
497 */
498 struct iwl_tof_responder_dyn_config_cmd {
499 u8 cipher;
500 u8 valid_flags;
501 u8 lci_len;
502 u8 civic_len;
503 u8 lci_buf[IWL_LCI_MAX_SIZE];
504 u8 civic_buf[IWL_LCI_MAX_SIZE];
505 u8 hltk_buf[HLTK_11AZ_LEN];
506 u8 addr[ETH_ALEN];
507 u8 reserved[2];
508 } __packed; /* TOF_RESPONDER_DYN_CONFIG_CMD_API_S_VER_3 */
509
510 /**
511 * struct iwl_tof_range_req_ext_cmd - extended range req for WLS
512 * @tsf_timer_offset_msec: the recommended time offset (mSec) from the AP's TSF
513 * @reserved: reserved
514 * @min_delta_ftm: Minimal time between two consecutive measurements,
515 * in units of 100us. 0 means no preference by station
516 * @ftm_format_and_bw20M: FTM Channel Spacing/Format for 20MHz: recommended
517 * value be sent to the AP
518 * @ftm_format_and_bw40M: FTM Channel Spacing/Format for 40MHz: recommended
519 * value to be sent to the AP
520 * @ftm_format_and_bw80M: FTM Channel Spacing/Format for 80MHz: recommended
521 * value to be sent to the AP
522 */
523 struct iwl_tof_range_req_ext_cmd {
524 __le16 tsf_timer_offset_msec;
525 __le16 reserved;
526 u8 min_delta_ftm;
527 u8 ftm_format_and_bw20M;
528 u8 ftm_format_and_bw40M;
529 u8 ftm_format_and_bw80M;
530 } __packed;
531
532 /**
533 * enum iwl_tof_location_query - values for query bitmap
534 * @IWL_TOF_LOC_LCI: query LCI
535 * @IWL_TOF_LOC_CIVIC: query civic
536 */
537 enum iwl_tof_location_query {
538 IWL_TOF_LOC_LCI = 0x01,
539 IWL_TOF_LOC_CIVIC = 0x02,
540 };
541
542 /**
543 * struct iwl_tof_range_req_ap_entry_v2 - AP configuration parameters
544 * @channel_num: Current AP Channel
545 * @bandwidth: Current AP Bandwidth. One of iwl_tof_bandwidth.
546 * @tsf_delta_direction: TSF relatively to the subject AP
547 * @ctrl_ch_position: Coding of the control channel position relative to the
548 * center frequency, see iwl_mvm_get_ctrl_pos().
549 * @bssid: AP's BSSID
550 * @measure_type: Measurement type: 0 - two sided, 1 - One sided
551 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of the
552 * number of measurement iterations (min 2^0 = 1, max 2^14)
553 * @burst_period: Recommended value to be sent to the AP. Measurement
554 * periodicity In units of 100ms. ignored if num_of_bursts = 0
555 * @samples_per_burst: 2-sided: the number of FTMs pairs in single Burst (1-31);
556 * 1-sided: how many rts/cts pairs should be used per burst.
557 * @retries_per_sample: Max number of retries that the LMAC should send
558 * in case of no replies by the AP.
559 * @tsf_delta: TSF Delta in units of microseconds.
560 * The difference between the AP TSF and the device local clock.
561 * @location_req: Location Request Bit[0] LCI should be sent in the FTMR;
562 * Bit[1] Civic should be sent in the FTMR
563 * @asap_mode: 0 - non asap mode, 1 - asap mode (not relevant for one sided)
564 * @enable_dyn_ack: Enable Dynamic ACK BW.
565 * 0: Initiator interact with regular AP;
566 * 1: Initiator interact with Responder machine: need to send the
567 * Initiator Acks with HT 40MHz / 80MHz, since the Responder should
568 * use it for its ch est measurement (this flag will be set when we
569 * configure the opposite machine to be Responder).
570 * @rssi: Last received value
571 * legal values: -128-0 (0x7f). above 0x0 indicating an invalid value.
572 * @algo_type: &enum iwl_tof_algo_type
573 * @notify_mcsi: &enum iwl_tof_mcsi_ntfy.
574 * @reserved: For alignment and future use
575 */
576 struct iwl_tof_range_req_ap_entry_v2 {
577 u8 channel_num;
578 u8 bandwidth;
579 u8 tsf_delta_direction;
580 u8 ctrl_ch_position;
581 u8 bssid[ETH_ALEN];
582 u8 measure_type;
583 u8 num_of_bursts;
584 __le16 burst_period;
585 u8 samples_per_burst;
586 u8 retries_per_sample;
587 __le32 tsf_delta;
588 u8 location_req;
589 u8 asap_mode;
590 u8 enable_dyn_ack;
591 s8 rssi;
592 u8 algo_type;
593 u8 notify_mcsi;
594 __le16 reserved;
595 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_2 */
596
597 /**
598 * enum iwl_initiator_ap_flags - per responder FTM configuration flags
599 * @IWL_INITIATOR_AP_FLAGS_ASAP: Request for ASAP measurement.
600 * @IWL_INITIATOR_AP_FLAGS_LCI_REQUEST: Request for LCI information
601 * @IWL_INITIATOR_AP_FLAGS_CIVIC_REQUEST: Request for CIVIC information
602 * @IWL_INITIATOR_AP_FLAGS_DYN_ACK: Send HT/VHT ack for FTM frames. If not set,
603 * 20Mhz dup acks will be sent.
604 * @IWL_INITIATOR_AP_FLAGS_ALGO_LR: Use LR algo type for rtt calculation.
605 * Default algo type is ML.
606 * @IWL_INITIATOR_AP_FLAGS_ALGO_FFT: Use FFT algo type for rtt calculation.
607 * Default algo type is ML.
608 * @IWL_INITIATOR_AP_FLAGS_MCSI_REPORT: Send the MCSI for each FTM frame to the
609 * driver.
610 * @IWL_INITIATOR_AP_FLAGS_NON_TB: Use non trigger based flow
611 * @IWL_INITIATOR_AP_FLAGS_TB: Use trigger based flow
612 * @IWL_INITIATOR_AP_FLAGS_SECURED: request secure LTF measurement
613 * @IWL_INITIATOR_AP_FLAGS_LMR_FEEDBACK: Send LMR feedback
614 * @IWL_INITIATOR_AP_FLAGS_USE_CALIB: Use calibration values from the request
615 * instead of fw internal values.
616 * @IWL_INITIATOR_AP_FLAGS_PMF: request to protect the negotiation and LMR
617 * frames with protected management frames.
618 * @IWL_INITIATOR_AP_FLAGS_TERMINATE_ON_LMR_FEEDBACK: terminate the session if
619 * the responder asked for LMR feedback although the initiator did not set
620 * the LMR feedback bit in the FTM request. If not set, the initiator will
621 * continue with the session and will provide the LMR feedback.
622 * @IWL_INITIATOR_AP_FLAGS_TEST_INCORRECT_SAC: send an incorrect SAC in the
623 * first NDP exchange. This is used for testing.
624 * @IWL_INITIATOR_AP_FLAGS_TEST_BAD_SLTF: use incorrect secure LTF tx key. This
625 * is used for testing. Only supported from version 15 of the range request
626 * command.
627 */
628 enum iwl_initiator_ap_flags {
629 IWL_INITIATOR_AP_FLAGS_ASAP = BIT(1),
630 IWL_INITIATOR_AP_FLAGS_LCI_REQUEST = BIT(2),
631 IWL_INITIATOR_AP_FLAGS_CIVIC_REQUEST = BIT(3),
632 IWL_INITIATOR_AP_FLAGS_DYN_ACK = BIT(4),
633 IWL_INITIATOR_AP_FLAGS_ALGO_LR = BIT(5),
634 IWL_INITIATOR_AP_FLAGS_ALGO_FFT = BIT(6),
635 IWL_INITIATOR_AP_FLAGS_MCSI_REPORT = BIT(8),
636 IWL_INITIATOR_AP_FLAGS_NON_TB = BIT(9),
637 IWL_INITIATOR_AP_FLAGS_TB = BIT(10),
638 IWL_INITIATOR_AP_FLAGS_SECURED = BIT(11),
639 IWL_INITIATOR_AP_FLAGS_LMR_FEEDBACK = BIT(12),
640 IWL_INITIATOR_AP_FLAGS_USE_CALIB = BIT(13),
641 IWL_INITIATOR_AP_FLAGS_PMF = BIT(14),
642 IWL_INITIATOR_AP_FLAGS_TERMINATE_ON_LMR_FEEDBACK = BIT(15),
643 IWL_INITIATOR_AP_FLAGS_TEST_INCORRECT_SAC = BIT(16),
644 IWL_INITIATOR_AP_FLAGS_TEST_BAD_SLTF = BIT(17),
645 };
646
647 /**
648 * struct iwl_tof_range_req_ap_entry_v3 - AP configuration parameters
649 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
650 * @channel_num: AP Channel number
651 * @bandwidth: AP bandwidth. One of iwl_tof_bandwidth.
652 * @ctrl_ch_position: Coding of the control channel position relative to the
653 * center frequency, see iwl_mvm_get_ctrl_pos().
654 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
655 * reply from the AP.
656 * @bssid: AP's BSSID
657 * @burst_period: Recommended value to be sent to the AP. Measurement
658 * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0
659 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
660 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
661 * the number of measurement iterations (min 2^0 = 1, max 2^14)
662 * @reserved: For alignment and future use
663 * @tsf_delta: not in use
664 */
665 struct iwl_tof_range_req_ap_entry_v3 {
666 __le32 initiator_ap_flags;
667 u8 channel_num;
668 u8 bandwidth;
669 u8 ctrl_ch_position;
670 u8 ftmr_max_retries;
671 u8 bssid[ETH_ALEN];
672 __le16 burst_period;
673 u8 samples_per_burst;
674 u8 num_of_bursts;
675 __le16 reserved;
676 __le32 tsf_delta;
677 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_3 */
678
679 /**
680 * enum iwl_location_frame_format - location frame formats
681 * @IWL_LOCATION_FRAME_FORMAT_LEGACY: legacy
682 * @IWL_LOCATION_FRAME_FORMAT_HT: HT
683 * @IWL_LOCATION_FRAME_FORMAT_VHT: VHT
684 * @IWL_LOCATION_FRAME_FORMAT_HE: HE
685 */
686 enum iwl_location_frame_format {
687 IWL_LOCATION_FRAME_FORMAT_LEGACY,
688 IWL_LOCATION_FRAME_FORMAT_HT,
689 IWL_LOCATION_FRAME_FORMAT_VHT,
690 IWL_LOCATION_FRAME_FORMAT_HE,
691 };
692
693 /**
694 * enum iwl_location_bw - location bandwidth selection
695 * @IWL_LOCATION_BW_20MHZ: 20MHz
696 * @IWL_LOCATION_BW_40MHZ: 40MHz
697 * @IWL_LOCATION_BW_80MHZ: 80MHz
698 * @IWL_LOCATION_BW_160MHZ: 160MHz
699 */
700 enum iwl_location_bw {
701 IWL_LOCATION_BW_20MHZ,
702 IWL_LOCATION_BW_40MHZ,
703 IWL_LOCATION_BW_80MHZ,
704 IWL_LOCATION_BW_160MHZ,
705 };
706
707 #define TK_11AZ_LEN 32
708
709 #define LOCATION_BW_POS 4
710
711 /**
712 * struct iwl_tof_range_req_ap_entry_v4 - AP configuration parameters
713 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
714 * @channel_num: AP Channel number
715 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
716 * bits 4 - 7: &enum iwl_location_bw.
717 * @ctrl_ch_position: Coding of the control channel position relative to the
718 * center frequency, see iwl_mvm_get_ctrl_pos().
719 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
720 * reply from the AP.
721 * @bssid: AP's BSSID
722 * @burst_period: Recommended value to be sent to the AP. Measurement
723 * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0
724 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
725 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
726 * the number of measurement iterations (min 2^0 = 1, max 2^14)
727 * @reserved: For alignment and future use
728 * @hltk: HLTK to be used for secured 11az measurement
729 * @tk: TK to be used for secured 11az measurement
730 */
731 struct iwl_tof_range_req_ap_entry_v4 {
732 __le32 initiator_ap_flags;
733 u8 channel_num;
734 u8 format_bw;
735 u8 ctrl_ch_position;
736 u8 ftmr_max_retries;
737 u8 bssid[ETH_ALEN];
738 __le16 burst_period;
739 u8 samples_per_burst;
740 u8 num_of_bursts;
741 __le16 reserved;
742 u8 hltk[HLTK_11AZ_LEN];
743 u8 tk[TK_11AZ_LEN];
744 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_4 */
745
746 /**
747 * enum iwl_location_cipher - location cipher selection
748 * @IWL_LOCATION_CIPHER_CCMP_128: CCMP 128
749 * @IWL_LOCATION_CIPHER_GCMP_128: GCMP 128
750 * @IWL_LOCATION_CIPHER_GCMP_256: GCMP 256
751 * @IWL_LOCATION_CIPHER_INVALID: security is not used.
752 * @IWL_LOCATION_CIPHER_MAX: maximum value for this enum.
753 */
754 enum iwl_location_cipher {
755 IWL_LOCATION_CIPHER_CCMP_128,
756 IWL_LOCATION_CIPHER_GCMP_128,
757 IWL_LOCATION_CIPHER_GCMP_256,
758 IWL_LOCATION_CIPHER_INVALID,
759 IWL_LOCATION_CIPHER_MAX,
760 };
761
762 /**
763 * struct iwl_tof_range_req_ap_entry_v6 - AP configuration parameters
764 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
765 * @channel_num: AP Channel number
766 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
767 * bits 4 - 7: &enum iwl_location_bw.
768 * @ctrl_ch_position: Coding of the control channel position relative to the
769 * center frequency, see iwl_mvm_get_ctrl_pos().
770 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
771 * reply from the AP.
772 * @bssid: AP's BSSID
773 * @burst_period: Recommended value to be sent to the AP. Measurement
774 * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0
775 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
776 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
777 * the number of measurement iterations (min 2^0 = 1, max 2^14)
778 * @sta_id: the station id of the AP. Only relevant when associated to the AP,
779 * otherwise should be set to &IWL_INVALID_STA.
780 * @cipher: pairwise cipher suite for secured measurement.
781 * &enum iwl_location_cipher.
782 * @hltk: HLTK to be used for secured 11az measurement
783 * @tk: TK to be used for secured 11az measurement
784 * @calib: An array of calibration values per FTM rx bandwidth.
785 * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the
786 * calibration value that corresponds to the rx bandwidth of the FTM
787 * frame.
788 * @beacon_interval: beacon interval of the AP in TUs. Only required if
789 * &IWL_INITIATOR_AP_FLAGS_TB is set.
790 */
791 struct iwl_tof_range_req_ap_entry_v6 {
792 __le32 initiator_ap_flags;
793 u8 channel_num;
794 u8 format_bw;
795 u8 ctrl_ch_position;
796 u8 ftmr_max_retries;
797 u8 bssid[ETH_ALEN];
798 __le16 burst_period;
799 u8 samples_per_burst;
800 u8 num_of_bursts;
801 u8 sta_id;
802 u8 cipher;
803 u8 hltk[HLTK_11AZ_LEN];
804 u8 tk[TK_11AZ_LEN];
805 __le16 calib[IWL_TOF_BW_NUM];
806 __le16 beacon_interval;
807 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_6 */
808
809 /**
810 * struct iwl_tof_range_req_ap_entry_v7 - AP configuration parameters
811 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
812 * @channel_num: AP Channel number
813 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
814 * bits 4 - 7: &enum iwl_location_bw.
815 * @ctrl_ch_position: Coding of the control channel position relative to the
816 * center frequency, see iwl_mvm_get_ctrl_pos().
817 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
818 * reply from the AP.
819 * @bssid: AP's BSSID
820 * @burst_period: Recommended value to be sent to the AP. Measurement
821 * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0
822 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
823 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
824 * the number of measurement iterations (min 2^0 = 1, max 2^14)
825 * @sta_id: the station id of the AP. Only relevant when associated to the AP,
826 * otherwise should be set to &IWL_INVALID_STA.
827 * @cipher: pairwise cipher suite for secured measurement.
828 * &enum iwl_location_cipher.
829 * @hltk: HLTK to be used for secured 11az measurement
830 * @tk: TK to be used for secured 11az measurement
831 * @calib: An array of calibration values per FTM rx bandwidth.
832 * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the
833 * calibration value that corresponds to the rx bandwidth of the FTM
834 * frame.
835 * @beacon_interval: beacon interval of the AP in TUs. Only required if
836 * &IWL_INITIATOR_AP_FLAGS_TB is set.
837 * @rx_pn: the next expected PN for protected management frames Rx. LE byte
838 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
839 * is set to &IWL_INVALID_STA.
840 * @tx_pn: the next PN to use for protected management frames Tx. LE byte
841 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
842 * is set to &IWL_INVALID_STA.
843 */
844 struct iwl_tof_range_req_ap_entry_v7 {
845 __le32 initiator_ap_flags;
846 u8 channel_num;
847 u8 format_bw;
848 u8 ctrl_ch_position;
849 u8 ftmr_max_retries;
850 u8 bssid[ETH_ALEN];
851 __le16 burst_period;
852 u8 samples_per_burst;
853 u8 num_of_bursts;
854 u8 sta_id;
855 u8 cipher;
856 u8 hltk[HLTK_11AZ_LEN];
857 u8 tk[TK_11AZ_LEN];
858 __le16 calib[IWL_TOF_BW_NUM];
859 __le16 beacon_interval;
860 u8 rx_pn[IEEE80211_CCMP_PN_LEN];
861 u8 tx_pn[IEEE80211_CCMP_PN_LEN];
862 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_7 */
863
864 #define IWL_LOCATION_MAX_STS_POS 3
865 #define IWL_LOCATION_TOTAL_LTF_POS 6
866
867 /**
868 * struct iwl_tof_range_req_ap_entry_v8 - AP configuration parameters
869 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
870 * @channel_num: AP Channel number
871 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
872 * bits 4 - 7: &enum iwl_location_bw.
873 * @ctrl_ch_position: Coding of the control channel position relative to the
874 * center frequency, see iwl_mvm_get_ctrl_pos().
875 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
876 * reply from the AP.
877 * @bssid: AP's BSSID
878 * @burst_period: Recommended value to be sent to the AP. Measurement
879 * periodicity In units of 100ms. ignored if num_of_bursts_exp = 0
880 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
881 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
882 * the number of measurement iterations (min 2^0 = 1, max 2^14)
883 * @sta_id: the station id of the AP. Only relevant when associated to the AP,
884 * otherwise should be set to &IWL_INVALID_STA.
885 * @cipher: pairwise cipher suite for secured measurement.
886 * &enum iwl_location_cipher.
887 * @hltk: HLTK to be used for secured 11az measurement
888 * @tk: TK to be used for secured 11az measurement
889 * @calib: An array of calibration values per FTM rx bandwidth.
890 * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the
891 * calibration value that corresponds to the rx bandwidth of the FTM
892 * frame.
893 * @beacon_interval: beacon interval of the AP in TUs. Only required if
894 * &IWL_INITIATOR_AP_FLAGS_TB is set.
895 * @rx_pn: the next expected PN for protected management frames Rx. LE byte
896 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
897 * is set to &IWL_INVALID_STA.
898 * @tx_pn: the next PN to use for protected management frames Tx. LE byte
899 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
900 * is set to &IWL_INVALID_STA.
901 * @r2i_ndp_params: parameters for R2I NDP ranging negotiation.
902 * bits 0 - 2: max LTF repetitions
903 * bits 3 - 5: max number of spatial streams
904 * bits 6 - 7: reserved
905 * @i2r_ndp_params: parameters for I2R NDP ranging negotiation.
906 * bits 0 - 2: max LTF repetitions
907 * bits 3 - 5: max number of spatial streams (supported values are < 2)
908 * bits 6 - 7: reserved
909 * @r2i_max_total_ltf: R2I Max Total LTFs for NDP ranging negotiation.
910 * One of &enum ieee80211_range_params_max_total_ltf.
911 * @i2r_max_total_ltf: I2R Max Total LTFs for NDP ranging negotiation.
912 * One of &enum ieee80211_range_params_max_total_ltf.
913 */
914 struct iwl_tof_range_req_ap_entry_v8 {
915 __le32 initiator_ap_flags;
916 u8 channel_num;
917 u8 format_bw;
918 u8 ctrl_ch_position;
919 u8 ftmr_max_retries;
920 u8 bssid[ETH_ALEN];
921 __le16 burst_period;
922 u8 samples_per_burst;
923 u8 num_of_bursts;
924 u8 sta_id;
925 u8 cipher;
926 u8 hltk[HLTK_11AZ_LEN];
927 u8 tk[TK_11AZ_LEN];
928 __le16 calib[IWL_TOF_BW_NUM];
929 __le16 beacon_interval;
930 u8 rx_pn[IEEE80211_CCMP_PN_LEN];
931 u8 tx_pn[IEEE80211_CCMP_PN_LEN];
932 u8 r2i_ndp_params;
933 u8 i2r_ndp_params;
934 u8 r2i_max_total_ltf;
935 u8 i2r_max_total_ltf;
936 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_8 */
937
938 /**
939 * struct iwl_tof_range_req_ap_entry_v9 - AP configuration parameters
940 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
941 * @channel_num: AP Channel number
942 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
943 * bits 4 - 7: &enum iwl_location_bw.
944 * @ctrl_ch_position: Coding of the control channel position relative to the
945 * center frequency, see iwl_mvm_get_ctrl_pos().
946 * @ftmr_max_retries: Max number of retries to send the FTMR in case of no
947 * reply from the AP.
948 * @bssid: AP's BSSID
949 * @burst_period: For EDCA based ranging: Recommended value to be sent to the
950 * AP. Measurement periodicity In units of 100ms. ignored if
951 * num_of_bursts_exp = 0.
952 * For non trigger based NDP ranging, the maximum time between
953 * measurements in units of milliseconds.
954 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
955 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
956 * the number of measurement iterations (min 2^0 = 1, max 2^14)
957 * @sta_id: the station id of the AP. Only relevant when associated to the AP,
958 * otherwise should be set to &IWL_INVALID_STA.
959 * @cipher: pairwise cipher suite for secured measurement.
960 * &enum iwl_location_cipher.
961 * @hltk: HLTK to be used for secured 11az measurement
962 * @tk: TK to be used for secured 11az measurement
963 * @calib: An array of calibration values per FTM rx bandwidth.
964 * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the
965 * calibration value that corresponds to the rx bandwidth of the FTM
966 * frame.
967 * @beacon_interval: beacon interval of the AP in TUs. Only required if
968 * &IWL_INITIATOR_AP_FLAGS_TB is set.
969 * @bss_color: the BSS color of the responder. Only valid if
970 * &IWL_INITIATOR_AP_FLAGS_TB or &IWL_INITIATOR_AP_FLAGS_NON_TB is set.
971 * @rx_pn: the next expected PN for protected management frames Rx. LE byte
972 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
973 * is set to &IWL_INVALID_STA.
974 * @tx_pn: the next PN to use for protected management frames Tx. LE byte
975 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
976 * is set to &IWL_INVALID_STA.
977 * @r2i_ndp_params: parameters for R2I NDP ranging negotiation.
978 * bits 0 - 2: max LTF repetitions
979 * bits 3 - 5: max number of spatial streams
980 * bits 6 - 7: reserved
981 * @i2r_ndp_params: parameters for I2R NDP ranging negotiation.
982 * bits 0 - 2: max LTF repetitions
983 * bits 3 - 5: max number of spatial streams (supported values are < 2)
984 * bits 6 - 7: reserved
985 * @r2i_max_total_ltf: R2I Max Total LTFs for NDP ranging negotiation.
986 * One of &enum ieee80211_range_params_max_total_ltf.
987 * @i2r_max_total_ltf: I2R Max Total LTFs for NDP ranging negotiation.
988 * One of &enum ieee80211_range_params_max_total_ltf.
989 * @bss_color: the BSS color of the responder. Only valid if
990 * &IWL_INITIATOR_AP_FLAGS_NON_TB or &IWL_INITIATOR_AP_FLAGS_TB is set.
991 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz, 2 for 6GHz
992 * @min_time_between_msr: For non trigger based NDP ranging, the minimum time
993 * between measurements in units of milliseconds
994 */
995 struct iwl_tof_range_req_ap_entry_v9 {
996 __le32 initiator_ap_flags;
997 u8 channel_num;
998 u8 format_bw;
999 u8 ctrl_ch_position;
1000 u8 ftmr_max_retries;
1001 u8 bssid[ETH_ALEN];
1002 __le16 burst_period;
1003 u8 samples_per_burst;
1004 u8 num_of_bursts;
1005 u8 sta_id;
1006 u8 cipher;
1007 u8 hltk[HLTK_11AZ_LEN];
1008 u8 tk[TK_11AZ_LEN];
1009 __le16 calib[IWL_TOF_BW_NUM];
1010 u16 beacon_interval;
1011 u8 rx_pn[IEEE80211_CCMP_PN_LEN];
1012 u8 tx_pn[IEEE80211_CCMP_PN_LEN];
1013 u8 r2i_ndp_params;
1014 u8 i2r_ndp_params;
1015 u8 r2i_max_total_ltf;
1016 u8 i2r_max_total_ltf;
1017 u8 bss_color;
1018 u8 band;
1019 __le16 min_time_between_msr;
1020 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_9 */
1021
1022 /**
1023 * struct iwl_tof_range_req_ap_entry - AP configuration parameters
1024 * @initiator_ap_flags: see &enum iwl_initiator_ap_flags.
1025 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz, 2 for 6GHz
1026 * @channel_num: AP Channel number
1027 * @format_bw: bits 0 - 3: &enum iwl_location_frame_format.
1028 * bits 4 - 7: &enum iwl_location_bw.
1029 * @ctrl_ch_position: Coding of the control channel position relative to the
1030 * center frequency, see iwl_mvm_get_ctrl_pos().
1031 * @bssid: AP's BSSID
1032 * @burst_period: For EDCA based ranging: Recommended value to be sent to the
1033 * AP. Measurement periodicity In units of 100ms. ignored if
1034 * num_of_bursts_exp = 0.
1035 * For non trigger based NDP ranging, the maximum time between
1036 * measurements in units of milliseconds.
1037 * @samples_per_burst: the number of FTMs pairs in single Burst (1-31);
1038 * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of
1039 * the number of measurement iterations (min 2^0 = 1, max 2^14)
1040 * @sta_id: the station id of the AP. Only relevant when associated to the AP,
1041 * otherwise should be set to &IWL_INVALID_STA.
1042 * @cipher: pairwise cipher suite for secured measurement.
1043 * &enum iwl_location_cipher.
1044 * @hltk: HLTK to be used for secured 11az measurement
1045 * @tk: TK to be used for secured 11az measurement
1046 * @calib: An array of calibration values per FTM rx bandwidth.
1047 * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the
1048 * calibration value that corresponds to the rx bandwidth of the FTM
1049 * frame.
1050 * @beacon_interval: beacon interval of the AP in TUs. Only required if
1051 * &IWL_INITIATOR_AP_FLAGS_TB is set.
1052 * @rx_pn: the next expected PN for protected management frames Rx. LE byte
1053 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
1054 * is set to &IWL_INVALID_STA.
1055 * @tx_pn: the next PN to use for protected management frames Tx. LE byte
1056 * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id
1057 * is set to &IWL_INVALID_STA.
1058 * @r2i_ndp_params: parameters for R2I NDP ranging negotiation.
1059 * bits 0 - 2: max LTF repetitions
1060 * bits 3 - 5: max number of spatial streams
1061 * bits 6 - 7: max total LTFs. One of
1062 * &enum ieee80211_range_params_max_total_ltf.
1063 * @i2r_ndp_params: parameters for I2R NDP ranging negotiation.
1064 * bits 0 - 2: max LTF repetitions
1065 * bits 3 - 5: max number of spatial streams (supported values are < 2)
1066 * bits 6 - 7: max total LTFs. One of
1067 * &enum ieee80211_range_params_max_total_ltf.
1068 * @min_time_between_msr: For non trigger based NDP ranging, the minimum time
1069 * between measurements in units of milliseconds
1070 */
1071 struct iwl_tof_range_req_ap_entry {
1072 __le32 initiator_ap_flags;
1073 u8 band;
1074 u8 channel_num;
1075 u8 format_bw;
1076 u8 ctrl_ch_position;
1077 u8 bssid[ETH_ALEN];
1078 __le16 burst_period;
1079 u8 samples_per_burst;
1080 u8 num_of_bursts;
1081 u8 sta_id;
1082 u8 cipher;
1083 u8 hltk[HLTK_11AZ_LEN];
1084 u8 tk[TK_11AZ_LEN];
1085 __le16 calib[IWL_TOF_BW_NUM];
1086 __le16 beacon_interval;
1087 u8 rx_pn[IEEE80211_CCMP_PN_LEN];
1088 u8 tx_pn[IEEE80211_CCMP_PN_LEN];
1089 u8 r2i_ndp_params;
1090 u8 i2r_ndp_params;
1091 __le16 min_time_between_msr;
1092 } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_9 */
1093
1094 /**
1095 * enum iwl_tof_response_mode - TOF response mode
1096 * @IWL_MVM_TOF_RESPONSE_ASAP: report each AP measurement separately as soon as
1097 * possible (not supported for this release)
1098 * @IWL_MVM_TOF_RESPONSE_TIMEOUT: report all AP measurements as a batch upon
1099 * timeout expiration
1100 * @IWL_MVM_TOF_RESPONSE_COMPLETE: report all AP measurements as a batch at the
1101 * earlier of: measurements completion / timeout
1102 * expiration.
1103 */
1104 enum iwl_tof_response_mode {
1105 IWL_MVM_TOF_RESPONSE_ASAP,
1106 IWL_MVM_TOF_RESPONSE_TIMEOUT,
1107 IWL_MVM_TOF_RESPONSE_COMPLETE,
1108 };
1109
1110 /**
1111 * enum iwl_tof_initiator_flags - TOF initiator flags
1112 *
1113 * @IWL_TOF_INITIATOR_FLAGS_FAST_ALGO_DISABLED: disable fast algo, meaning run
1114 * the algo on ant A+B, instead of only one of them.
1115 * @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_A: open RX antenna A for FTMs RX
1116 * @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_B: open RX antenna B for FTMs RX
1117 * @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_C: open RX antenna C for FTMs RX
1118 * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A: use antenna A fo TX ACKs during FTM
1119 * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B: use antenna B fo TX ACKs during FTM
1120 * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C: use antenna C fo TX ACKs during FTM
1121 * @IWL_TOF_INITIATOR_FLAGS_MACADDR_RANDOM: use random mac address for FTM
1122 * @IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB: use the specific calib value from
1123 * the range request command
1124 * @IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB: use the common calib value from the
1125 * ragne request command
1126 * @IWL_TOF_INITIATOR_FLAGS_NON_ASAP_SUPPORT: support non-asap measurements
1127 */
1128 enum iwl_tof_initiator_flags {
1129 IWL_TOF_INITIATOR_FLAGS_FAST_ALGO_DISABLED = BIT(0),
1130 IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_A = BIT(1),
1131 IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_B = BIT(2),
1132 IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_C = BIT(3),
1133 IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A = BIT(4),
1134 IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B = BIT(5),
1135 IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C = BIT(6),
1136 IWL_TOF_INITIATOR_FLAGS_MACADDR_RANDOM = BIT(7),
1137 IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB = BIT(15),
1138 IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB = BIT(16),
1139 IWL_TOF_INITIATOR_FLAGS_NON_ASAP_SUPPORT = BIT(20),
1140 }; /* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */
1141
1142 #define IWL_TOF_MAX_APS 5
1143 #define IWL_MVM_TOF_MAX_TWO_SIDED_APS 5
1144
1145 /**
1146 * struct iwl_tof_range_req_cmd_v5 - start measurement cmd
1147 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1148 * @request_id: A Token incremented per request. The same Token will be
1149 * sent back in the range response
1150 * @initiator: 0- NW initiated, 1 - Client Initiated
1151 * @one_sided_los_disable: '0'- run ML-Algo for both ToF/OneSided,
1152 * '1' - run ML-Algo for ToF only
1153 * @req_timeout: Requested timeout of the response in units of 100ms.
1154 * This is equivalent to the session time configured to the
1155 * LMAC in Initiator Request
1156 * @report_policy: Supported partially for this release: For current release -
1157 * the range report will be uploaded as a batch when ready or
1158 * when the session is done (successfully / partially).
1159 * one of iwl_tof_response_mode.
1160 * @reserved0: reserved
1161 * @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)
1162 * @macaddr_random: '0' Use default source MAC address (i.e. p2_p),
1163 * '1' Use MAC Address randomization according to the below
1164 * @range_req_bssid: ranging request BSSID
1165 * @macaddr_template: MAC address template to use for non-randomized bits
1166 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1167 * Bits set to 1 shall be randomized by the UMAC
1168 * @ftm_rx_chains: Rx chain to open to receive Responder's FTMs (XVT)
1169 * @ftm_tx_chains: Tx chain to send the ack to the Responder FTM (XVT)
1170 * @common_calib: The common calib value to inject to this measurement calc
1171 * @specific_calib: The specific calib value to inject to this measurement calc
1172 * @ap: per-AP request data
1173 */
1174 struct iwl_tof_range_req_cmd_v5 {
1175 __le32 initiator_flags;
1176 u8 request_id;
1177 u8 initiator;
1178 u8 one_sided_los_disable;
1179 u8 req_timeout;
1180 u8 report_policy;
1181 u8 reserved0;
1182 u8 num_of_ap;
1183 u8 macaddr_random;
1184 u8 range_req_bssid[ETH_ALEN];
1185 u8 macaddr_template[ETH_ALEN];
1186 u8 macaddr_mask[ETH_ALEN];
1187 u8 ftm_rx_chains;
1188 u8 ftm_tx_chains;
1189 __le16 common_calib;
1190 __le16 specific_calib;
1191 struct iwl_tof_range_req_ap_entry_v2 ap[IWL_TOF_MAX_APS];
1192 } __packed;
1193 /* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */
1194
1195 /**
1196 * struct iwl_tof_range_req_cmd_v7 - start measurement cmd
1197 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1198 * @request_id: A Token incremented per request. The same Token will be
1199 * sent back in the range response
1200 * @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)
1201 * @range_req_bssid: ranging request BSSID
1202 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1203 * Bits set to 1 shall be randomized by the UMAC
1204 * @macaddr_template: MAC address template to use for non-randomized bits
1205 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1206 * This is the session time for completing the measurement.
1207 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1208 * TSF of this mac id. 0xff to disable TSF reporting.
1209 * @common_calib: The common calib value to inject to this measurement calc
1210 * @specific_calib: The specific calib value to inject to this measurement calc
1211 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.
1212 */
1213 struct iwl_tof_range_req_cmd_v7 {
1214 __le32 initiator_flags;
1215 u8 request_id;
1216 u8 num_of_ap;
1217 u8 range_req_bssid[ETH_ALEN];
1218 u8 macaddr_mask[ETH_ALEN];
1219 u8 macaddr_template[ETH_ALEN];
1220 __le32 req_timeout_ms;
1221 __le32 tsf_mac_id;
1222 __le16 common_calib;
1223 __le16 specific_calib;
1224 struct iwl_tof_range_req_ap_entry_v3 ap[IWL_TOF_MAX_APS];
1225 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_7 */
1226
1227 /**
1228 * struct iwl_tof_range_req_cmd_v8 - start measurement cmd
1229 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1230 * @request_id: A Token incremented per request. The same Token will be
1231 * sent back in the range response
1232 * @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)
1233 * @range_req_bssid: ranging request BSSID
1234 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1235 * Bits set to 1 shall be randomized by the UMAC
1236 * @macaddr_template: MAC address template to use for non-randomized bits
1237 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1238 * This is the session time for completing the measurement.
1239 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1240 * TSF of this mac id. 0xff to disable TSF reporting.
1241 * @common_calib: The common calib value to inject to this measurement calc
1242 * @specific_calib: The specific calib value to inject to this measurement calc
1243 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.
1244 */
1245 struct iwl_tof_range_req_cmd_v8 {
1246 __le32 initiator_flags;
1247 u8 request_id;
1248 u8 num_of_ap;
1249 u8 range_req_bssid[ETH_ALEN];
1250 u8 macaddr_mask[ETH_ALEN];
1251 u8 macaddr_template[ETH_ALEN];
1252 __le32 req_timeout_ms;
1253 __le32 tsf_mac_id;
1254 __le16 common_calib;
1255 __le16 specific_calib;
1256 struct iwl_tof_range_req_ap_entry_v4 ap[IWL_TOF_MAX_APS];
1257 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_8 */
1258
1259 /**
1260 * struct iwl_tof_range_req_cmd_v9 - start measurement cmd
1261 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1262 * @request_id: A Token incremented per request. The same Token will be
1263 * sent back in the range response
1264 * @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)
1265 * @range_req_bssid: ranging request BSSID
1266 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1267 * Bits set to 1 shall be randomized by the UMAC
1268 * @macaddr_template: MAC address template to use for non-randomized bits
1269 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1270 * This is the session time for completing the measurement.
1271 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1272 * TSF of this mac id. 0xff to disable TSF reporting.
1273 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.
1274 */
1275 struct iwl_tof_range_req_cmd_v9 {
1276 __le32 initiator_flags;
1277 u8 request_id;
1278 u8 num_of_ap;
1279 u8 range_req_bssid[ETH_ALEN];
1280 u8 macaddr_mask[ETH_ALEN];
1281 u8 macaddr_template[ETH_ALEN];
1282 __le32 req_timeout_ms;
1283 __le32 tsf_mac_id;
1284 struct iwl_tof_range_req_ap_entry_v6 ap[IWL_TOF_MAX_APS];
1285 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_9 */
1286
1287 /**
1288 * struct iwl_tof_range_req_cmd_v11 - start measurement cmd
1289 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1290 * @request_id: A Token incremented per request. The same Token will be
1291 * sent back in the range response
1292 * @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)
1293 * @range_req_bssid: ranging request BSSID
1294 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1295 * Bits set to 1 shall be randomized by the UMAC
1296 * @macaddr_template: MAC address template to use for non-randomized bits
1297 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1298 * This is the session time for completing the measurement.
1299 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1300 * TSF of this mac id. 0xff to disable TSF reporting.
1301 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.
1302 */
1303 struct iwl_tof_range_req_cmd_v11 {
1304 __le32 initiator_flags;
1305 u8 request_id;
1306 u8 num_of_ap;
1307 u8 range_req_bssid[ETH_ALEN];
1308 u8 macaddr_mask[ETH_ALEN];
1309 u8 macaddr_template[ETH_ALEN];
1310 __le32 req_timeout_ms;
1311 __le32 tsf_mac_id;
1312 struct iwl_tof_range_req_ap_entry_v7 ap[IWL_TOF_MAX_APS];
1313 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_11 */
1314
1315 /**
1316 * struct iwl_tof_range_req_cmd_v12 - start measurement cmd
1317 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1318 * @request_id: A Token incremented per request. The same Token will be
1319 * sent back in the range response
1320 * @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)
1321 * @range_req_bssid: ranging request BSSID
1322 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1323 * Bits set to 1 shall be randomized by the UMAC
1324 * @macaddr_template: MAC address template to use for non-randomized bits
1325 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1326 * This is the session time for completing the measurement.
1327 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1328 * TSF of this mac id. 0xff to disable TSF reporting.
1329 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v2.
1330 */
1331 struct iwl_tof_range_req_cmd_v12 {
1332 __le32 initiator_flags;
1333 u8 request_id;
1334 u8 num_of_ap;
1335 u8 range_req_bssid[ETH_ALEN];
1336 u8 macaddr_mask[ETH_ALEN];
1337 u8 macaddr_template[ETH_ALEN];
1338 __le32 req_timeout_ms;
1339 __le32 tsf_mac_id;
1340 struct iwl_tof_range_req_ap_entry_v8 ap[IWL_TOF_MAX_APS];
1341 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_12 */
1342
1343 /**
1344 * struct iwl_tof_range_req_cmd_v13 - start measurement cmd
1345 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1346 * @request_id: A Token incremented per request. The same Token will be
1347 * sent back in the range response
1348 * @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)
1349 * @range_req_bssid: ranging request BSSID
1350 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1351 * Bits set to 1 shall be randomized by the UMAC
1352 * @macaddr_template: MAC address template to use for non-randomized bits
1353 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1354 * This is the session time for completing the measurement.
1355 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1356 * TSF of this mac id. 0xff to disable TSF reporting.
1357 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v9.
1358 */
1359 struct iwl_tof_range_req_cmd_v13 {
1360 __le32 initiator_flags;
1361 u8 request_id;
1362 u8 num_of_ap;
1363 u8 range_req_bssid[ETH_ALEN];
1364 u8 macaddr_mask[ETH_ALEN];
1365 u8 macaddr_template[ETH_ALEN];
1366 __le32 req_timeout_ms;
1367 __le32 tsf_mac_id;
1368 struct iwl_tof_range_req_ap_entry_v9 ap[IWL_TOF_MAX_APS];
1369 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_13 */
1370
1371 /**
1372 * struct iwl_tof_range_req_cmd - start measurement cmd
1373 * @initiator_flags: see flags @ iwl_tof_initiator_flags
1374 * @request_id: A Token incremented per request. The same Token will be
1375 * sent back in the range response
1376 * @num_of_ap: Number of APs to measure (error if > IWL_TOF_MAX_APS)
1377 * @range_req_bssid: ranging request BSSID
1378 * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template.
1379 * Bits set to 1 shall be randomized by the UMAC
1380 * @macaddr_template: MAC address template to use for non-randomized bits
1381 * @req_timeout_ms: Requested timeout of the response in units of milliseconds.
1382 * This is the session time for completing the measurement.
1383 * @tsf_mac_id: report the measurement start time for each ap in terms of the
1384 * TSF of this mac id. 0xff to disable TSF reporting.
1385 * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry.
1386 */
1387 struct iwl_tof_range_req_cmd {
1388 __le32 initiator_flags;
1389 u8 request_id;
1390 u8 num_of_ap;
1391 u8 range_req_bssid[ETH_ALEN];
1392 u8 macaddr_mask[ETH_ALEN];
1393 u8 macaddr_template[ETH_ALEN];
1394 __le32 req_timeout_ms;
1395 __le32 tsf_mac_id;
1396 struct iwl_tof_range_req_ap_entry ap[IWL_TOF_MAX_APS];
1397 } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_15 */
1398
1399 /*
1400 * enum iwl_tof_range_request_status - status of the sent request
1401 * @IWL_TOF_RANGE_REQUEST_STATUS_SUCCESSFUL - FW successfully received the
1402 * request
1403 * @IWL_TOF_RANGE_REQUEST_STATUS_BUSY - FW is busy with a previous request, the
1404 * sent request will not be handled
1405 */
1406 enum iwl_tof_range_request_status {
1407 IWL_TOF_RANGE_REQUEST_STATUS_SUCCESS,
1408 IWL_TOF_RANGE_REQUEST_STATUS_BUSY,
1409 };
1410
1411 /**
1412 * enum iwl_tof_entry_status - TOF entry status
1413 *
1414 * @IWL_TOF_ENTRY_SUCCESS: successful measurement.
1415 * @IWL_TOF_ENTRY_GENERAL_FAILURE: General failure.
1416 * @IWL_TOF_ENTRY_NO_RESPONSE: Responder didn't reply to the request.
1417 * @IWL_TOF_ENTRY_REQUEST_REJECTED: Responder rejected the request.
1418 * @IWL_TOF_ENTRY_NOT_SCHEDULED: Time event was scheduled but not called yet.
1419 * @IWL_TOF_ENTRY_TIMING_MEASURE_TIMEOUT: Time event triggered but no
1420 * measurement was completed.
1421 * @IWL_TOF_ENTRY_TARGET_DIFF_CH_CANNOT_CHANGE: No range due inability to switch
1422 * from the primary channel.
1423 * @IWL_TOF_ENTRY_RANGE_NOT_SUPPORTED: Device doesn't support FTM.
1424 * @IWL_TOF_ENTRY_REQUEST_ABORT_UNKNOWN_REASON: Request aborted due to unknown
1425 * reason.
1426 * @IWL_TOF_ENTRY_LOCATION_INVALID_T1_T4_TIME_STAMP: Failure due to invalid
1427 * T1/T4.
1428 * @IWL_TOF_ENTRY_11MC_PROTOCOL_FAILURE: Failure due to invalid FTM frame
1429 * structure.
1430 * @IWL_TOF_ENTRY_REQUEST_CANNOT_SCHED: Request cannot be scheduled.
1431 * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE: Responder cannot serve the
1432 * initiator for some period, period supplied in @refusal_period.
1433 * @IWL_TOF_ENTRY_BAD_REQUEST_ARGS: Bad request arguments.
1434 * @IWL_TOF_ENTRY_WIFI_NOT_ENABLED: Wifi not enabled.
1435 * @IWL_TOF_ENTRY_RESPONDER_OVERRIDE_PARAMS: Responder override the original
1436 * parameters within the current session.
1437 */
1438 enum iwl_tof_entry_status {
1439 IWL_TOF_ENTRY_SUCCESS = 0,
1440 IWL_TOF_ENTRY_GENERAL_FAILURE = 1,
1441 IWL_TOF_ENTRY_NO_RESPONSE = 2,
1442 IWL_TOF_ENTRY_REQUEST_REJECTED = 3,
1443 IWL_TOF_ENTRY_NOT_SCHEDULED = 4,
1444 IWL_TOF_ENTRY_TIMING_MEASURE_TIMEOUT = 5,
1445 IWL_TOF_ENTRY_TARGET_DIFF_CH_CANNOT_CHANGE = 6,
1446 IWL_TOF_ENTRY_RANGE_NOT_SUPPORTED = 7,
1447 IWL_TOF_ENTRY_REQUEST_ABORT_UNKNOWN_REASON = 8,
1448 IWL_TOF_ENTRY_LOCATION_INVALID_T1_T4_TIME_STAMP = 9,
1449 IWL_TOF_ENTRY_11MC_PROTOCOL_FAILURE = 10,
1450 IWL_TOF_ENTRY_REQUEST_CANNOT_SCHED = 11,
1451 IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE = 12,
1452 IWL_TOF_ENTRY_BAD_REQUEST_ARGS = 13,
1453 IWL_TOF_ENTRY_WIFI_NOT_ENABLED = 14,
1454 IWL_TOF_ENTRY_RESPONDER_OVERRIDE_PARAMS = 15,
1455 }; /* LOCATION_RANGE_RSP_AP_ENTRY_NTFY_API_S_VER_2 */
1456
1457 /**
1458 * struct iwl_tof_range_rsp_ap_entry_ntfy_v3 - AP parameters (response)
1459 * @bssid: BSSID of the AP
1460 * @measure_status: current APs measurement status, one of
1461 * &enum iwl_tof_entry_status.
1462 * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz
1463 * @rtt: The Round Trip Time that took for the last measurement for
1464 * current AP [pSec]
1465 * @rtt_variance: The Variance of the RTT values measured for current AP
1466 * @rtt_spread: The Difference between the maximum and the minimum RTT
1467 * values measured for current AP in the current session [pSec]
1468 * @rssi: RSSI as uploaded in the Channel Estimation notification
1469 * @rssi_spread: The Difference between the maximum and the minimum RSSI values
1470 * measured for current AP in the current session
1471 * @reserved: reserved
1472 * @refusal_period: refusal period in case of
1473 * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]
1474 * @range: Measured range [cm]
1475 * @range_variance: Measured range variance [cm]
1476 * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was
1477 * uploaded by the LMAC
1478 * @t2t3_initiator: as calculated from the algo in the initiator
1479 * @t1t4_responder: as calculated from the algo in the responder
1480 * @common_calib: Calib val that was used in for this AP measurement
1481 * @specific_calib: val that was used in for this AP measurement
1482 * @papd_calib_output: The result of the tof papd calibration that was injected
1483 * into the algorithm.
1484 */
1485 struct iwl_tof_range_rsp_ap_entry_ntfy_v3 {
1486 u8 bssid[ETH_ALEN];
1487 u8 measure_status;
1488 u8 measure_bw;
1489 __le32 rtt;
1490 __le32 rtt_variance;
1491 __le32 rtt_spread;
1492 s8 rssi;
1493 u8 rssi_spread;
1494 u8 reserved;
1495 u8 refusal_period;
1496 __le32 range;
1497 __le32 range_variance;
1498 __le32 timestamp;
1499 __le32 t2t3_initiator;
1500 __le32 t1t4_responder;
1501 __le16 common_calib;
1502 __le16 specific_calib;
1503 __le32 papd_calib_output;
1504 } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_3 */
1505
1506 /**
1507 * struct iwl_tof_range_rsp_ap_entry_ntfy_v4 - AP parameters (response)
1508 * @bssid: BSSID of the AP
1509 * @measure_status: current APs measurement status, one of
1510 * &enum iwl_tof_entry_status.
1511 * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz
1512 * @rtt: The Round Trip Time that took for the last measurement for
1513 * current AP [pSec]
1514 * @rtt_variance: The Variance of the RTT values measured for current AP
1515 * @rtt_spread: The Difference between the maximum and the minimum RTT
1516 * values measured for current AP in the current session [pSec]
1517 * @rssi: RSSI as uploaded in the Channel Estimation notification
1518 * @rssi_spread: The Difference between the maximum and the minimum RSSI values
1519 * measured for current AP in the current session
1520 * @last_burst: 1 if no more FTM sessions are scheduled for this responder
1521 * @refusal_period: refusal period in case of
1522 * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]
1523 * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was
1524 * uploaded by the LMAC
1525 * @start_tsf: measurement start time in TSF of the mac specified in the range
1526 * request
1527 * @rx_rate_n_flags: rate and flags of the last FTM frame received from this
1528 * responder
1529 * @tx_rate_n_flags: rate and flags of the last ack sent to this responder
1530 * @t2t3_initiator: as calculated from the algo in the initiator
1531 * @t1t4_responder: as calculated from the algo in the responder
1532 * @common_calib: Calib val that was used in for this AP measurement
1533 * @specific_calib: val that was used in for this AP measurement
1534 * @papd_calib_output: The result of the tof papd calibration that was injected
1535 * into the algorithm.
1536 */
1537 struct iwl_tof_range_rsp_ap_entry_ntfy_v4 {
1538 u8 bssid[ETH_ALEN];
1539 u8 measure_status;
1540 u8 measure_bw;
1541 __le32 rtt;
1542 __le32 rtt_variance;
1543 __le32 rtt_spread;
1544 s8 rssi;
1545 u8 rssi_spread;
1546 u8 last_burst;
1547 u8 refusal_period;
1548 __le32 timestamp;
1549 __le32 start_tsf;
1550 __le32 rx_rate_n_flags;
1551 __le32 tx_rate_n_flags;
1552 __le32 t2t3_initiator;
1553 __le32 t1t4_responder;
1554 __le16 common_calib;
1555 __le16 specific_calib;
1556 __le32 papd_calib_output;
1557 } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_4 */
1558
1559 /**
1560 * struct iwl_tof_range_rsp_ap_entry_ntfy_v5 - AP parameters (response)
1561 * @bssid: BSSID of the AP
1562 * @measure_status: current APs measurement status, one of
1563 * &enum iwl_tof_entry_status.
1564 * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz
1565 * @rtt: The Round Trip Time that took for the last measurement for
1566 * current AP [pSec]
1567 * @rtt_variance: The Variance of the RTT values measured for current AP
1568 * @rtt_spread: The Difference between the maximum and the minimum RTT
1569 * values measured for current AP in the current session [pSec]
1570 * @rssi: RSSI as uploaded in the Channel Estimation notification
1571 * @rssi_spread: The Difference between the maximum and the minimum RSSI values
1572 * measured for current AP in the current session
1573 * @last_burst: 1 if no more FTM sessions are scheduled for this responder
1574 * @refusal_period: refusal period in case of
1575 * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]
1576 * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was
1577 * uploaded by the LMAC
1578 * @start_tsf: measurement start time in TSF of the mac specified in the range
1579 * request
1580 * @rx_rate_n_flags: rate and flags of the last FTM frame received from this
1581 * responder
1582 * @tx_rate_n_flags: rate and flags of the last ack sent to this responder
1583 * @t2t3_initiator: as calculated from the algo in the initiator
1584 * @t1t4_responder: as calculated from the algo in the responder
1585 * @common_calib: Calib val that was used in for this AP measurement
1586 * @specific_calib: val that was used in for this AP measurement
1587 * @papd_calib_output: The result of the tof papd calibration that was injected
1588 * into the algorithm.
1589 * @rttConfidence: a value between 0 - 31 that represents the rtt accuracy.
1590 * @reserved: for alignment
1591 */
1592 struct iwl_tof_range_rsp_ap_entry_ntfy_v5 {
1593 u8 bssid[ETH_ALEN];
1594 u8 measure_status;
1595 u8 measure_bw;
1596 __le32 rtt;
1597 __le32 rtt_variance;
1598 __le32 rtt_spread;
1599 s8 rssi;
1600 u8 rssi_spread;
1601 u8 last_burst;
1602 u8 refusal_period;
1603 __le32 timestamp;
1604 __le32 start_tsf;
1605 __le32 rx_rate_n_flags;
1606 __le32 tx_rate_n_flags;
1607 __le32 t2t3_initiator;
1608 __le32 t1t4_responder;
1609 __le16 common_calib;
1610 __le16 specific_calib;
1611 __le32 papd_calib_output;
1612 u8 rttConfidence;
1613 u8 reserved[3];
1614 } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_5 */
1615
1616 /**
1617 * struct iwl_tof_range_rsp_ap_entry_ntfy_v7 - AP parameters (response)
1618 * @bssid: BSSID of the AP
1619 * @measure_status: current APs measurement status, one of
1620 * &enum iwl_tof_entry_status.
1621 * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz
1622 * @rtt: The Round Trip Time that took for the last measurement for
1623 * current AP [pSec]
1624 * @rtt_variance: The Variance of the RTT values measured for current AP
1625 * @rtt_spread: The Difference between the maximum and the minimum RTT
1626 * values measured for current AP in the current session [pSec]
1627 * @rssi: RSSI as uploaded in the Channel Estimation notification
1628 * @rssi_spread: The Difference between the maximum and the minimum RSSI values
1629 * measured for current AP in the current session
1630 * @last_burst: 1 if no more FTM sessions are scheduled for this responder
1631 * @refusal_period: refusal period in case of
1632 * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]
1633 * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was
1634 * uploaded by the LMAC
1635 * @start_tsf: measurement start time in TSF of the mac specified in the range
1636 * request
1637 * @rx_rate_n_flags: rate and flags of the last FTM frame received from this
1638 * responder
1639 * @tx_rate_n_flags: rate and flags of the last ack sent to this responder
1640 * @t2t3_initiator: as calculated from the algo in the initiator
1641 * @t1t4_responder: as calculated from the algo in the responder
1642 * @common_calib: Calib val that was used in for this AP measurement
1643 * @specific_calib: val that was used in for this AP measurement
1644 * @papd_calib_output: The result of the tof papd calibration that was injected
1645 * into the algorithm.
1646 * @rttConfidence: a value between 0 - 31 that represents the rtt accuracy.
1647 * @reserved: for alignment
1648 * @rx_pn: the last PN used for this responder Rx in case PMF is configured in
1649 * LE byte order.
1650 * @tx_pn: the last PN used for this responder Tx in case PMF is configured in
1651 * LE byte order.
1652 */
1653 struct iwl_tof_range_rsp_ap_entry_ntfy_v7 {
1654 u8 bssid[ETH_ALEN];
1655 u8 measure_status;
1656 u8 measure_bw;
1657 __le32 rtt;
1658 __le32 rtt_variance;
1659 __le32 rtt_spread;
1660 s8 rssi;
1661 u8 rssi_spread;
1662 u8 last_burst;
1663 u8 refusal_period;
1664 __le32 timestamp;
1665 __le32 start_tsf;
1666 __le32 rx_rate_n_flags;
1667 __le32 tx_rate_n_flags;
1668 __le32 t2t3_initiator;
1669 __le32 t1t4_responder;
1670 __le16 common_calib;
1671 __le16 specific_calib;
1672 __le32 papd_calib_output;
1673 u8 rttConfidence;
1674 u8 reserved[3];
1675 u8 rx_pn[IEEE80211_CCMP_PN_LEN];
1676 u8 tx_pn[IEEE80211_CCMP_PN_LEN];
1677 } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_6,
1678 LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_7 */
1679
1680 /**
1681 * struct iwl_tof_range_rsp_ap_entry_ntfy - AP parameters (response)
1682 * @bssid: BSSID of the AP
1683 * @measure_status: current APs measurement status, one of
1684 * &enum iwl_tof_entry_status.
1685 * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz
1686 * @rtt: The Round Trip Time that took for the last measurement for
1687 * current AP [pSec]
1688 * @rtt_variance: The Variance of the RTT values measured for current AP
1689 * @rtt_spread: The Difference between the maximum and the minimum RTT
1690 * values measured for current AP in the current session [pSec]
1691 * @rssi: RSSI as uploaded in the Channel Estimation notification
1692 * @rssi_spread: The Difference between the maximum and the minimum RSSI values
1693 * measured for current AP in the current session
1694 * @last_burst: 1 if no more FTM sessions are scheduled for this responder
1695 * @refusal_period: refusal period in case of
1696 * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec]
1697 * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was
1698 * uploaded by the LMAC
1699 * @start_tsf: measurement start time in TSF of the mac specified in the range
1700 * request
1701 * @reserved1: reserved, for backwards compatibility
1702 * @t2t3_initiator: as calculated from the algo in the initiator
1703 * @t1t4_responder: as calculated from the algo in the responder
1704 * @common_calib: Calib val that was used in for this AP measurement
1705 * @specific_calib: val that was used in for this AP measurement
1706 * @papd_calib_output: The result of the tof papd calibration that was injected
1707 * into the algorithm.
1708 * @rttConfidence: a value between 0 - 31 that represents the rtt accuracy.
1709 * @reserved: for alignment
1710 * @rx_pn: the last PN used for this responder Rx in case PMF is configured in
1711 * LE byte order.
1712 * @tx_pn: the last PN used for this responder Tx in case PMF is configured in
1713 * LE byte order.
1714 */
1715 struct iwl_tof_range_rsp_ap_entry_ntfy {
1716 u8 bssid[ETH_ALEN];
1717 u8 measure_status;
1718 u8 measure_bw;
1719 __le32 rtt;
1720 __le32 rtt_variance;
1721 __le32 rtt_spread;
1722 s8 rssi;
1723 u8 rssi_spread;
1724 u8 last_burst;
1725 u8 refusal_period;
1726 __le32 timestamp;
1727 __le32 start_tsf;
1728 __le32 reserved1[2];
1729 __le32 t2t3_initiator;
1730 __le32 t1t4_responder;
1731 __le16 common_calib;
1732 __le16 specific_calib;
1733 __le32 papd_calib_output;
1734 u8 rttConfidence;
1735 u8 reserved[3];
1736 u8 rx_pn[IEEE80211_CCMP_PN_LEN];
1737 u8 tx_pn[IEEE80211_CCMP_PN_LEN];
1738 } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_8 */
1739
1740 /**
1741 * enum iwl_tof_response_status - tof response status
1742 *
1743 * @IWL_TOF_RESPONSE_SUCCESS: successful range.
1744 * @IWL_TOF_RESPONSE_TIMEOUT: request aborted due to timeout expiration.
1745 * partial result of ranges done so far is included in the response.
1746 * @IWL_TOF_RESPONSE_ABORTED: Measurement aborted by command.
1747 * @IWL_TOF_RESPONSE_FAILED: Measurement request command failed.
1748 */
1749 enum iwl_tof_response_status {
1750 IWL_TOF_RESPONSE_SUCCESS = 0,
1751 IWL_TOF_RESPONSE_TIMEOUT = 1,
1752 IWL_TOF_RESPONSE_ABORTED = 4,
1753 IWL_TOF_RESPONSE_FAILED = 5,
1754 }; /* LOCATION_RNG_RSP_STATUS */
1755
1756 /**
1757 * struct iwl_tof_range_rsp_ntfy_v5 - ranging response notification
1758 * @request_id: A Token ID of the corresponding Range request
1759 * @request_status: status of current measurement session, one of
1760 * &enum iwl_tof_response_status.
1761 * @last_in_batch: reprot policy (when not all responses are uploaded at once)
1762 * @num_of_aps: Number of APs to measure (error if > IWL_TOF_MAX_APS)
1763 * @ap: per-AP data
1764 */
1765 struct iwl_tof_range_rsp_ntfy_v5 {
1766 u8 request_id;
1767 u8 request_status;
1768 u8 last_in_batch;
1769 u8 num_of_aps;
1770 struct iwl_tof_range_rsp_ap_entry_ntfy_v3 ap[IWL_TOF_MAX_APS];
1771 } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_5 */
1772
1773 /**
1774 * struct iwl_tof_range_rsp_ntfy_v6 - ranging response notification
1775 * @request_id: A Token ID of the corresponding Range request
1776 * @num_of_aps: Number of APs results
1777 * @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise.
1778 * @reserved: reserved
1779 * @ap: per-AP data
1780 */
1781 struct iwl_tof_range_rsp_ntfy_v6 {
1782 u8 request_id;
1783 u8 num_of_aps;
1784 u8 last_report;
1785 u8 reserved;
1786 struct iwl_tof_range_rsp_ap_entry_ntfy_v4 ap[IWL_TOF_MAX_APS];
1787 } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_6 */
1788
1789 /**
1790 * struct iwl_tof_range_rsp_ntfy_v7 - ranging response notification
1791 * @request_id: A Token ID of the corresponding Range request
1792 * @num_of_aps: Number of APs results
1793 * @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise.
1794 * @reserved: reserved
1795 * @ap: per-AP data
1796 */
1797 struct iwl_tof_range_rsp_ntfy_v7 {
1798 u8 request_id;
1799 u8 num_of_aps;
1800 u8 last_report;
1801 u8 reserved;
1802 struct iwl_tof_range_rsp_ap_entry_ntfy_v5 ap[IWL_TOF_MAX_APS];
1803 } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_7 */
1804
1805 /**
1806 * struct iwl_tof_range_rsp_ntfy_v9 - ranging response notification
1807 * @request_id: A Token ID of the corresponding Range request
1808 * @num_of_aps: Number of APs results
1809 * @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise.
1810 * @reserved: reserved
1811 * @ap: per-AP data
1812 */
1813 struct iwl_tof_range_rsp_ntfy_v9 {
1814 u8 request_id;
1815 u8 num_of_aps;
1816 u8 last_report;
1817 u8 reserved;
1818 struct iwl_tof_range_rsp_ap_entry_ntfy_v7 ap[IWL_TOF_MAX_APS];
1819 } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_8,
1820 * LOCATION_RANGE_RSP_NTFY_API_S_VER_9
1821 */
1822
1823 /**
1824 * struct iwl_tof_range_rsp_ntfy - ranging response notification
1825 * @request_id: A Token ID of the corresponding Range request
1826 * @num_of_aps: Number of APs results
1827 * @last_report: 1 if no more FTM sessions are scheduled, 0 otherwise.
1828 * @reserved: reserved
1829 * @ap: per-AP data
1830 */
1831 struct iwl_tof_range_rsp_ntfy {
1832 u8 request_id;
1833 u8 num_of_aps;
1834 u8 last_report;
1835 u8 reserved;
1836 struct iwl_tof_range_rsp_ap_entry_ntfy ap[IWL_TOF_MAX_APS];
1837 } __packed; /* LOCATION_RANGE_RSP_NTFY_API_S_VER_10 */
1838
1839 #define IWL_MVM_TOF_MCSI_BUF_SIZE (245)
1840 /**
1841 * struct iwl_tof_mcsi_notif - used for debug
1842 * @token: token ID for the current session
1843 * @role: '0' - initiator, '1' - responder
1844 * @reserved: reserved
1845 * @initiator_bssid: initiator machine
1846 * @responder_bssid: responder machine
1847 * @mcsi_buffer: debug data
1848 */
1849 struct iwl_tof_mcsi_notif {
1850 u8 token;
1851 u8 role;
1852 __le16 reserved;
1853 u8 initiator_bssid[ETH_ALEN];
1854 u8 responder_bssid[ETH_ALEN];
1855 u8 mcsi_buffer[IWL_MVM_TOF_MCSI_BUF_SIZE * 4];
1856 } __packed;
1857
1858 /**
1859 * struct iwl_tof_range_abort_cmd - TOF range abort command
1860 * @request_id: corresponds to a range request
1861 * @reserved: reserved
1862 */
1863 struct iwl_tof_range_abort_cmd {
1864 u8 request_id;
1865 u8 reserved[3];
1866 } __packed;
1867
1868 enum ftm_responder_stats_flags {
1869 FTM_RESP_STAT_NON_ASAP_STARTED = BIT(0),
1870 FTM_RESP_STAT_NON_ASAP_IN_WIN = BIT(1),
1871 FTM_RESP_STAT_NON_ASAP_OUT_WIN = BIT(2),
1872 FTM_RESP_STAT_TRIGGER_DUP = BIT(3),
1873 FTM_RESP_STAT_DUP = BIT(4),
1874 FTM_RESP_STAT_DUP_IN_WIN = BIT(5),
1875 FTM_RESP_STAT_DUP_OUT_WIN = BIT(6),
1876 FTM_RESP_STAT_SCHED_SUCCESS = BIT(7),
1877 FTM_RESP_STAT_ASAP_REQ = BIT(8),
1878 FTM_RESP_STAT_NON_ASAP_REQ = BIT(9),
1879 FTM_RESP_STAT_ASAP_RESP = BIT(10),
1880 FTM_RESP_STAT_NON_ASAP_RESP = BIT(11),
1881 FTM_RESP_STAT_FAIL_INITIATOR_INACTIVE = BIT(12),
1882 FTM_RESP_STAT_FAIL_INITIATOR_OUT_WIN = BIT(13),
1883 FTM_RESP_STAT_FAIL_INITIATOR_RETRY_LIM = BIT(14),
1884 FTM_RESP_STAT_FAIL_NEXT_SERVED = BIT(15),
1885 FTM_RESP_STAT_FAIL_TRIGGER_ERR = BIT(16),
1886 FTM_RESP_STAT_FAIL_GC = BIT(17),
1887 FTM_RESP_STAT_SUCCESS = BIT(18),
1888 FTM_RESP_STAT_INTEL_IE = BIT(19),
1889 FTM_RESP_STAT_INITIATOR_ACTIVE = BIT(20),
1890 FTM_RESP_STAT_MEASUREMENTS_AVAILABLE = BIT(21),
1891 FTM_RESP_STAT_TRIGGER_UNKNOWN = BIT(22),
1892 FTM_RESP_STAT_PROCESS_FAIL = BIT(23),
1893 FTM_RESP_STAT_ACK = BIT(24),
1894 FTM_RESP_STAT_NACK = BIT(25),
1895 FTM_RESP_STAT_INVALID_INITIATOR_ID = BIT(26),
1896 FTM_RESP_STAT_TIMER_MIN_DELTA = BIT(27),
1897 FTM_RESP_STAT_INITIATOR_REMOVED = BIT(28),
1898 FTM_RESP_STAT_INITIATOR_ADDED = BIT(29),
1899 FTM_RESP_STAT_ERR_LIST_FULL = BIT(30),
1900 FTM_RESP_STAT_INITIATOR_SCHED_NOW = BIT(31),
1901 }; /* RESP_IND_E */
1902
1903 /**
1904 * struct iwl_ftm_responder_stats - FTM responder statistics
1905 * @addr: initiator address
1906 * @success_ftm: number of successful ftm frames
1907 * @ftm_per_burst: num of FTM frames that were received
1908 * @flags: &enum ftm_responder_stats_flags
1909 * @duration: actual duration of FTM
1910 * @allocated_duration: time that was allocated for this FTM session
1911 * @bw: FTM request bandwidth
1912 * @rate: FTM request rate
1913 * @reserved: for alingment and future use
1914 */
1915 struct iwl_ftm_responder_stats {
1916 u8 addr[ETH_ALEN];
1917 u8 success_ftm;
1918 u8 ftm_per_burst;
1919 __le32 flags;
1920 __le32 duration;
1921 __le32 allocated_duration;
1922 u8 bw;
1923 u8 rate;
1924 __le16 reserved;
1925 } __packed; /* TOF_RESPONDER_STATISTICS_NTFY_S_VER_2 */
1926
1927 #define IWL_CSI_MAX_EXPECTED_CHUNKS 16
1928
1929 #define IWL_CSI_CHUNK_CTL_NUM_MASK_VER_1 0x0003
1930 #define IWL_CSI_CHUNK_CTL_IDX_MASK_VER_1 0x000c
1931
1932 #define IWL_CSI_CHUNK_CTL_NUM_MASK_VER_2 0x00ff
1933 #define IWL_CSI_CHUNK_CTL_IDX_MASK_VER_2 0xff00
1934
1935 struct iwl_csi_chunk_notification {
1936 __le32 token;
1937 __le16 seq;
1938 __le16 ctl;
1939 __le32 size;
1940 u8 data[];
1941 } __packed; /* CSI_CHUNKS_HDR_NTFY_API_S_VER_1/VER_2 */
1942
1943 #endif /* __iwl_fw_api_location_h__ */