fw-api-scan.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  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. *
  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 - 2014 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. *@SCAN_FLAGS_PASSIVE2ACTIVE: use active scan on channels that was active
  133. * in the past hour, even if they are marked as passive.
  134. */
  135. enum iwl_scan_flags {
  136. SCAN_FLAGS_PERIODIC_SCAN = BIT(0),
  137. SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX = BIT(1),
  138. SCAN_FLAGS_DELAYED_SCAN_LOWBAND = BIT(2),
  139. SCAN_FLAGS_DELAYED_SCAN_HIGHBAND = BIT(3),
  140. SCAN_FLAGS_FRAGMENTED_SCAN = BIT(4),
  141. SCAN_FLAGS_PASSIVE2ACTIVE = BIT(5),
  142. };
  143. /**
  144. * enum iwl_scan_type - Scan types for scan command
  145. * @SCAN_TYPE_FORCED:
  146. * @SCAN_TYPE_BACKGROUND:
  147. * @SCAN_TYPE_OS:
  148. * @SCAN_TYPE_ROAMING:
  149. * @SCAN_TYPE_ACTION:
  150. * @SCAN_TYPE_DISCOVERY:
  151. * @SCAN_TYPE_DISCOVERY_FORCED:
  152. */
  153. enum iwl_scan_type {
  154. SCAN_TYPE_FORCED = 0,
  155. SCAN_TYPE_BACKGROUND = 1,
  156. SCAN_TYPE_OS = 2,
  157. SCAN_TYPE_ROAMING = 3,
  158. SCAN_TYPE_ACTION = 4,
  159. SCAN_TYPE_DISCOVERY = 5,
  160. SCAN_TYPE_DISCOVERY_FORCED = 6,
  161. }; /* SCAN_ACTIVITY_TYPE_E_VER_1 */
  162. /**
  163. * Maximal number of channels to scan
  164. * it should be equal to:
  165. * max(IWL_NUM_CHANNELS, IWL_NUM_CHANNELS_FAMILY_8000)
  166. */
  167. #define MAX_NUM_SCAN_CHANNELS 50
  168. /**
  169. * struct iwl_scan_cmd - scan request command
  170. * ( SCAN_REQUEST_CMD = 0x80 )
  171. * @len: command length in bytes
  172. * @scan_flags: scan flags from SCAN_FLAGS_*
  173. * @channel_count: num of channels in channel list (1 - MAX_NUM_SCAN_CHANNELS)
  174. * @quiet_time: in msecs, dwell this time for active scan on quiet channels
  175. * @quiet_plcp_th: quiet PLCP threshold (channel is quiet if less than
  176. * this number of packets were received (typically 1)
  177. * @passive2active: is auto switching from passive to active during scan allowed
  178. * @rxchain_sel_flags: RXON_RX_CHAIN_*
  179. * @max_out_time: in TUs, max out of serving channel time
  180. * @suspend_time: how long to pause scan when returning to service channel:
  181. * bits 0-19: beacon interal in TUs (suspend before executing)
  182. * bits 20-23: reserved
  183. * bits 24-31: number of beacons (suspend between channels)
  184. * @rxon_flags: RXON_FLG_*
  185. * @filter_flags: RXON_FILTER_*
  186. * @tx_cmd: for active scans (zero for passive), w/o payload,
  187. * no RS so specify TX rate
  188. * @direct_scan: direct scan SSIDs
  189. * @type: one of SCAN_TYPE_*
  190. * @repeats: how many time to repeat the scan
  191. */
  192. struct iwl_scan_cmd {
  193. __le16 len;
  194. u8 scan_flags;
  195. u8 channel_count;
  196. __le16 quiet_time;
  197. __le16 quiet_plcp_th;
  198. __le16 passive2active;
  199. __le16 rxchain_sel_flags;
  200. __le32 max_out_time;
  201. __le32 suspend_time;
  202. /* RX_ON_FLAGS_API_S_VER_1 */
  203. __le32 rxon_flags;
  204. __le32 filter_flags;
  205. struct iwl_tx_cmd tx_cmd;
  206. struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
  207. __le32 type;
  208. __le32 repeats;
  209. /*
  210. * Probe request frame, followed by channel list.
  211. *
  212. * Size of probe request frame is specified by byte count in tx_cmd.
  213. * Channel list follows immediately after probe request frame.
  214. * Number of channels in list is specified by channel_count.
  215. * Each channel in list is of type:
  216. *
  217. * struct iwl_scan_channel channels[0];
  218. *
  219. * NOTE: Only one band of channels can be scanned per pass. You
  220. * must not mix 2.4GHz channels and 5.2GHz channels, and you must wait
  221. * for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION)
  222. * before requesting another scan.
  223. */
  224. u8 data[0];
  225. } __packed; /* SCAN_REQUEST_FIXED_PART_API_S_VER_5 */
  226. /* Response to scan request contains only status with one of these values */
  227. #define SCAN_RESPONSE_OK 0x1
  228. #define SCAN_RESPONSE_ERROR 0x2
  229. /*
  230. * SCAN_ABORT_CMD = 0x81
  231. * When scan abort is requested, the command has no fields except the common
  232. * header. The response contains only a status with one of these values.
  233. */
  234. #define SCAN_ABORT_POSSIBLE 0x1
  235. #define SCAN_ABORT_IGNORED 0x2 /* no pending scans */
  236. /* TODO: complete documentation */
  237. #define SCAN_OWNER_STATUS 0x1
  238. #define MEASURE_OWNER_STATUS 0x2
  239. /**
  240. * struct iwl_scan_start_notif - notifies start of scan in the device
  241. * ( SCAN_START_NOTIFICATION = 0x82 )
  242. * @tsf_low: TSF timer (lower half) in usecs
  243. * @tsf_high: TSF timer (higher half) in usecs
  244. * @beacon_timer: structured as follows:
  245. * bits 0:19 - beacon interval in usecs
  246. * bits 20:23 - reserved (0)
  247. * bits 24:31 - number of beacons
  248. * @channel: which channel is scanned
  249. * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
  250. * @status: one of *_OWNER_STATUS
  251. */
  252. struct iwl_scan_start_notif {
  253. __le32 tsf_low;
  254. __le32 tsf_high;
  255. __le32 beacon_timer;
  256. u8 channel;
  257. u8 band;
  258. u8 reserved[2];
  259. __le32 status;
  260. } __packed; /* SCAN_START_NTF_API_S_VER_1 */
  261. /* scan results probe_status first bit indicates success */
  262. #define SCAN_PROBE_STATUS_OK 0
  263. #define SCAN_PROBE_STATUS_TX_FAILED BIT(0)
  264. /* error statuses combined with TX_FAILED */
  265. #define SCAN_PROBE_STATUS_FAIL_TTL BIT(1)
  266. #define SCAN_PROBE_STATUS_FAIL_BT BIT(2)
  267. /* How many statistics are gathered for each channel */
  268. #define SCAN_RESULTS_STATISTICS 1
  269. /**
  270. * enum iwl_scan_complete_status - status codes for scan complete notifications
  271. * @SCAN_COMP_STATUS_OK: scan completed successfully
  272. * @SCAN_COMP_STATUS_ABORT: scan was aborted by user
  273. * @SCAN_COMP_STATUS_ERR_SLEEP: sending null sleep packet failed
  274. * @SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT: timeout before channel is ready
  275. * @SCAN_COMP_STATUS_ERR_PROBE: sending probe request failed
  276. * @SCAN_COMP_STATUS_ERR_WAKEUP: sending null wakeup packet failed
  277. * @SCAN_COMP_STATUS_ERR_ANTENNAS: invalid antennas chosen at scan command
  278. * @SCAN_COMP_STATUS_ERR_INTERNAL: internal error caused scan abort
  279. * @SCAN_COMP_STATUS_ERR_COEX: medium was lost ot WiMax
  280. * @SCAN_COMP_STATUS_P2P_ACTION_OK: P2P public action frame TX was successful
  281. * (not an error!)
  282. * @SCAN_COMP_STATUS_ITERATION_END: indicates end of one repeatition the driver
  283. * asked for
  284. * @SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events
  285. */
  286. enum iwl_scan_complete_status {
  287. SCAN_COMP_STATUS_OK = 0x1,
  288. SCAN_COMP_STATUS_ABORT = 0x2,
  289. SCAN_COMP_STATUS_ERR_SLEEP = 0x3,
  290. SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT = 0x4,
  291. SCAN_COMP_STATUS_ERR_PROBE = 0x5,
  292. SCAN_COMP_STATUS_ERR_WAKEUP = 0x6,
  293. SCAN_COMP_STATUS_ERR_ANTENNAS = 0x7,
  294. SCAN_COMP_STATUS_ERR_INTERNAL = 0x8,
  295. SCAN_COMP_STATUS_ERR_COEX = 0x9,
  296. SCAN_COMP_STATUS_P2P_ACTION_OK = 0xA,
  297. SCAN_COMP_STATUS_ITERATION_END = 0x0B,
  298. SCAN_COMP_STATUS_ERR_ALLOC_TE = 0x0C,
  299. };
  300. /**
  301. * struct iwl_scan_results_notif - scan results for one channel
  302. * ( SCAN_RESULTS_NOTIFICATION = 0x83 )
  303. * @channel: which channel the results are from
  304. * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
  305. * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
  306. * @num_probe_not_sent: # of request that weren't sent due to not enough time
  307. * @duration: duration spent in channel, in usecs
  308. * @statistics: statistics gathered for this channel
  309. */
  310. struct iwl_scan_results_notif {
  311. u8 channel;
  312. u8 band;
  313. u8 probe_status;
  314. u8 num_probe_not_sent;
  315. __le32 duration;
  316. __le32 statistics[SCAN_RESULTS_STATISTICS];
  317. } __packed; /* SCAN_RESULT_NTF_API_S_VER_2 */
  318. /**
  319. * struct iwl_scan_complete_notif - notifies end of scanning (all channels)
  320. * ( SCAN_COMPLETE_NOTIFICATION = 0x84 )
  321. * @scanned_channels: number of channels scanned (and number of valid results)
  322. * @status: one of SCAN_COMP_STATUS_*
  323. * @bt_status: BT on/off status
  324. * @last_channel: last channel that was scanned
  325. * @tsf_low: TSF timer (lower half) in usecs
  326. * @tsf_high: TSF timer (higher half) in usecs
  327. * @results: all scan results, only "scanned_channels" of them are valid
  328. */
  329. struct iwl_scan_complete_notif {
  330. u8 scanned_channels;
  331. u8 status;
  332. u8 bt_status;
  333. u8 last_channel;
  334. __le32 tsf_low;
  335. __le32 tsf_high;
  336. struct iwl_scan_results_notif results[MAX_NUM_SCAN_CHANNELS];
  337. } __packed; /* SCAN_COMPLETE_NTF_API_S_VER_2 */
  338. /* scan offload */
  339. #define IWL_MAX_SCAN_CHANNELS 40
  340. #define IWL_SCAN_MAX_BLACKLIST_LEN 64
  341. #define IWL_SCAN_SHORT_BLACKLIST_LEN 16
  342. #define IWL_SCAN_MAX_PROFILES 11
  343. #define SCAN_OFFLOAD_PROBE_REQ_SIZE 512
  344. /* Default watchdog (in MS) for scheduled scan iteration */
  345. #define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000)
  346. #define IWL_GOOD_CRC_TH_DEFAULT cpu_to_le16(1)
  347. #define CAN_ABORT_STATUS 1
  348. #define IWL_FULL_SCAN_MULTIPLIER 5
  349. #define IWL_FAST_SCHED_SCAN_ITERATIONS 3
  350. enum scan_framework_client {
  351. SCAN_CLIENT_SCHED_SCAN = BIT(0),
  352. SCAN_CLIENT_NETDETECT = BIT(1),
  353. SCAN_CLIENT_ASSET_TRACKING = BIT(2),
  354. };
  355. /**
  356. * struct iwl_scan_offload_cmd - SCAN_REQUEST_FIXED_PART_API_S_VER_6
  357. * @scan_flags: see enum iwl_scan_flags
  358. * @channel_count: channels in channel list
  359. * @quiet_time: dwell time, in milisiconds, on quiet channel
  360. * @quiet_plcp_th: quiet channel num of packets threshold
  361. * @good_CRC_th: passive to active promotion threshold
  362. * @rx_chain: RXON rx chain.
  363. * @max_out_time: max TUs to be out of assoceated channel
  364. * @suspend_time: pause scan this TUs when returning to service channel
  365. * @flags: RXON flags
  366. * @filter_flags: RXONfilter
  367. * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz.
  368. * @direct_scan: list of SSIDs for directed active scan
  369. * @scan_type: see enum iwl_scan_type.
  370. * @rep_count: repetition count for each scheduled scan iteration.
  371. */
  372. struct iwl_scan_offload_cmd {
  373. __le16 len;
  374. u8 scan_flags;
  375. u8 channel_count;
  376. __le16 quiet_time;
  377. __le16 quiet_plcp_th;
  378. __le16 good_CRC_th;
  379. __le16 rx_chain;
  380. __le32 max_out_time;
  381. __le32 suspend_time;
  382. /* RX_ON_FLAGS_API_S_VER_1 */
  383. __le32 flags;
  384. __le32 filter_flags;
  385. struct iwl_tx_cmd tx_cmd[2];
  386. /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
  387. struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
  388. __le32 scan_type;
  389. __le32 rep_count;
  390. } __packed;
  391. enum iwl_scan_offload_channel_flags {
  392. IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE = BIT(0),
  393. IWL_SCAN_OFFLOAD_CHANNEL_NARROW = BIT(22),
  394. IWL_SCAN_OFFLOAD_CHANNEL_FULL = BIT(24),
  395. IWL_SCAN_OFFLOAD_CHANNEL_PARTIAL = BIT(25),
  396. };
  397. /**
  398. * iwl_scan_channel_cfg - SCAN_CHANNEL_CFG_S
  399. * @type: bitmap - see enum iwl_scan_offload_channel_flags.
  400. * 0: passive (0) or active (1) scan.
  401. * 1-20: directed scan to i'th ssid.
  402. * 22: channel width configuation - 1 for narrow.
  403. * 24: full scan.
  404. * 25: partial scan.
  405. * @channel_number: channel number 1-13 etc.
  406. * @iter_count: repetition count for the channel.
  407. * @iter_interval: interval between two innteration on one channel.
  408. * @dwell_time: entry 0 - active scan, entry 1 - passive scan.
  409. */
  410. struct iwl_scan_channel_cfg {
  411. __le32 type[IWL_MAX_SCAN_CHANNELS];
  412. __le16 channel_number[IWL_MAX_SCAN_CHANNELS];
  413. __le16 iter_count[IWL_MAX_SCAN_CHANNELS];
  414. __le32 iter_interval[IWL_MAX_SCAN_CHANNELS];
  415. u8 dwell_time[IWL_MAX_SCAN_CHANNELS][2];
  416. } __packed;
  417. /**
  418. * iwl_scan_offload_cfg - SCAN_OFFLOAD_CONFIG_API_S
  419. * @scan_cmd: scan command fixed part
  420. * @channel_cfg: scan channel configuration
  421. * @data: probe request frames (one per band)
  422. */
  423. struct iwl_scan_offload_cfg {
  424. struct iwl_scan_offload_cmd scan_cmd;
  425. struct iwl_scan_channel_cfg channel_cfg;
  426. u8 data[0];
  427. } __packed;
  428. /**
  429. * iwl_scan_offload_blacklist - SCAN_OFFLOAD_BLACKLIST_S
  430. * @ssid: MAC address to filter out
  431. * @reported_rssi: AP rssi reported to the host
  432. * @client_bitmap: clients ignore this entry - enum scan_framework_client
  433. */
  434. struct iwl_scan_offload_blacklist {
  435. u8 ssid[ETH_ALEN];
  436. u8 reported_rssi;
  437. u8 client_bitmap;
  438. } __packed;
  439. enum iwl_scan_offload_network_type {
  440. IWL_NETWORK_TYPE_BSS = 1,
  441. IWL_NETWORK_TYPE_IBSS = 2,
  442. IWL_NETWORK_TYPE_ANY = 3,
  443. };
  444. enum iwl_scan_offload_band_selection {
  445. IWL_SCAN_OFFLOAD_SELECT_2_4 = 0x4,
  446. IWL_SCAN_OFFLOAD_SELECT_5_2 = 0x8,
  447. IWL_SCAN_OFFLOAD_SELECT_ANY = 0xc,
  448. };
  449. /**
  450. * iwl_scan_offload_profile - SCAN_OFFLOAD_PROFILE_S
  451. * @ssid_index: index to ssid list in fixed part
  452. * @unicast_cipher: encryption olgorithm to match - bitmap
  453. * @aut_alg: authentication olgorithm to match - bitmap
  454. * @network_type: enum iwl_scan_offload_network_type
  455. * @band_selection: enum iwl_scan_offload_band_selection
  456. * @client_bitmap: clients waiting for match - enum scan_framework_client
  457. */
  458. struct iwl_scan_offload_profile {
  459. u8 ssid_index;
  460. u8 unicast_cipher;
  461. u8 auth_alg;
  462. u8 network_type;
  463. u8 band_selection;
  464. u8 client_bitmap;
  465. u8 reserved[2];
  466. } __packed;
  467. /**
  468. * iwl_scan_offload_profile_cfg - SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1
  469. * @blaclist: AP list to filter off from scan results
  470. * @profiles: profiles to search for match
  471. * @blacklist_len: length of blacklist
  472. * @num_profiles: num of profiles in the list
  473. * @match_notify: clients waiting for match found notification
  474. * @pass_match: clients waiting for the results
  475. * @active_clients: active clients bitmap - enum scan_framework_client
  476. * @any_beacon_notify: clients waiting for match notification without match
  477. */
  478. struct iwl_scan_offload_profile_cfg {
  479. struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES];
  480. u8 blacklist_len;
  481. u8 num_profiles;
  482. u8 match_notify;
  483. u8 pass_match;
  484. u8 active_clients;
  485. u8 any_beacon_notify;
  486. u8 reserved[2];
  487. } __packed;
  488. /**
  489. * iwl_scan_offload_schedule - schedule of scan offload
  490. * @delay: delay between iterations, in seconds.
  491. * @iterations: num of scan iterations
  492. * @full_scan_mul: number of partial scans before each full scan
  493. */
  494. struct iwl_scan_offload_schedule {
  495. u16 delay;
  496. u8 iterations;
  497. u8 full_scan_mul;
  498. } __packed;
  499. /*
  500. * iwl_scan_offload_flags
  501. *
  502. * IWL_SCAN_OFFLOAD_FLAG_PASS_ALL: pass all results - no filtering.
  503. * IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL: add cached channels to partial scan.
  504. * IWL_SCAN_OFFLOAD_FLAG_EBS_QUICK_MODE: EBS duration is 100mSec - typical
  505. * beacon period. Finding channel activity in this mode is not guaranteed.
  506. * IWL_SCAN_OFFLOAD_FLAG_EBS_ACCURATE_MODE: EBS duration is 200mSec.
  507. * Assuming beacon period is 100ms finding channel activity is guaranteed.
  508. */
  509. enum iwl_scan_offload_flags {
  510. IWL_SCAN_OFFLOAD_FLAG_PASS_ALL = BIT(0),
  511. IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL = BIT(2),
  512. IWL_SCAN_OFFLOAD_FLAG_EBS_QUICK_MODE = BIT(5),
  513. IWL_SCAN_OFFLOAD_FLAG_EBS_ACCURATE_MODE = BIT(6),
  514. };
  515. /**
  516. * iwl_scan_offload_req - scan offload request command
  517. * @flags: bitmap - enum iwl_scan_offload_flags.
  518. * @watchdog: maximum scan duration in TU.
  519. * @delay: delay in seconds before first iteration.
  520. * @schedule_line: scan offload schedule, for fast and regular scan.
  521. */
  522. struct iwl_scan_offload_req {
  523. __le16 flags;
  524. __le16 watchdog;
  525. __le16 delay;
  526. __le16 reserved;
  527. struct iwl_scan_offload_schedule schedule_line[2];
  528. } __packed;
  529. enum iwl_scan_offload_compleate_status {
  530. IWL_SCAN_OFFLOAD_COMPLETED = 1,
  531. IWL_SCAN_OFFLOAD_ABORTED = 2,
  532. };
  533. enum iwl_scan_ebs_status {
  534. IWL_SCAN_EBS_SUCCESS,
  535. IWL_SCAN_EBS_FAILED,
  536. IWL_SCAN_EBS_CHAN_NOT_FOUND,
  537. };
  538. /**
  539. * iwl_scan_offload_complete - SCAN_OFFLOAD_COMPLETE_NTF_API_S_VER_1
  540. * @last_schedule_line: last schedule line executed (fast or regular)
  541. * @last_schedule_iteration: last scan iteration executed before scan abort
  542. * @status: enum iwl_scan_offload_compleate_status
  543. * @ebs_status: last EBS status, see IWL_SCAN_EBS_*
  544. */
  545. struct iwl_scan_offload_complete {
  546. u8 last_schedule_line;
  547. u8 last_schedule_iteration;
  548. u8 status;
  549. u8 ebs_status;
  550. } __packed;
  551. /**
  552. * iwl_sched_scan_results - SCAN_OFFLOAD_MATCH_FOUND_NTF_API_S_VER_1
  553. * @ssid_bitmap: SSIDs indexes found in this iteration
  554. * @client_bitmap: clients that are active and wait for this notification
  555. */
  556. struct iwl_sched_scan_results {
  557. __le16 ssid_bitmap;
  558. u8 client_bitmap;
  559. u8 reserved;
  560. };
  561. #endif