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.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24 * The full GNU General Public License is included in this distribution
25 * in the file called COPYING.
27 * Contact Information:
28 * Intel Linux Wireless <ilw@linux.intel.com>
29 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
33 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
34 * All rights reserved.
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
40 * * Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * * Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in
44 * the documentation and/or other materials provided with the
46 * * Neither the name Intel Corporation nor the names of its
47 * contributors may be used to endorse or promote products derived
48 * from this software without specific prior written permission.
50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
51 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
52 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
53 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
54 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
56 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62 *****************************************************************************/
64 #ifndef __fw_api_scan_h__
65 #define __fw_api_scan_h__
69 /* Scan Commands, Responses, Notifications */
71 /* Masks for iwl_scan_channel.type flags */
72 #define SCAN_CHANNEL_TYPE_ACTIVE BIT(0)
73 #define SCAN_CHANNEL_NARROW_BAND BIT(22)
75 /* Max number of IEs for direct SSID scans in a command */
76 #define PROBE_OPTION_MAX 20
79 * struct iwl_scan_channel - entry in REPLY_SCAN_CMD channel table
80 * @channel: band is selected by iwl_scan_cmd "flags" field
81 * @tx_gain: gain for analog radio
82 * @dsp_atten: gain for DSP
83 * @active_dwell: dwell time for active scan in TU, typically 5-50
84 * @passive_dwell: dwell time for passive scan in TU, typically 20-500
85 * @type: type is broken down to these bits:
86 * bit 0: 0 = passive, 1 = active
87 * bits 1-20: SSID direct bit map. If any of these bits is set then
88 * the corresponding SSID IE is transmitted in probe request
89 * (bit i adds IE in position i to the probe request)
90 * bit 22: channel width, 0 = regular, 1 = TGj narrow channel
93 * @iteration_interval:
94 * This struct is used once for each channel in the scan list.
95 * Each channel can independently select:
96 * 1) SSID for directed active scans
97 * 2) Txpower setting (for rate specified within Tx command)
98 * 3) How long to stay on-channel (behavior may be modified by quiet_time,
99 * quiet_plcp_th, good_CRC_th)
101 * To avoid uCode errors, make sure the following are true (see comments
102 * under struct iwl_scan_cmd about max_out_time and quiet_time):
103 * 1) If using passive_dwell (i.e. passive_dwell != 0):
104 * active_dwell <= passive_dwell (< max_out_time if max_out_time != 0)
105 * 2) quiet_time <= active_dwell
106 * 3) If restricting off-channel time (i.e. max_out_time !=0):
107 * passive_dwell < max_out_time
108 * active_dwell < max_out_time
110 struct iwl_scan_channel
{
113 __le16 iteration_count
;
114 __le32 iteration_interval
;
116 __le16 passive_dwell
;
117 } __packed
; /* SCAN_CHANNEL_CONTROL_API_S_VER_1 */
120 * struct iwl_ssid_ie - directed scan network information element
122 * Up to 20 of these may appear in REPLY_SCAN_CMD,
123 * selected by "type" bit field in struct iwl_scan_channel;
124 * each channel may select different ssids from among the 20 entries.
125 * SSID IEs get transmitted in reverse order of entry.
130 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
131 } __packed
; /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
134 * iwl_scan_flags - masks for scan command flags
135 *@SCAN_FLAGS_PERIODIC_SCAN:
136 *@SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX:
137 *@SCAN_FLAGS_DELAYED_SCAN_LOWBAND:
138 *@SCAN_FLAGS_DELAYED_SCAN_HIGHBAND:
139 *@SCAN_FLAGS_FRAGMENTED_SCAN:
140 *@SCAN_FLAGS_PASSIVE2ACTIVE: use active scan on channels that was active
141 * in the past hour, even if they are marked as passive.
143 enum iwl_scan_flags
{
144 SCAN_FLAGS_PERIODIC_SCAN
= BIT(0),
145 SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX
= BIT(1),
146 SCAN_FLAGS_DELAYED_SCAN_LOWBAND
= BIT(2),
147 SCAN_FLAGS_DELAYED_SCAN_HIGHBAND
= BIT(3),
148 SCAN_FLAGS_FRAGMENTED_SCAN
= BIT(4),
149 SCAN_FLAGS_PASSIVE2ACTIVE
= BIT(5),
153 * enum iwl_scan_type - Scan types for scan command
155 * @SCAN_TYPE_BACKGROUND:
157 * @SCAN_TYPE_ROAMING:
159 * @SCAN_TYPE_DISCOVERY:
160 * @SCAN_TYPE_DISCOVERY_FORCED:
163 SCAN_TYPE_FORCED
= 0,
164 SCAN_TYPE_BACKGROUND
= 1,
166 SCAN_TYPE_ROAMING
= 3,
167 SCAN_TYPE_ACTION
= 4,
168 SCAN_TYPE_DISCOVERY
= 5,
169 SCAN_TYPE_DISCOVERY_FORCED
= 6,
170 }; /* SCAN_ACTIVITY_TYPE_E_VER_1 */
173 * struct iwl_scan_cmd - scan request command
174 * ( SCAN_REQUEST_CMD = 0x80 )
175 * @len: command length in bytes
176 * @scan_flags: scan flags from SCAN_FLAGS_*
177 * @channel_count: num of channels in channel list
178 * (1 - ucode_capa.n_scan_channels)
179 * @quiet_time: in msecs, dwell this time for active scan on quiet channels
180 * @quiet_plcp_th: quiet PLCP threshold (channel is quiet if less than
181 * this number of packets were received (typically 1)
182 * @passive2active: is auto switching from passive to active during scan allowed
183 * @rxchain_sel_flags: RXON_RX_CHAIN_*
184 * @max_out_time: in TUs, max out of serving channel time
185 * @suspend_time: how long to pause scan when returning to service channel:
186 * bits 0-19: beacon interal in TUs (suspend before executing)
187 * bits 20-23: reserved
188 * bits 24-31: number of beacons (suspend between channels)
189 * @rxon_flags: RXON_FLG_*
190 * @filter_flags: RXON_FILTER_*
191 * @tx_cmd: for active scans (zero for passive), w/o payload,
192 * no RS so specify TX rate
193 * @direct_scan: direct scan SSIDs
194 * @type: one of SCAN_TYPE_*
195 * @repeats: how many time to repeat the scan
197 struct iwl_scan_cmd
{
202 __le16 quiet_plcp_th
;
203 __le16 passive2active
;
204 __le16 rxchain_sel_flags
;
207 /* RX_ON_FLAGS_API_S_VER_1 */
210 struct iwl_tx_cmd tx_cmd
;
211 struct iwl_ssid_ie direct_scan
[PROBE_OPTION_MAX
];
216 * Probe request frame, followed by channel list.
218 * Size of probe request frame is specified by byte count in tx_cmd.
219 * Channel list follows immediately after probe request frame.
220 * Number of channels in list is specified by channel_count.
221 * Each channel in list is of type:
223 * struct iwl_scan_channel channels[0];
225 * NOTE: Only one band of channels can be scanned per pass. You
226 * must not mix 2.4GHz channels and 5.2GHz channels, and you must wait
227 * for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION)
228 * before requesting another scan.
231 } __packed
; /* SCAN_REQUEST_FIXED_PART_API_S_VER_5 */
233 /* Response to scan request contains only status with one of these values */
234 #define SCAN_RESPONSE_OK 0x1
235 #define SCAN_RESPONSE_ERROR 0x2
238 * SCAN_ABORT_CMD = 0x81
239 * When scan abort is requested, the command has no fields except the common
240 * header. The response contains only a status with one of these values.
242 #define SCAN_ABORT_POSSIBLE 0x1
243 #define SCAN_ABORT_IGNORED 0x2 /* no pending scans */
245 /* TODO: complete documentation */
246 #define SCAN_OWNER_STATUS 0x1
247 #define MEASURE_OWNER_STATUS 0x2
250 * struct iwl_scan_start_notif - notifies start of scan in the device
251 * ( SCAN_START_NOTIFICATION = 0x82 )
252 * @tsf_low: TSF timer (lower half) in usecs
253 * @tsf_high: TSF timer (higher half) in usecs
254 * @beacon_timer: structured as follows:
255 * bits 0:19 - beacon interval in usecs
256 * bits 20:23 - reserved (0)
257 * bits 24:31 - number of beacons
258 * @channel: which channel is scanned
259 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
260 * @status: one of *_OWNER_STATUS
262 struct iwl_scan_start_notif
{
270 } __packed
; /* SCAN_START_NTF_API_S_VER_1 */
272 /* scan results probe_status first bit indicates success */
273 #define SCAN_PROBE_STATUS_OK 0
274 #define SCAN_PROBE_STATUS_TX_FAILED BIT(0)
275 /* error statuses combined with TX_FAILED */
276 #define SCAN_PROBE_STATUS_FAIL_TTL BIT(1)
277 #define SCAN_PROBE_STATUS_FAIL_BT BIT(2)
279 /* How many statistics are gathered for each channel */
280 #define SCAN_RESULTS_STATISTICS 1
283 * enum iwl_scan_complete_status - status codes for scan complete notifications
284 * @SCAN_COMP_STATUS_OK: scan completed successfully
285 * @SCAN_COMP_STATUS_ABORT: scan was aborted by user
286 * @SCAN_COMP_STATUS_ERR_SLEEP: sending null sleep packet failed
287 * @SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT: timeout before channel is ready
288 * @SCAN_COMP_STATUS_ERR_PROBE: sending probe request failed
289 * @SCAN_COMP_STATUS_ERR_WAKEUP: sending null wakeup packet failed
290 * @SCAN_COMP_STATUS_ERR_ANTENNAS: invalid antennas chosen at scan command
291 * @SCAN_COMP_STATUS_ERR_INTERNAL: internal error caused scan abort
292 * @SCAN_COMP_STATUS_ERR_COEX: medium was lost ot WiMax
293 * @SCAN_COMP_STATUS_P2P_ACTION_OK: P2P public action frame TX was successful
295 * @SCAN_COMP_STATUS_ITERATION_END: indicates end of one repeatition the driver
297 * @SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events
299 enum iwl_scan_complete_status
{
300 SCAN_COMP_STATUS_OK
= 0x1,
301 SCAN_COMP_STATUS_ABORT
= 0x2,
302 SCAN_COMP_STATUS_ERR_SLEEP
= 0x3,
303 SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT
= 0x4,
304 SCAN_COMP_STATUS_ERR_PROBE
= 0x5,
305 SCAN_COMP_STATUS_ERR_WAKEUP
= 0x6,
306 SCAN_COMP_STATUS_ERR_ANTENNAS
= 0x7,
307 SCAN_COMP_STATUS_ERR_INTERNAL
= 0x8,
308 SCAN_COMP_STATUS_ERR_COEX
= 0x9,
309 SCAN_COMP_STATUS_P2P_ACTION_OK
= 0xA,
310 SCAN_COMP_STATUS_ITERATION_END
= 0x0B,
311 SCAN_COMP_STATUS_ERR_ALLOC_TE
= 0x0C,
315 * struct iwl_scan_results_notif - scan results for one channel
316 * ( SCAN_RESULTS_NOTIFICATION = 0x83 )
317 * @channel: which channel the results are from
318 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
319 * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
320 * @num_probe_not_sent: # of request that weren't sent due to not enough time
321 * @duration: duration spent in channel, in usecs
322 * @statistics: statistics gathered for this channel
324 struct iwl_scan_results_notif
{
328 u8 num_probe_not_sent
;
330 __le32 statistics
[SCAN_RESULTS_STATISTICS
];
331 } __packed
; /* SCAN_RESULT_NTF_API_S_VER_2 */
334 * struct iwl_scan_complete_notif - notifies end of scanning (all channels)
335 * ( SCAN_COMPLETE_NOTIFICATION = 0x84 )
336 * @scanned_channels: number of channels scanned (and number of valid results)
337 * @status: one of SCAN_COMP_STATUS_*
338 * @bt_status: BT on/off status
339 * @last_channel: last channel that was scanned
340 * @tsf_low: TSF timer (lower half) in usecs
341 * @tsf_high: TSF timer (higher half) in usecs
342 * @results: array of scan results, only "scanned_channels" of them are valid
344 struct iwl_scan_complete_notif
{
351 struct iwl_scan_results_notif results
[];
352 } __packed
; /* SCAN_COMPLETE_NTF_API_S_VER_2 */
355 #define IWL_SCAN_MAX_BLACKLIST_LEN 64
356 #define IWL_SCAN_SHORT_BLACKLIST_LEN 16
357 #define IWL_SCAN_MAX_PROFILES 11
358 #define SCAN_OFFLOAD_PROBE_REQ_SIZE 512
360 /* Default watchdog (in MS) for scheduled scan iteration */
361 #define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000)
363 #define IWL_GOOD_CRC_TH_DEFAULT cpu_to_le16(1)
364 #define CAN_ABORT_STATUS 1
366 #define IWL_FULL_SCAN_MULTIPLIER 5
367 #define IWL_FAST_SCHED_SCAN_ITERATIONS 3
369 enum scan_framework_client
{
370 SCAN_CLIENT_SCHED_SCAN
= BIT(0),
371 SCAN_CLIENT_NETDETECT
= BIT(1),
372 SCAN_CLIENT_ASSET_TRACKING
= BIT(2),
376 * struct iwl_scan_offload_cmd - SCAN_REQUEST_FIXED_PART_API_S_VER_6
377 * @scan_flags: see enum iwl_scan_flags
378 * @channel_count: channels in channel list
379 * @quiet_time: dwell time, in milisiconds, on quiet channel
380 * @quiet_plcp_th: quiet channel num of packets threshold
381 * @good_CRC_th: passive to active promotion threshold
382 * @rx_chain: RXON rx chain.
383 * @max_out_time: max TUs to be out of assoceated channel
384 * @suspend_time: pause scan this TUs when returning to service channel
386 * @filter_flags: RXONfilter
387 * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz.
388 * @direct_scan: list of SSIDs for directed active scan
389 * @scan_type: see enum iwl_scan_type.
390 * @rep_count: repetition count for each scheduled scan iteration.
392 struct iwl_scan_offload_cmd
{
397 __le16 quiet_plcp_th
;
402 /* RX_ON_FLAGS_API_S_VER_1 */
405 struct iwl_tx_cmd tx_cmd
[2];
406 /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
407 struct iwl_ssid_ie direct_scan
[PROBE_OPTION_MAX
];
412 enum iwl_scan_offload_channel_flags
{
413 IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE
= BIT(0),
414 IWL_SCAN_OFFLOAD_CHANNEL_NARROW
= BIT(22),
415 IWL_SCAN_OFFLOAD_CHANNEL_FULL
= BIT(24),
416 IWL_SCAN_OFFLOAD_CHANNEL_PARTIAL
= BIT(25),
419 /* channel configuration for struct iwl_scan_offload_cfg. Each channels needs:
420 * __le32 type: bitmap; bits 1-20 are for directed scan to i'th ssid and
421 * see enum iwl_scan_offload_channel_flags.
422 * __le16 channel_number: channel number 1-13 etc.
423 * __le16 iter_count: repetition count for the channel.
424 * __le32 iter_interval: interval between two innteration on one channel.
428 #define IWL_SCAN_CHAN_SIZE 14
431 * iwl_scan_offload_cfg - SCAN_OFFLOAD_CONFIG_API_S
432 * @scan_cmd: scan command fixed part
433 * @data: scan channel configuration and probe request frames
435 struct iwl_scan_offload_cfg
{
436 struct iwl_scan_offload_cmd scan_cmd
;
441 * iwl_scan_offload_blacklist - SCAN_OFFLOAD_BLACKLIST_S
442 * @ssid: MAC address to filter out
443 * @reported_rssi: AP rssi reported to the host
444 * @client_bitmap: clients ignore this entry - enum scan_framework_client
446 struct iwl_scan_offload_blacklist
{
452 enum iwl_scan_offload_network_type
{
453 IWL_NETWORK_TYPE_BSS
= 1,
454 IWL_NETWORK_TYPE_IBSS
= 2,
455 IWL_NETWORK_TYPE_ANY
= 3,
458 enum iwl_scan_offload_band_selection
{
459 IWL_SCAN_OFFLOAD_SELECT_2_4
= 0x4,
460 IWL_SCAN_OFFLOAD_SELECT_5_2
= 0x8,
461 IWL_SCAN_OFFLOAD_SELECT_ANY
= 0xc,
465 * iwl_scan_offload_profile - SCAN_OFFLOAD_PROFILE_S
466 * @ssid_index: index to ssid list in fixed part
467 * @unicast_cipher: encryption olgorithm to match - bitmap
468 * @aut_alg: authentication olgorithm to match - bitmap
469 * @network_type: enum iwl_scan_offload_network_type
470 * @band_selection: enum iwl_scan_offload_band_selection
471 * @client_bitmap: clients waiting for match - enum scan_framework_client
473 struct iwl_scan_offload_profile
{
484 * iwl_scan_offload_profile_cfg - SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1
485 * @blaclist: AP list to filter off from scan results
486 * @profiles: profiles to search for match
487 * @blacklist_len: length of blacklist
488 * @num_profiles: num of profiles in the list
489 * @match_notify: clients waiting for match found notification
490 * @pass_match: clients waiting for the results
491 * @active_clients: active clients bitmap - enum scan_framework_client
492 * @any_beacon_notify: clients waiting for match notification without match
494 struct iwl_scan_offload_profile_cfg
{
495 struct iwl_scan_offload_profile profiles
[IWL_SCAN_MAX_PROFILES
];
501 u8 any_beacon_notify
;
506 * iwl_scan_offload_schedule - schedule of scan offload
507 * @delay: delay between iterations, in seconds.
508 * @iterations: num of scan iterations
509 * @full_scan_mul: number of partial scans before each full scan
511 struct iwl_scan_offload_schedule
{
518 * iwl_scan_offload_flags
520 * IWL_SCAN_OFFLOAD_FLAG_PASS_ALL: pass all results - no filtering.
521 * IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL: add cached channels to partial scan.
522 * IWL_SCAN_OFFLOAD_FLAG_EBS_QUICK_MODE: EBS duration is 100mSec - typical
523 * beacon period. Finding channel activity in this mode is not guaranteed.
524 * IWL_SCAN_OFFLOAD_FLAG_EBS_ACCURATE_MODE: EBS duration is 200mSec.
525 * Assuming beacon period is 100ms finding channel activity is guaranteed.
527 enum iwl_scan_offload_flags
{
528 IWL_SCAN_OFFLOAD_FLAG_PASS_ALL
= BIT(0),
529 IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL
= BIT(2),
530 IWL_SCAN_OFFLOAD_FLAG_EBS_QUICK_MODE
= BIT(5),
531 IWL_SCAN_OFFLOAD_FLAG_EBS_ACCURATE_MODE
= BIT(6),
535 * iwl_scan_offload_req - scan offload request command
536 * @flags: bitmap - enum iwl_scan_offload_flags.
537 * @watchdog: maximum scan duration in TU.
538 * @delay: delay in seconds before first iteration.
539 * @schedule_line: scan offload schedule, for fast and regular scan.
541 struct iwl_scan_offload_req
{
546 struct iwl_scan_offload_schedule schedule_line
[2];
549 enum iwl_scan_offload_compleate_status
{
550 IWL_SCAN_OFFLOAD_COMPLETED
= 1,
551 IWL_SCAN_OFFLOAD_ABORTED
= 2,
554 enum iwl_scan_ebs_status
{
555 IWL_SCAN_EBS_SUCCESS
,
557 IWL_SCAN_EBS_CHAN_NOT_FOUND
,
561 * iwl_scan_offload_complete - SCAN_OFFLOAD_COMPLETE_NTF_API_S_VER_1
562 * @last_schedule_line: last schedule line executed (fast or regular)
563 * @last_schedule_iteration: last scan iteration executed before scan abort
564 * @status: enum iwl_scan_offload_compleate_status
565 * @ebs_status: last EBS status, see IWL_SCAN_EBS_*
567 struct iwl_scan_offload_complete
{
568 u8 last_schedule_line
;
569 u8 last_schedule_iteration
;
575 * iwl_sched_scan_results - SCAN_OFFLOAD_MATCH_FOUND_NTF_API_S_VER_1
576 * @ssid_bitmap: SSIDs indexes found in this iteration
577 * @client_bitmap: clients that are active and wait for this notification
579 struct iwl_sched_scan_results
{
585 /* Unified LMAC scan API */
587 #define IWL_MVM_BASIC_PASSIVE_DWELL 110
590 * iwl_scan_req_tx_cmd - SCAN_REQ_TX_CMD_API_S
591 * @tx_flags: combination of TX_CMD_FLG_*
592 * @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is
593 * cleared. Combination of RATE_MCS_*
594 * @sta_id: index of destination station in FW station table
595 * @reserved: for alignment and future use
597 struct iwl_scan_req_tx_cmd
{
604 enum iwl_scan_channel_flags_lmac
{
605 IWL_UNIFIED_SCAN_CHANNEL_FULL
= BIT(27),
606 IWL_UNIFIED_SCAN_CHANNEL_PARTIAL
= BIT(28),
610 * iwl_scan_channel_cfg_lmac - SCAN_CHANNEL_CFG_S_VER2
611 * @flags: bits 1-20: directed scan to i'th ssid
612 * other bits &enum iwl_scan_channel_flags_lmac
613 * @channel_number: channel number 1-13 etc
614 * @iter_count: scan iteration on this channel
615 * @iter_interval: interval in seconds between iterations on one channel
617 struct iwl_scan_channel_cfg_lmac
{
621 __le32 iter_interval
;
625 * iwl_scan_probe_segment - PROBE_SEGMENT_API_S_VER_1
626 * @offset: offset in the data block
627 * @len: length of the segment
629 struct iwl_scan_probe_segment
{
634 /* iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_2
635 * @mac_header: first (and common) part of the probe
636 * @band_data: band specific data
637 * @common_data: last (and common) part of the probe
638 * @buf: raw data block
640 struct iwl_scan_probe_req
{
641 struct iwl_scan_probe_segment mac_header
;
642 struct iwl_scan_probe_segment band_data
[2];
643 struct iwl_scan_probe_segment common_data
;
644 u8 buf
[SCAN_OFFLOAD_PROBE_REQ_SIZE
];
647 enum iwl_scan_channel_flags
{
648 IWL_SCAN_CHANNEL_FLAG_EBS
= BIT(0),
649 IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE
= BIT(1),
650 IWL_SCAN_CHANNEL_FLAG_CACHE_ADD
= BIT(2),
653 /* iwl_scan_channel_opt - CHANNEL_OPTIMIZATION_API_S
654 * @flags: enum iwl_scan_channel_flgs
655 * @non_ebs_ratio: how many regular scan iteration before EBS
657 struct iwl_scan_channel_opt
{
659 __le16 non_ebs_ratio
;
663 * iwl_mvm_lmac_scan_flags
664 * @IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL: pass all beacons and probe responses
666 * @IWL_MVM_LMAC_SCAN_FLAG_PASSIVE: force passive scan on all channels
667 * @IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION: single channel scan
668 * @IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE: send iteration complete notification
669 * @IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS multiple SSID matching
670 * @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented
672 enum iwl_mvm_lmac_scan_flags
{
673 IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL
= BIT(0),
674 IWL_MVM_LMAC_SCAN_FLAG_PASSIVE
= BIT(1),
675 IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION
= BIT(2),
676 IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE
= BIT(3),
677 IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS
= BIT(4),
678 IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED
= BIT(5),
681 enum iwl_scan_priority
{
682 IWL_SCAN_PRIORITY_LOW
,
683 IWL_SCAN_PRIORITY_MEDIUM
,
684 IWL_SCAN_PRIORITY_HIGH
,
688 * iwl_scan_req_unified_lmac - SCAN_REQUEST_CMD_API_S_VER_1
689 * @reserved1: for alignment and future use
690 * @channel_num: num of channels to scan
691 * @active-dwell: dwell time for active channels
692 * @passive-dwell: dwell time for passive channels
693 * @fragmented-dwell: dwell time for fragmented passive scan
694 * @reserved2: for alignment and future use
695 * @rx_chain_selct: PHY_RX_CHAIN_* flags
696 * @scan_flags: &enum iwl_mvm_lmac_scan_flags
697 * @max_out_time: max time (in TU) to be out of associated channel
698 * @suspend_time: pause scan this long (TUs) when returning to service channel
700 * @filter_flags: RXON filter
701 * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz
702 * @direct_scan: list of SSIDs for directed active scan
703 * @scan_prio: enum iwl_scan_priority
704 * @iter_num: number of scan iterations
705 * @delay: delay in seconds before first iteration
706 * @schedule: two scheduling plans. The first one is finite, the second one can
708 * @channel_opt: channel optimization options, for full and partial scan
709 * @data: channel configuration and probe request packet.
711 struct iwl_scan_req_unified_lmac
{
712 /* SCAN_REQUEST_FIXED_PART_API_S_VER_7 */
719 __le16 rx_chain_select
;
723 /* RX_ON_FLAGS_API_S_VER_1 */
726 struct iwl_scan_req_tx_cmd tx_cmd
[2];
727 struct iwl_ssid_ie direct_scan
[PROBE_OPTION_MAX
];
729 /* SCAN_REQ_PERIODIC_PARAMS_API_S */
732 struct iwl_scan_offload_schedule schedule
[2];
733 struct iwl_scan_channel_opt channel_opt
[2];
738 * struct iwl_lmac_scan_results_notif - scan results for one channel -
739 * SCAN_RESULT_NTF_API_S_VER_3
740 * @channel: which channel the results are from
741 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
742 * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
743 * @num_probe_not_sent: # of request that weren't sent due to not enough time
744 * @duration: duration spent in channel, in usecs
746 struct iwl_lmac_scan_results_notif
{
750 u8 num_probe_not_sent
;
755 * struct iwl_lmac_scan_complete_notif - notifies end of scanning (all channels)
756 * SCAN_COMPLETE_NTF_API_S_VER_3
757 * @scanned_channels: number of channels scanned (and number of valid results)
758 * @status: one of SCAN_COMP_STATUS_*
759 * @bt_status: BT on/off status
760 * @last_channel: last channel that was scanned
761 * @tsf_low: TSF timer (lower half) in usecs
762 * @tsf_high: TSF timer (higher half) in usecs
763 * @results: an array of scan results, only "scanned_channels" of them are valid
765 struct iwl_lmac_scan_complete_notif
{
772 struct iwl_scan_results_notif results
[];
776 * iwl_scan_offload_complete - PERIODIC_SCAN_COMPLETE_NTF_API_S_VER_2
777 * @last_schedule_line: last schedule line executed (fast or regular)
778 * @last_schedule_iteration: last scan iteration executed before scan abort
779 * @status: enum iwl_scan_offload_complete_status
780 * @ebs_status: EBS success status &enum iwl_scan_ebs_status
781 * @time_after_last_iter; time in seconds elapsed after last iteration
783 struct iwl_periodic_scan_complete
{
784 u8 last_schedule_line
;
785 u8 last_schedule_iteration
;
788 __le32 time_after_last_iter
;