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
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
25 * The full GNU General Public License is included in this distribution
26 * in the file called COPYING.
28 * Contact Information:
29 * Intel Linux Wireless <ilw@linux.intel.com>
30 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
36 * All rights reserved.
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
42 * * Redistributions of source code must retain the above copyright
43 * notice, this list of conditions and the following disclaimer.
44 * * Redistributions in binary form must reproduce the above copyright
45 * notice, this list of conditions and the following disclaimer in
46 * the documentation and/or other materials provided with the
48 * * Neither the name Intel Corporation nor the names of its
49 * contributors may be used to endorse or promote products derived
50 * from this software without specific prior written permission.
52 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
53 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
54 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
55 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
56 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
57 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
58 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
59 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
60 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
62 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64 *****************************************************************************/
66 #ifndef __fw_api_scan_h__
67 #define __fw_api_scan_h__
71 /* Scan Commands, Responses, Notifications */
73 /* Max number of IEs for direct SSID scans in a command */
74 #define PROBE_OPTION_MAX 20
77 * struct iwl_ssid_ie - directed scan network information element
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.
87 u8 ssid[IEEE80211_MAX_SSID_LEN];
88 } __packed; /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
90 /* How many statistics are gathered for each channel */
91 #define SCAN_RESULTS_STATISTICS 1
94 * enum iwl_scan_complete_status - status codes for scan complete notifications
95 * @SCAN_COMP_STATUS_OK: scan completed successfully
96 * @SCAN_COMP_STATUS_ABORT: scan was aborted by user
97 * @SCAN_COMP_STATUS_ERR_SLEEP: sending null sleep packet failed
98 * @SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT: timeout before channel is ready
99 * @SCAN_COMP_STATUS_ERR_PROBE: sending probe request failed
100 * @SCAN_COMP_STATUS_ERR_WAKEUP: sending null wakeup packet failed
101 * @SCAN_COMP_STATUS_ERR_ANTENNAS: invalid antennas chosen at scan command
102 * @SCAN_COMP_STATUS_ERR_INTERNAL: internal error caused scan abort
103 * @SCAN_COMP_STATUS_ERR_COEX: medium was lost ot WiMax
104 * @SCAN_COMP_STATUS_P2P_ACTION_OK: P2P public action frame TX was successful
106 * @SCAN_COMP_STATUS_ITERATION_END: indicates end of one repetition the driver
108 * @SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events
110 enum iwl_scan_complete_status {
111 SCAN_COMP_STATUS_OK = 0x1,
112 SCAN_COMP_STATUS_ABORT = 0x2,
113 SCAN_COMP_STATUS_ERR_SLEEP = 0x3,
114 SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT = 0x4,
115 SCAN_COMP_STATUS_ERR_PROBE = 0x5,
116 SCAN_COMP_STATUS_ERR_WAKEUP = 0x6,
117 SCAN_COMP_STATUS_ERR_ANTENNAS = 0x7,
118 SCAN_COMP_STATUS_ERR_INTERNAL = 0x8,
119 SCAN_COMP_STATUS_ERR_COEX = 0x9,
120 SCAN_COMP_STATUS_P2P_ACTION_OK = 0xA,
121 SCAN_COMP_STATUS_ITERATION_END = 0x0B,
122 SCAN_COMP_STATUS_ERR_ALLOC_TE = 0x0C,
126 #define IWL_SCAN_MAX_BLACKLIST_LEN 64
127 #define IWL_SCAN_SHORT_BLACKLIST_LEN 16
128 #define IWL_SCAN_MAX_PROFILES 11
129 #define SCAN_OFFLOAD_PROBE_REQ_SIZE 512
131 /* Default watchdog (in MS) for scheduled scan iteration */
132 #define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000)
134 #define IWL_GOOD_CRC_TH_DEFAULT cpu_to_le16(1)
135 #define CAN_ABORT_STATUS 1
137 #define IWL_FULL_SCAN_MULTIPLIER 5
138 #define IWL_FAST_SCHED_SCAN_ITERATIONS 3
140 enum scan_framework_client {
141 SCAN_CLIENT_SCHED_SCAN = BIT(0),
142 SCAN_CLIENT_NETDETECT = BIT(1),
143 SCAN_CLIENT_ASSET_TRACKING = BIT(2),
147 * struct iwl_scan_offload_cmd - SCAN_REQUEST_FIXED_PART_API_S_VER_6
148 * @scan_flags: see enum iwl_scan_flags
149 * @channel_count: channels in channel list
150 * @quiet_time: dwell time, in milliseconds, on quiet channel
151 * @quiet_plcp_th: quiet channel num of packets threshold
152 * @good_CRC_th: passive to active promotion threshold
153 * @rx_chain: RXON rx chain.
154 * @max_out_time: max TUs to be out of associated channel
155 * @suspend_time: pause scan this TUs when returning to service channel
157 * @filter_flags: RXONfilter
158 * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz.
159 * @direct_scan: list of SSIDs for directed active scan
160 * @scan_type: see enum iwl_scan_type.
161 * @rep_count: repetition count for each scheduled scan iteration.
163 struct iwl_scan_offload_cmd {
168 __le16 quiet_plcp_th;
173 /* RX_ON_FLAGS_API_S_VER_1 */
176 struct iwl_tx_cmd tx_cmd[2];
177 /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
178 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
183 enum iwl_scan_offload_channel_flags {
184 IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE = BIT(0),
185 IWL_SCAN_OFFLOAD_CHANNEL_NARROW = BIT(22),
186 IWL_SCAN_OFFLOAD_CHANNEL_FULL = BIT(24),
187 IWL_SCAN_OFFLOAD_CHANNEL_PARTIAL = BIT(25),
190 /* channel configuration for struct iwl_scan_offload_cfg. Each channels needs:
191 * __le32 type: bitmap; bits 1-20 are for directed scan to i'th ssid and
192 * see enum iwl_scan_offload_channel_flags.
193 * __le16 channel_number: channel number 1-13 etc.
194 * __le16 iter_count: repetition count for the channel.
195 * __le32 iter_interval: interval between two iterations on one channel.
199 #define IWL_SCAN_CHAN_SIZE 14
202 * iwl_scan_offload_cfg - SCAN_OFFLOAD_CONFIG_API_S
203 * @scan_cmd: scan command fixed part
204 * @data: scan channel configuration and probe request frames
206 struct iwl_scan_offload_cfg {
207 struct iwl_scan_offload_cmd scan_cmd;
212 * iwl_scan_offload_blacklist - SCAN_OFFLOAD_BLACKLIST_S
213 * @ssid: MAC address to filter out
214 * @reported_rssi: AP rssi reported to the host
215 * @client_bitmap: clients ignore this entry - enum scan_framework_client
217 struct iwl_scan_offload_blacklist {
223 enum iwl_scan_offload_network_type {
224 IWL_NETWORK_TYPE_BSS = 1,
225 IWL_NETWORK_TYPE_IBSS = 2,
226 IWL_NETWORK_TYPE_ANY = 3,
229 enum iwl_scan_offload_band_selection {
230 IWL_SCAN_OFFLOAD_SELECT_2_4 = 0x4,
231 IWL_SCAN_OFFLOAD_SELECT_5_2 = 0x8,
232 IWL_SCAN_OFFLOAD_SELECT_ANY = 0xc,
236 * iwl_scan_offload_profile - SCAN_OFFLOAD_PROFILE_S
237 * @ssid_index: index to ssid list in fixed part
238 * @unicast_cipher: encryption algorithm to match - bitmap
239 * @aut_alg: authentication algorithm to match - bitmap
240 * @network_type: enum iwl_scan_offload_network_type
241 * @band_selection: enum iwl_scan_offload_band_selection
242 * @client_bitmap: clients waiting for match - enum scan_framework_client
244 struct iwl_scan_offload_profile {
255 * iwl_scan_offload_profile_cfg - SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1
256 * @blaclist: AP list to filter off from scan results
257 * @profiles: profiles to search for match
258 * @blacklist_len: length of blacklist
259 * @num_profiles: num of profiles in the list
260 * @match_notify: clients waiting for match found notification
261 * @pass_match: clients waiting for the results
262 * @active_clients: active clients bitmap - enum scan_framework_client
263 * @any_beacon_notify: clients waiting for match notification without match
265 struct iwl_scan_offload_profile_cfg {
266 struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES];
272 u8 any_beacon_notify;
277 * iwl_scan_schedule_lmac - schedule of scan offload
278 * @delay: delay between iterations, in seconds.
279 * @iterations: num of scan iterations
280 * @full_scan_mul: number of partial scans before each full scan
282 struct iwl_scan_schedule_lmac {
286 } __packed; /* SCAN_SCHEDULE_API_S */
288 enum iwl_scan_offload_complete_status {
289 IWL_SCAN_OFFLOAD_COMPLETED = 1,
290 IWL_SCAN_OFFLOAD_ABORTED = 2,
293 enum iwl_scan_ebs_status {
294 IWL_SCAN_EBS_SUCCESS,
296 IWL_SCAN_EBS_CHAN_NOT_FOUND,
297 IWL_SCAN_EBS_INACTIVE,
301 * iwl_scan_offload_complete - SCAN_OFFLOAD_COMPLETE_NTF_API_S_VER_1
302 * @last_schedule_line: last schedule line executed (fast or regular)
303 * @last_schedule_iteration: last scan iteration executed before scan abort
304 * @status: enum iwl_scan_offload_compleate_status
305 * @ebs_status: last EBS status, see IWL_SCAN_EBS_*
307 struct iwl_scan_offload_complete {
308 u8 last_schedule_line;
309 u8 last_schedule_iteration;
315 * iwl_sched_scan_results - SCAN_OFFLOAD_MATCH_FOUND_NTF_API_S_VER_1
316 * @ssid_bitmap: SSIDs indexes found in this iteration
317 * @client_bitmap: clients that are active and wait for this notification
319 struct iwl_sched_scan_results {
325 /* Unified LMAC scan API */
327 #define IWL_MVM_BASIC_PASSIVE_DWELL 110
330 * iwl_scan_req_tx_cmd - SCAN_REQ_TX_CMD_API_S
331 * @tx_flags: combination of TX_CMD_FLG_*
332 * @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is
333 * cleared. Combination of RATE_MCS_*
334 * @sta_id: index of destination station in FW station table
335 * @reserved: for alignment and future use
337 struct iwl_scan_req_tx_cmd {
344 enum iwl_scan_channel_flags_lmac {
345 IWL_UNIFIED_SCAN_CHANNEL_FULL = BIT(27),
346 IWL_UNIFIED_SCAN_CHANNEL_PARTIAL = BIT(28),
350 * iwl_scan_channel_cfg_lmac - SCAN_CHANNEL_CFG_S_VER2
351 * @flags: bits 1-20: directed scan to i'th ssid
352 * other bits &enum iwl_scan_channel_flags_lmac
353 * @channel_number: channel number 1-13 etc
354 * @iter_count: scan iteration on this channel
355 * @iter_interval: interval in seconds between iterations on one channel
357 struct iwl_scan_channel_cfg_lmac {
361 __le32 iter_interval;
365 * iwl_scan_probe_segment - PROBE_SEGMENT_API_S_VER_1
366 * @offset: offset in the data block
367 * @len: length of the segment
369 struct iwl_scan_probe_segment {
374 /* iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_2
375 * @mac_header: first (and common) part of the probe
376 * @band_data: band specific data
377 * @common_data: last (and common) part of the probe
378 * @buf: raw data block
380 struct iwl_scan_probe_req {
381 struct iwl_scan_probe_segment mac_header;
382 struct iwl_scan_probe_segment band_data[2];
383 struct iwl_scan_probe_segment common_data;
384 u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE];
387 enum iwl_scan_channel_flags {
388 IWL_SCAN_CHANNEL_FLAG_EBS = BIT(0),
389 IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE = BIT(1),
390 IWL_SCAN_CHANNEL_FLAG_CACHE_ADD = BIT(2),
393 /* iwl_scan_channel_opt - CHANNEL_OPTIMIZATION_API_S
394 * @flags: enum iwl_scan_channel_flags
395 * @non_ebs_ratio: defines the ratio of number of scan iterations where EBS is
397 * 1 - EBS is disabled.
398 * 2 - every second scan will be full scan(and so on).
400 struct iwl_scan_channel_opt {
402 __le16 non_ebs_ratio;
406 * iwl_mvm_lmac_scan_flags
407 * @IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL: pass all beacons and probe responses
409 * @IWL_MVM_LMAC_SCAN_FLAG_PASSIVE: force passive scan on all channels
410 * @IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION: single channel scan
411 * @IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE: send iteration complete notification
412 * @IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS multiple SSID matching
413 * @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented
414 * @IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED: insert WFA vendor-specific TPC report
415 * and DS parameter set IEs into probe requests.
416 * @IWL_MVM_LMAC_SCAN_FLAG_MATCH: Send match found notification on matches
418 enum iwl_mvm_lmac_scan_flags {
419 IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL = BIT(0),
420 IWL_MVM_LMAC_SCAN_FLAG_PASSIVE = BIT(1),
421 IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION = BIT(2),
422 IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE = BIT(3),
423 IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS = BIT(4),
424 IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED = BIT(5),
425 IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED = BIT(6),
426 IWL_MVM_LMAC_SCAN_FLAG_MATCH = BIT(9),
429 enum iwl_scan_priority {
430 IWL_SCAN_PRIORITY_LOW,
431 IWL_SCAN_PRIORITY_MEDIUM,
432 IWL_SCAN_PRIORITY_HIGH,
435 enum iwl_scan_priority_ext {
436 IWL_SCAN_PRIORITY_EXT_0_LOWEST,
437 IWL_SCAN_PRIORITY_EXT_1,
438 IWL_SCAN_PRIORITY_EXT_2,
439 IWL_SCAN_PRIORITY_EXT_3,
440 IWL_SCAN_PRIORITY_EXT_4,
441 IWL_SCAN_PRIORITY_EXT_5,
442 IWL_SCAN_PRIORITY_EXT_6,
443 IWL_SCAN_PRIORITY_EXT_7_HIGHEST,
447 * iwl_scan_req_lmac - SCAN_REQUEST_CMD_API_S_VER_1
448 * @reserved1: for alignment and future use
449 * @channel_num: num of channels to scan
450 * @active-dwell: dwell time for active channels
451 * @passive-dwell: dwell time for passive channels
452 * @fragmented-dwell: dwell time for fragmented passive scan
453 * @reserved2: for alignment and future use
454 * @rx_chain_selct: PHY_RX_CHAIN_* flags
455 * @scan_flags: &enum iwl_mvm_lmac_scan_flags
456 * @max_out_time: max time (in TU) to be out of associated channel
457 * @suspend_time: pause scan this long (TUs) when returning to service channel
459 * @filter_flags: RXON filter
460 * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz
461 * @direct_scan: list of SSIDs for directed active scan
462 * @scan_prio: enum iwl_scan_priority
463 * @iter_num: number of scan iterations
464 * @delay: delay in seconds before first iteration
465 * @schedule: two scheduling plans. The first one is finite, the second one can
467 * @channel_opt: channel optimization options, for full and partial scan
468 * @data: channel configuration and probe request packet.
470 struct iwl_scan_req_lmac {
471 /* SCAN_REQUEST_FIXED_PART_API_S_VER_7 */
478 __le16 rx_chain_select;
482 /* RX_ON_FLAGS_API_S_VER_1 */
485 struct iwl_scan_req_tx_cmd tx_cmd[2];
486 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
488 /* SCAN_REQ_PERIODIC_PARAMS_API_S */
491 struct iwl_scan_schedule_lmac schedule[2];
492 struct iwl_scan_channel_opt channel_opt[2];
497 * struct iwl_scan_results_notif - scan results for one channel -
498 * SCAN_RESULT_NTF_API_S_VER_3
499 * @channel: which channel the results are from
500 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
501 * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
502 * @num_probe_not_sent: # of request that weren't sent due to not enough time
503 * @duration: duration spent in channel, in usecs
505 struct iwl_scan_results_notif {
509 u8 num_probe_not_sent;
514 * struct iwl_lmac_scan_complete_notif - notifies end of scanning (all channels)
515 * SCAN_COMPLETE_NTF_API_S_VER_3
516 * @scanned_channels: number of channels scanned (and number of valid results)
517 * @status: one of SCAN_COMP_STATUS_*
518 * @bt_status: BT on/off status
519 * @last_channel: last channel that was scanned
520 * @tsf_low: TSF timer (lower half) in usecs
521 * @tsf_high: TSF timer (higher half) in usecs
522 * @results: an array of scan results, only "scanned_channels" of them are valid
524 struct iwl_lmac_scan_complete_notif {
531 struct iwl_scan_results_notif results[];
535 * iwl_scan_offload_complete - PERIODIC_SCAN_COMPLETE_NTF_API_S_VER_2
536 * @last_schedule_line: last schedule line executed (fast or regular)
537 * @last_schedule_iteration: last scan iteration executed before scan abort
538 * @status: enum iwl_scan_offload_complete_status
539 * @ebs_status: EBS success status &enum iwl_scan_ebs_status
540 * @time_after_last_iter; time in seconds elapsed after last iteration
542 struct iwl_periodic_scan_complete {
543 u8 last_schedule_line;
544 u8 last_schedule_iteration;
547 __le32 time_after_last_iter;
554 * struct iwl_mvm_umac_cmd_hdr - Command header for UMAC commands
555 * @size: size of the command (not including header)
556 * @reserved0: for future use and alignment
557 * @ver: API version number
559 struct iwl_mvm_umac_cmd_hdr {
565 /* The maximum of either of these cannot exceed 8, because we use an
566 * 8-bit mask (see IWL_MVM_SCAN_MASK in mvm.h).
568 #define IWL_MVM_MAX_UMAC_SCANS 8
569 #define IWL_MVM_MAX_LMAC_SCANS 1
571 enum scan_config_flags {
572 SCAN_CONFIG_FLAG_ACTIVATE = BIT(0),
573 SCAN_CONFIG_FLAG_DEACTIVATE = BIT(1),
574 SCAN_CONFIG_FLAG_FORBID_CHUB_REQS = BIT(2),
575 SCAN_CONFIG_FLAG_ALLOW_CHUB_REQS = BIT(3),
576 SCAN_CONFIG_FLAG_SET_TX_CHAINS = BIT(8),
577 SCAN_CONFIG_FLAG_SET_RX_CHAINS = BIT(9),
578 SCAN_CONFIG_FLAG_SET_AUX_STA_ID = BIT(10),
579 SCAN_CONFIG_FLAG_SET_ALL_TIMES = BIT(11),
580 SCAN_CONFIG_FLAG_SET_EFFECTIVE_TIMES = BIT(12),
581 SCAN_CONFIG_FLAG_SET_CHANNEL_FLAGS = BIT(13),
582 SCAN_CONFIG_FLAG_SET_LEGACY_RATES = BIT(14),
583 SCAN_CONFIG_FLAG_SET_MAC_ADDR = BIT(15),
584 SCAN_CONFIG_FLAG_SET_FRAGMENTED = BIT(16),
585 SCAN_CONFIG_FLAG_CLEAR_FRAGMENTED = BIT(17),
586 SCAN_CONFIG_FLAG_SET_CAM_MODE = BIT(18),
587 SCAN_CONFIG_FLAG_CLEAR_CAM_MODE = BIT(19),
588 SCAN_CONFIG_FLAG_SET_PROMISC_MODE = BIT(20),
589 SCAN_CONFIG_FLAG_CLEAR_PROMISC_MODE = BIT(21),
591 /* Bits 26-31 are for num of channels in channel_array */
592 #define SCAN_CONFIG_N_CHANNELS(n) ((n) << 26)
595 enum scan_config_rates {
596 /* OFDM basic rates */
597 SCAN_CONFIG_RATE_6M = BIT(0),
598 SCAN_CONFIG_RATE_9M = BIT(1),
599 SCAN_CONFIG_RATE_12M = BIT(2),
600 SCAN_CONFIG_RATE_18M = BIT(3),
601 SCAN_CONFIG_RATE_24M = BIT(4),
602 SCAN_CONFIG_RATE_36M = BIT(5),
603 SCAN_CONFIG_RATE_48M = BIT(6),
604 SCAN_CONFIG_RATE_54M = BIT(7),
605 /* CCK basic rates */
606 SCAN_CONFIG_RATE_1M = BIT(8),
607 SCAN_CONFIG_RATE_2M = BIT(9),
608 SCAN_CONFIG_RATE_5M = BIT(10),
609 SCAN_CONFIG_RATE_11M = BIT(11),
611 /* Bits 16-27 are for supported rates */
612 #define SCAN_CONFIG_SUPPORTED_RATE(rate) ((rate) << 16)
615 enum iwl_channel_flags {
616 IWL_CHANNEL_FLAG_EBS = BIT(0),
617 IWL_CHANNEL_FLAG_ACCURATE_EBS = BIT(1),
618 IWL_CHANNEL_FLAG_EBS_ADD = BIT(2),
619 IWL_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE = BIT(3),
623 * struct iwl_scan_config
624 * @hdr: umac command header
625 * @flags: enum scan_config_flags
626 * @tx_chains: valid_tx antenna - ANT_* definitions
627 * @rx_chains: valid_rx antenna - ANT_* definitions
628 * @legacy_rates: default legacy rates - enum scan_config_rates
629 * @out_of_channel_time: default max out of serving channel time
630 * @suspend_time: default max suspend time
631 * @dwell_active: default dwell time for active scan
632 * @dwell_passive: default dwell time for passive scan
633 * @dwell_fragmented: default dwell time for fragmented scan
634 * @reserved: for future use and alignment
635 * @mac_addr: default mac address to be used in probes
636 * @bcast_sta_id: the index of the station in the fw
637 * @channel_flags: default channel flags - enum iwl_channel_flags
638 * scan_config_channel_flag
639 * @channel_array: default supported channels
641 struct iwl_scan_config {
642 struct iwl_mvm_umac_cmd_hdr hdr;
647 __le32 out_of_channel_time;
653 u8 mac_addr[ETH_ALEN];
657 } __packed; /* SCAN_CONFIG_DB_CMD_API_S */
660 * iwl_umac_scan_flags
661 *@IWL_UMAC_SCAN_FLAG_PREEMPTIVE: scan process triggered by this scan request
662 * can be preempted by other scan requests with higher priority.
663 * The low priority scan will be resumed when the higher proirity scan is
665 *@IWL_UMAC_SCAN_FLAG_START_NOTIF: notification will be sent to the driver
668 enum iwl_umac_scan_flags {
669 IWL_UMAC_SCAN_FLAG_PREEMPTIVE = BIT(0),
670 IWL_UMAC_SCAN_FLAG_START_NOTIF = BIT(1),
673 enum iwl_umac_scan_uid_offsets {
674 IWL_UMAC_SCAN_UID_TYPE_OFFSET = 0,
675 IWL_UMAC_SCAN_UID_SEQ_OFFSET = 8,
678 enum iwl_umac_scan_general_flags {
679 IWL_UMAC_SCAN_GEN_FLAGS_PERIODIC = BIT(0),
680 IWL_UMAC_SCAN_GEN_FLAGS_OVER_BT = BIT(1),
681 IWL_UMAC_SCAN_GEN_FLAGS_PASS_ALL = BIT(2),
682 IWL_UMAC_SCAN_GEN_FLAGS_PASSIVE = BIT(3),
683 IWL_UMAC_SCAN_GEN_FLAGS_PRE_CONNECT = BIT(4),
684 IWL_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE = BIT(5),
685 IWL_UMAC_SCAN_GEN_FLAGS_MULTIPLE_SSID = BIT(6),
686 IWL_UMAC_SCAN_GEN_FLAGS_FRAGMENTED = BIT(7),
687 IWL_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED = BIT(8),
688 IWL_UMAC_SCAN_GEN_FLAGS_MATCH = BIT(9)
692 * struct iwl_scan_channel_cfg_umac
693 * @flags: bitmap - 0-19: directed scan to i'th ssid.
694 * @channel_num: channel number 1-13 etc.
695 * @iter_count: repetition count for the channel.
696 * @iter_interval: interval between two scan iterations on one channel.
698 struct iwl_scan_channel_cfg_umac {
702 __le16 iter_interval;
703 } __packed; /* SCAN_CHANNEL_CFG_S_VER2 */
706 * struct iwl_scan_umac_schedule
707 * @interval: interval in seconds between scan iterations
708 * @iter_count: num of scan iterations for schedule plan, 0xff for infinite loop
709 * @reserved: for alignment and future use
711 struct iwl_scan_umac_schedule {
715 } __packed; /* SCAN_SCHED_PARAM_API_S_VER_1 */
718 * struct iwl_scan_req_umac_tail - the rest of the UMAC scan request command
719 * parameters following channels configuration array.
720 * @schedule: two scheduling plans.
721 * @delay: delay in TUs before starting the first scan iteration
722 * @reserved: for future use and alignment
723 * @preq: probe request with IEs blocks
724 * @direct_scan: list of SSIDs for directed active scan
726 struct iwl_scan_req_umac_tail {
727 /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */
728 struct iwl_scan_umac_schedule schedule[2];
731 /* SCAN_PROBE_PARAMS_API_S_VER_1 */
732 struct iwl_scan_probe_req preq;
733 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
737 * struct iwl_scan_req_umac
738 * @hdr: umac command header
739 * @flags: &enum iwl_umac_scan_flags
740 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
741 * @ooc_priority: out of channel priority - &enum iwl_scan_priority
742 * @general_flags: &enum iwl_umac_scan_general_flags
743 * @reserved1: for future use and alignment
744 * @active_dwell: dwell time for active scan
745 * @passive_dwell: dwell time for passive scan
746 * @fragmented_dwell: dwell time for fragmented passive scan
747 * @max_out_time: max out of serving channel time
748 * @suspend_time: max suspend time
749 * @scan_priority: scan internal prioritization &enum iwl_scan_priority
750 * @channel_flags: &enum iwl_scan_channel_flags
751 * @n_channels: num of channels in scan request
752 * @reserved2: for future use and alignment
753 * @data: &struct iwl_scan_channel_cfg_umac and
754 * &struct iwl_scan_req_umac_tail
756 struct iwl_scan_req_umac {
757 struct iwl_mvm_umac_cmd_hdr hdr;
761 /* SCAN_GENERAL_PARAMS_API_S_VER_1 */
762 __le32 general_flags;
769 __le32 scan_priority;
770 /* SCAN_CHANNEL_PARAMS_API_S_VER_1 */
775 } __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */
778 * struct iwl_umac_scan_abort
779 * @hdr: umac command header
780 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
783 struct iwl_umac_scan_abort {
784 struct iwl_mvm_umac_cmd_hdr hdr;
787 } __packed; /* SCAN_ABORT_CMD_UMAC_API_S_VER_1 */
790 * struct iwl_umac_scan_complete
791 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
792 * @last_schedule: last scheduling line
793 * @last_iter: last scan iteration number
794 * @scan status: &enum iwl_scan_offload_complete_status
795 * @ebs_status: &enum iwl_scan_ebs_status
796 * @time_from_last_iter: time elapsed from last iteration
797 * @reserved: for future use
799 struct iwl_umac_scan_complete {
805 __le32 time_from_last_iter;
807 } __packed; /* SCAN_COMPLETE_NTF_UMAC_API_S_VER_1 */
809 #define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN 5
811 * struct iwl_scan_offload_profile_match - match information
812 * @bssid: matched bssid
813 * @channel: channel where the match occurred
816 * @matching_channels: bitmap of channels that matched, referencing
817 * the channels passed in tue scan offload request
819 struct iwl_scan_offload_profile_match {
825 u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN];
826 } __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_1 */
829 * struct iwl_scan_offload_profiles_query - match results query response
830 * @matched_profiles: bitmap of matched profiles, referencing the
831 * matches passed in the scan offload request
832 * @last_scan_age: age of the last offloaded scan
833 * @n_scans_done: number of offloaded scans done
834 * @gp2_d0u: GP2 when D0U occurred
835 * @gp2_invoked: GP2 when scan offload was invoked
836 * @resume_while_scanning: not used
837 * @self_recovery: obsolete
838 * @reserved: reserved
839 * @matches: array of match information, one for each match
841 struct iwl_scan_offload_profiles_query {
842 __le32 matched_profiles;
843 __le32 last_scan_age;
847 u8 resume_while_scanning;
850 struct iwl_scan_offload_profile_match matches[IWL_SCAN_MAX_PROFILES];
851 } __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_2 */
854 * struct iwl_umac_scan_iter_complete_notif - notifies end of scanning iteration
855 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
856 * @scanned_channels: number of channels scanned and number of valid elements in
858 * @status: one of SCAN_COMP_STATUS_*
859 * @bt_status: BT on/off status
860 * @last_channel: last channel that was scanned
861 * @tsf_low: TSF timer (lower half) in usecs
862 * @tsf_high: TSF timer (higher half) in usecs
863 * @results: array of scan results, only "scanned_channels" of them are valid
865 struct iwl_umac_scan_iter_complete_notif {
873 struct iwl_scan_results_notif results[];
874 } __packed; /* SCAN_ITER_COMPLETE_NTF_UMAC_API_S_VER_1 */