iwlwifi: mvm: remove deprecated scan API code
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / mvm / fw-api-scan.h
1 /******************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
10 *
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.
14 *
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.
19 *
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,
23 * USA
24 *
25 * The full GNU General Public License is included in this distribution
26 * in the file called COPYING.
27 *
28 * Contact Information:
29 * Intel Linux Wireless <ilw@linux.intel.com>
30 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
31 *
32 * BSD LICENSE
33 *
34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
36 * All rights reserved.
37 *
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
41 *
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
47 * distribution.
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.
51 *
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.
63 *
64 *****************************************************************************/
65
66 #ifndef __fw_api_scan_h__
67 #define __fw_api_scan_h__
68
69 #include "fw-api.h"
70
71 /* Scan Commands, Responses, Notifications */
72
73 /* Max number of IEs for direct SSID scans in a command */
74 #define PROBE_OPTION_MAX 20
75
76 /**
77 * struct iwl_ssid_ie - directed scan network information element
78 *
79 * Up to 20 of these may appear in REPLY_SCAN_CMD,
80 * selected by "type" bit field in struct iwl_scan_channel;
81 * each channel may select different ssids from among the 20 entries.
82 * SSID IEs get transmitted in reverse order of entry.
83 */
84 struct iwl_ssid_ie {
85 u8 id;
86 u8 len;
87 u8 ssid[IEEE80211_MAX_SSID_LEN];
88 } __packed; /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
89
90 /* How many statistics are gathered for each channel */
91 #define SCAN_RESULTS_STATISTICS 1
92
93 /**
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
105 * (not an error!)
106 * @SCAN_COMP_STATUS_ITERATION_END: indicates end of one repeatition the driver
107 * asked for
108 * @SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events
109 */
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,
123 };
124
125 /**
126 * struct iwl_scan_results_notif - scan results for one channel
127 * ( SCAN_RESULTS_NOTIFICATION = 0x83 )
128 * @channel: which channel the results are from
129 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
130 * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
131 * @num_probe_not_sent: # of request that weren't sent due to not enough time
132 * @duration: duration spent in channel, in usecs
133 * @statistics: statistics gathered for this channel
134 */
135 struct iwl_scan_results_notif {
136 u8 channel;
137 u8 band;
138 u8 probe_status;
139 u8 num_probe_not_sent;
140 __le32 duration;
141 __le32 statistics[SCAN_RESULTS_STATISTICS];
142 } __packed; /* SCAN_RESULT_NTF_API_S_VER_2 */
143
144 /**
145 * struct iwl_scan_complete_notif - notifies end of scanning (all channels)
146 * ( SCAN_COMPLETE_NOTIFICATION = 0x84 )
147 * @scanned_channels: number of channels scanned (and number of valid results)
148 * @status: one of SCAN_COMP_STATUS_*
149 * @bt_status: BT on/off status
150 * @last_channel: last channel that was scanned
151 * @tsf_low: TSF timer (lower half) in usecs
152 * @tsf_high: TSF timer (higher half) in usecs
153 * @results: array of scan results, only "scanned_channels" of them are valid
154 */
155 struct iwl_scan_complete_notif {
156 u8 scanned_channels;
157 u8 status;
158 u8 bt_status;
159 u8 last_channel;
160 __le32 tsf_low;
161 __le32 tsf_high;
162 struct iwl_scan_results_notif results[];
163 } __packed; /* SCAN_COMPLETE_NTF_API_S_VER_2 */
164
165 /* scan offload */
166 #define IWL_SCAN_MAX_BLACKLIST_LEN 64
167 #define IWL_SCAN_SHORT_BLACKLIST_LEN 16
168 #define IWL_SCAN_MAX_PROFILES 11
169 #define SCAN_OFFLOAD_PROBE_REQ_SIZE 512
170
171 /* Default watchdog (in MS) for scheduled scan iteration */
172 #define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000)
173
174 #define IWL_GOOD_CRC_TH_DEFAULT cpu_to_le16(1)
175 #define CAN_ABORT_STATUS 1
176
177 #define IWL_FULL_SCAN_MULTIPLIER 5
178 #define IWL_FAST_SCHED_SCAN_ITERATIONS 3
179
180 enum scan_framework_client {
181 SCAN_CLIENT_SCHED_SCAN = BIT(0),
182 SCAN_CLIENT_NETDETECT = BIT(1),
183 SCAN_CLIENT_ASSET_TRACKING = BIT(2),
184 };
185
186 /**
187 * struct iwl_scan_offload_cmd - SCAN_REQUEST_FIXED_PART_API_S_VER_6
188 * @scan_flags: see enum iwl_scan_flags
189 * @channel_count: channels in channel list
190 * @quiet_time: dwell time, in milisiconds, on quiet channel
191 * @quiet_plcp_th: quiet channel num of packets threshold
192 * @good_CRC_th: passive to active promotion threshold
193 * @rx_chain: RXON rx chain.
194 * @max_out_time: max TUs to be out of assoceated channel
195 * @suspend_time: pause scan this TUs when returning to service channel
196 * @flags: RXON flags
197 * @filter_flags: RXONfilter
198 * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz.
199 * @direct_scan: list of SSIDs for directed active scan
200 * @scan_type: see enum iwl_scan_type.
201 * @rep_count: repetition count for each scheduled scan iteration.
202 */
203 struct iwl_scan_offload_cmd {
204 __le16 len;
205 u8 scan_flags;
206 u8 channel_count;
207 __le16 quiet_time;
208 __le16 quiet_plcp_th;
209 __le16 good_CRC_th;
210 __le16 rx_chain;
211 __le32 max_out_time;
212 __le32 suspend_time;
213 /* RX_ON_FLAGS_API_S_VER_1 */
214 __le32 flags;
215 __le32 filter_flags;
216 struct iwl_tx_cmd tx_cmd[2];
217 /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
218 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
219 __le32 scan_type;
220 __le32 rep_count;
221 } __packed;
222
223 enum iwl_scan_offload_channel_flags {
224 IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE = BIT(0),
225 IWL_SCAN_OFFLOAD_CHANNEL_NARROW = BIT(22),
226 IWL_SCAN_OFFLOAD_CHANNEL_FULL = BIT(24),
227 IWL_SCAN_OFFLOAD_CHANNEL_PARTIAL = BIT(25),
228 };
229
230 /* channel configuration for struct iwl_scan_offload_cfg. Each channels needs:
231 * __le32 type: bitmap; bits 1-20 are for directed scan to i'th ssid and
232 * see enum iwl_scan_offload_channel_flags.
233 * __le16 channel_number: channel number 1-13 etc.
234 * __le16 iter_count: repetition count for the channel.
235 * __le32 iter_interval: interval between two innteration on one channel.
236 * u8 active_dwell.
237 * u8 passive_dwell.
238 */
239 #define IWL_SCAN_CHAN_SIZE 14
240
241 /**
242 * iwl_scan_offload_cfg - SCAN_OFFLOAD_CONFIG_API_S
243 * @scan_cmd: scan command fixed part
244 * @data: scan channel configuration and probe request frames
245 */
246 struct iwl_scan_offload_cfg {
247 struct iwl_scan_offload_cmd scan_cmd;
248 u8 data[0];
249 } __packed;
250
251 /**
252 * iwl_scan_offload_blacklist - SCAN_OFFLOAD_BLACKLIST_S
253 * @ssid: MAC address to filter out
254 * @reported_rssi: AP rssi reported to the host
255 * @client_bitmap: clients ignore this entry - enum scan_framework_client
256 */
257 struct iwl_scan_offload_blacklist {
258 u8 ssid[ETH_ALEN];
259 u8 reported_rssi;
260 u8 client_bitmap;
261 } __packed;
262
263 enum iwl_scan_offload_network_type {
264 IWL_NETWORK_TYPE_BSS = 1,
265 IWL_NETWORK_TYPE_IBSS = 2,
266 IWL_NETWORK_TYPE_ANY = 3,
267 };
268
269 enum iwl_scan_offload_band_selection {
270 IWL_SCAN_OFFLOAD_SELECT_2_4 = 0x4,
271 IWL_SCAN_OFFLOAD_SELECT_5_2 = 0x8,
272 IWL_SCAN_OFFLOAD_SELECT_ANY = 0xc,
273 };
274
275 /**
276 * iwl_scan_offload_profile - SCAN_OFFLOAD_PROFILE_S
277 * @ssid_index: index to ssid list in fixed part
278 * @unicast_cipher: encryption olgorithm to match - bitmap
279 * @aut_alg: authentication olgorithm to match - bitmap
280 * @network_type: enum iwl_scan_offload_network_type
281 * @band_selection: enum iwl_scan_offload_band_selection
282 * @client_bitmap: clients waiting for match - enum scan_framework_client
283 */
284 struct iwl_scan_offload_profile {
285 u8 ssid_index;
286 u8 unicast_cipher;
287 u8 auth_alg;
288 u8 network_type;
289 u8 band_selection;
290 u8 client_bitmap;
291 u8 reserved[2];
292 } __packed;
293
294 /**
295 * iwl_scan_offload_profile_cfg - SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1
296 * @blaclist: AP list to filter off from scan results
297 * @profiles: profiles to search for match
298 * @blacklist_len: length of blacklist
299 * @num_profiles: num of profiles in the list
300 * @match_notify: clients waiting for match found notification
301 * @pass_match: clients waiting for the results
302 * @active_clients: active clients bitmap - enum scan_framework_client
303 * @any_beacon_notify: clients waiting for match notification without match
304 */
305 struct iwl_scan_offload_profile_cfg {
306 struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES];
307 u8 blacklist_len;
308 u8 num_profiles;
309 u8 match_notify;
310 u8 pass_match;
311 u8 active_clients;
312 u8 any_beacon_notify;
313 u8 reserved[2];
314 } __packed;
315
316 /**
317 * iwl_scan_offload_schedule - schedule of scan offload
318 * @delay: delay between iterations, in seconds.
319 * @iterations: num of scan iterations
320 * @full_scan_mul: number of partial scans before each full scan
321 */
322 struct iwl_scan_offload_schedule {
323 __le16 delay;
324 u8 iterations;
325 u8 full_scan_mul;
326 } __packed;
327
328 /*
329 * iwl_scan_offload_flags
330 *
331 * IWL_SCAN_OFFLOAD_FLAG_PASS_ALL: pass all results - no filtering.
332 * IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL: add cached channels to partial scan.
333 * IWL_SCAN_OFFLOAD_FLAG_EBS_QUICK_MODE: EBS duration is 100mSec - typical
334 * beacon period. Finding channel activity in this mode is not guaranteed.
335 * IWL_SCAN_OFFLOAD_FLAG_EBS_ACCURATE_MODE: EBS duration is 200mSec.
336 * Assuming beacon period is 100ms finding channel activity is guaranteed.
337 */
338 enum iwl_scan_offload_flags {
339 IWL_SCAN_OFFLOAD_FLAG_PASS_ALL = BIT(0),
340 IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL = BIT(2),
341 IWL_SCAN_OFFLOAD_FLAG_EBS_QUICK_MODE = BIT(5),
342 IWL_SCAN_OFFLOAD_FLAG_EBS_ACCURATE_MODE = BIT(6),
343 };
344
345 /**
346 * iwl_scan_offload_req - scan offload request command
347 * @flags: bitmap - enum iwl_scan_offload_flags.
348 * @watchdog: maximum scan duration in TU.
349 * @delay: delay in seconds before first iteration.
350 * @schedule_line: scan offload schedule, for fast and regular scan.
351 */
352 struct iwl_scan_offload_req {
353 __le16 flags;
354 __le16 watchdog;
355 __le16 delay;
356 __le16 reserved;
357 struct iwl_scan_offload_schedule schedule_line[2];
358 } __packed;
359
360 enum iwl_scan_offload_compleate_status {
361 IWL_SCAN_OFFLOAD_COMPLETED = 1,
362 IWL_SCAN_OFFLOAD_ABORTED = 2,
363 };
364
365 enum iwl_scan_ebs_status {
366 IWL_SCAN_EBS_SUCCESS,
367 IWL_SCAN_EBS_FAILED,
368 IWL_SCAN_EBS_CHAN_NOT_FOUND,
369 };
370
371 /**
372 * iwl_scan_offload_complete - SCAN_OFFLOAD_COMPLETE_NTF_API_S_VER_1
373 * @last_schedule_line: last schedule line executed (fast or regular)
374 * @last_schedule_iteration: last scan iteration executed before scan abort
375 * @status: enum iwl_scan_offload_compleate_status
376 * @ebs_status: last EBS status, see IWL_SCAN_EBS_*
377 */
378 struct iwl_scan_offload_complete {
379 u8 last_schedule_line;
380 u8 last_schedule_iteration;
381 u8 status;
382 u8 ebs_status;
383 } __packed;
384
385 /**
386 * iwl_sched_scan_results - SCAN_OFFLOAD_MATCH_FOUND_NTF_API_S_VER_1
387 * @ssid_bitmap: SSIDs indexes found in this iteration
388 * @client_bitmap: clients that are active and wait for this notification
389 */
390 struct iwl_sched_scan_results {
391 __le16 ssid_bitmap;
392 u8 client_bitmap;
393 u8 reserved;
394 };
395
396 /* Unified LMAC scan API */
397
398 #define IWL_MVM_BASIC_PASSIVE_DWELL 110
399
400 /**
401 * iwl_scan_req_tx_cmd - SCAN_REQ_TX_CMD_API_S
402 * @tx_flags: combination of TX_CMD_FLG_*
403 * @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is
404 * cleared. Combination of RATE_MCS_*
405 * @sta_id: index of destination station in FW station table
406 * @reserved: for alignment and future use
407 */
408 struct iwl_scan_req_tx_cmd {
409 __le32 tx_flags;
410 __le32 rate_n_flags;
411 u8 sta_id;
412 u8 reserved[3];
413 } __packed;
414
415 enum iwl_scan_channel_flags_lmac {
416 IWL_UNIFIED_SCAN_CHANNEL_FULL = BIT(27),
417 IWL_UNIFIED_SCAN_CHANNEL_PARTIAL = BIT(28),
418 };
419
420 /**
421 * iwl_scan_channel_cfg_lmac - SCAN_CHANNEL_CFG_S_VER2
422 * @flags: bits 1-20: directed scan to i'th ssid
423 * other bits &enum iwl_scan_channel_flags_lmac
424 * @channel_number: channel number 1-13 etc
425 * @iter_count: scan iteration on this channel
426 * @iter_interval: interval in seconds between iterations on one channel
427 */
428 struct iwl_scan_channel_cfg_lmac {
429 __le32 flags;
430 __le16 channel_num;
431 __le16 iter_count;
432 __le32 iter_interval;
433 } __packed;
434
435 /*
436 * iwl_scan_probe_segment - PROBE_SEGMENT_API_S_VER_1
437 * @offset: offset in the data block
438 * @len: length of the segment
439 */
440 struct iwl_scan_probe_segment {
441 __le16 offset;
442 __le16 len;
443 } __packed;
444
445 /* iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_2
446 * @mac_header: first (and common) part of the probe
447 * @band_data: band specific data
448 * @common_data: last (and common) part of the probe
449 * @buf: raw data block
450 */
451 struct iwl_scan_probe_req {
452 struct iwl_scan_probe_segment mac_header;
453 struct iwl_scan_probe_segment band_data[2];
454 struct iwl_scan_probe_segment common_data;
455 u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE];
456 } __packed;
457
458 enum iwl_scan_channel_flags {
459 IWL_SCAN_CHANNEL_FLAG_EBS = BIT(0),
460 IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE = BIT(1),
461 IWL_SCAN_CHANNEL_FLAG_CACHE_ADD = BIT(2),
462 };
463
464 /* iwl_scan_channel_opt - CHANNEL_OPTIMIZATION_API_S
465 * @flags: enum iwl_scan_channel_flags
466 * @non_ebs_ratio: defines the ratio of number of scan iterations where EBS is
467 * involved.
468 * 1 - EBS is disabled.
469 * 2 - every second scan will be full scan(and so on).
470 */
471 struct iwl_scan_channel_opt {
472 __le16 flags;
473 __le16 non_ebs_ratio;
474 } __packed;
475
476 /**
477 * iwl_mvm_lmac_scan_flags
478 * @IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL: pass all beacons and probe responses
479 * without filtering.
480 * @IWL_MVM_LMAC_SCAN_FLAG_PASSIVE: force passive scan on all channels
481 * @IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION: single channel scan
482 * @IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE: send iteration complete notification
483 * @IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS multiple SSID matching
484 * @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented
485 * @IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED: insert WFA vendor-specific TPC report
486 * and DS parameter set IEs into probe requests.
487 * @IWL_MVM_LMAC_SCAN_FLAG_MATCH: Send match found notification on matches
488 */
489 enum iwl_mvm_lmac_scan_flags {
490 IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL = BIT(0),
491 IWL_MVM_LMAC_SCAN_FLAG_PASSIVE = BIT(1),
492 IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION = BIT(2),
493 IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE = BIT(3),
494 IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS = BIT(4),
495 IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED = BIT(5),
496 IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED = BIT(6),
497 IWL_MVM_LMAC_SCAN_FLAG_MATCH = BIT(9),
498 };
499
500 enum iwl_scan_priority {
501 IWL_SCAN_PRIORITY_LOW,
502 IWL_SCAN_PRIORITY_MEDIUM,
503 IWL_SCAN_PRIORITY_HIGH,
504 };
505
506 /**
507 * iwl_scan_req_unified_lmac - SCAN_REQUEST_CMD_API_S_VER_1
508 * @reserved1: for alignment and future use
509 * @channel_num: num of channels to scan
510 * @active-dwell: dwell time for active channels
511 * @passive-dwell: dwell time for passive channels
512 * @fragmented-dwell: dwell time for fragmented passive scan
513 * @reserved2: for alignment and future use
514 * @rx_chain_selct: PHY_RX_CHAIN_* flags
515 * @scan_flags: &enum iwl_mvm_lmac_scan_flags
516 * @max_out_time: max time (in TU) to be out of associated channel
517 * @suspend_time: pause scan this long (TUs) when returning to service channel
518 * @flags: RXON flags
519 * @filter_flags: RXON filter
520 * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz
521 * @direct_scan: list of SSIDs for directed active scan
522 * @scan_prio: enum iwl_scan_priority
523 * @iter_num: number of scan iterations
524 * @delay: delay in seconds before first iteration
525 * @schedule: two scheduling plans. The first one is finite, the second one can
526 * be infinite.
527 * @channel_opt: channel optimization options, for full and partial scan
528 * @data: channel configuration and probe request packet.
529 */
530 struct iwl_scan_req_unified_lmac {
531 /* SCAN_REQUEST_FIXED_PART_API_S_VER_7 */
532 __le32 reserved1;
533 u8 n_channels;
534 u8 active_dwell;
535 u8 passive_dwell;
536 u8 fragmented_dwell;
537 __le16 reserved2;
538 __le16 rx_chain_select;
539 __le32 scan_flags;
540 __le32 max_out_time;
541 __le32 suspend_time;
542 /* RX_ON_FLAGS_API_S_VER_1 */
543 __le32 flags;
544 __le32 filter_flags;
545 struct iwl_scan_req_tx_cmd tx_cmd[2];
546 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
547 __le32 scan_prio;
548 /* SCAN_REQ_PERIODIC_PARAMS_API_S */
549 __le32 iter_num;
550 __le32 delay;
551 struct iwl_scan_offload_schedule schedule[2];
552 struct iwl_scan_channel_opt channel_opt[2];
553 u8 data[];
554 } __packed;
555
556 /**
557 * struct iwl_lmac_scan_results_notif - scan results for one channel -
558 * SCAN_RESULT_NTF_API_S_VER_3
559 * @channel: which channel the results are from
560 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
561 * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
562 * @num_probe_not_sent: # of request that weren't sent due to not enough time
563 * @duration: duration spent in channel, in usecs
564 */
565 struct iwl_lmac_scan_results_notif {
566 u8 channel;
567 u8 band;
568 u8 probe_status;
569 u8 num_probe_not_sent;
570 __le32 duration;
571 } __packed;
572
573 /**
574 * struct iwl_lmac_scan_complete_notif - notifies end of scanning (all channels)
575 * SCAN_COMPLETE_NTF_API_S_VER_3
576 * @scanned_channels: number of channels scanned (and number of valid results)
577 * @status: one of SCAN_COMP_STATUS_*
578 * @bt_status: BT on/off status
579 * @last_channel: last channel that was scanned
580 * @tsf_low: TSF timer (lower half) in usecs
581 * @tsf_high: TSF timer (higher half) in usecs
582 * @results: an array of scan results, only "scanned_channels" of them are valid
583 */
584 struct iwl_lmac_scan_complete_notif {
585 u8 scanned_channels;
586 u8 status;
587 u8 bt_status;
588 u8 last_channel;
589 __le32 tsf_low;
590 __le32 tsf_high;
591 struct iwl_scan_results_notif results[];
592 } __packed;
593
594 /**
595 * iwl_scan_offload_complete - PERIODIC_SCAN_COMPLETE_NTF_API_S_VER_2
596 * @last_schedule_line: last schedule line executed (fast or regular)
597 * @last_schedule_iteration: last scan iteration executed before scan abort
598 * @status: enum iwl_scan_offload_complete_status
599 * @ebs_status: EBS success status &enum iwl_scan_ebs_status
600 * @time_after_last_iter; time in seconds elapsed after last iteration
601 */
602 struct iwl_periodic_scan_complete {
603 u8 last_schedule_line;
604 u8 last_schedule_iteration;
605 u8 status;
606 u8 ebs_status;
607 __le32 time_after_last_iter;
608 __le32 reserved;
609 } __packed;
610
611 /* UMAC Scan API */
612
613 /**
614 * struct iwl_mvm_umac_cmd_hdr - Command header for UMAC commands
615 * @size: size of the command (not including header)
616 * @reserved0: for future use and alignment
617 * @ver: API version number
618 */
619 struct iwl_mvm_umac_cmd_hdr {
620 __le16 size;
621 u8 reserved0;
622 u8 ver;
623 } __packed;
624
625 #define IWL_MVM_MAX_SIMULTANEOUS_SCANS 8
626
627 enum scan_config_flags {
628 SCAN_CONFIG_FLAG_ACTIVATE = BIT(0),
629 SCAN_CONFIG_FLAG_DEACTIVATE = BIT(1),
630 SCAN_CONFIG_FLAG_FORBID_CHUB_REQS = BIT(2),
631 SCAN_CONFIG_FLAG_ALLOW_CHUB_REQS = BIT(3),
632 SCAN_CONFIG_FLAG_SET_TX_CHAINS = BIT(8),
633 SCAN_CONFIG_FLAG_SET_RX_CHAINS = BIT(9),
634 SCAN_CONFIG_FLAG_SET_AUX_STA_ID = BIT(10),
635 SCAN_CONFIG_FLAG_SET_ALL_TIMES = BIT(11),
636 SCAN_CONFIG_FLAG_SET_EFFECTIVE_TIMES = BIT(12),
637 SCAN_CONFIG_FLAG_SET_CHANNEL_FLAGS = BIT(13),
638 SCAN_CONFIG_FLAG_SET_LEGACY_RATES = BIT(14),
639 SCAN_CONFIG_FLAG_SET_MAC_ADDR = BIT(15),
640 SCAN_CONFIG_FLAG_SET_FRAGMENTED = BIT(16),
641 SCAN_CONFIG_FLAG_CLEAR_FRAGMENTED = BIT(17),
642 SCAN_CONFIG_FLAG_SET_CAM_MODE = BIT(18),
643 SCAN_CONFIG_FLAG_CLEAR_CAM_MODE = BIT(19),
644 SCAN_CONFIG_FLAG_SET_PROMISC_MODE = BIT(20),
645 SCAN_CONFIG_FLAG_CLEAR_PROMISC_MODE = BIT(21),
646
647 /* Bits 26-31 are for num of channels in channel_array */
648 #define SCAN_CONFIG_N_CHANNELS(n) ((n) << 26)
649 };
650
651 enum scan_config_rates {
652 /* OFDM basic rates */
653 SCAN_CONFIG_RATE_6M = BIT(0),
654 SCAN_CONFIG_RATE_9M = BIT(1),
655 SCAN_CONFIG_RATE_12M = BIT(2),
656 SCAN_CONFIG_RATE_18M = BIT(3),
657 SCAN_CONFIG_RATE_24M = BIT(4),
658 SCAN_CONFIG_RATE_36M = BIT(5),
659 SCAN_CONFIG_RATE_48M = BIT(6),
660 SCAN_CONFIG_RATE_54M = BIT(7),
661 /* CCK basic rates */
662 SCAN_CONFIG_RATE_1M = BIT(8),
663 SCAN_CONFIG_RATE_2M = BIT(9),
664 SCAN_CONFIG_RATE_5M = BIT(10),
665 SCAN_CONFIG_RATE_11M = BIT(11),
666
667 /* Bits 16-27 are for supported rates */
668 #define SCAN_CONFIG_SUPPORTED_RATE(rate) ((rate) << 16)
669 };
670
671 enum iwl_channel_flags {
672 IWL_CHANNEL_FLAG_EBS = BIT(0),
673 IWL_CHANNEL_FLAG_ACCURATE_EBS = BIT(1),
674 IWL_CHANNEL_FLAG_EBS_ADD = BIT(2),
675 IWL_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE = BIT(3),
676 };
677
678 /**
679 * struct iwl_scan_config
680 * @hdr: umac command header
681 * @flags: enum scan_config_flags
682 * @tx_chains: valid_tx antenna - ANT_* definitions
683 * @rx_chains: valid_rx antenna - ANT_* definitions
684 * @legacy_rates: default legacy rates - enum scan_config_rates
685 * @out_of_channel_time: default max out of serving channel time
686 * @suspend_time: default max suspend time
687 * @dwell_active: default dwell time for active scan
688 * @dwell_passive: default dwell time for passive scan
689 * @dwell_fragmented: default dwell time for fragmented scan
690 * @reserved: for future use and alignment
691 * @mac_addr: default mac address to be used in probes
692 * @bcast_sta_id: the index of the station in the fw
693 * @channel_flags: default channel flags - enum iwl_channel_flags
694 * scan_config_channel_flag
695 * @channel_array: default supported channels
696 */
697 struct iwl_scan_config {
698 struct iwl_mvm_umac_cmd_hdr hdr;
699 __le32 flags;
700 __le32 tx_chains;
701 __le32 rx_chains;
702 __le32 legacy_rates;
703 __le32 out_of_channel_time;
704 __le32 suspend_time;
705 u8 dwell_active;
706 u8 dwell_passive;
707 u8 dwell_fragmented;
708 u8 reserved;
709 u8 mac_addr[ETH_ALEN];
710 u8 bcast_sta_id;
711 u8 channel_flags;
712 u8 channel_array[];
713 } __packed; /* SCAN_CONFIG_DB_CMD_API_S */
714
715 /**
716 * iwl_umac_scan_flags
717 *@IWL_UMAC_SCAN_FLAG_PREEMPTIVE: scan process triggered by this scan request
718 * can be preempted by other scan requests with higher priority.
719 * The low priority scan is aborted.
720 *@IWL_UMAC_SCAN_FLAG_START_NOTIF: notification will be sent to the driver
721 * when scan starts.
722 */
723 enum iwl_umac_scan_flags {
724 IWL_UMAC_SCAN_FLAG_PREEMPTIVE = BIT(0),
725 IWL_UMAC_SCAN_FLAG_START_NOTIF = BIT(1),
726 };
727
728 enum iwl_umac_scan_uid_offsets {
729 IWL_UMAC_SCAN_UID_TYPE_OFFSET = 0,
730 IWL_UMAC_SCAN_UID_SEQ_OFFSET = 8,
731 };
732
733 enum iwl_umac_scan_general_flags {
734 IWL_UMAC_SCAN_GEN_FLAGS_PERIODIC = BIT(0),
735 IWL_UMAC_SCAN_GEN_FLAGS_OVER_BT = BIT(1),
736 IWL_UMAC_SCAN_GEN_FLAGS_PASS_ALL = BIT(2),
737 IWL_UMAC_SCAN_GEN_FLAGS_PASSIVE = BIT(3),
738 IWL_UMAC_SCAN_GEN_FLAGS_PRE_CONNECT = BIT(4),
739 IWL_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE = BIT(5),
740 IWL_UMAC_SCAN_GEN_FLAGS_MULTIPLE_SSID = BIT(6),
741 IWL_UMAC_SCAN_GEN_FLAGS_FRAGMENTED = BIT(7),
742 IWL_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED = BIT(8),
743 IWL_UMAC_SCAN_GEN_FLAGS_MATCH = BIT(9)
744 };
745
746 /**
747 * struct iwl_scan_channel_cfg_umac
748 * @flags: bitmap - 0-19: directed scan to i'th ssid.
749 * @channel_num: channel number 1-13 etc.
750 * @iter_count: repetition count for the channel.
751 * @iter_interval: interval between two scan interations on one channel.
752 */
753 struct iwl_scan_channel_cfg_umac {
754 __le32 flags;
755 u8 channel_num;
756 u8 iter_count;
757 __le16 iter_interval;
758 } __packed; /* SCAN_CHANNEL_CFG_S_VER2 */
759
760 /**
761 * struct iwl_scan_umac_schedule
762 * @interval: interval in seconds between scan iterations
763 * @iter_count: num of scan iterations for schedule plan, 0xff for infinite loop
764 * @reserved: for alignment and future use
765 */
766 struct iwl_scan_umac_schedule {
767 __le16 interval;
768 u8 iter_count;
769 u8 reserved;
770 } __packed; /* SCAN_SCHED_PARAM_API_S_VER_1 */
771
772 /**
773 * struct iwl_scan_req_umac_tail - the rest of the UMAC scan request command
774 * parameters following channels configuration array.
775 * @schedule: two scheduling plans.
776 * @delay: delay in TUs before starting the first scan iteration
777 * @reserved: for future use and alignment
778 * @preq: probe request with IEs blocks
779 * @direct_scan: list of SSIDs for directed active scan
780 */
781 struct iwl_scan_req_umac_tail {
782 /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */
783 struct iwl_scan_umac_schedule schedule[2];
784 __le16 delay;
785 __le16 reserved;
786 /* SCAN_PROBE_PARAMS_API_S_VER_1 */
787 struct iwl_scan_probe_req preq;
788 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
789 } __packed;
790
791 /**
792 * struct iwl_scan_req_umac
793 * @hdr: umac command header
794 * @flags: &enum iwl_umac_scan_flags
795 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
796 * @ooc_priority: out of channel priority - &enum iwl_scan_priority
797 * @general_flags: &enum iwl_umac_scan_general_flags
798 * @reserved1: for future use and alignment
799 * @active_dwell: dwell time for active scan
800 * @passive_dwell: dwell time for passive scan
801 * @fragmented_dwell: dwell time for fragmented passive scan
802 * @max_out_time: max out of serving channel time
803 * @suspend_time: max suspend time
804 * @scan_priority: scan internal prioritization &enum iwl_scan_priority
805 * @channel_flags: &enum iwl_scan_channel_flags
806 * @n_channels: num of channels in scan request
807 * @reserved2: for future use and alignment
808 * @data: &struct iwl_scan_channel_cfg_umac and
809 * &struct iwl_scan_req_umac_tail
810 */
811 struct iwl_scan_req_umac {
812 struct iwl_mvm_umac_cmd_hdr hdr;
813 __le32 flags;
814 __le32 uid;
815 __le32 ooc_priority;
816 /* SCAN_GENERAL_PARAMS_API_S_VER_1 */
817 __le32 general_flags;
818 u8 reserved1;
819 u8 active_dwell;
820 u8 passive_dwell;
821 u8 fragmented_dwell;
822 __le32 max_out_time;
823 __le32 suspend_time;
824 __le32 scan_priority;
825 /* SCAN_CHANNEL_PARAMS_API_S_VER_1 */
826 u8 channel_flags;
827 u8 n_channels;
828 __le16 reserved2;
829 u8 data[];
830 } __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */
831
832 /**
833 * struct iwl_umac_scan_abort
834 * @hdr: umac command header
835 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
836 * @flags: reserved
837 */
838 struct iwl_umac_scan_abort {
839 struct iwl_mvm_umac_cmd_hdr hdr;
840 __le32 uid;
841 __le32 flags;
842 } __packed; /* SCAN_ABORT_CMD_UMAC_API_S_VER_1 */
843
844 /**
845 * struct iwl_umac_scan_complete
846 * @uid: scan id, &enum iwl_umac_scan_uid_offsets
847 * @last_schedule: last scheduling line
848 * @last_iter: last scan iteration number
849 * @scan status: &enum iwl_scan_offload_complete_status
850 * @ebs_status: &enum iwl_scan_ebs_status
851 * @time_from_last_iter: time elapsed from last iteration
852 * @reserved: for future use
853 */
854 struct iwl_umac_scan_complete {
855 __le32 uid;
856 u8 last_schedule;
857 u8 last_iter;
858 u8 status;
859 u8 ebs_status;
860 __le32 time_from_last_iter;
861 __le32 reserved;
862 } __packed; /* SCAN_COMPLETE_NTF_UMAC_API_S_VER_1 */
863
864 #define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN 5
865 /**
866 * struct iwl_scan_offload_profile_match - match information
867 * @bssid: matched bssid
868 * @channel: channel where the match occurred
869 * @energy:
870 * @matching_feature:
871 * @matching_channels: bitmap of channels that matched, referencing
872 * the channels passed in tue scan offload request
873 */
874 struct iwl_scan_offload_profile_match {
875 u8 bssid[ETH_ALEN];
876 __le16 reserved;
877 u8 channel;
878 u8 energy;
879 u8 matching_feature;
880 u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN];
881 } __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_1 */
882
883 /**
884 * struct iwl_scan_offload_profiles_query - match results query response
885 * @matched_profiles: bitmap of matched profiles, referencing the
886 * matches passed in the scan offload request
887 * @last_scan_age: age of the last offloaded scan
888 * @n_scans_done: number of offloaded scans done
889 * @gp2_d0u: GP2 when D0U occurred
890 * @gp2_invoked: GP2 when scan offload was invoked
891 * @resume_while_scanning: not used
892 * @self_recovery: obsolete
893 * @reserved: reserved
894 * @matches: array of match information, one for each match
895 */
896 struct iwl_scan_offload_profiles_query {
897 __le32 matched_profiles;
898 __le32 last_scan_age;
899 __le32 n_scans_done;
900 __le32 gp2_d0u;
901 __le32 gp2_invoked;
902 u8 resume_while_scanning;
903 u8 self_recovery;
904 __le16 reserved;
905 struct iwl_scan_offload_profile_match matches[IWL_SCAN_MAX_PROFILES];
906 } __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_2 */
907
908 #endif
This page took 0.068773 seconds and 5 git commands to generate.