fw-api-scan.h 19 KB

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