blob: c33ff8e61f4fd4e14407ce79b2a56232ba181978 [file] [log] [blame]
Johannes Berg8ca151b2013-01-24 14:25:36 +01001/******************************************************************************
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 *
8 * Copyright(c) 2012 - 2013 Intel Corporation. All rights reserved.
9 *
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.
13 *
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.
18 *
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,
22 * USA
23 *
24 * The full GNU General Public License is included in this distribution
Emmanuel Grumbach410dc5a2013-02-18 09:22:28 +020025 * in the file called COPYING.
Johannes Berg8ca151b2013-01-24 14:25:36 +010026 *
27 * Contact Information:
28 * Intel Linux Wireless <ilw@linux.intel.com>
29 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
30 *
31 * BSD LICENSE
32 *
33 * Copyright(c) 2012 - 2013 Intel Corporation. All rights reserved.
34 * All rights reserved.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 *
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
45 * distribution.
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.
49 *
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.
61 *
62 *****************************************************************************/
63
64#ifndef __fw_api_scan_h__
65#define __fw_api_scan_h__
66
67#include "fw-api.h"
68
69/* Scan Commands, Responses, Notifications */
70
71/* Masks for iwl_scan_channel.type flags */
72#define SCAN_CHANNEL_TYPE_PASSIVE 0
73#define SCAN_CHANNEL_TYPE_ACTIVE BIT(0)
74#define SCAN_CHANNEL_NARROW_BAND BIT(22)
75
76/* Max number of IEs for direct SSID scans in a command */
77#define PROBE_OPTION_MAX 20
78
79/**
80 * struct iwl_scan_channel - entry in REPLY_SCAN_CMD channel table
81 * @channel: band is selected by iwl_scan_cmd "flags" field
82 * @tx_gain: gain for analog radio
83 * @dsp_atten: gain for DSP
84 * @active_dwell: dwell time for active scan in TU, typically 5-50
85 * @passive_dwell: dwell time for passive scan in TU, typically 20-500
86 * @type: type is broken down to these bits:
87 * bit 0: 0 = passive, 1 = active
88 * bits 1-20: SSID direct bit map. If any of these bits is set then
89 * the corresponding SSID IE is transmitted in probe request
90 * (bit i adds IE in position i to the probe request)
91 * bit 22: channel width, 0 = regular, 1 = TGj narrow channel
92 *
93 * @iteration_count:
94 * @iteration_interval:
95 * This struct is used once for each channel in the scan list.
96 * Each channel can independently select:
97 * 1) SSID for directed active scans
98 * 2) Txpower setting (for rate specified within Tx command)
99 * 3) How long to stay on-channel (behavior may be modified by quiet_time,
100 * quiet_plcp_th, good_CRC_th)
101 *
102 * To avoid uCode errors, make sure the following are true (see comments
103 * under struct iwl_scan_cmd about max_out_time and quiet_time):
104 * 1) If using passive_dwell (i.e. passive_dwell != 0):
105 * active_dwell <= passive_dwell (< max_out_time if max_out_time != 0)
106 * 2) quiet_time <= active_dwell
107 * 3) If restricting off-channel time (i.e. max_out_time !=0):
108 * passive_dwell < max_out_time
109 * active_dwell < max_out_time
110 */
111struct iwl_scan_channel {
112 __le32 type;
113 __le16 channel;
114 __le16 iteration_count;
115 __le32 iteration_interval;
116 __le16 active_dwell;
117 __le16 passive_dwell;
118} __packed; /* SCAN_CHANNEL_CONTROL_API_S_VER_1 */
119
120/**
121 * struct iwl_ssid_ie - directed scan network information element
122 *
123 * Up to 20 of these may appear in REPLY_SCAN_CMD,
124 * selected by "type" bit field in struct iwl_scan_channel;
125 * each channel may select different ssids from among the 20 entries.
126 * SSID IEs get transmitted in reverse order of entry.
127 */
128struct iwl_ssid_ie {
129 u8 id;
130 u8 len;
131 u8 ssid[IEEE80211_MAX_SSID_LEN];
132} __packed; /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
133
134/**
135 * iwl_scan_flags - masks for scan command flags
136 *@SCAN_FLAGS_PERIODIC_SCAN:
137 *@SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX:
138 *@SCAN_FLAGS_DELAYED_SCAN_LOWBAND:
139 *@SCAN_FLAGS_DELAYED_SCAN_HIGHBAND:
140 *@SCAN_FLAGS_FRAGMENTED_SCAN:
David Spinadel26e05cc2013-07-08 13:12:29 +0300141 *@SCAN_FLAGS_PASSIVE2ACTIVE: use active scan on channels that was active
142 * in the past hour, even if they are marked as passive.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100143 */
144enum iwl_scan_flags {
145 SCAN_FLAGS_PERIODIC_SCAN = BIT(0),
146 SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX = BIT(1),
147 SCAN_FLAGS_DELAYED_SCAN_LOWBAND = BIT(2),
148 SCAN_FLAGS_DELAYED_SCAN_HIGHBAND = BIT(3),
149 SCAN_FLAGS_FRAGMENTED_SCAN = BIT(4),
David Spinadel26e05cc2013-07-08 13:12:29 +0300150 SCAN_FLAGS_PASSIVE2ACTIVE = BIT(5),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100151};
152
153/**
154 * enum iwl_scan_type - Scan types for scan command
155 * @SCAN_TYPE_FORCED:
156 * @SCAN_TYPE_BACKGROUND:
157 * @SCAN_TYPE_OS:
158 * @SCAN_TYPE_ROAMING:
159 * @SCAN_TYPE_ACTION:
160 * @SCAN_TYPE_DISCOVERY:
161 * @SCAN_TYPE_DISCOVERY_FORCED:
162 */
163enum iwl_scan_type {
164 SCAN_TYPE_FORCED = 0,
165 SCAN_TYPE_BACKGROUND = 1,
166 SCAN_TYPE_OS = 2,
167 SCAN_TYPE_ROAMING = 3,
168 SCAN_TYPE_ACTION = 4,
169 SCAN_TYPE_DISCOVERY = 5,
170 SCAN_TYPE_DISCOVERY_FORCED = 6,
171}; /* SCAN_ACTIVITY_TYPE_E_VER_1 */
172
173/* Maximal number of channels to scan */
174#define MAX_NUM_SCAN_CHANNELS 0x24
175
176/**
177 * struct iwl_scan_cmd - scan request command
178 * ( SCAN_REQUEST_CMD = 0x80 )
179 * @len: command length in bytes
180 * @scan_flags: scan flags from SCAN_FLAGS_*
181 * @channel_count: num of channels in channel list (1 - MAX_NUM_SCAN_CHANNELS)
182 * @quiet_time: in msecs, dwell this time for active scan on quiet channels
183 * @quiet_plcp_th: quiet PLCP threshold (channel is quiet if less than
184 * this number of packets were received (typically 1)
David Spinadel26e05cc2013-07-08 13:12:29 +0300185 * @passive2active: is auto switching from passive to active during scan allowed
Johannes Berg8ca151b2013-01-24 14:25:36 +0100186 * @rxchain_sel_flags: RXON_RX_CHAIN_*
187 * @max_out_time: in usecs, max out of serving channel time
188 * @suspend_time: how long to pause scan when returning to service channel:
189 * bits 0-19: beacon interal in usecs (suspend before executing)
190 * bits 20-23: reserved
191 * bits 24-31: number of beacons (suspend between channels)
192 * @rxon_flags: RXON_FLG_*
193 * @filter_flags: RXON_FILTER_*
194 * @tx_cmd: for active scans (zero for passive), w/o payload,
195 * no RS so specify TX rate
196 * @direct_scan: direct scan SSIDs
197 * @type: one of SCAN_TYPE_*
198 * @repeats: how many time to repeat the scan
199 */
200struct iwl_scan_cmd {
201 __le16 len;
202 u8 scan_flags;
203 u8 channel_count;
204 __le16 quiet_time;
205 __le16 quiet_plcp_th;
206 __le16 passive2active;
207 __le16 rxchain_sel_flags;
208 __le32 max_out_time;
209 __le32 suspend_time;
210 /* RX_ON_FLAGS_API_S_VER_1 */
211 __le32 rxon_flags;
212 __le32 filter_flags;
213 struct iwl_tx_cmd tx_cmd;
214 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
215 __le32 type;
216 __le32 repeats;
217
218 /*
219 * Probe request frame, followed by channel list.
220 *
221 * Size of probe request frame is specified by byte count in tx_cmd.
222 * Channel list follows immediately after probe request frame.
223 * Number of channels in list is specified by channel_count.
224 * Each channel in list is of type:
225 *
226 * struct iwl_scan_channel channels[0];
227 *
228 * NOTE: Only one band of channels can be scanned per pass. You
229 * must not mix 2.4GHz channels and 5.2GHz channels, and you must wait
230 * for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION)
231 * before requesting another scan.
232 */
233 u8 data[0];
234} __packed; /* SCAN_REQUEST_FIXED_PART_API_S_VER_5 */
235
236/* Response to scan request contains only status with one of these values */
237#define SCAN_RESPONSE_OK 0x1
238#define SCAN_RESPONSE_ERROR 0x2
239
240/*
241 * SCAN_ABORT_CMD = 0x81
242 * When scan abort is requested, the command has no fields except the common
243 * header. The response contains only a status with one of these values.
244 */
245#define SCAN_ABORT_POSSIBLE 0x1
246#define SCAN_ABORT_IGNORED 0x2 /* no pending scans */
247
248/* TODO: complete documentation */
249#define SCAN_OWNER_STATUS 0x1
250#define MEASURE_OWNER_STATUS 0x2
251
252/**
253 * struct iwl_scan_start_notif - notifies start of scan in the device
254 * ( SCAN_START_NOTIFICATION = 0x82 )
255 * @tsf_low: TSF timer (lower half) in usecs
256 * @tsf_high: TSF timer (higher half) in usecs
257 * @beacon_timer: structured as follows:
258 * bits 0:19 - beacon interval in usecs
259 * bits 20:23 - reserved (0)
260 * bits 24:31 - number of beacons
261 * @channel: which channel is scanned
262 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
263 * @status: one of *_OWNER_STATUS
264 */
265struct iwl_scan_start_notif {
266 __le32 tsf_low;
267 __le32 tsf_high;
268 __le32 beacon_timer;
269 u8 channel;
270 u8 band;
271 u8 reserved[2];
272 __le32 status;
273} __packed; /* SCAN_START_NTF_API_S_VER_1 */
274
275/* scan results probe_status first bit indicates success */
276#define SCAN_PROBE_STATUS_OK 0
277#define SCAN_PROBE_STATUS_TX_FAILED BIT(0)
278/* error statuses combined with TX_FAILED */
279#define SCAN_PROBE_STATUS_FAIL_TTL BIT(1)
280#define SCAN_PROBE_STATUS_FAIL_BT BIT(2)
281
282/* How many statistics are gathered for each channel */
283#define SCAN_RESULTS_STATISTICS 1
284
285/**
286 * enum iwl_scan_complete_status - status codes for scan complete notifications
287 * @SCAN_COMP_STATUS_OK: scan completed successfully
288 * @SCAN_COMP_STATUS_ABORT: scan was aborted by user
289 * @SCAN_COMP_STATUS_ERR_SLEEP: sending null sleep packet failed
290 * @SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT: timeout before channel is ready
291 * @SCAN_COMP_STATUS_ERR_PROBE: sending probe request failed
292 * @SCAN_COMP_STATUS_ERR_WAKEUP: sending null wakeup packet failed
293 * @SCAN_COMP_STATUS_ERR_ANTENNAS: invalid antennas chosen at scan command
294 * @SCAN_COMP_STATUS_ERR_INTERNAL: internal error caused scan abort
295 * @SCAN_COMP_STATUS_ERR_COEX: medium was lost ot WiMax
296 * @SCAN_COMP_STATUS_P2P_ACTION_OK: P2P public action frame TX was successful
297 * (not an error!)
298 * @SCAN_COMP_STATUS_ITERATION_END: indicates end of one repeatition the driver
299 * asked for
300 * @SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events
301*/
302enum iwl_scan_complete_status {
303 SCAN_COMP_STATUS_OK = 0x1,
304 SCAN_COMP_STATUS_ABORT = 0x2,
305 SCAN_COMP_STATUS_ERR_SLEEP = 0x3,
306 SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT = 0x4,
307 SCAN_COMP_STATUS_ERR_PROBE = 0x5,
308 SCAN_COMP_STATUS_ERR_WAKEUP = 0x6,
309 SCAN_COMP_STATUS_ERR_ANTENNAS = 0x7,
310 SCAN_COMP_STATUS_ERR_INTERNAL = 0x8,
311 SCAN_COMP_STATUS_ERR_COEX = 0x9,
312 SCAN_COMP_STATUS_P2P_ACTION_OK = 0xA,
313 SCAN_COMP_STATUS_ITERATION_END = 0x0B,
314 SCAN_COMP_STATUS_ERR_ALLOC_TE = 0x0C,
315};
316
317/**
318 * struct iwl_scan_results_notif - scan results for one channel
319 * ( SCAN_RESULTS_NOTIFICATION = 0x83 )
320 * @channel: which channel the results are from
321 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
322 * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
323 * @num_probe_not_sent: # of request that weren't sent due to not enough time
324 * @duration: duration spent in channel, in usecs
325 * @statistics: statistics gathered for this channel
326 */
327struct iwl_scan_results_notif {
328 u8 channel;
329 u8 band;
330 u8 probe_status;
331 u8 num_probe_not_sent;
332 __le32 duration;
333 __le32 statistics[SCAN_RESULTS_STATISTICS];
334} __packed; /* SCAN_RESULT_NTF_API_S_VER_2 */
335
336/**
337 * struct iwl_scan_complete_notif - notifies end of scanning (all channels)
338 * ( SCAN_COMPLETE_NOTIFICATION = 0x84 )
339 * @scanned_channels: number of channels scanned (and number of valid results)
340 * @status: one of SCAN_COMP_STATUS_*
341 * @bt_status: BT on/off status
342 * @last_channel: last channel that was scanned
343 * @tsf_low: TSF timer (lower half) in usecs
344 * @tsf_high: TSF timer (higher half) in usecs
345 * @results: all scan results, only "scanned_channels" of them are valid
346 */
347struct iwl_scan_complete_notif {
348 u8 scanned_channels;
349 u8 status;
350 u8 bt_status;
351 u8 last_channel;
352 __le32 tsf_low;
353 __le32 tsf_high;
354 struct iwl_scan_results_notif results[MAX_NUM_SCAN_CHANNELS];
355} __packed; /* SCAN_COMPLETE_NTF_API_S_VER_2 */
356
357/* scan offload */
358#define IWL_MAX_SCAN_CHANNELS 40
359#define IWL_SCAN_MAX_BLACKLIST_LEN 64
360#define IWL_SCAN_MAX_PROFILES 11
361#define SCAN_OFFLOAD_PROBE_REQ_SIZE 512
362
363/* Default watchdog (in MS) for scheduled scan iteration */
364#define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000)
365
366#define IWL_GOOD_CRC_TH_DEFAULT cpu_to_le16(1)
367#define CAN_ABORT_STATUS 1
368
369#define IWL_FULL_SCAN_MULTIPLIER 5
370#define IWL_FAST_SCHED_SCAN_ITERATIONS 3
371
372/**
373 * struct iwl_scan_offload_cmd - SCAN_REQUEST_FIXED_PART_API_S_VER_6
374 * @scan_flags: see enum iwl_scan_flags
375 * @channel_count: channels in channel list
376 * @quiet_time: dwell time, in milisiconds, on quiet channel
377 * @quiet_plcp_th: quiet channel num of packets threshold
378 * @good_CRC_th: passive to active promotion threshold
379 * @rx_chain: RXON rx chain.
380 * @max_out_time: max uSec to be out of assoceated channel
381 * @suspend_time: pause scan this long when returning to service channel
382 * @flags: RXON flags
383 * @filter_flags: RXONfilter
384 * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz.
385 * @direct_scan: list of SSIDs for directed active scan
386 * @scan_type: see enum iwl_scan_type.
387 * @rep_count: repetition count for each scheduled scan iteration.
388 */
389struct iwl_scan_offload_cmd {
390 __le16 len;
391 u8 scan_flags;
392 u8 channel_count;
393 __le16 quiet_time;
394 __le16 quiet_plcp_th;
395 __le16 good_CRC_th;
396 __le16 rx_chain;
397 __le32 max_out_time;
398 __le32 suspend_time;
399 /* RX_ON_FLAGS_API_S_VER_1 */
400 __le32 flags;
401 __le32 filter_flags;
402 struct iwl_tx_cmd tx_cmd[2];
403 /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
404 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
405 __le32 scan_type;
406 __le32 rep_count;
407} __packed;
408
409enum iwl_scan_offload_channel_flags {
410 IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE = BIT(0),
411 IWL_SCAN_OFFLOAD_CHANNEL_NARROW = BIT(22),
412 IWL_SCAN_OFFLOAD_CHANNEL_FULL = BIT(24),
413 IWL_SCAN_OFFLOAD_CHANNEL_PARTIAL = BIT(25),
414};
415
416/**
417 * iwl_scan_channel_cfg - SCAN_CHANNEL_CFG_S
418 * @type: bitmap - see enum iwl_scan_offload_channel_flags.
419 * 0: passive (0) or active (1) scan.
420 * 1-20: directed scan to i'th ssid.
421 * 22: channel width configuation - 1 for narrow.
422 * 24: full scan.
423 * 25: partial scan.
424 * @channel_number: channel number 1-13 etc.
425 * @iter_count: repetition count for the channel.
426 * @iter_interval: interval between two innteration on one channel.
427 * @dwell_time: entry 0 - active scan, entry 1 - passive scan.
428 */
429struct iwl_scan_channel_cfg {
430 __le32 type[IWL_MAX_SCAN_CHANNELS];
431 __le16 channel_number[IWL_MAX_SCAN_CHANNELS];
432 __le16 iter_count[IWL_MAX_SCAN_CHANNELS];
433 __le32 iter_interval[IWL_MAX_SCAN_CHANNELS];
434 u8 dwell_time[IWL_MAX_SCAN_CHANNELS][2];
435} __packed;
436
437/**
438 * iwl_scan_offload_cfg - SCAN_OFFLOAD_CONFIG_API_S
439 * @scan_cmd: scan command fixed part
440 * @channel_cfg: scan channel configuration
441 * @data: probe request frames (one per band)
442 */
443struct iwl_scan_offload_cfg {
444 struct iwl_scan_offload_cmd scan_cmd;
445 struct iwl_scan_channel_cfg channel_cfg;
446 u8 data[0];
447} __packed;
448
449/**
450 * iwl_scan_offload_blacklist - SCAN_OFFLOAD_BLACKLIST_S
451 * @ssid: MAC address to filter out
452 * @reported_rssi: AP rssi reported to the host
453 */
454struct iwl_scan_offload_blacklist {
455 u8 ssid[ETH_ALEN];
456 u8 reported_rssi;
457 u8 reserved;
458} __packed;
459
460enum iwl_scan_offload_network_type {
461 IWL_NETWORK_TYPE_BSS = 1,
462 IWL_NETWORK_TYPE_IBSS = 2,
463 IWL_NETWORK_TYPE_ANY = 3,
464};
465
466enum iwl_scan_offload_band_selection {
467 IWL_SCAN_OFFLOAD_SELECT_2_4 = 0x4,
468 IWL_SCAN_OFFLOAD_SELECT_5_2 = 0x8,
469 IWL_SCAN_OFFLOAD_SELECT_ANY = 0xc,
470};
471
472/**
473 * iwl_scan_offload_profile - SCAN_OFFLOAD_PROFILE_S
474 * @ssid_index: index to ssid list in fixed part
475 * @unicast_cipher: encryption olgorithm to match - bitmap
476 * @aut_alg: authentication olgorithm to match - bitmap
477 * @network_type: enum iwl_scan_offload_network_type
478 * @band_selection: enum iwl_scan_offload_band_selection
479 */
480struct iwl_scan_offload_profile {
481 u8 ssid_index;
482 u8 unicast_cipher;
483 u8 auth_alg;
484 u8 network_type;
485 u8 band_selection;
486 u8 reserved[3];
487} __packed;
488
489/**
490 * iwl_scan_offload_profile_cfg - SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1
491 * @blaclist: AP list to filter off from scan results
492 * @profiles: profiles to search for match
493 * @blacklist_len: length of blacklist
494 * @num_profiles: num of profiles in the list
495 */
496struct iwl_scan_offload_profile_cfg {
497 struct iwl_scan_offload_blacklist blacklist[IWL_SCAN_MAX_BLACKLIST_LEN];
498 struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES];
499 u8 blacklist_len;
500 u8 num_profiles;
501 u8 reserved[2];
502} __packed;
503
504/**
505 * iwl_scan_offload_schedule - schedule of scan offload
506 * @delay: delay between iterations, in seconds.
507 * @iterations: num of scan iterations
508 * @full_scan_mul: number of partial scans before each full scan
509 */
510struct iwl_scan_offload_schedule {
511 u16 delay;
512 u8 iterations;
513 u8 full_scan_mul;
514} __packed;
515
516/*
517 * iwl_scan_offload_flags
518 *
519 * IWL_SCAN_OFFLOAD_FLAG_FILTER_SSID: filter mode - upload every beacon or match
520 * ssid list.
521 * IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL: add cached channels to partial scan.
522 * IWL_SCAN_OFFLOAD_FLAG_ENERGY_SCAN: use energy based scan before partial scan
523 * on A band.
524 */
525enum iwl_scan_offload_flags {
526 IWL_SCAN_OFFLOAD_FLAG_FILTER_SSID = BIT(0),
527 IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL = BIT(2),
528 IWL_SCAN_OFFLOAD_FLAG_ENERGY_SCAN = BIT(3),
529};
530
531/**
532 * iwl_scan_offload_req - scan offload request command
533 * @flags: bitmap - enum iwl_scan_offload_flags.
534 * @watchdog: maximum scan duration in TU.
535 * @delay: delay in seconds before first iteration.
536 * @schedule_line: scan offload schedule, for fast and regular scan.
537 */
538struct iwl_scan_offload_req {
539 __le16 flags;
540 __le16 watchdog;
541 __le16 delay;
542 __le16 reserved;
543 struct iwl_scan_offload_schedule schedule_line[2];
544} __packed;
545
546enum iwl_scan_offload_compleate_status {
547 IWL_SCAN_OFFLOAD_COMPLETED = 1,
548 IWL_SCAN_OFFLOAD_ABORTED = 2,
549};
550
551/**
552 * iwl_scan_offload_complete - SCAN_OFFLOAD_COMPLETE_NTF_API_S_VER_1
553 * @last_schedule_line: last schedule line executed (fast or regular)
554 * @last_schedule_iteration: last scan iteration executed before scan abort
555 * @status: enum iwl_scan_offload_compleate_status
556 */
557struct iwl_scan_offload_complete {
558 u8 last_schedule_line;
559 u8 last_schedule_iteration;
560 u8 status;
561 u8 reserved;
562} __packed;
563
564#endif