Commit | Line | Data |
---|---|---|
8ca151b5 JB |
1 | /****************************************************************************** |
2 | * | |
3 | * This file is provided under a dual BSD/GPLv2 license. When using or | |
4 | * redistributing this file, you may do so under either license. | |
5 | * | |
6 | * GPL LICENSE SUMMARY | |
7 | * | |
51368bf7 | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
507e4cda | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
31a658b2 | 10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
e2b7f83c | 11 | * Copyright(c) 2018 - 2019 Intel Corporation |
8ca151b5 JB |
12 | * |
13 | * This program is free software; you can redistribute it and/or modify | |
14 | * it under the terms of version 2 of the GNU General Public License as | |
15 | * published by the Free Software Foundation. | |
16 | * | |
17 | * This program is distributed in the hope that it will be useful, but | |
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
20 | * General Public License for more details. | |
21 | * | |
8ca151b5 | 22 | * The full GNU General Public License is included in this distribution |
410dc5aa | 23 | * in the file called COPYING. |
8ca151b5 JB |
24 | * |
25 | * Contact Information: | |
cb2f8277 | 26 | * Intel Linux Wireless <linuxwifi@intel.com> |
8ca151b5 JB |
27 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
28 | * | |
29 | * BSD LICENSE | |
30 | * | |
51368bf7 | 31 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
507e4cda | 32 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
31a658b2 | 33 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
e2b7f83c | 34 | * Copyright(c) 2018 - 2019 Intel Corporation |
8ca151b5 JB |
35 | * All rights reserved. |
36 | * | |
37 | * Redistribution and use in source and binary forms, with or without | |
38 | * modification, are permitted provided that the following conditions | |
39 | * are met: | |
40 | * | |
41 | * * Redistributions of source code must retain the above copyright | |
42 | * notice, this list of conditions and the following disclaimer. | |
43 | * * Redistributions in binary form must reproduce the above copyright | |
44 | * notice, this list of conditions and the following disclaimer in | |
45 | * the documentation and/or other materials provided with the | |
46 | * distribution. | |
47 | * * Neither the name Intel Corporation nor the names of its | |
48 | * contributors may be used to endorse or promote products derived | |
49 | * from this software without specific prior written permission. | |
50 | * | |
51 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
52 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
53 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
54 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
55 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
56 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
57 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
58 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
59 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
60 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
61 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
62 | * | |
63 | *****************************************************************************/ | |
64 | ||
d172a5ef JB |
65 | #ifndef __iwl_fw_api_scan_h__ |
66 | #define __iwl_fw_api_scan_h__ | |
8ca151b5 | 67 | |
8ca151b5 JB |
68 | /* Scan Commands, Responses, Notifications */ |
69 | ||
8ca151b5 JB |
70 | /* Max number of IEs for direct SSID scans in a command */ |
71 | #define PROBE_OPTION_MAX 20 | |
72 | ||
19ff9b2c TM |
73 | #define SCAN_SHORT_SSID_MAX_SIZE 8 |
74 | #define SCAN_BSSID_MAX_SIZE 16 | |
75 | ||
8ca151b5 JB |
76 | /** |
77 | * struct iwl_ssid_ie - directed scan network information element | |
78 | * | |
79 | * Up to 20 of these may appear in REPLY_SCAN_CMD, | |
80 | * selected by "type" bit field in struct iwl_scan_channel; | |
81 | * each channel may select different ssids from among the 20 entries. | |
82 | * SSID IEs get transmitted in reverse order of entry. | |
acf91dda JB |
83 | * |
84 | * @id: element ID | |
85 | * @len: element length | |
86 | * @ssid: element (SSID) data | |
8ca151b5 JB |
87 | */ |
88 | struct iwl_ssid_ie { | |
89 | u8 id; | |
90 | u8 len; | |
91 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | |
92 | } __packed; /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */ | |
93 | ||
8ca151b5 | 94 | /* scan offload */ |
8ca151b5 | 95 | #define IWL_SCAN_MAX_BLACKLIST_LEN 64 |
35a000b7 | 96 | #define IWL_SCAN_SHORT_BLACKLIST_LEN 16 |
8ca151b5 JB |
97 | #define IWL_SCAN_MAX_PROFILES 11 |
98 | #define SCAN_OFFLOAD_PROBE_REQ_SIZE 512 | |
de645c93 AB |
99 | #define SCAN_NUM_BAND_PROBE_DATA_V_1 2 |
100 | #define SCAN_NUM_BAND_PROBE_DATA_V_2 3 | |
8ca151b5 JB |
101 | |
102 | /* Default watchdog (in MS) for scheduled scan iteration */ | |
103 | #define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000) | |
104 | ||
105 | #define IWL_GOOD_CRC_TH_DEFAULT cpu_to_le16(1) | |
106 | #define CAN_ABORT_STATUS 1 | |
107 | ||
108 | #define IWL_FULL_SCAN_MULTIPLIER 5 | |
109 | #define IWL_FAST_SCHED_SCAN_ITERATIONS 3 | |
cd55ccea | 110 | #define IWL_MAX_SCHED_SCAN_PLANS 2 |
8ca151b5 | 111 | |
35a000b7 DS |
112 | enum scan_framework_client { |
113 | SCAN_CLIENT_SCHED_SCAN = BIT(0), | |
114 | SCAN_CLIENT_NETDETECT = BIT(1), | |
115 | SCAN_CLIENT_ASSET_TRACKING = BIT(2), | |
116 | }; | |
117 | ||
8ca151b5 | 118 | /** |
31a658b2 | 119 | * struct iwl_scan_offload_blacklist - SCAN_OFFLOAD_BLACKLIST_S |
8ca151b5 JB |
120 | * @ssid: MAC address to filter out |
121 | * @reported_rssi: AP rssi reported to the host | |
35a000b7 | 122 | * @client_bitmap: clients ignore this entry - enum scan_framework_client |
8ca151b5 JB |
123 | */ |
124 | struct iwl_scan_offload_blacklist { | |
125 | u8 ssid[ETH_ALEN]; | |
126 | u8 reported_rssi; | |
35a000b7 | 127 | u8 client_bitmap; |
8ca151b5 JB |
128 | } __packed; |
129 | ||
130 | enum iwl_scan_offload_network_type { | |
131 | IWL_NETWORK_TYPE_BSS = 1, | |
132 | IWL_NETWORK_TYPE_IBSS = 2, | |
133 | IWL_NETWORK_TYPE_ANY = 3, | |
134 | }; | |
135 | ||
136 | enum iwl_scan_offload_band_selection { | |
137 | IWL_SCAN_OFFLOAD_SELECT_2_4 = 0x4, | |
138 | IWL_SCAN_OFFLOAD_SELECT_5_2 = 0x8, | |
139 | IWL_SCAN_OFFLOAD_SELECT_ANY = 0xc, | |
140 | }; | |
141 | ||
142 | /** | |
31a658b2 | 143 | * struct iwl_scan_offload_profile - SCAN_OFFLOAD_PROFILE_S |
8ca151b5 | 144 | * @ssid_index: index to ssid list in fixed part |
0d365ae5 | 145 | * @unicast_cipher: encryption algorithm to match - bitmap |
83b0319a | 146 | * @auth_alg: authentication algorithm to match - bitmap |
8ca151b5 JB |
147 | * @network_type: enum iwl_scan_offload_network_type |
148 | * @band_selection: enum iwl_scan_offload_band_selection | |
35a000b7 | 149 | * @client_bitmap: clients waiting for match - enum scan_framework_client |
acf91dda | 150 | * @reserved: reserved |
8ca151b5 JB |
151 | */ |
152 | struct iwl_scan_offload_profile { | |
153 | u8 ssid_index; | |
154 | u8 unicast_cipher; | |
155 | u8 auth_alg; | |
156 | u8 network_type; | |
157 | u8 band_selection; | |
35a000b7 DS |
158 | u8 client_bitmap; |
159 | u8 reserved[2]; | |
8ca151b5 JB |
160 | } __packed; |
161 | ||
162 | /** | |
31a658b2 | 163 | * struct iwl_scan_offload_profile_cfg - SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1 |
8ca151b5 JB |
164 | * @profiles: profiles to search for match |
165 | * @blacklist_len: length of blacklist | |
166 | * @num_profiles: num of profiles in the list | |
35a000b7 DS |
167 | * @match_notify: clients waiting for match found notification |
168 | * @pass_match: clients waiting for the results | |
169 | * @active_clients: active clients bitmap - enum scan_framework_client | |
6e0bbe5e | 170 | * @any_beacon_notify: clients waiting for match notification without match |
acf91dda | 171 | * @reserved: reserved |
8ca151b5 JB |
172 | */ |
173 | struct iwl_scan_offload_profile_cfg { | |
8ca151b5 JB |
174 | struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES]; |
175 | u8 blacklist_len; | |
176 | u8 num_profiles; | |
35a000b7 DS |
177 | u8 match_notify; |
178 | u8 pass_match; | |
179 | u8 active_clients; | |
6e0bbe5e DS |
180 | u8 any_beacon_notify; |
181 | u8 reserved[2]; | |
8ca151b5 JB |
182 | } __packed; |
183 | ||
184 | /** | |
31a658b2 | 185 | * struct iwl_scan_schedule_lmac - schedule of scan offload |
8ca151b5 JB |
186 | * @delay: delay between iterations, in seconds. |
187 | * @iterations: num of scan iterations | |
188 | * @full_scan_mul: number of partial scans before each full scan | |
189 | */ | |
0bef0383 | 190 | struct iwl_scan_schedule_lmac { |
b14fc2be | 191 | __le16 delay; |
8ca151b5 JB |
192 | u8 iterations; |
193 | u8 full_scan_mul; | |
0bef0383 | 194 | } __packed; /* SCAN_SCHEDULE_API_S */ |
8ca151b5 | 195 | |
0bef0383 | 196 | enum iwl_scan_offload_complete_status { |
8ca151b5 JB |
197 | IWL_SCAN_OFFLOAD_COMPLETED = 1, |
198 | IWL_SCAN_OFFLOAD_ABORTED = 2, | |
199 | }; | |
200 | ||
e820c2da HD |
201 | enum iwl_scan_ebs_status { |
202 | IWL_SCAN_EBS_SUCCESS, | |
203 | IWL_SCAN_EBS_FAILED, | |
204 | IWL_SCAN_EBS_CHAN_NOT_FOUND, | |
f0bf8593 | 205 | IWL_SCAN_EBS_INACTIVE, |
e820c2da HD |
206 | }; |
207 | ||
fb98be5e | 208 | /** |
31a658b2 | 209 | * struct iwl_scan_req_tx_cmd - SCAN_REQ_TX_CMD_API_S |
fb98be5e DS |
210 | * @tx_flags: combination of TX_CMD_FLG_* |
211 | * @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is | |
212 | * cleared. Combination of RATE_MCS_* | |
213 | * @sta_id: index of destination station in FW station table | |
214 | * @reserved: for alignment and future use | |
215 | */ | |
216 | struct iwl_scan_req_tx_cmd { | |
217 | __le32 tx_flags; | |
218 | __le32 rate_n_flags; | |
219 | u8 sta_id; | |
220 | u8 reserved[3]; | |
221 | } __packed; | |
222 | ||
223 | enum iwl_scan_channel_flags_lmac { | |
224 | IWL_UNIFIED_SCAN_CHANNEL_FULL = BIT(27), | |
225 | IWL_UNIFIED_SCAN_CHANNEL_PARTIAL = BIT(28), | |
226 | }; | |
227 | ||
228 | /** | |
31a658b2 | 229 | * struct iwl_scan_channel_cfg_lmac - SCAN_CHANNEL_CFG_S_VER2 |
fb98be5e DS |
230 | * @flags: bits 1-20: directed scan to i'th ssid |
231 | * other bits &enum iwl_scan_channel_flags_lmac | |
83b0319a | 232 | * @channel_num: channel number 1-13 etc |
fb98be5e DS |
233 | * @iter_count: scan iteration on this channel |
234 | * @iter_interval: interval in seconds between iterations on one channel | |
235 | */ | |
236 | struct iwl_scan_channel_cfg_lmac { | |
237 | __le32 flags; | |
238 | __le16 channel_num; | |
239 | __le16 iter_count; | |
240 | __le32 iter_interval; | |
241 | } __packed; | |
242 | ||
243 | /* | |
31a658b2 | 244 | * struct iwl_scan_probe_segment - PROBE_SEGMENT_API_S_VER_1 |
fb98be5e DS |
245 | * @offset: offset in the data block |
246 | * @len: length of the segment | |
247 | */ | |
248 | struct iwl_scan_probe_segment { | |
249 | __le16 offset; | |
250 | __le16 len; | |
251 | } __packed; | |
252 | ||
253 | /* iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_2 | |
254 | * @mac_header: first (and common) part of the probe | |
255 | * @band_data: band specific data | |
256 | * @common_data: last (and common) part of the probe | |
257 | * @buf: raw data block | |
258 | */ | |
de645c93 AB |
259 | struct iwl_scan_probe_req_v1 { |
260 | struct iwl_scan_probe_segment mac_header; | |
261 | struct iwl_scan_probe_segment band_data[SCAN_NUM_BAND_PROBE_DATA_V_1]; | |
262 | struct iwl_scan_probe_segment common_data; | |
263 | u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE]; | |
264 | } __packed; | |
265 | ||
266 | /* iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_v2 | |
267 | * @mac_header: first (and common) part of the probe | |
268 | * @band_data: band specific data | |
269 | * @common_data: last (and common) part of the probe | |
270 | * @buf: raw data block | |
271 | */ | |
fb98be5e DS |
272 | struct iwl_scan_probe_req { |
273 | struct iwl_scan_probe_segment mac_header; | |
de645c93 | 274 | struct iwl_scan_probe_segment band_data[SCAN_NUM_BAND_PROBE_DATA_V_2]; |
fb98be5e DS |
275 | struct iwl_scan_probe_segment common_data; |
276 | u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE]; | |
277 | } __packed; | |
278 | ||
279 | enum iwl_scan_channel_flags { | |
280 | IWL_SCAN_CHANNEL_FLAG_EBS = BIT(0), | |
281 | IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE = BIT(1), | |
282 | IWL_SCAN_CHANNEL_FLAG_CACHE_ADD = BIT(2), | |
930ab73c | 283 | IWL_SCAN_CHANNEL_FLAG_EBS_FRAG = BIT(3), |
19ff9b2c TM |
284 | IWL_SCAN_CHANNEL_FLAG_FORCE_EBS = BIT(4), |
285 | IWL_SCAN_CHANNEL_FLAG_ENABLE_CHAN_ORDER = BIT(5), | |
286 | IWL_SCAN_CHANNEL_FLAG_6G_PSC_NO_FILTER = BIT(6), | |
fb98be5e DS |
287 | }; |
288 | ||
31a658b2 | 289 | /* struct iwl_scan_channel_opt - CHANNEL_OPTIMIZATION_API_S |
1f9c418f DS |
290 | * @flags: enum iwl_scan_channel_flags |
291 | * @non_ebs_ratio: defines the ratio of number of scan iterations where EBS is | |
292 | * involved. | |
293 | * 1 - EBS is disabled. | |
294 | * 2 - every second scan will be full scan(and so on). | |
fb98be5e DS |
295 | */ |
296 | struct iwl_scan_channel_opt { | |
297 | __le16 flags; | |
298 | __le16 non_ebs_ratio; | |
299 | } __packed; | |
300 | ||
301 | /** | |
31a658b2 | 302 | * enum iwl_mvm_lmac_scan_flags - LMAC scan flags |
fb98be5e DS |
303 | * @IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL: pass all beacons and probe responses |
304 | * without filtering. | |
305 | * @IWL_MVM_LMAC_SCAN_FLAG_PASSIVE: force passive scan on all channels | |
306 | * @IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION: single channel scan | |
307 | * @IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE: send iteration complete notification | |
acf91dda | 308 | * @IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS: multiple SSID matching |
fb98be5e | 309 | * @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented |
73897bd1 AO |
310 | * @IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED: insert WFA vendor-specific TPC report |
311 | * and DS parameter set IEs into probe requests. | |
c3e230b1 DS |
312 | * @IWL_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL: use extended dwell time on channels |
313 | * 1, 6 and 11. | |
7e2a3883 | 314 | * @IWL_MVM_LMAC_SCAN_FLAG_MATCH: Send match found notification on matches |
fb98be5e DS |
315 | */ |
316 | enum iwl_mvm_lmac_scan_flags { | |
317 | IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL = BIT(0), | |
318 | IWL_MVM_LMAC_SCAN_FLAG_PASSIVE = BIT(1), | |
319 | IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION = BIT(2), | |
320 | IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE = BIT(3), | |
321 | IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS = BIT(4), | |
322 | IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED = BIT(5), | |
73897bd1 | 323 | IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED = BIT(6), |
c3e230b1 | 324 | IWL_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL = BIT(7), |
7e2a3883 | 325 | IWL_MVM_LMAC_SCAN_FLAG_MATCH = BIT(9), |
fb98be5e DS |
326 | }; |
327 | ||
328 | enum iwl_scan_priority { | |
329 | IWL_SCAN_PRIORITY_LOW, | |
330 | IWL_SCAN_PRIORITY_MEDIUM, | |
331 | IWL_SCAN_PRIORITY_HIGH, | |
332 | }; | |
333 | ||
d7afbfc4 AS |
334 | enum iwl_scan_priority_ext { |
335 | IWL_SCAN_PRIORITY_EXT_0_LOWEST, | |
336 | IWL_SCAN_PRIORITY_EXT_1, | |
337 | IWL_SCAN_PRIORITY_EXT_2, | |
338 | IWL_SCAN_PRIORITY_EXT_3, | |
339 | IWL_SCAN_PRIORITY_EXT_4, | |
340 | IWL_SCAN_PRIORITY_EXT_5, | |
341 | IWL_SCAN_PRIORITY_EXT_6, | |
342 | IWL_SCAN_PRIORITY_EXT_7_HIGHEST, | |
343 | }; | |
344 | ||
fb98be5e | 345 | /** |
31a658b2 | 346 | * struct iwl_scan_req_lmac - SCAN_REQUEST_CMD_API_S_VER_1 |
fb98be5e | 347 | * @reserved1: for alignment and future use |
83b0319a | 348 | * @n_channels: num of channels to scan |
acf91dda JB |
349 | * @active_dwell: dwell time for active channels |
350 | * @passive_dwell: dwell time for passive channels | |
351 | * @fragmented_dwell: dwell time for fragmented passive scan | |
c3e230b1 | 352 | * @extended_dwell: dwell time for channels 1, 6 and 11 (in certain cases) |
fb98be5e | 353 | * @reserved2: for alignment and future use |
83b0319a | 354 | * @rx_chain_select: PHY_RX_CHAIN_* flags |
fb98be5e DS |
355 | * @scan_flags: &enum iwl_mvm_lmac_scan_flags |
356 | * @max_out_time: max time (in TU) to be out of associated channel | |
357 | * @suspend_time: pause scan this long (TUs) when returning to service channel | |
358 | * @flags: RXON flags | |
359 | * @filter_flags: RXON filter | |
360 | * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz | |
361 | * @direct_scan: list of SSIDs for directed active scan | |
362 | * @scan_prio: enum iwl_scan_priority | |
363 | * @iter_num: number of scan iterations | |
364 | * @delay: delay in seconds before first iteration | |
365 | * @schedule: two scheduling plans. The first one is finite, the second one can | |
366 | * be infinite. | |
367 | * @channel_opt: channel optimization options, for full and partial scan | |
368 | * @data: channel configuration and probe request packet. | |
369 | */ | |
65ff556b | 370 | struct iwl_scan_req_lmac { |
fb98be5e DS |
371 | /* SCAN_REQUEST_FIXED_PART_API_S_VER_7 */ |
372 | __le32 reserved1; | |
373 | u8 n_channels; | |
374 | u8 active_dwell; | |
375 | u8 passive_dwell; | |
376 | u8 fragmented_dwell; | |
c3e230b1 DS |
377 | u8 extended_dwell; |
378 | u8 reserved2; | |
fb98be5e DS |
379 | __le16 rx_chain_select; |
380 | __le32 scan_flags; | |
381 | __le32 max_out_time; | |
382 | __le32 suspend_time; | |
383 | /* RX_ON_FLAGS_API_S_VER_1 */ | |
384 | __le32 flags; | |
385 | __le32 filter_flags; | |
386 | struct iwl_scan_req_tx_cmd tx_cmd[2]; | |
387 | struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX]; | |
388 | __le32 scan_prio; | |
389 | /* SCAN_REQ_PERIODIC_PARAMS_API_S */ | |
390 | __le32 iter_num; | |
391 | __le32 delay; | |
cd55ccea | 392 | struct iwl_scan_schedule_lmac schedule[IWL_MAX_SCHED_SCAN_PLANS]; |
fb98be5e DS |
393 | struct iwl_scan_channel_opt channel_opt[2]; |
394 | u8 data[]; | |
395 | } __packed; | |
396 | ||
397 | /** | |
1083fd73 | 398 | * struct iwl_scan_results_notif - scan results for one channel - |
fb98be5e DS |
399 | * SCAN_RESULT_NTF_API_S_VER_3 |
400 | * @channel: which channel the results are from | |
401 | * @band: 0 for 5.2 GHz, 1 for 2.4 GHz | |
402 | * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request | |
403 | * @num_probe_not_sent: # of request that weren't sent due to not enough time | |
404 | * @duration: duration spent in channel, in usecs | |
405 | */ | |
1083fd73 | 406 | struct iwl_scan_results_notif { |
fb98be5e DS |
407 | u8 channel; |
408 | u8 band; | |
409 | u8 probe_status; | |
410 | u8 num_probe_not_sent; | |
411 | __le32 duration; | |
412 | } __packed; | |
413 | ||
414 | /** | |
415 | * struct iwl_lmac_scan_complete_notif - notifies end of scanning (all channels) | |
416 | * SCAN_COMPLETE_NTF_API_S_VER_3 | |
417 | * @scanned_channels: number of channels scanned (and number of valid results) | |
418 | * @status: one of SCAN_COMP_STATUS_* | |
419 | * @bt_status: BT on/off status | |
420 | * @last_channel: last channel that was scanned | |
421 | * @tsf_low: TSF timer (lower half) in usecs | |
422 | * @tsf_high: TSF timer (higher half) in usecs | |
423 | * @results: an array of scan results, only "scanned_channels" of them are valid | |
424 | */ | |
425 | struct iwl_lmac_scan_complete_notif { | |
426 | u8 scanned_channels; | |
427 | u8 status; | |
428 | u8 bt_status; | |
429 | u8 last_channel; | |
430 | __le32 tsf_low; | |
431 | __le32 tsf_high; | |
432 | struct iwl_scan_results_notif results[]; | |
433 | } __packed; | |
434 | ||
435 | /** | |
31a658b2 | 436 | * struct iwl_scan_offload_complete - PERIODIC_SCAN_COMPLETE_NTF_API_S_VER_2 |
fb98be5e DS |
437 | * @last_schedule_line: last schedule line executed (fast or regular) |
438 | * @last_schedule_iteration: last scan iteration executed before scan abort | |
acf91dda | 439 | * @status: &enum iwl_scan_offload_complete_status |
fb98be5e | 440 | * @ebs_status: EBS success status &enum iwl_scan_ebs_status |
acf91dda JB |
441 | * @time_after_last_iter: time in seconds elapsed after last iteration |
442 | * @reserved: reserved | |
fb98be5e DS |
443 | */ |
444 | struct iwl_periodic_scan_complete { | |
445 | u8 last_schedule_line; | |
446 | u8 last_schedule_iteration; | |
447 | u8 status; | |
448 | u8 ebs_status; | |
449 | __le32 time_after_last_iter; | |
450 | __le32 reserved; | |
451 | } __packed; | |
452 | ||
d2496221 DS |
453 | /* UMAC Scan API */ |
454 | ||
507e4cda LC |
455 | /* The maximum of either of these cannot exceed 8, because we use an |
456 | * 8-bit mask (see IWL_MVM_SCAN_MASK in mvm.h). | |
457 | */ | |
e2b7f83c | 458 | #define IWL_MVM_MAX_UMAC_SCANS 4 |
507e4cda | 459 | #define IWL_MVM_MAX_LMAC_SCANS 1 |
d2496221 DS |
460 | |
461 | enum scan_config_flags { | |
462 | SCAN_CONFIG_FLAG_ACTIVATE = BIT(0), | |
463 | SCAN_CONFIG_FLAG_DEACTIVATE = BIT(1), | |
464 | SCAN_CONFIG_FLAG_FORBID_CHUB_REQS = BIT(2), | |
465 | SCAN_CONFIG_FLAG_ALLOW_CHUB_REQS = BIT(3), | |
466 | SCAN_CONFIG_FLAG_SET_TX_CHAINS = BIT(8), | |
467 | SCAN_CONFIG_FLAG_SET_RX_CHAINS = BIT(9), | |
468 | SCAN_CONFIG_FLAG_SET_AUX_STA_ID = BIT(10), | |
469 | SCAN_CONFIG_FLAG_SET_ALL_TIMES = BIT(11), | |
470 | SCAN_CONFIG_FLAG_SET_EFFECTIVE_TIMES = BIT(12), | |
471 | SCAN_CONFIG_FLAG_SET_CHANNEL_FLAGS = BIT(13), | |
472 | SCAN_CONFIG_FLAG_SET_LEGACY_RATES = BIT(14), | |
473 | SCAN_CONFIG_FLAG_SET_MAC_ADDR = BIT(15), | |
474 | SCAN_CONFIG_FLAG_SET_FRAGMENTED = BIT(16), | |
475 | SCAN_CONFIG_FLAG_CLEAR_FRAGMENTED = BIT(17), | |
476 | SCAN_CONFIG_FLAG_SET_CAM_MODE = BIT(18), | |
477 | SCAN_CONFIG_FLAG_CLEAR_CAM_MODE = BIT(19), | |
478 | SCAN_CONFIG_FLAG_SET_PROMISC_MODE = BIT(20), | |
479 | SCAN_CONFIG_FLAG_CLEAR_PROMISC_MODE = BIT(21), | |
9ba221b3 SS |
480 | SCAN_CONFIG_FLAG_SET_LMAC2_FRAGMENTED = BIT(22), |
481 | SCAN_CONFIG_FLAG_CLEAR_LMAC2_FRAGMENTED = BIT(23), | |
d2496221 DS |
482 | |
483 | /* Bits 26-31 are for num of channels in channel_array */ | |
484 | #define SCAN_CONFIG_N_CHANNELS(n) ((n) << 26) | |
485 | }; | |
486 | ||
487 | enum scan_config_rates { | |
488 | /* OFDM basic rates */ | |
489 | SCAN_CONFIG_RATE_6M = BIT(0), | |
490 | SCAN_CONFIG_RATE_9M = BIT(1), | |
491 | SCAN_CONFIG_RATE_12M = BIT(2), | |
492 | SCAN_CONFIG_RATE_18M = BIT(3), | |
493 | SCAN_CONFIG_RATE_24M = BIT(4), | |
494 | SCAN_CONFIG_RATE_36M = BIT(5), | |
495 | SCAN_CONFIG_RATE_48M = BIT(6), | |
496 | SCAN_CONFIG_RATE_54M = BIT(7), | |
497 | /* CCK basic rates */ | |
498 | SCAN_CONFIG_RATE_1M = BIT(8), | |
499 | SCAN_CONFIG_RATE_2M = BIT(9), | |
500 | SCAN_CONFIG_RATE_5M = BIT(10), | |
501 | SCAN_CONFIG_RATE_11M = BIT(11), | |
502 | ||
503 | /* Bits 16-27 are for supported rates */ | |
504 | #define SCAN_CONFIG_SUPPORTED_RATE(rate) ((rate) << 16) | |
505 | }; | |
506 | ||
507 | enum iwl_channel_flags { | |
508 | IWL_CHANNEL_FLAG_EBS = BIT(0), | |
509 | IWL_CHANNEL_FLAG_ACCURATE_EBS = BIT(1), | |
510 | IWL_CHANNEL_FLAG_EBS_ADD = BIT(2), | |
511 | IWL_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE = BIT(3), | |
512 | }; | |
513 | ||
9ba221b3 SS |
514 | /** |
515 | * struct iwl_scan_dwell | |
516 | * @active: default dwell time for active scan | |
517 | * @passive: default dwell time for passive scan | |
518 | * @fragmented: default dwell time for fragmented scan | |
519 | * @extended: default dwell time for channels 1, 6 and 11 | |
520 | */ | |
521 | struct iwl_scan_dwell { | |
522 | u8 active; | |
523 | u8 passive; | |
524 | u8 fragmented; | |
525 | u8 extended; | |
526 | } __packed; | |
527 | ||
d2496221 | 528 | /** |
3d206e68 | 529 | * struct iwl_scan_config_v1 |
d2496221 DS |
530 | * @flags: enum scan_config_flags |
531 | * @tx_chains: valid_tx antenna - ANT_* definitions | |
532 | * @rx_chains: valid_rx antenna - ANT_* definitions | |
533 | * @legacy_rates: default legacy rates - enum scan_config_rates | |
534 | * @out_of_channel_time: default max out of serving channel time | |
535 | * @suspend_time: default max suspend time | |
9ba221b3 | 536 | * @dwell: dwells for the scan |
d2496221 DS |
537 | * @mac_addr: default mac address to be used in probes |
538 | * @bcast_sta_id: the index of the station in the fw | |
539 | * @channel_flags: default channel flags - enum iwl_channel_flags | |
540 | * scan_config_channel_flag | |
541 | * @channel_array: default supported channels | |
542 | */ | |
a0b4828c | 543 | struct iwl_scan_config_v1 { |
d2496221 DS |
544 | __le32 flags; |
545 | __le32 tx_chains; | |
546 | __le32 rx_chains; | |
547 | __le32 legacy_rates; | |
548 | __le32 out_of_channel_time; | |
549 | __le32 suspend_time; | |
9ba221b3 | 550 | struct iwl_scan_dwell dwell; |
d2496221 DS |
551 | u8 mac_addr[ETH_ALEN]; |
552 | u8 bcast_sta_id; | |
553 | u8 channel_flags; | |
554 | u8 channel_array[]; | |
555 | } __packed; /* SCAN_CONFIG_DB_CMD_API_S */ | |
556 | ||
9ba221b3 | 557 | #define SCAN_TWO_LMACS 2 |
dac4df1c LC |
558 | #define SCAN_LB_LMAC_IDX 0 |
559 | #define SCAN_HB_LMAC_IDX 1 | |
9ba221b3 | 560 | |
3d206e68 | 561 | struct iwl_scan_config_v2 { |
9ba221b3 SS |
562 | __le32 flags; |
563 | __le32 tx_chains; | |
564 | __le32 rx_chains; | |
565 | __le32 legacy_rates; | |
566 | __le32 out_of_channel_time[SCAN_TWO_LMACS]; | |
567 | __le32 suspend_time[SCAN_TWO_LMACS]; | |
568 | struct iwl_scan_dwell dwell; | |
569 | u8 mac_addr[ETH_ALEN]; | |
570 | u8 bcast_sta_id; | |
571 | u8 channel_flags; | |
572 | u8 channel_array[]; | |
3d206e68 AB |
573 | } __packed; /* SCAN_CONFIG_DB_CMD_API_S_2 */ |
574 | ||
575 | /** | |
576 | * struct iwl_scan_config | |
577 | * @enable_cam_mode: whether to enable CAM mode. | |
578 | * @enable_promiscouos_mode: whether to enable promiscouos mode | |
579 | * @bcast_sta_id: the index of the station in the fw | |
580 | * @reserved: reserved | |
581 | * @tx_chains: valid_tx antenna - ANT_* definitions | |
582 | * @rx_chains: valid_rx antenna - ANT_* definitions | |
583 | */ | |
584 | struct iwl_scan_config { | |
585 | u8 enable_cam_mode; | |
586 | u8 enable_promiscouos_mode; | |
587 | u8 bcast_sta_id; | |
588 | u8 reserved; | |
589 | __le32 tx_chains; | |
590 | __le32 rx_chains; | |
9ba221b3 SS |
591 | } __packed; /* SCAN_CONFIG_DB_CMD_API_S_3 */ |
592 | ||
d2496221 | 593 | /** |
31a658b2 JB |
594 | * enum iwl_umac_scan_flags - UMAC scan flags |
595 | * @IWL_UMAC_SCAN_FLAG_PREEMPTIVE: scan process triggered by this scan request | |
d2496221 | 596 | * can be preempted by other scan requests with higher priority. |
8465fe6a AS |
597 | * The low priority scan will be resumed when the higher proirity scan is |
598 | * completed. | |
31a658b2 | 599 | * @IWL_UMAC_SCAN_FLAG_START_NOTIF: notification will be sent to the driver |
d2496221 DS |
600 | * when scan starts. |
601 | */ | |
602 | enum iwl_umac_scan_flags { | |
603 | IWL_UMAC_SCAN_FLAG_PREEMPTIVE = BIT(0), | |
604 | IWL_UMAC_SCAN_FLAG_START_NOTIF = BIT(1), | |
605 | }; | |
606 | ||
607 | enum iwl_umac_scan_uid_offsets { | |
608 | IWL_UMAC_SCAN_UID_TYPE_OFFSET = 0, | |
609 | IWL_UMAC_SCAN_UID_SEQ_OFFSET = 8, | |
610 | }; | |
611 | ||
612 | enum iwl_umac_scan_general_flags { | |
9ba221b3 SS |
613 | IWL_UMAC_SCAN_GEN_FLAGS_PERIODIC = BIT(0), |
614 | IWL_UMAC_SCAN_GEN_FLAGS_OVER_BT = BIT(1), | |
615 | IWL_UMAC_SCAN_GEN_FLAGS_PASS_ALL = BIT(2), | |
616 | IWL_UMAC_SCAN_GEN_FLAGS_PASSIVE = BIT(3), | |
617 | IWL_UMAC_SCAN_GEN_FLAGS_PRE_CONNECT = BIT(4), | |
618 | IWL_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE = BIT(5), | |
619 | IWL_UMAC_SCAN_GEN_FLAGS_MULTIPLE_SSID = BIT(6), | |
620 | IWL_UMAC_SCAN_GEN_FLAGS_FRAGMENTED = BIT(7), | |
621 | IWL_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED = BIT(8), | |
622 | IWL_UMAC_SCAN_GEN_FLAGS_MATCH = BIT(9), | |
623 | IWL_UMAC_SCAN_GEN_FLAGS_EXTENDED_DWELL = BIT(10), | |
8f691af9 ZR |
624 | /* Extended dwell is obselete when adaptive dwell is used, making this |
625 | * bit reusable. Hence, probe request defer is used only when adaptive | |
626 | * dwell is supported. */ | |
627 | IWL_UMAC_SCAN_GEN_FLAGS_PROB_REQ_DEFER_SUPP = BIT(10), | |
9ba221b3 | 628 | IWL_UMAC_SCAN_GEN_FLAGS_LMAC2_FRAGMENTED = BIT(11), |
dac4df1c | 629 | IWL_UMAC_SCAN_GEN_FLAGS_ADAPTIVE_DWELL = BIT(13), |
8f691af9 ZR |
630 | IWL_UMAC_SCAN_GEN_FLAGS_MAX_CHNL_TIME = BIT(14), |
631 | IWL_UMAC_SCAN_GEN_FLAGS_PROB_REQ_HIGH_TX_RATE = BIT(15), | |
d2496221 DS |
632 | }; |
633 | ||
66fa2424 AB |
634 | /** |
635 | * enum iwl_umac_scan_general_flags2 - UMAC scan general flags #2 | |
636 | * @IWL_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL: Whether to send a complete | |
637 | * notification per channel or not. | |
9c16e0bb AB |
638 | * @IWL_UMAC_SCAN_GEN_FLAGS2_ALLOW_CHNL_REORDER: Whether to allow channel |
639 | * reorder optimization or not. | |
66fa2424 AB |
640 | */ |
641 | enum iwl_umac_scan_general_flags2 { | |
9c16e0bb AB |
642 | IWL_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL = BIT(0), |
643 | IWL_UMAC_SCAN_GEN_FLAGS2_ALLOW_CHNL_REORDER = BIT(1), | |
66fa2424 AB |
644 | }; |
645 | ||
19ff9b2c | 646 | /** |
687db6ff SM |
647 | * enum iwl_umac_scan_general_flags_v2 - UMAC scan general flags version 2 |
648 | * | |
649 | * The FW flags were reordered and hence the driver introduce version 2 | |
650 | * | |
19ff9b2c TM |
651 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_PERIODIC: periodic or scheduled |
652 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_PASS_ALL: pass all probe responses and beacons | |
653 | * during scan iterations | |
654 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_NTFY_ITER_COMPLETE: send complete notification | |
655 | * on every iteration instead of only once after the last iteration | |
656 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC1: fragmented scan LMAC1 | |
657 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC2: fragmented scan LMAC2 | |
658 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_MATCH: does this scan check for profile matching | |
659 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_USE_ALL_RX_CHAINS: use all valid chains for RX | |
660 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_ADAPTIVE_DWELL: works with adaptive dwell | |
661 | * for active channel | |
662 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_PREEMPTIVE: can be preempted by other requests | |
663 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_NTF_START: send notification of scan start | |
664 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_MULTI_SSID: matching on multiple SSIDs | |
665 | * @IWL_UMAC_SCAN_GEN_FLAGS_V2_FORCE_PASSIVE: all the channels scanned | |
666 | * as passive | |
667 | */ | |
668 | enum iwl_umac_scan_general_flags_v2 { | |
669 | IWL_UMAC_SCAN_GEN_FLAGS_V2_PERIODIC = BIT(0), | |
670 | IWL_UMAC_SCAN_GEN_FLAGS_V2_PASS_ALL = BIT(1), | |
671 | IWL_UMAC_SCAN_GEN_FLAGS_V2_NTFY_ITER_COMPLETE = BIT(2), | |
672 | IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC1 = BIT(3), | |
673 | IWL_UMAC_SCAN_GEN_FLAGS_V2_FRAGMENTED_LMAC2 = BIT(4), | |
674 | IWL_UMAC_SCAN_GEN_FLAGS_V2_MATCH = BIT(5), | |
675 | IWL_UMAC_SCAN_GEN_FLAGS_V2_USE_ALL_RX_CHAINS = BIT(6), | |
676 | IWL_UMAC_SCAN_GEN_FLAGS_V2_ADAPTIVE_DWELL = BIT(7), | |
677 | IWL_UMAC_SCAN_GEN_FLAGS_V2_PREEMPTIVE = BIT(8), | |
678 | IWL_UMAC_SCAN_GEN_FLAGS_V2_NTF_START = BIT(9), | |
679 | IWL_UMAC_SCAN_GEN_FLAGS_V2_MULTI_SSID = BIT(10), | |
680 | IWL_UMAC_SCAN_GEN_FLAGS_V2_FORCE_PASSIVE = BIT(11), | |
681 | }; | |
682 | ||
d2496221 DS |
683 | /** |
684 | * struct iwl_scan_channel_cfg_umac | |
685 | * @flags: bitmap - 0-19: directed scan to i'th ssid. | |
686 | * @channel_num: channel number 1-13 etc. | |
de645c93 | 687 | * @band: band of channel: 0 for 2GHz, 1 for 5GHz |
d2496221 | 688 | * @iter_count: repetition count for the channel. |
0d365ae5 | 689 | * @iter_interval: interval between two scan iterations on one channel. |
d2496221 | 690 | */ |
de645c93 | 691 | struct iwl_scan_channel_cfg_umac { |
d2496221 | 692 | __le32 flags; |
de645c93 AB |
693 | /* Both versions are of the same size, so use a union without adjusting |
694 | * the command size later | |
695 | */ | |
696 | union { | |
697 | struct { | |
698 | u8 channel_num; | |
699 | u8 iter_count; | |
700 | __le16 iter_interval; | |
701 | } v1; /* SCAN_CHANNEL_CFG_S_VER1 */ | |
702 | struct { | |
703 | u8 channel_num; | |
704 | u8 band; | |
705 | u8 iter_count; | |
706 | u8 iter_interval; | |
707 | } v2; /* SCAN_CHANNEL_CFG_S_VER2 */ | |
708 | }; | |
709 | } __packed; | |
d2496221 DS |
710 | |
711 | /** | |
712 | * struct iwl_scan_umac_schedule | |
713 | * @interval: interval in seconds between scan iterations | |
714 | * @iter_count: num of scan iterations for schedule plan, 0xff for infinite loop | |
715 | * @reserved: for alignment and future use | |
716 | */ | |
717 | struct iwl_scan_umac_schedule { | |
718 | __le16 interval; | |
719 | u8 iter_count; | |
720 | u8 reserved; | |
721 | } __packed; /* SCAN_SCHED_PARAM_API_S_VER_1 */ | |
722 | ||
de645c93 AB |
723 | struct iwl_scan_req_umac_tail_v1 { |
724 | /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */ | |
725 | struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS]; | |
726 | __le16 delay; | |
727 | __le16 reserved; | |
728 | /* SCAN_PROBE_PARAMS_API_S_VER_1 */ | |
729 | struct iwl_scan_probe_req_v1 preq; | |
730 | struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX]; | |
731 | } __packed; | |
732 | ||
d2496221 DS |
733 | /** |
734 | * struct iwl_scan_req_umac_tail - the rest of the UMAC scan request command | |
735 | * parameters following channels configuration array. | |
736 | * @schedule: two scheduling plans. | |
737 | * @delay: delay in TUs before starting the first scan iteration | |
738 | * @reserved: for future use and alignment | |
739 | * @preq: probe request with IEs blocks | |
740 | * @direct_scan: list of SSIDs for directed active scan | |
741 | */ | |
de645c93 | 742 | struct iwl_scan_req_umac_tail_v2 { |
d2496221 | 743 | /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */ |
cd55ccea | 744 | struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS]; |
d2496221 DS |
745 | __le16 delay; |
746 | __le16 reserved; | |
de645c93 | 747 | /* SCAN_PROBE_PARAMS_API_S_VER_2 */ |
d2496221 DS |
748 | struct iwl_scan_probe_req preq; |
749 | struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX]; | |
750 | } __packed; | |
751 | ||
66fa2424 AB |
752 | /** |
753 | * struct iwl_scan_umac_chan_param | |
754 | * @flags: channel flags &enum iwl_scan_channel_flags | |
755 | * @count: num of channels in scan request | |
756 | * @reserved: for future use and alignment | |
757 | */ | |
758 | struct iwl_scan_umac_chan_param { | |
759 | u8 flags; | |
760 | u8 count; | |
761 | __le16 reserved; | |
762 | } __packed; /*SCAN_CHANNEL_PARAMS_API_S_VER_1 */ | |
763 | ||
d2496221 DS |
764 | /** |
765 | * struct iwl_scan_req_umac | |
d2496221 DS |
766 | * @flags: &enum iwl_umac_scan_flags |
767 | * @uid: scan id, &enum iwl_umac_scan_uid_offsets | |
768 | * @ooc_priority: out of channel priority - &enum iwl_scan_priority | |
769 | * @general_flags: &enum iwl_umac_scan_general_flags | |
aacf8f18 | 770 | * @scan_start_mac_id: report the scan start TSF time according to this mac TSF |
c3e230b1 | 771 | * @extended_dwell: dwell time for channels 1, 6 and 11 |
66fa2424 AB |
772 | * @active_dwell: dwell time for active scan per LMAC |
773 | * @passive_dwell: dwell time for passive scan per LMAC | |
d2496221 | 774 | * @fragmented_dwell: dwell time for fragmented passive scan |
dac4df1c LC |
775 | * @adwell_default_n_aps: for adaptive dwell the default number of APs |
776 | * per channel | |
777 | * @adwell_default_n_aps_social: for adaptive dwell the default | |
778 | * number of APs per social (1,6,11) channel | |
66fa2424 | 779 | * @general_flags2: &enum iwl_umac_scan_general_flags2 |
dac4df1c LC |
780 | * @adwell_max_budget: for adaptive dwell the maximal budget of TU to be added |
781 | * to total scan time | |
9ba221b3 SS |
782 | * @max_out_time: max out of serving channel time, per LMAC - for CDB there |
783 | * are 2 LMACs | |
784 | * @suspend_time: max suspend time, per LMAC - for CDB there are 2 LMACs | |
d2496221 | 785 | * @scan_priority: scan internal prioritization &enum iwl_scan_priority |
66fa2424 AB |
786 | * @num_of_fragments: Number of fragments needed for full coverage per band. |
787 | * Relevant only for fragmented scan. | |
788 | * @channel: &struct iwl_scan_umac_chan_param | |
c3e230b1 | 789 | * @reserved: for future use and alignment |
dac4df1c | 790 | * @reserved3: for future use and alignment |
d2496221 DS |
791 | * @data: &struct iwl_scan_channel_cfg_umac and |
792 | * &struct iwl_scan_req_umac_tail | |
793 | */ | |
794 | struct iwl_scan_req_umac { | |
d2496221 DS |
795 | __le32 flags; |
796 | __le32 uid; | |
797 | __le32 ooc_priority; | |
aacf8f18 | 798 | __le16 general_flags; |
dac4df1c | 799 | u8 reserved; |
aacf8f18 | 800 | u8 scan_start_mac_id; |
9ba221b3 SS |
801 | union { |
802 | struct { | |
dac4df1c LC |
803 | u8 extended_dwell; |
804 | u8 active_dwell; | |
805 | u8 passive_dwell; | |
806 | u8 fragmented_dwell; | |
9ba221b3 SS |
807 | __le32 max_out_time; |
808 | __le32 suspend_time; | |
809 | __le32 scan_priority; | |
66fa2424 | 810 | struct iwl_scan_umac_chan_param channel; |
9ba221b3 | 811 | u8 data[]; |
a0b4828c | 812 | } v1; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */ |
9ba221b3 | 813 | struct { |
dac4df1c LC |
814 | u8 extended_dwell; |
815 | u8 active_dwell; | |
816 | u8 passive_dwell; | |
817 | u8 fragmented_dwell; | |
9ba221b3 SS |
818 | __le32 max_out_time[SCAN_TWO_LMACS]; |
819 | __le32 suspend_time[SCAN_TWO_LMACS]; | |
820 | __le32 scan_priority; | |
66fa2424 | 821 | struct iwl_scan_umac_chan_param channel; |
9ba221b3 | 822 | u8 data[]; |
a0b4828c | 823 | } v6; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_6 */ |
dac4df1c LC |
824 | struct { |
825 | u8 active_dwell; | |
826 | u8 passive_dwell; | |
827 | u8 fragmented_dwell; | |
828 | u8 adwell_default_n_aps; | |
829 | u8 adwell_default_n_aps_social; | |
830 | u8 reserved3; | |
831 | __le16 adwell_max_budget; | |
832 | __le32 max_out_time[SCAN_TWO_LMACS]; | |
833 | __le32 suspend_time[SCAN_TWO_LMACS]; | |
834 | __le32 scan_priority; | |
66fa2424 | 835 | struct iwl_scan_umac_chan_param channel; |
dac4df1c LC |
836 | u8 data[]; |
837 | } v7; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_7 */ | |
66fa2424 AB |
838 | struct { |
839 | u8 active_dwell[SCAN_TWO_LMACS]; | |
840 | u8 reserved2; | |
841 | u8 adwell_default_n_aps; | |
842 | u8 adwell_default_n_aps_social; | |
843 | u8 general_flags2; | |
844 | __le16 adwell_max_budget; | |
845 | __le32 max_out_time[SCAN_TWO_LMACS]; | |
846 | __le32 suspend_time[SCAN_TWO_LMACS]; | |
847 | __le32 scan_priority; | |
848 | u8 passive_dwell[SCAN_TWO_LMACS]; | |
849 | u8 num_of_fragments[SCAN_TWO_LMACS]; | |
850 | struct iwl_scan_umac_chan_param channel; | |
851 | u8 data[]; | |
852 | } v8; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_8 */ | |
3e832fd1 SM |
853 | struct { |
854 | u8 active_dwell[SCAN_TWO_LMACS]; | |
855 | u8 adwell_default_hb_n_aps; | |
856 | u8 adwell_default_lb_n_aps; | |
857 | u8 adwell_default_n_aps_social; | |
858 | u8 general_flags2; | |
859 | __le16 adwell_max_budget; | |
860 | __le32 max_out_time[SCAN_TWO_LMACS]; | |
861 | __le32 suspend_time[SCAN_TWO_LMACS]; | |
862 | __le32 scan_priority; | |
863 | u8 passive_dwell[SCAN_TWO_LMACS]; | |
864 | u8 num_of_fragments[SCAN_TWO_LMACS]; | |
865 | struct iwl_scan_umac_chan_param channel; | |
866 | u8 data[]; | |
867 | } v9; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_9 */ | |
9ba221b3 SS |
868 | }; |
869 | } __packed; | |
870 | ||
66fa2424 | 871 | #define IWL_SCAN_REQ_UMAC_SIZE_V8 sizeof(struct iwl_scan_req_umac) |
a083429e LC |
872 | #define IWL_SCAN_REQ_UMAC_SIZE_V7 48 |
873 | #define IWL_SCAN_REQ_UMAC_SIZE_V6 44 | |
874 | #define IWL_SCAN_REQ_UMAC_SIZE_V1 36 | |
d2496221 | 875 | |
19ff9b2c | 876 | /** |
687db6ff | 877 | * struct iwl_scan_probe_params_v3 |
19ff9b2c TM |
878 | * @preq: scan probe request params |
879 | * @ssid_num: number of valid SSIDs in direct scan array | |
880 | * @short_ssid_num: number of valid short SSIDs in short ssid array | |
881 | * @bssid_num: number of valid bssid in bssids array | |
882 | * @reserved: reserved | |
883 | * @direct_scan: list of ssids | |
884 | * @short_ssid: array of short ssids | |
885 | * @bssid_array: array of bssids | |
687db6ff SM |
886 | */ |
887 | struct iwl_scan_probe_params_v3 { | |
19ff9b2c TM |
888 | struct iwl_scan_probe_req preq; |
889 | u8 ssid_num; | |
890 | u8 short_ssid_num; | |
891 | u8 bssid_num; | |
892 | u8 reserved; | |
893 | struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX]; | |
894 | __le32 short_ssid[SCAN_SHORT_SSID_MAX_SIZE]; | |
895 | u8 bssid_array[ETH_ALEN][SCAN_BSSID_MAX_SIZE]; | |
896 | } __packed; | |
897 | ||
898 | #define SCAN_MAX_NUM_CHANS_V3 67 | |
899 | ||
900 | /** | |
687db6ff | 901 | * struct iwl_scan_channel_params_v3 |
19ff9b2c TM |
902 | * @flags: channel flags &enum iwl_scan_channel_flags |
903 | * @count: num of channels in scan request | |
904 | * @reserved: for future use and alignment | |
905 | * @channel_config: array of explicit channel configurations | |
906 | * for 2.4Ghz and 5.2Ghz bands | |
907 | */ | |
687db6ff | 908 | struct iwl_scan_channel_params_v3 { |
19ff9b2c TM |
909 | u8 flags; |
910 | u8 count; | |
911 | __le16 reserved; | |
912 | struct iwl_scan_channel_cfg_umac channel_config[SCAN_MAX_NUM_CHANS_V3]; | |
687db6ff | 913 | } __packed; /* SCAN_CHANNEL_PARAMS_API_S_VER_3 */ |
19ff9b2c | 914 | |
5167ff45 SM |
915 | /** |
916 | * struct iwl_scan_channel_params_v4 | |
917 | * @flags: channel flags &enum iwl_scan_channel_flags | |
918 | * @count: num of channels in scan request | |
919 | * @num_of_aps_override: override the number of APs the FW uses to calculate | |
920 | * dwell time when adaptive dwell is used | |
921 | * @reserved: for future use and alignment | |
922 | * @channel_config: array of explicit channel configurations | |
923 | * for 2.4Ghz and 5.2Ghz bands | |
924 | * @adwell_ch_override_bitmap: when using adaptive dwell, override the number | |
925 | * of APs value with &num_of_aps_override for the channel. | |
926 | * To cast channel to index, use &iwl_mvm_scan_ch_and_band_to_idx | |
927 | */ | |
928 | struct iwl_scan_channel_params_v4 { | |
929 | u8 flags; | |
930 | u8 count; | |
931 | u8 num_of_aps_override; | |
932 | u8 reserved; | |
933 | struct iwl_scan_channel_cfg_umac channel_config[SCAN_MAX_NUM_CHANS_V3]; | |
934 | u8 adwell_ch_override_bitmap[16]; | |
935 | } __packed; /* SCAN_CHANNEL_PARAMS_API_S_VER_4 */ | |
936 | ||
687db6ff SM |
937 | /** |
938 | * struct iwl_scan_general_params_v10 | |
939 | * @flags: &enum iwl_umac_scan_flags | |
940 | * @reserved: reserved for future | |
941 | * @scan_start_mac_id: report the scan start TSF time according to this mac TSF | |
942 | * @active_dwell: dwell time for active scan per LMAC | |
943 | * @adwell_default_2g: adaptive dwell default number of APs | |
944 | * for 2.4GHz channel | |
945 | * @adwell_default_5g: adaptive dwell default number of APs | |
946 | * for 5GHz channels | |
947 | * @adwell_default_social_chn: adaptive dwell default number of | |
948 | * APs per social channel | |
949 | * @reserved1: reserved for future | |
950 | * @adwell_max_budget: the maximal number of TUs that adaptive dwell | |
951 | * can add to the total scan time | |
952 | * @max_out_of_time: max out of serving channel time, per LMAC | |
953 | * @suspend_time: max suspend time, per LMAC | |
954 | * @scan_priority: priority of the request | |
955 | * @passive_dwell: continues dwell time for passive channel | |
956 | * (without adaptive dwell) | |
957 | * @num_of_fragments: number of fragments needed for full fragmented | |
958 | * scan coverage. | |
959 | */ | |
960 | struct iwl_scan_general_params_v10 { | |
19ff9b2c TM |
961 | __le16 flags; |
962 | u8 reserved; | |
963 | u8 scan_start_mac_id; | |
964 | u8 active_dwell[SCAN_TWO_LMACS]; | |
965 | u8 adwell_default_2g; | |
966 | u8 adwell_default_5g; | |
967 | u8 adwell_default_social_chn; | |
968 | u8 reserved1; | |
969 | __le16 adwell_max_budget; | |
970 | __le32 max_out_of_time[SCAN_TWO_LMACS]; | |
971 | __le32 suspend_time[SCAN_TWO_LMACS]; | |
972 | __le32 scan_priority; | |
973 | u8 passive_dwell[SCAN_TWO_LMACS]; | |
974 | u8 num_of_fragments[SCAN_TWO_LMACS]; | |
687db6ff | 975 | } __packed; /* SCAN_GENERAL_PARAMS_API_S_VER_10 */ |
19ff9b2c TM |
976 | |
977 | /** | |
687db6ff SM |
978 | * struct iwl_scan_periodic_parms_v1 |
979 | * @schedule: can scheduling parameter | |
980 | * @delay: initial delay of the periodic scan in seconds | |
981 | * @reserved: reserved for future | |
982 | */ | |
983 | struct iwl_scan_periodic_parms_v1 { | |
19ff9b2c TM |
984 | struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS]; |
985 | __le16 delay; | |
986 | __le16 reserved; | |
687db6ff | 987 | } __packed; /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */ |
19ff9b2c TM |
988 | |
989 | /** | |
687db6ff SM |
990 | * struct iwl_scan_req_params_v11 |
991 | * @general_params: &struct iwl_scan_general_params_v10 | |
992 | * @channel_params: &struct iwl_scan_channel_params_v3 | |
993 | * @periodic_params: &struct iwl_scan_periodic_parms_v1 | |
994 | * @probe_params: &struct iwl_scan_probe_params_v3 | |
995 | */ | |
996 | struct iwl_scan_req_params_v11 { | |
997 | struct iwl_scan_general_params_v10 general_params; | |
998 | struct iwl_scan_channel_params_v3 channel_params; | |
999 | struct iwl_scan_periodic_parms_v1 periodic_params; | |
1000 | struct iwl_scan_probe_params_v3 probe_params; | |
1001 | } __packed; /* SCAN_REQUEST_PARAMS_API_S_VER_11 */ | |
19ff9b2c | 1002 | |
5167ff45 SM |
1003 | /** |
1004 | * struct iwl_scan_req_params_v12 | |
1005 | * @general_params: &struct iwl_scan_general_params_v10 | |
1006 | * @channel_params: &struct iwl_scan_channel_params_v4 | |
1007 | * @periodic_params: &struct iwl_scan_periodic_parms_v1 | |
1008 | * @probe_params: &struct iwl_scan_probe_params_v3 | |
1009 | */ | |
1010 | struct iwl_scan_req_params_v12 { | |
1011 | struct iwl_scan_general_params_v10 general_params; | |
1012 | struct iwl_scan_channel_params_v4 channel_params; | |
1013 | struct iwl_scan_periodic_parms_v1 periodic_params; | |
1014 | struct iwl_scan_probe_params_v3 probe_params; | |
1015 | } __packed; /* SCAN_REQUEST_PARAMS_API_S_VER_12 */ | |
1016 | ||
19ff9b2c | 1017 | /** |
687db6ff | 1018 | * struct iwl_scan_req_umac_v11 |
19ff9b2c TM |
1019 | * @uid: scan id, &enum iwl_umac_scan_uid_offsets |
1020 | * @ooc_priority: out of channel priority - &enum iwl_scan_priority | |
1021 | * @scan_params: scan parameters | |
1022 | */ | |
687db6ff | 1023 | struct iwl_scan_req_umac_v11 { |
19ff9b2c TM |
1024 | __le32 uid; |
1025 | __le32 ooc_priority; | |
687db6ff SM |
1026 | struct iwl_scan_req_params_v11 scan_params; |
1027 | } __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_11 */ | |
19ff9b2c | 1028 | |
5167ff45 SM |
1029 | /** |
1030 | * struct iwl_scan_req_umac_v12 | |
1031 | * @uid: scan id, &enum iwl_umac_scan_uid_offsets | |
1032 | * @ooc_priority: out of channel priority - &enum iwl_scan_priority | |
1033 | * @scan_params: scan parameters | |
1034 | */ | |
1035 | struct iwl_scan_req_umac_v12 { | |
1036 | __le32 uid; | |
1037 | __le32 ooc_priority; | |
1038 | struct iwl_scan_req_params_v12 scan_params; | |
1039 | } __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_12 */ | |
1040 | ||
d2496221 DS |
1041 | /** |
1042 | * struct iwl_umac_scan_abort | |
d2496221 DS |
1043 | * @uid: scan id, &enum iwl_umac_scan_uid_offsets |
1044 | * @flags: reserved | |
1045 | */ | |
1046 | struct iwl_umac_scan_abort { | |
d2496221 DS |
1047 | __le32 uid; |
1048 | __le32 flags; | |
1049 | } __packed; /* SCAN_ABORT_CMD_UMAC_API_S_VER_1 */ | |
1050 | ||
1051 | /** | |
1052 | * struct iwl_umac_scan_complete | |
1053 | * @uid: scan id, &enum iwl_umac_scan_uid_offsets | |
1054 | * @last_schedule: last scheduling line | |
acf91dda JB |
1055 | * @last_iter: last scan iteration number |
1056 | * @status: &enum iwl_scan_offload_complete_status | |
d2496221 DS |
1057 | * @ebs_status: &enum iwl_scan_ebs_status |
1058 | * @time_from_last_iter: time elapsed from last iteration | |
1059 | * @reserved: for future use | |
1060 | */ | |
1061 | struct iwl_umac_scan_complete { | |
1062 | __le32 uid; | |
1063 | u8 last_schedule; | |
1064 | u8 last_iter; | |
1065 | u8 status; | |
1066 | u8 ebs_status; | |
1067 | __le32 time_from_last_iter; | |
1068 | __le32 reserved; | |
1069 | } __packed; /* SCAN_COMPLETE_NTF_UMAC_API_S_VER_1 */ | |
1070 | ||
e4fe5d4b IP |
1071 | #define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN_V1 5 |
1072 | #define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN 7 | |
1073 | ||
1074 | /** | |
1075 | * struct iwl_scan_offload_profile_match_v1 - match information | |
1076 | * @bssid: matched bssid | |
1077 | * @reserved: reserved | |
1078 | * @channel: channel where the match occurred | |
1079 | * @energy: energy | |
1080 | * @matching_feature: feature matches | |
1081 | * @matching_channels: bitmap of channels that matched, referencing | |
1082 | * the channels passed in the scan offload request. | |
1083 | */ | |
1084 | struct iwl_scan_offload_profile_match_v1 { | |
1085 | u8 bssid[ETH_ALEN]; | |
1086 | __le16 reserved; | |
1087 | u8 channel; | |
1088 | u8 energy; | |
1089 | u8 matching_feature; | |
1090 | u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN_V1]; | |
1091 | } __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_1 */ | |
1092 | ||
1093 | /** | |
1094 | * struct iwl_scan_offload_profiles_query_v1 - match results query response | |
1095 | * @matched_profiles: bitmap of matched profiles, referencing the | |
1096 | * matches passed in the scan offload request | |
1097 | * @last_scan_age: age of the last offloaded scan | |
1098 | * @n_scans_done: number of offloaded scans done | |
1099 | * @gp2_d0u: GP2 when D0U occurred | |
1100 | * @gp2_invoked: GP2 when scan offload was invoked | |
1101 | * @resume_while_scanning: not used | |
1102 | * @self_recovery: obsolete | |
1103 | * @reserved: reserved | |
1104 | * @matches: array of match information, one for each match | |
1105 | */ | |
1106 | struct iwl_scan_offload_profiles_query_v1 { | |
1107 | __le32 matched_profiles; | |
1108 | __le32 last_scan_age; | |
1109 | __le32 n_scans_done; | |
1110 | __le32 gp2_d0u; | |
1111 | __le32 gp2_invoked; | |
1112 | u8 resume_while_scanning; | |
1113 | u8 self_recovery; | |
1114 | __le16 reserved; | |
1115 | struct iwl_scan_offload_profile_match_v1 matches[IWL_SCAN_MAX_PROFILES]; | |
1116 | } __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_2 */ | |
1117 | ||
b04998f3 LC |
1118 | /** |
1119 | * struct iwl_scan_offload_profile_match - match information | |
1120 | * @bssid: matched bssid | |
acf91dda | 1121 | * @reserved: reserved |
b04998f3 | 1122 | * @channel: channel where the match occurred |
acf91dda JB |
1123 | * @energy: energy |
1124 | * @matching_feature: feature matches | |
b04998f3 | 1125 | * @matching_channels: bitmap of channels that matched, referencing |
e4fe5d4b | 1126 | * the channels passed in the scan offload request. |
b04998f3 LC |
1127 | */ |
1128 | struct iwl_scan_offload_profile_match { | |
1129 | u8 bssid[ETH_ALEN]; | |
1130 | __le16 reserved; | |
1131 | u8 channel; | |
1132 | u8 energy; | |
1133 | u8 matching_feature; | |
1134 | u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN]; | |
e4fe5d4b | 1135 | } __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_2 */ |
b04998f3 LC |
1136 | |
1137 | /** | |
1138 | * struct iwl_scan_offload_profiles_query - match results query response | |
1139 | * @matched_profiles: bitmap of matched profiles, referencing the | |
1140 | * matches passed in the scan offload request | |
1141 | * @last_scan_age: age of the last offloaded scan | |
1142 | * @n_scans_done: number of offloaded scans done | |
1143 | * @gp2_d0u: GP2 when D0U occurred | |
1144 | * @gp2_invoked: GP2 when scan offload was invoked | |
1145 | * @resume_while_scanning: not used | |
1146 | * @self_recovery: obsolete | |
1147 | * @reserved: reserved | |
1148 | * @matches: array of match information, one for each match | |
1149 | */ | |
1150 | struct iwl_scan_offload_profiles_query { | |
1151 | __le32 matched_profiles; | |
1152 | __le32 last_scan_age; | |
1153 | __le32 n_scans_done; | |
1154 | __le32 gp2_d0u; | |
1155 | __le32 gp2_invoked; | |
1156 | u8 resume_while_scanning; | |
1157 | u8 self_recovery; | |
1158 | __le16 reserved; | |
1159 | struct iwl_scan_offload_profile_match matches[IWL_SCAN_MAX_PROFILES]; | |
e4fe5d4b | 1160 | } __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_3 */ |
b04998f3 | 1161 | |
ee9219b2 AS |
1162 | /** |
1163 | * struct iwl_umac_scan_iter_complete_notif - notifies end of scanning iteration | |
1164 | * @uid: scan id, &enum iwl_umac_scan_uid_offsets | |
1165 | * @scanned_channels: number of channels scanned and number of valid elements in | |
1166 | * results array | |
1167 | * @status: one of SCAN_COMP_STATUS_* | |
1168 | * @bt_status: BT on/off status | |
1169 | * @last_channel: last channel that was scanned | |
aacf8f18 AS |
1170 | * @start_tsf: TSF timer in usecs of the scan start time for the mac specified |
1171 | * in &struct iwl_scan_req_umac. | |
550aba9b | 1172 | * @results: array of scan results, length in @scanned_channels |
ee9219b2 AS |
1173 | */ |
1174 | struct iwl_umac_scan_iter_complete_notif { | |
1175 | __le32 uid; | |
1176 | u8 scanned_channels; | |
1177 | u8 status; | |
1178 | u8 bt_status; | |
1179 | u8 last_channel; | |
aacf8f18 | 1180 | __le64 start_tsf; |
ee9219b2 | 1181 | struct iwl_scan_results_notif results[]; |
aacf8f18 | 1182 | } __packed; /* SCAN_ITER_COMPLETE_NTF_UMAC_API_S_VER_2 */ |
ee9219b2 | 1183 | |
d172a5ef | 1184 | #endif /* __iwl_fw_api_scan_h__ */ |