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