1 /******************************************************************************
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.
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 * Copyright(c) 2018 Intel Corporation
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.
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.
22 * The full GNU General Public License is included in this distribution
23 * in the file called COPYING.
25 * Contact Information:
26 * Intel Linux Wireless <linuxwifi@intel.com>
27 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34 * Copyright(c) 2018 Intel Corporation
35 * All rights reserved.
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
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
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.
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.
63 *****************************************************************************/
65 #ifndef __iwl_fw_api_scan_h__
66 #define __iwl_fw_api_scan_h__
68 /* Scan Commands, Responses, Notifications */
70 /* Max number of IEs for direct SSID scans in a command */
71 #define PROBE_OPTION_MAX 20
74 * struct iwl_ssid_ie - directed scan network information element
76 * Up to 20 of these may appear in REPLY_SCAN_CMD,
77 * selected by "type" bit field in struct iwl_scan_channel;
78 * each channel may select different ssids from among the 20 entries.
79 * SSID IEs get transmitted in reverse order of entry.
82 * @len: element length
83 * @ssid: element (SSID) data
88 u8 ssid[IEEE80211_MAX_SSID_LEN];
89 } __packed; /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
92 #define IWL_SCAN_MAX_BLACKLIST_LEN 64
93 #define IWL_SCAN_SHORT_BLACKLIST_LEN 16
94 #define IWL_SCAN_MAX_PROFILES 11
95 #define SCAN_OFFLOAD_PROBE_REQ_SIZE 512
97 /* Default watchdog (in MS) for scheduled scan iteration */
98 #define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000)
100 #define IWL_GOOD_CRC_TH_DEFAULT cpu_to_le16(1)
101 #define CAN_ABORT_STATUS 1
103 #define IWL_FULL_SCAN_MULTIPLIER 5
104 #define IWL_FAST_SCHED_SCAN_ITERATIONS 3
105 #define IWL_MAX_SCHED_SCAN_PLANS 2
107 enum scan_framework_client {
108 SCAN_CLIENT_SCHED_SCAN = BIT(0),
109 SCAN_CLIENT_NETDETECT = BIT(1),
110 SCAN_CLIENT_ASSET_TRACKING = BIT(2),
114 * struct iwl_scan_offload_blacklist - SCAN_OFFLOAD_BLACKLIST_S
115 * @ssid: MAC address to filter out
116 * @reported_rssi: AP rssi reported to the host
117 * @client_bitmap: clients ignore this entry - enum scan_framework_client
119 struct iwl_scan_offload_blacklist {
125 enum iwl_scan_offload_network_type {
126 IWL_NETWORK_TYPE_BSS = 1,
127 IWL_NETWORK_TYPE_IBSS = 2,
128 IWL_NETWORK_TYPE_ANY = 3,
131 enum iwl_scan_offload_band_selection {
132 IWL_SCAN_OFFLOAD_SELECT_2_4 = 0x4,
133 IWL_SCAN_OFFLOAD_SELECT_5_2 = 0x8,
134 IWL_SCAN_OFFLOAD_SELECT_ANY = 0xc,
138 * struct iwl_scan_offload_profile - SCAN_OFFLOAD_PROFILE_S
139 * @ssid_index: index to ssid list in fixed part
140 * @unicast_cipher: encryption algorithm to match - bitmap
141 * @auth_alg: authentication algorithm to match - bitmap
142 * @network_type: enum iwl_scan_offload_network_type
143 * @band_selection: enum iwl_scan_offload_band_selection
144 * @client_bitmap: clients waiting for match - enum scan_framework_client
145 * @reserved: reserved
147 struct iwl_scan_offload_profile {
158 * struct iwl_scan_offload_profile_cfg - SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1
159 * @profiles: profiles to search for match
160 * @blacklist_len: length of blacklist
161 * @num_profiles: num of profiles in the list
162 * @match_notify: clients waiting for match found notification
163 * @pass_match: clients waiting for the results
164 * @active_clients: active clients bitmap - enum scan_framework_client
165 * @any_beacon_notify: clients waiting for match notification without match
166 * @reserved: reserved
168 struct iwl_scan_offload_profile_cfg {
169 struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES];
175 u8 any_beacon_notify;
180 * struct iwl_scan_schedule_lmac - schedule of scan offload
181 * @delay: delay between iterations, in seconds.
182 * @iterations: num of scan iterations
183 * @full_scan_mul: number of partial scans before each full scan
185 struct iwl_scan_schedule_lmac {
189 } __packed; /* SCAN_SCHEDULE_API_S */
191 enum iwl_scan_offload_complete_status {
192 IWL_SCAN_OFFLOAD_COMPLETED = 1,
193 IWL_SCAN_OFFLOAD_ABORTED = 2,
196 enum iwl_scan_ebs_status {
197 IWL_SCAN_EBS_SUCCESS,
199 IWL_SCAN_EBS_CHAN_NOT_FOUND,
200 IWL_SCAN_EBS_INACTIVE,
204 * struct iwl_scan_req_tx_cmd - SCAN_REQ_TX_CMD_API_S
205 * @tx_flags: combination of TX_CMD_FLG_*
206 * @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is
207 * cleared. Combination of RATE_MCS_*
208 * @sta_id: index of destination station in FW station table
209 * @reserved: for alignment and future use
211 struct iwl_scan_req_tx_cmd {
218 enum iwl_scan_channel_flags_lmac {
219 IWL_UNIFIED_SCAN_CHANNEL_FULL = BIT(27),
220 IWL_UNIFIED_SCAN_CHANNEL_PARTIAL = BIT(28),
224 * struct iwl_scan_channel_cfg_lmac - SCAN_CHANNEL_CFG_S_VER2
225 * @flags: bits 1-20: directed scan to i'th ssid
226 * other bits &enum iwl_scan_channel_flags_lmac
227 * @channel_num: channel number 1-13 etc
228 * @iter_count: scan iteration on this channel
229 * @iter_interval: interval in seconds between iterations on one channel
231 struct iwl_scan_channel_cfg_lmac {
235 __le32 iter_interval;
239 * struct iwl_scan_probe_segment - PROBE_SEGMENT_API_S_VER_1
240 * @offset: offset in the data block
241 * @len: length of the segment
243 struct iwl_scan_probe_segment {
248 /* iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_2
249 * @mac_header: first (and common) part of the probe
250 * @band_data: band specific data
251 * @common_data: last (and common) part of the probe
252 * @buf: raw data block
254 struct iwl_scan_probe_req {
255 struct iwl_scan_probe_segment mac_header;
256 struct iwl_scan_probe_segment band_data[2];
257 struct iwl_scan_probe_segment common_data;
258 u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE];
261 enum iwl_scan_channel_flags {
262 IWL_SCAN_CHANNEL_FLAG_EBS = BIT(0),
263 IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE = BIT(1),
264 IWL_SCAN_CHANNEL_FLAG_CACHE_ADD = BIT(2),
267 /* struct iwl_scan_channel_opt - CHANNEL_OPTIMIZATION_API_S
268 * @flags: enum iwl_scan_channel_flags
269 * @non_ebs_ratio: defines the ratio of number of scan iterations where EBS is
271 * 1 - EBS is disabled.
272 * 2 - every second scan will be full scan(and so on).
274 struct iwl_scan_channel_opt {
276 __le16 non_ebs_ratio;
280 * enum iwl_mvm_lmac_scan_flags - LMAC scan flags
281 * @IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL: pass all beacons and probe responses
283 * @IWL_MVM_LMAC_SCAN_FLAG_PASSIVE: force passive scan on all channels
284 * @IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION: single channel scan
285 * @IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE: send iteration complete notification
286 * @IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS: multiple SSID matching
287 * @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented
288 * @IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED: insert WFA vendor-specific TPC report
289 * and DS parameter set IEs into probe requests.
290 * @IWL_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL: use extended dwell time on channels
292 * @IWL_MVM_LMAC_SCAN_FLAG_MATCH: Send match found notification on matches
294 enum iwl_mvm_lmac_scan_flags {
295 IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL = BIT(0),
296 IWL_MVM_LMAC_SCAN_FLAG_PASSIVE = BIT(1),
297 IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION = BIT(2),
298 IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE = BIT(3),
299 IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS = BIT(4),
300 IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED = BIT(5),
301 IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED = BIT(6),
302 IWL_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL = BIT(7),
303 IWL_MVM_LMAC_SCAN_FLAG_MATCH = BIT(9),
306 enum iwl_scan_priority {
307 IWL_SCAN_PRIORITY_LOW,
308 IWL_SCAN_PRIORITY_MEDIUM,
309 IWL_SCAN_PRIORITY_HIGH,
312 enum iwl_scan_priority_ext {
313 IWL_SCAN_PRIORITY_EXT_0_LOWEST,
314 IWL_SCAN_PRIORITY_EXT_1,
315 IWL_SCAN_PRIORITY_EXT_2,
316 IWL_SCAN_PRIORITY_EXT_3,
317 IWL_SCAN_PRIORITY_EXT_4,
318 IWL_SCAN_PRIORITY_EXT_5,
319 IWL_SCAN_PRIORITY_EXT_6,
320 IWL_SCAN_PRIORITY_EXT_7_HIGHEST,
324 * struct iwl_scan_req_lmac - SCAN_REQUEST_CMD_API_S_VER_1
325 * @reserved1: for alignment and future use
326 * @n_channels: num of channels to scan
327 * @active_dwell: dwell time for active channels
328 * @passive_dwell: dwell time for passive channels
329 * @fragmented_dwell: dwell time for fragmented passive scan
330 * @extended_dwell: dwell time for channels 1, 6 and 11 (in certain cases)
331 * @reserved2: for alignment and future use
332 * @rx_chain_select: PHY_RX_CHAIN_* flags
333 * @scan_flags: &enum iwl_mvm_lmac_scan_flags
334 * @max_out_time: max time (in TU) to be out of associated channel
335 * @suspend_time: pause scan this long (TUs) when returning to service channel
337 * @filter_flags: RXON filter
338 * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz
339 * @direct_scan: list of SSIDs for directed active scan
340 * @scan_prio: enum iwl_scan_priority
341 * @iter_num: number of scan iterations
342 * @delay: delay in seconds before first iteration
343 * @schedule: two scheduling plans. The first one is finite, the second one can
345 * @channel_opt: channel optimization options, for full and partial scan
346 * @data: channel configuration and probe request packet.
348 struct iwl_scan_req_lmac {
349 /* SCAN_REQUEST_FIXED_PART_API_S_VER_7 */
357 __le16 rx_chain_select;
361 /* RX_ON_FLAGS_API_S_VER_1 */
364 struct iwl_scan_req_tx_cmd tx_cmd[2];
365 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
367 /* SCAN_REQ_PERIODIC_PARAMS_API_S */
370 struct iwl_scan_schedule_lmac schedule[IWL_MAX_SCHED_SCAN_PLANS];
371 struct iwl_scan_channel_opt channel_opt[2];
376 * struct iwl_scan_results_notif - scan results for one channel -
377 * SCAN_RESULT_NTF_API_S_VER_3
378 * @channel: which channel the results are from
379 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
380 * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
381 * @num_probe_not_sent: # of request that weren't sent due to not enough time
382 * @duration: duration spent in channel, in usecs
384 struct iwl_scan_results_notif {
388 u8 num_probe_not_sent;
393 * struct iwl_lmac_scan_complete_notif - notifies end of scanning (all channels)
394 * SCAN_COMPLETE_NTF_API_S_VER_3
395 * @scanned_channels: number of channels scanned (and number of valid results)
396 * @status: one of SCAN_COMP_STATUS_*
397 * @bt_status: BT on/off status
398 * @last_channel: last channel that was scanned
399 * @tsf_low: TSF timer (lower half) in usecs
400 * @tsf_high: TSF timer (higher half) in usecs
401 * @results: an array of scan results, only "scanned_channels" of them are valid
403 struct iwl_lmac_scan_complete_notif {
410 struct iwl_scan_results_notif results[];
414 * struct iwl_scan_offload_complete - PERIODIC_SCAN_COMPLETE_NTF_API_S_VER_2
415 * @last_schedule_line: last schedule line executed (fast or regular)
416 * @last_schedule_iteration: last scan iteration executed before scan abort
417 * @status: &enum iwl_scan_offload_complete_status
418 * @ebs_status: EBS success status &enum iwl_scan_ebs_status
419 * @time_after_last_iter: time in seconds elapsed after last iteration
420 * @reserved: reserved
422 struct iwl_periodic_scan_complete {
423 u8 last_schedule_line;
424 u8 last_schedule_iteration;
427 __le32 time_after_last_iter;
433 /* The maximum of either of these cannot exceed 8, because we use an
434 * 8-bit mask (see IWL_MVM_SCAN_MASK in mvm.h).
436 #define IWL_MVM_MAX_UMAC_SCANS 8
437 #define IWL_MVM_MAX_LMAC_SCANS 1
439 enum scan_config_flags {
440 SCAN_CONFIG_FLAG_ACTIVATE = BIT(0),
441 SCAN_CONFIG_FLAG_DEACTIVATE = BIT(1),
442 SCAN_CONFIG_FLAG_FORBID_CHUB_REQS = BIT(2),
443 SCAN_CONFIG_FLAG_ALLOW_CHUB_REQS = BIT(3),
444 SCAN_CONFIG_FLAG_SET_TX_CHAINS = BIT(8),
445 SCAN_CONFIG_FLAG_SET_RX_CHAINS = BIT(9),
446 SCAN_CONFIG_FLAG_SET_AUX_STA_ID = BIT(10),
447 SCAN_CONFIG_FLAG_SET_ALL_TIMES = BIT(11),
448 SCAN_CONFIG_FLAG_SET_EFFECTIVE_TIMES = BIT(12),
449 SCAN_CONFIG_FLAG_SET_CHANNEL_FLAGS = BIT(13),
450 SCAN_CONFIG_FLAG_SET_LEGACY_RATES = BIT(14),
451 SCAN_CONFIG_FLAG_SET_MAC_ADDR = BIT(15),
452 SCAN_CONFIG_FLAG_SET_FRAGMENTED = BIT(16),
453 SCAN_CONFIG_FLAG_CLEAR_FRAGMENTED = BIT(17),
454 SCAN_CONFIG_FLAG_SET_CAM_MODE = BIT(18),
455 SCAN_CONFIG_FLAG_CLEAR_CAM_MODE = BIT(19),
456 SCAN_CONFIG_FLAG_SET_PROMISC_MODE = BIT(20),
457 SCAN_CONFIG_FLAG_CLEAR_PROMISC_MODE = BIT(21),
458 SCAN_CONFIG_FLAG_SET_LMAC2_FRAGMENTED = BIT(22),
459 SCAN_CONFIG_FLAG_CLEAR_LMAC2_FRAGMENTED = BIT(23),
461 /* Bits 26-31 are for num of channels in channel_array */
462 #define SCAN_CONFIG_N_CHANNELS(n) ((n) << 26)
465 enum scan_config_rates {
466 /* OFDM basic rates */
467 SCAN_CONFIG_RATE_6M = BIT(0),
468 SCAN_CONFIG_RATE_9M = BIT(1),
469 SCAN_CONFIG_RATE_12M = BIT(2),
470 SCAN_CONFIG_RATE_18M = BIT(3),
471 SCAN_CONFIG_RATE_24M = BIT(4),
472 SCAN_CONFIG_RATE_36M = BIT(5),
473 SCAN_CONFIG_RATE_48M = BIT(6),
474 SCAN_CONFIG_RATE_54M = BIT(7),
475 /* CCK basic rates */
476 SCAN_CONFIG_RATE_1M = BIT(8),
477 SCAN_CONFIG_RATE_2M = BIT(9),
478 SCAN_CONFIG_RATE_5M = BIT(10),
479 SCAN_CONFIG_RATE_11M = BIT(11),
481 /* Bits 16-27 are for supported rates */
482 #define SCAN_CONFIG_SUPPORTED_RATE(rate) ((rate) << 16)
485 enum iwl_channel_flags {
486 IWL_CHANNEL_FLAG_EBS = BIT(0),
487 IWL_CHANNEL_FLAG_ACCURATE_EBS = BIT(1),
488 IWL_CHANNEL_FLAG_EBS_ADD = BIT(2),
489 IWL_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE = BIT(3),
493 * struct iwl_scan_dwell
494 * @active: default dwell time for active scan
495 * @passive: default dwell time for passive scan
496 * @fragmented: default dwell time for fragmented scan
497 * @extended: default dwell time for channels 1, 6 and 11
499 struct iwl_scan_dwell {
507 * struct iwl_scan_config
508 * @flags: enum scan_config_flags
509 * @tx_chains: valid_tx antenna - ANT_* definitions
510 * @rx_chains: valid_rx antenna - ANT_* definitions
511 * @legacy_rates: default legacy rates - enum scan_config_rates
512 * @out_of_channel_time: default max out of serving channel time
513 * @suspend_time: default max suspend time
514 * @dwell: dwells for the scan
515 * @mac_addr: default mac address to be used in probes
516 * @bcast_sta_id: the index of the station in the fw
517 * @channel_flags: default channel flags - enum iwl_channel_flags
518 * scan_config_channel_flag
519 * @channel_array: default supported channels
521 struct iwl_scan_config_v1 {
526 __le32 out_of_channel_time;
528 struct iwl_scan_dwell dwell;
529 u8 mac_addr[ETH_ALEN];
533 } __packed; /* SCAN_CONFIG_DB_CMD_API_S */
535 #define SCAN_TWO_LMACS 2
536 #define SCAN_LB_LMAC_IDX 0
537 #define SCAN_HB_LMAC_IDX 1
539 struct iwl_scan_config {
544 __le32 out_of_channel_time[SCAN_TWO_LMACS];
545 __le32 suspend_time[SCAN_TWO_LMACS];
546 struct iwl_scan_dwell dwell;
547 u8 mac_addr[ETH_ALEN];
551 } __packed; /* SCAN_CONFIG_DB_CMD_API_S_3 */
554 * enum iwl_umac_scan_flags - UMAC scan flags
555 * @IWL_UMAC_SCAN_FLAG_PREEMPTIVE: scan process triggered by this scan request
556 * can be preempted by other scan requests with higher priority.
557 * The low priority scan will be resumed when the higher proirity scan is
559 * @IWL_UMAC_SCAN_FLAG_START_NOTIF: notification will be sent to the driver
562 enum iwl_umac_scan_flags {
563 IWL_UMAC_SCAN_FLAG_PREEMPTIVE = BIT(0),
564 IWL_UMAC_SCAN_FLAG_START_NOTIF = BIT(1),
567 enum iwl_umac_scan_uid_offsets {
568 IWL_UMAC_SCAN_UID_TYPE_OFFSET = 0,
569 IWL_UMAC_SCAN_UID_SEQ_OFFSET = 8,
572 enum iwl_umac_scan_general_flags {
573 IWL_UMAC_SCAN_GEN_FLAGS_PERIODIC = BIT(0),
574 IWL_UMAC_SCAN_GEN_FLAGS_OVER_BT = BIT(1),
575 IWL_UMAC_SCAN_GEN_FLAGS_PASS_ALL = BIT(2),
576 IWL_UMAC_SCAN_GEN_FLAGS_PASSIVE = BIT(3),
577 IWL_UMAC_SCAN_GEN_FLAGS_PRE_CONNECT = BIT(4),
578 IWL_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE = BIT(5),
579 IWL_UMAC_SCAN_GEN_FLAGS_MULTIPLE_SSID = BIT(6),
580 IWL_UMAC_SCAN_GEN_FLAGS_FRAGMENTED = BIT(7),
581 IWL_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED = BIT(8),
582 IWL_UMAC_SCAN_GEN_FLAGS_MATCH = BIT(9),
583 IWL_UMAC_SCAN_GEN_FLAGS_EXTENDED_DWELL = BIT(10),
584 /* Extended dwell is obselete when adaptive dwell is used, making this
585 * bit reusable. Hence, probe request defer is used only when adaptive
586 * dwell is supported. */
587 IWL_UMAC_SCAN_GEN_FLAGS_PROB_REQ_DEFER_SUPP = BIT(10),
588 IWL_UMAC_SCAN_GEN_FLAGS_LMAC2_FRAGMENTED = BIT(11),
589 IWL_UMAC_SCAN_GEN_FLAGS_ADAPTIVE_DWELL = BIT(13),
590 IWL_UMAC_SCAN_GEN_FLAGS_MAX_CHNL_TIME = BIT(14),
591 IWL_UMAC_SCAN_GEN_FLAGS_PROB_REQ_HIGH_TX_RATE = BIT(15),
595 * enum iwl_umac_scan_general_flags2 - UMAC scan general flags #2
596 * @IWL_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL: Whether to send a complete
597 * notification per channel or not.
599 enum iwl_umac_scan_general_flags2 {
600 IWL_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL = BIT(0),
604 * struct iwl_scan_channel_cfg_umac
605 * @flags: bitmap - 0-19: directed scan to i'th ssid.
606 * @channel_num: channel number 1-13 etc.
607 * @iter_count: repetition count for the channel.
608 * @iter_interval: interval between two scan iterations on one channel.
610 struct iwl_scan_channel_cfg_umac {
614 __le16 iter_interval;
615 } __packed; /* SCAN_CHANNEL_CFG_S_VER2 */
618 * struct iwl_scan_umac_schedule
619 * @interval: interval in seconds between scan iterations
620 * @iter_count: num of scan iterations for schedule plan, 0xff for infinite loop
621 * @reserved: for alignment and future use
623 struct iwl_scan_umac_schedule {
627 } __packed; /* SCAN_SCHED_PARAM_API_S_VER_1 */
630 * struct iwl_scan_req_umac_tail - the rest of the UMAC scan request command
631 * parameters following channels configuration array.
632 * @schedule: two scheduling plans.
633 * @delay: delay in TUs before starting the first scan iteration
634 * @reserved: for future use and alignment
635 * @preq: probe request with IEs blocks
636 * @direct_scan: list of SSIDs for directed active scan
638 struct iwl_scan_req_umac_tail {
639 /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */
640 struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS];
643 /* SCAN_PROBE_PARAMS_API_S_VER_1 */
644 struct iwl_scan_probe_req preq;
645 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
649 * struct iwl_scan_umac_chan_param
650 * @flags: channel flags &enum iwl_scan_channel_flags
651 * @count: num of channels in scan request
652 * @reserved: for future use and alignment
654 struct iwl_scan_umac_chan_param {
658 } __packed; /*SCAN_CHANNEL_PARAMS_API_S_VER_1 */
661 * struct iwl_scan_req_umac
662 * @flags: &enum iwl_umac_scan_flags
663 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
664 * @ooc_priority: out of channel priority - &enum iwl_scan_priority
665 * @general_flags: &enum iwl_umac_scan_general_flags
666 * @scan_start_mac_id: report the scan start TSF time according to this mac TSF
667 * @extended_dwell: dwell time for channels 1, 6 and 11
668 * @active_dwell: dwell time for active scan per LMAC
669 * @passive_dwell: dwell time for passive scan per LMAC
670 * @fragmented_dwell: dwell time for fragmented passive scan
671 * @adwell_default_n_aps: for adaptive dwell the default number of APs
673 * @adwell_default_n_aps_social: for adaptive dwell the default
674 * number of APs per social (1,6,11) channel
675 * @general_flags2: &enum iwl_umac_scan_general_flags2
676 * @adwell_max_budget: for adaptive dwell the maximal budget of TU to be added
678 * @max_out_time: max out of serving channel time, per LMAC - for CDB there
680 * @suspend_time: max suspend time, per LMAC - for CDB there are 2 LMACs
681 * @scan_priority: scan internal prioritization &enum iwl_scan_priority
682 * @num_of_fragments: Number of fragments needed for full coverage per band.
683 * Relevant only for fragmented scan.
684 * @channel: &struct iwl_scan_umac_chan_param
685 * @reserved: for future use and alignment
686 * @reserved3: for future use and alignment
687 * @data: &struct iwl_scan_channel_cfg_umac and
688 * &struct iwl_scan_req_umac_tail
690 struct iwl_scan_req_umac {
694 __le16 general_flags;
696 u8 scan_start_mac_id;
705 __le32 scan_priority;
706 struct iwl_scan_umac_chan_param channel;
708 } v1; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */
714 __le32 max_out_time[SCAN_TWO_LMACS];
715 __le32 suspend_time[SCAN_TWO_LMACS];
716 __le32 scan_priority;
717 struct iwl_scan_umac_chan_param channel;
719 } v6; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_6 */
724 u8 adwell_default_n_aps;
725 u8 adwell_default_n_aps_social;
727 __le16 adwell_max_budget;
728 __le32 max_out_time[SCAN_TWO_LMACS];
729 __le32 suspend_time[SCAN_TWO_LMACS];
730 __le32 scan_priority;
731 struct iwl_scan_umac_chan_param channel;
733 } v7; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_7 */
735 u8 active_dwell[SCAN_TWO_LMACS];
737 u8 adwell_default_n_aps;
738 u8 adwell_default_n_aps_social;
740 __le16 adwell_max_budget;
741 __le32 max_out_time[SCAN_TWO_LMACS];
742 __le32 suspend_time[SCAN_TWO_LMACS];
743 __le32 scan_priority;
744 u8 passive_dwell[SCAN_TWO_LMACS];
745 u8 num_of_fragments[SCAN_TWO_LMACS];
746 struct iwl_scan_umac_chan_param channel;
748 } v8; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_8 */
752 #define IWL_SCAN_REQ_UMAC_SIZE_V8 sizeof(struct iwl_scan_req_umac)
753 #define IWL_SCAN_REQ_UMAC_SIZE_V7 48
754 #define IWL_SCAN_REQ_UMAC_SIZE_V6 44
755 #define IWL_SCAN_REQ_UMAC_SIZE_V1 36
758 * struct iwl_umac_scan_abort
759 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
762 struct iwl_umac_scan_abort {
765 } __packed; /* SCAN_ABORT_CMD_UMAC_API_S_VER_1 */
768 * struct iwl_umac_scan_complete
769 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
770 * @last_schedule: last scheduling line
771 * @last_iter: last scan iteration number
772 * @status: &enum iwl_scan_offload_complete_status
773 * @ebs_status: &enum iwl_scan_ebs_status
774 * @time_from_last_iter: time elapsed from last iteration
775 * @reserved: for future use
777 struct iwl_umac_scan_complete {
783 __le32 time_from_last_iter;
785 } __packed; /* SCAN_COMPLETE_NTF_UMAC_API_S_VER_1 */
787 #define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN 5
789 * struct iwl_scan_offload_profile_match - match information
790 * @bssid: matched bssid
791 * @reserved: reserved
792 * @channel: channel where the match occurred
794 * @matching_feature: feature matches
795 * @matching_channels: bitmap of channels that matched, referencing
796 * the channels passed in tue scan offload request
798 struct iwl_scan_offload_profile_match {
804 u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN];
805 } __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_1 */
808 * struct iwl_scan_offload_profiles_query - match results query response
809 * @matched_profiles: bitmap of matched profiles, referencing the
810 * matches passed in the scan offload request
811 * @last_scan_age: age of the last offloaded scan
812 * @n_scans_done: number of offloaded scans done
813 * @gp2_d0u: GP2 when D0U occurred
814 * @gp2_invoked: GP2 when scan offload was invoked
815 * @resume_while_scanning: not used
816 * @self_recovery: obsolete
817 * @reserved: reserved
818 * @matches: array of match information, one for each match
820 struct iwl_scan_offload_profiles_query {
821 __le32 matched_profiles;
822 __le32 last_scan_age;
826 u8 resume_while_scanning;
829 struct iwl_scan_offload_profile_match matches[IWL_SCAN_MAX_PROFILES];
830 } __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_2 */
833 * struct iwl_umac_scan_iter_complete_notif - notifies end of scanning iteration
834 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
835 * @scanned_channels: number of channels scanned and number of valid elements in
837 * @status: one of SCAN_COMP_STATUS_*
838 * @bt_status: BT on/off status
839 * @last_channel: last channel that was scanned
840 * @start_tsf: TSF timer in usecs of the scan start time for the mac specified
841 * in &struct iwl_scan_req_umac.
842 * @results: array of scan results, length in @scanned_channels
844 struct iwl_umac_scan_iter_complete_notif {
851 struct iwl_scan_results_notif results[];
852 } __packed; /* SCAN_ITER_COMPLETE_NTF_UMAC_API_S_VER_2 */
854 #endif /* __iwl_fw_api_scan_h__ */