fw-api-scan.h 19 KB

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