fw-api-scan.h 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099
  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. #ifndef __fw_api_scan_h__
  66. #define __fw_api_scan_h__
  67. #include "fw-api.h"
  68. /* Scan Commands, Responses, Notifications */
  69. /* Masks for iwl_scan_channel.type flags */
  70. #define SCAN_CHANNEL_TYPE_ACTIVE BIT(0)
  71. #define SCAN_CHANNEL_NARROW_BAND BIT(22)
  72. /* Max number of IEs for direct SSID scans in a command */
  73. #define PROBE_OPTION_MAX 20
  74. /**
  75. * struct iwl_scan_channel - entry in REPLY_SCAN_CMD channel table
  76. * @channel: band is selected by iwl_scan_cmd "flags" field
  77. * @tx_gain: gain for analog radio
  78. * @dsp_atten: gain for DSP
  79. * @active_dwell: dwell time for active scan in TU, typically 5-50
  80. * @passive_dwell: dwell time for passive scan in TU, typically 20-500
  81. * @type: type is broken down to these bits:
  82. * bit 0: 0 = passive, 1 = active
  83. * bits 1-20: SSID direct bit map. If any of these bits is set then
  84. * the corresponding SSID IE is transmitted in probe request
  85. * (bit i adds IE in position i to the probe request)
  86. * bit 22: channel width, 0 = regular, 1 = TGj narrow channel
  87. *
  88. * @iteration_count:
  89. * @iteration_interval:
  90. * This struct is used once for each channel in the scan list.
  91. * Each channel can independently select:
  92. * 1) SSID for directed active scans
  93. * 2) Txpower setting (for rate specified within Tx command)
  94. * 3) How long to stay on-channel (behavior may be modified by quiet_time,
  95. * quiet_plcp_th, good_CRC_th)
  96. *
  97. * To avoid uCode errors, make sure the following are true (see comments
  98. * under struct iwl_scan_cmd about max_out_time and quiet_time):
  99. * 1) If using passive_dwell (i.e. passive_dwell != 0):
  100. * active_dwell <= passive_dwell (< max_out_time if max_out_time != 0)
  101. * 2) quiet_time <= active_dwell
  102. * 3) If restricting off-channel time (i.e. max_out_time !=0):
  103. * passive_dwell < max_out_time
  104. * active_dwell < max_out_time
  105. */
  106. struct iwl_scan_channel {
  107. __le32 type;
  108. __le16 channel;
  109. __le16 iteration_count;
  110. __le32 iteration_interval;
  111. __le16 active_dwell;
  112. __le16 passive_dwell;
  113. } __packed; /* SCAN_CHANNEL_CONTROL_API_S_VER_1 */
  114. /**
  115. * struct iwl_ssid_ie - directed scan network information element
  116. *
  117. * Up to 20 of these may appear in REPLY_SCAN_CMD,
  118. * selected by "type" bit field in struct iwl_scan_channel;
  119. * each channel may select different ssids from among the 20 entries.
  120. * SSID IEs get transmitted in reverse order of entry.
  121. */
  122. struct iwl_ssid_ie {
  123. u8 id;
  124. u8 len;
  125. u8 ssid[IEEE80211_MAX_SSID_LEN];
  126. } __packed; /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
  127. /**
  128. * iwl_scan_flags - masks for scan command flags
  129. *@SCAN_FLAGS_PERIODIC_SCAN:
  130. *@SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX:
  131. *@SCAN_FLAGS_DELAYED_SCAN_LOWBAND:
  132. *@SCAN_FLAGS_DELAYED_SCAN_HIGHBAND:
  133. *@SCAN_FLAGS_FRAGMENTED_SCAN:
  134. *@SCAN_FLAGS_PASSIVE2ACTIVE: use active scan on channels that was active
  135. * in the past hour, even if they are marked as passive.
  136. */
  137. enum iwl_scan_flags {
  138. SCAN_FLAGS_PERIODIC_SCAN = BIT(0),
  139. SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX = BIT(1),
  140. SCAN_FLAGS_DELAYED_SCAN_LOWBAND = BIT(2),
  141. SCAN_FLAGS_DELAYED_SCAN_HIGHBAND = BIT(3),
  142. SCAN_FLAGS_FRAGMENTED_SCAN = BIT(4),
  143. SCAN_FLAGS_PASSIVE2ACTIVE = BIT(5),
  144. };
  145. /**
  146. * enum iwl_scan_type - Scan types for scan command
  147. * @SCAN_TYPE_FORCED:
  148. * @SCAN_TYPE_BACKGROUND:
  149. * @SCAN_TYPE_OS:
  150. * @SCAN_TYPE_ROAMING:
  151. * @SCAN_TYPE_ACTION:
  152. * @SCAN_TYPE_DISCOVERY:
  153. * @SCAN_TYPE_DISCOVERY_FORCED:
  154. */
  155. enum iwl_scan_type {
  156. SCAN_TYPE_FORCED = 0,
  157. SCAN_TYPE_BACKGROUND = 1,
  158. SCAN_TYPE_OS = 2,
  159. SCAN_TYPE_ROAMING = 3,
  160. SCAN_TYPE_ACTION = 4,
  161. SCAN_TYPE_DISCOVERY = 5,
  162. SCAN_TYPE_DISCOVERY_FORCED = 6,
  163. }; /* SCAN_ACTIVITY_TYPE_E_VER_1 */
  164. /**
  165. * struct iwl_scan_cmd - scan request command
  166. * ( SCAN_REQUEST_CMD = 0x80 )
  167. * @len: command length in bytes
  168. * @scan_flags: scan flags from SCAN_FLAGS_*
  169. * @channel_count: num of channels in channel list
  170. * (1 - ucode_capa.n_scan_channels)
  171. * @quiet_time: in msecs, dwell this time for active scan on quiet channels
  172. * @quiet_plcp_th: quiet PLCP threshold (channel is quiet if less than
  173. * this number of packets were received (typically 1)
  174. * @passive2active: is auto switching from passive to active during scan allowed
  175. * @rxchain_sel_flags: RXON_RX_CHAIN_*
  176. * @max_out_time: in TUs, max out of serving channel time
  177. * @suspend_time: how long to pause scan when returning to service channel:
  178. * bits 0-19: beacon interal in TUs (suspend before executing)
  179. * bits 20-23: reserved
  180. * bits 24-31: number of beacons (suspend between channels)
  181. * @rxon_flags: RXON_FLG_*
  182. * @filter_flags: RXON_FILTER_*
  183. * @tx_cmd: for active scans (zero for passive), w/o payload,
  184. * no RS so specify TX rate
  185. * @direct_scan: direct scan SSIDs
  186. * @type: one of SCAN_TYPE_*
  187. * @repeats: how many time to repeat the scan
  188. */
  189. struct iwl_scan_cmd {
  190. __le16 len;
  191. u8 scan_flags;
  192. u8 channel_count;
  193. __le16 quiet_time;
  194. __le16 quiet_plcp_th;
  195. __le16 passive2active;
  196. __le16 rxchain_sel_flags;
  197. __le32 max_out_time;
  198. __le32 suspend_time;
  199. /* RX_ON_FLAGS_API_S_VER_1 */
  200. __le32 rxon_flags;
  201. __le32 filter_flags;
  202. struct iwl_tx_cmd tx_cmd;
  203. struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
  204. __le32 type;
  205. __le32 repeats;
  206. /*
  207. * Probe request frame, followed by channel list.
  208. *
  209. * Size of probe request frame is specified by byte count in tx_cmd.
  210. * Channel list follows immediately after probe request frame.
  211. * Number of channels in list is specified by channel_count.
  212. * Each channel in list is of type:
  213. *
  214. * struct iwl_scan_channel channels[0];
  215. *
  216. * NOTE: Only one band of channels can be scanned per pass. You
  217. * must not mix 2.4GHz channels and 5.2GHz channels, and you must wait
  218. * for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION)
  219. * before requesting another scan.
  220. */
  221. u8 data[0];
  222. } __packed; /* SCAN_REQUEST_FIXED_PART_API_S_VER_5 */
  223. /* Response to scan request contains only status with one of these values */
  224. #define SCAN_RESPONSE_OK 0x1
  225. #define SCAN_RESPONSE_ERROR 0x2
  226. /*
  227. * SCAN_ABORT_CMD = 0x81
  228. * When scan abort is requested, the command has no fields except the common
  229. * header. The response contains only a status with one of these values.
  230. */
  231. #define SCAN_ABORT_POSSIBLE 0x1
  232. #define SCAN_ABORT_IGNORED 0x2 /* no pending scans */
  233. /* TODO: complete documentation */
  234. #define SCAN_OWNER_STATUS 0x1
  235. #define MEASURE_OWNER_STATUS 0x2
  236. /**
  237. * struct iwl_scan_start_notif - notifies start of scan in the device
  238. * ( SCAN_START_NOTIFICATION = 0x82 )
  239. * @tsf_low: TSF timer (lower half) in usecs
  240. * @tsf_high: TSF timer (higher half) in usecs
  241. * @beacon_timer: structured as follows:
  242. * bits 0:19 - beacon interval in usecs
  243. * bits 20:23 - reserved (0)
  244. * bits 24:31 - number of beacons
  245. * @channel: which channel is scanned
  246. * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
  247. * @status: one of *_OWNER_STATUS
  248. */
  249. struct iwl_scan_start_notif {
  250. __le32 tsf_low;
  251. __le32 tsf_high;
  252. __le32 beacon_timer;
  253. u8 channel;
  254. u8 band;
  255. u8 reserved[2];
  256. __le32 status;
  257. } __packed; /* SCAN_START_NTF_API_S_VER_1 */
  258. /* scan results probe_status first bit indicates success */
  259. #define SCAN_PROBE_STATUS_OK 0
  260. #define SCAN_PROBE_STATUS_TX_FAILED BIT(0)
  261. /* error statuses combined with TX_FAILED */
  262. #define SCAN_PROBE_STATUS_FAIL_TTL BIT(1)
  263. #define SCAN_PROBE_STATUS_FAIL_BT BIT(2)
  264. /* How many statistics are gathered for each channel */
  265. #define SCAN_RESULTS_STATISTICS 1
  266. /**
  267. * enum iwl_scan_complete_status - status codes for scan complete notifications
  268. * @SCAN_COMP_STATUS_OK: scan completed successfully
  269. * @SCAN_COMP_STATUS_ABORT: scan was aborted by user
  270. * @SCAN_COMP_STATUS_ERR_SLEEP: sending null sleep packet failed
  271. * @SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT: timeout before channel is ready
  272. * @SCAN_COMP_STATUS_ERR_PROBE: sending probe request failed
  273. * @SCAN_COMP_STATUS_ERR_WAKEUP: sending null wakeup packet failed
  274. * @SCAN_COMP_STATUS_ERR_ANTENNAS: invalid antennas chosen at scan command
  275. * @SCAN_COMP_STATUS_ERR_INTERNAL: internal error caused scan abort
  276. * @SCAN_COMP_STATUS_ERR_COEX: medium was lost ot WiMax
  277. * @SCAN_COMP_STATUS_P2P_ACTION_OK: P2P public action frame TX was successful
  278. * (not an error!)
  279. * @SCAN_COMP_STATUS_ITERATION_END: indicates end of one repeatition the driver
  280. * asked for
  281. * @SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events
  282. */
  283. enum iwl_scan_complete_status {
  284. SCAN_COMP_STATUS_OK = 0x1,
  285. SCAN_COMP_STATUS_ABORT = 0x2,
  286. SCAN_COMP_STATUS_ERR_SLEEP = 0x3,
  287. SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT = 0x4,
  288. SCAN_COMP_STATUS_ERR_PROBE = 0x5,
  289. SCAN_COMP_STATUS_ERR_WAKEUP = 0x6,
  290. SCAN_COMP_STATUS_ERR_ANTENNAS = 0x7,
  291. SCAN_COMP_STATUS_ERR_INTERNAL = 0x8,
  292. SCAN_COMP_STATUS_ERR_COEX = 0x9,
  293. SCAN_COMP_STATUS_P2P_ACTION_OK = 0xA,
  294. SCAN_COMP_STATUS_ITERATION_END = 0x0B,
  295. SCAN_COMP_STATUS_ERR_ALLOC_TE = 0x0C,
  296. };
  297. /**
  298. * struct iwl_scan_results_notif - scan results for one channel
  299. * ( SCAN_RESULTS_NOTIFICATION = 0x83 )
  300. * @channel: which channel the results are from
  301. * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
  302. * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
  303. * @num_probe_not_sent: # of request that weren't sent due to not enough time
  304. * @duration: duration spent in channel, in usecs
  305. * @statistics: statistics gathered for this channel
  306. */
  307. struct iwl_scan_results_notif {
  308. u8 channel;
  309. u8 band;
  310. u8 probe_status;
  311. u8 num_probe_not_sent;
  312. __le32 duration;
  313. __le32 statistics[SCAN_RESULTS_STATISTICS];
  314. } __packed; /* SCAN_RESULT_NTF_API_S_VER_2 */
  315. /**
  316. * struct iwl_scan_complete_notif - notifies end of scanning (all channels)
  317. * ( SCAN_COMPLETE_NOTIFICATION = 0x84 )
  318. * @scanned_channels: number of channels scanned (and number of valid results)
  319. * @status: one of SCAN_COMP_STATUS_*
  320. * @bt_status: BT on/off status
  321. * @last_channel: last channel that was scanned
  322. * @tsf_low: TSF timer (lower half) in usecs
  323. * @tsf_high: TSF timer (higher half) in usecs
  324. * @results: array of scan results, only "scanned_channels" of them are valid
  325. */
  326. struct iwl_scan_complete_notif {
  327. u8 scanned_channels;
  328. u8 status;
  329. u8 bt_status;
  330. u8 last_channel;
  331. __le32 tsf_low;
  332. __le32 tsf_high;
  333. struct iwl_scan_results_notif results[];
  334. } __packed; /* SCAN_COMPLETE_NTF_API_S_VER_2 */
  335. /* scan offload */
  336. #define IWL_SCAN_MAX_BLACKLIST_LEN 64
  337. #define IWL_SCAN_SHORT_BLACKLIST_LEN 16
  338. #define IWL_SCAN_MAX_PROFILES 11
  339. #define SCAN_OFFLOAD_PROBE_REQ_SIZE 512
  340. /* Default watchdog (in MS) for scheduled scan iteration */
  341. #define IWL_SCHED_SCAN_WATCHDOG cpu_to_le16(15000)
  342. #define IWL_GOOD_CRC_TH_DEFAULT cpu_to_le16(1)
  343. #define CAN_ABORT_STATUS 1
  344. #define IWL_FULL_SCAN_MULTIPLIER 5
  345. #define IWL_FAST_SCHED_SCAN_ITERATIONS 3
  346. enum scan_framework_client {
  347. SCAN_CLIENT_SCHED_SCAN = BIT(0),
  348. SCAN_CLIENT_NETDETECT = BIT(1),
  349. SCAN_CLIENT_ASSET_TRACKING = BIT(2),
  350. };
  351. /**
  352. * struct iwl_scan_offload_cmd - SCAN_REQUEST_FIXED_PART_API_S_VER_6
  353. * @scan_flags: see enum iwl_scan_flags
  354. * @channel_count: channels in channel list
  355. * @quiet_time: dwell time, in milisiconds, on quiet channel
  356. * @quiet_plcp_th: quiet channel num of packets threshold
  357. * @good_CRC_th: passive to active promotion threshold
  358. * @rx_chain: RXON rx chain.
  359. * @max_out_time: max TUs to be out of assoceated channel
  360. * @suspend_time: pause scan this TUs when returning to service channel
  361. * @flags: RXON flags
  362. * @filter_flags: RXONfilter
  363. * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz.
  364. * @direct_scan: list of SSIDs for directed active scan
  365. * @scan_type: see enum iwl_scan_type.
  366. * @rep_count: repetition count for each scheduled scan iteration.
  367. */
  368. struct iwl_scan_offload_cmd {
  369. __le16 len;
  370. u8 scan_flags;
  371. u8 channel_count;
  372. __le16 quiet_time;
  373. __le16 quiet_plcp_th;
  374. __le16 good_CRC_th;
  375. __le16 rx_chain;
  376. __le32 max_out_time;
  377. __le32 suspend_time;
  378. /* RX_ON_FLAGS_API_S_VER_1 */
  379. __le32 flags;
  380. __le32 filter_flags;
  381. struct iwl_tx_cmd tx_cmd[2];
  382. /* SCAN_DIRECT_SSID_IE_API_S_VER_1 */
  383. struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
  384. __le32 scan_type;
  385. __le32 rep_count;
  386. } __packed;
  387. enum iwl_scan_offload_channel_flags {
  388. IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE = BIT(0),
  389. IWL_SCAN_OFFLOAD_CHANNEL_NARROW = BIT(22),
  390. IWL_SCAN_OFFLOAD_CHANNEL_FULL = BIT(24),
  391. IWL_SCAN_OFFLOAD_CHANNEL_PARTIAL = BIT(25),
  392. };
  393. /* channel configuration for struct iwl_scan_offload_cfg. Each channels needs:
  394. * __le32 type: bitmap; bits 1-20 are for directed scan to i'th ssid and
  395. * see enum iwl_scan_offload_channel_flags.
  396. * __le16 channel_number: channel number 1-13 etc.
  397. * __le16 iter_count: repetition count for the channel.
  398. * __le32 iter_interval: interval between two innteration on one channel.
  399. * u8 active_dwell.
  400. * u8 passive_dwell.
  401. */
  402. #define IWL_SCAN_CHAN_SIZE 14
  403. /**
  404. * iwl_scan_offload_cfg - SCAN_OFFLOAD_CONFIG_API_S
  405. * @scan_cmd: scan command fixed part
  406. * @data: scan channel configuration and probe request frames
  407. */
  408. struct iwl_scan_offload_cfg {
  409. struct iwl_scan_offload_cmd scan_cmd;
  410. u8 data[0];
  411. } __packed;
  412. /**
  413. * iwl_scan_offload_blacklist - SCAN_OFFLOAD_BLACKLIST_S
  414. * @ssid: MAC address to filter out
  415. * @reported_rssi: AP rssi reported to the host
  416. * @client_bitmap: clients ignore this entry - enum scan_framework_client
  417. */
  418. struct iwl_scan_offload_blacklist {
  419. u8 ssid[ETH_ALEN];
  420. u8 reported_rssi;
  421. u8 client_bitmap;
  422. } __packed;
  423. enum iwl_scan_offload_network_type {
  424. IWL_NETWORK_TYPE_BSS = 1,
  425. IWL_NETWORK_TYPE_IBSS = 2,
  426. IWL_NETWORK_TYPE_ANY = 3,
  427. };
  428. enum iwl_scan_offload_band_selection {
  429. IWL_SCAN_OFFLOAD_SELECT_2_4 = 0x4,
  430. IWL_SCAN_OFFLOAD_SELECT_5_2 = 0x8,
  431. IWL_SCAN_OFFLOAD_SELECT_ANY = 0xc,
  432. };
  433. /**
  434. * iwl_scan_offload_profile - SCAN_OFFLOAD_PROFILE_S
  435. * @ssid_index: index to ssid list in fixed part
  436. * @unicast_cipher: encryption olgorithm to match - bitmap
  437. * @aut_alg: authentication olgorithm to match - bitmap
  438. * @network_type: enum iwl_scan_offload_network_type
  439. * @band_selection: enum iwl_scan_offload_band_selection
  440. * @client_bitmap: clients waiting for match - enum scan_framework_client
  441. */
  442. struct iwl_scan_offload_profile {
  443. u8 ssid_index;
  444. u8 unicast_cipher;
  445. u8 auth_alg;
  446. u8 network_type;
  447. u8 band_selection;
  448. u8 client_bitmap;
  449. u8 reserved[2];
  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. * @match_notify: clients waiting for match found notification
  458. * @pass_match: clients waiting for the results
  459. * @active_clients: active clients bitmap - enum scan_framework_client
  460. * @any_beacon_notify: clients waiting for match notification without match
  461. */
  462. struct iwl_scan_offload_profile_cfg {
  463. struct iwl_scan_offload_profile profiles[IWL_SCAN_MAX_PROFILES];
  464. u8 blacklist_len;
  465. u8 num_profiles;
  466. u8 match_notify;
  467. u8 pass_match;
  468. u8 active_clients;
  469. u8 any_beacon_notify;
  470. u8 reserved[2];
  471. } __packed;
  472. /**
  473. * iwl_scan_offload_schedule - schedule of scan offload
  474. * @delay: delay between iterations, in seconds.
  475. * @iterations: num of scan iterations
  476. * @full_scan_mul: number of partial scans before each full scan
  477. */
  478. struct iwl_scan_offload_schedule {
  479. __le16 delay;
  480. u8 iterations;
  481. u8 full_scan_mul;
  482. } __packed;
  483. /*
  484. * iwl_scan_offload_flags
  485. *
  486. * IWL_SCAN_OFFLOAD_FLAG_PASS_ALL: pass all results - no filtering.
  487. * IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL: add cached channels to partial scan.
  488. * IWL_SCAN_OFFLOAD_FLAG_EBS_QUICK_MODE: EBS duration is 100mSec - typical
  489. * beacon period. Finding channel activity in this mode is not guaranteed.
  490. * IWL_SCAN_OFFLOAD_FLAG_EBS_ACCURATE_MODE: EBS duration is 200mSec.
  491. * Assuming beacon period is 100ms finding channel activity is guaranteed.
  492. */
  493. enum iwl_scan_offload_flags {
  494. IWL_SCAN_OFFLOAD_FLAG_PASS_ALL = BIT(0),
  495. IWL_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL = BIT(2),
  496. IWL_SCAN_OFFLOAD_FLAG_EBS_QUICK_MODE = BIT(5),
  497. IWL_SCAN_OFFLOAD_FLAG_EBS_ACCURATE_MODE = BIT(6),
  498. };
  499. /**
  500. * iwl_scan_offload_req - scan offload request command
  501. * @flags: bitmap - enum iwl_scan_offload_flags.
  502. * @watchdog: maximum scan duration in TU.
  503. * @delay: delay in seconds before first iteration.
  504. * @schedule_line: scan offload schedule, for fast and regular scan.
  505. */
  506. struct iwl_scan_offload_req {
  507. __le16 flags;
  508. __le16 watchdog;
  509. __le16 delay;
  510. __le16 reserved;
  511. struct iwl_scan_offload_schedule schedule_line[2];
  512. } __packed;
  513. enum iwl_scan_offload_compleate_status {
  514. IWL_SCAN_OFFLOAD_COMPLETED = 1,
  515. IWL_SCAN_OFFLOAD_ABORTED = 2,
  516. };
  517. enum iwl_scan_ebs_status {
  518. IWL_SCAN_EBS_SUCCESS,
  519. IWL_SCAN_EBS_FAILED,
  520. IWL_SCAN_EBS_CHAN_NOT_FOUND,
  521. };
  522. /**
  523. * iwl_scan_offload_complete - SCAN_OFFLOAD_COMPLETE_NTF_API_S_VER_1
  524. * @last_schedule_line: last schedule line executed (fast or regular)
  525. * @last_schedule_iteration: last scan iteration executed before scan abort
  526. * @status: enum iwl_scan_offload_compleate_status
  527. * @ebs_status: last EBS status, see IWL_SCAN_EBS_*
  528. */
  529. struct iwl_scan_offload_complete {
  530. u8 last_schedule_line;
  531. u8 last_schedule_iteration;
  532. u8 status;
  533. u8 ebs_status;
  534. } __packed;
  535. /**
  536. * iwl_sched_scan_results - SCAN_OFFLOAD_MATCH_FOUND_NTF_API_S_VER_1
  537. * @ssid_bitmap: SSIDs indexes found in this iteration
  538. * @client_bitmap: clients that are active and wait for this notification
  539. */
  540. struct iwl_sched_scan_results {
  541. __le16 ssid_bitmap;
  542. u8 client_bitmap;
  543. u8 reserved;
  544. };
  545. /* Unified LMAC scan API */
  546. #define IWL_MVM_BASIC_PASSIVE_DWELL 110
  547. /**
  548. * iwl_scan_req_tx_cmd - SCAN_REQ_TX_CMD_API_S
  549. * @tx_flags: combination of TX_CMD_FLG_*
  550. * @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is
  551. * cleared. Combination of RATE_MCS_*
  552. * @sta_id: index of destination station in FW station table
  553. * @reserved: for alignment and future use
  554. */
  555. struct iwl_scan_req_tx_cmd {
  556. __le32 tx_flags;
  557. __le32 rate_n_flags;
  558. u8 sta_id;
  559. u8 reserved[3];
  560. } __packed;
  561. enum iwl_scan_channel_flags_lmac {
  562. IWL_UNIFIED_SCAN_CHANNEL_FULL = BIT(27),
  563. IWL_UNIFIED_SCAN_CHANNEL_PARTIAL = BIT(28),
  564. };
  565. /**
  566. * iwl_scan_channel_cfg_lmac - SCAN_CHANNEL_CFG_S_VER2
  567. * @flags: bits 1-20: directed scan to i'th ssid
  568. * other bits &enum iwl_scan_channel_flags_lmac
  569. * @channel_number: channel number 1-13 etc
  570. * @iter_count: scan iteration on this channel
  571. * @iter_interval: interval in seconds between iterations on one channel
  572. */
  573. struct iwl_scan_channel_cfg_lmac {
  574. __le32 flags;
  575. __le16 channel_num;
  576. __le16 iter_count;
  577. __le32 iter_interval;
  578. } __packed;
  579. /*
  580. * iwl_scan_probe_segment - PROBE_SEGMENT_API_S_VER_1
  581. * @offset: offset in the data block
  582. * @len: length of the segment
  583. */
  584. struct iwl_scan_probe_segment {
  585. __le16 offset;
  586. __le16 len;
  587. } __packed;
  588. /* iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_2
  589. * @mac_header: first (and common) part of the probe
  590. * @band_data: band specific data
  591. * @common_data: last (and common) part of the probe
  592. * @buf: raw data block
  593. */
  594. struct iwl_scan_probe_req {
  595. struct iwl_scan_probe_segment mac_header;
  596. struct iwl_scan_probe_segment band_data[2];
  597. struct iwl_scan_probe_segment common_data;
  598. u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE];
  599. } __packed;
  600. enum iwl_scan_channel_flags {
  601. IWL_SCAN_CHANNEL_FLAG_EBS = BIT(0),
  602. IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE = BIT(1),
  603. IWL_SCAN_CHANNEL_FLAG_CACHE_ADD = BIT(2),
  604. };
  605. /* iwl_scan_channel_opt - CHANNEL_OPTIMIZATION_API_S
  606. * @flags: enum iwl_scan_channel_flags
  607. * @non_ebs_ratio: defines the ratio of number of scan iterations where EBS is
  608. * involved.
  609. * 1 - EBS is disabled.
  610. * 2 - every second scan will be full scan(and so on).
  611. */
  612. struct iwl_scan_channel_opt {
  613. __le16 flags;
  614. __le16 non_ebs_ratio;
  615. } __packed;
  616. /**
  617. * iwl_mvm_lmac_scan_flags
  618. * @IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL: pass all beacons and probe responses
  619. * without filtering.
  620. * @IWL_MVM_LMAC_SCAN_FLAG_PASSIVE: force passive scan on all channels
  621. * @IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION: single channel scan
  622. * @IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE: send iteration complete notification
  623. * @IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS multiple SSID matching
  624. * @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented
  625. * @IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED: insert WFA vendor-specific TPC report
  626. * and DS parameter set IEs into probe requests.
  627. * @IWL_MVM_LMAC_SCAN_FLAG_MATCH: Send match found notification on matches
  628. */
  629. enum iwl_mvm_lmac_scan_flags {
  630. IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL = BIT(0),
  631. IWL_MVM_LMAC_SCAN_FLAG_PASSIVE = BIT(1),
  632. IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION = BIT(2),
  633. IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE = BIT(3),
  634. IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS = BIT(4),
  635. IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED = BIT(5),
  636. IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED = BIT(6),
  637. IWL_MVM_LMAC_SCAN_FLAG_MATCH = BIT(9),
  638. };
  639. enum iwl_scan_priority {
  640. IWL_SCAN_PRIORITY_LOW,
  641. IWL_SCAN_PRIORITY_MEDIUM,
  642. IWL_SCAN_PRIORITY_HIGH,
  643. };
  644. /**
  645. * iwl_scan_req_unified_lmac - SCAN_REQUEST_CMD_API_S_VER_1
  646. * @reserved1: for alignment and future use
  647. * @channel_num: num of channels to scan
  648. * @active-dwell: dwell time for active channels
  649. * @passive-dwell: dwell time for passive channels
  650. * @fragmented-dwell: dwell time for fragmented passive scan
  651. * @reserved2: for alignment and future use
  652. * @rx_chain_selct: PHY_RX_CHAIN_* flags
  653. * @scan_flags: &enum iwl_mvm_lmac_scan_flags
  654. * @max_out_time: max time (in TU) to be out of associated channel
  655. * @suspend_time: pause scan this long (TUs) when returning to service channel
  656. * @flags: RXON flags
  657. * @filter_flags: RXON filter
  658. * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz
  659. * @direct_scan: list of SSIDs for directed active scan
  660. * @scan_prio: enum iwl_scan_priority
  661. * @iter_num: number of scan iterations
  662. * @delay: delay in seconds before first iteration
  663. * @schedule: two scheduling plans. The first one is finite, the second one can
  664. * be infinite.
  665. * @channel_opt: channel optimization options, for full and partial scan
  666. * @data: channel configuration and probe request packet.
  667. */
  668. struct iwl_scan_req_unified_lmac {
  669. /* SCAN_REQUEST_FIXED_PART_API_S_VER_7 */
  670. __le32 reserved1;
  671. u8 n_channels;
  672. u8 active_dwell;
  673. u8 passive_dwell;
  674. u8 fragmented_dwell;
  675. __le16 reserved2;
  676. __le16 rx_chain_select;
  677. __le32 scan_flags;
  678. __le32 max_out_time;
  679. __le32 suspend_time;
  680. /* RX_ON_FLAGS_API_S_VER_1 */
  681. __le32 flags;
  682. __le32 filter_flags;
  683. struct iwl_scan_req_tx_cmd tx_cmd[2];
  684. struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
  685. __le32 scan_prio;
  686. /* SCAN_REQ_PERIODIC_PARAMS_API_S */
  687. __le32 iter_num;
  688. __le32 delay;
  689. struct iwl_scan_offload_schedule schedule[2];
  690. struct iwl_scan_channel_opt channel_opt[2];
  691. u8 data[];
  692. } __packed;
  693. /**
  694. * struct iwl_lmac_scan_results_notif - scan results for one channel -
  695. * SCAN_RESULT_NTF_API_S_VER_3
  696. * @channel: which channel the results are from
  697. * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
  698. * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
  699. * @num_probe_not_sent: # of request that weren't sent due to not enough time
  700. * @duration: duration spent in channel, in usecs
  701. */
  702. struct iwl_lmac_scan_results_notif {
  703. u8 channel;
  704. u8 band;
  705. u8 probe_status;
  706. u8 num_probe_not_sent;
  707. __le32 duration;
  708. } __packed;
  709. /**
  710. * struct iwl_lmac_scan_complete_notif - notifies end of scanning (all channels)
  711. * SCAN_COMPLETE_NTF_API_S_VER_3
  712. * @scanned_channels: number of channels scanned (and number of valid results)
  713. * @status: one of SCAN_COMP_STATUS_*
  714. * @bt_status: BT on/off status
  715. * @last_channel: last channel that was scanned
  716. * @tsf_low: TSF timer (lower half) in usecs
  717. * @tsf_high: TSF timer (higher half) in usecs
  718. * @results: an array of scan results, only "scanned_channels" of them are valid
  719. */
  720. struct iwl_lmac_scan_complete_notif {
  721. u8 scanned_channels;
  722. u8 status;
  723. u8 bt_status;
  724. u8 last_channel;
  725. __le32 tsf_low;
  726. __le32 tsf_high;
  727. struct iwl_scan_results_notif results[];
  728. } __packed;
  729. /**
  730. * iwl_scan_offload_complete - PERIODIC_SCAN_COMPLETE_NTF_API_S_VER_2
  731. * @last_schedule_line: last schedule line executed (fast or regular)
  732. * @last_schedule_iteration: last scan iteration executed before scan abort
  733. * @status: enum iwl_scan_offload_complete_status
  734. * @ebs_status: EBS success status &enum iwl_scan_ebs_status
  735. * @time_after_last_iter; time in seconds elapsed after last iteration
  736. */
  737. struct iwl_periodic_scan_complete {
  738. u8 last_schedule_line;
  739. u8 last_schedule_iteration;
  740. u8 status;
  741. u8 ebs_status;
  742. __le32 time_after_last_iter;
  743. __le32 reserved;
  744. } __packed;
  745. /* UMAC Scan API */
  746. /**
  747. * struct iwl_mvm_umac_cmd_hdr - Command header for UMAC commands
  748. * @size: size of the command (not including header)
  749. * @reserved0: for future use and alignment
  750. * @ver: API version number
  751. */
  752. struct iwl_mvm_umac_cmd_hdr {
  753. __le16 size;
  754. u8 reserved0;
  755. u8 ver;
  756. } __packed;
  757. #define IWL_MVM_MAX_SIMULTANEOUS_SCANS 8
  758. enum scan_config_flags {
  759. SCAN_CONFIG_FLAG_ACTIVATE = BIT(0),
  760. SCAN_CONFIG_FLAG_DEACTIVATE = BIT(1),
  761. SCAN_CONFIG_FLAG_FORBID_CHUB_REQS = BIT(2),
  762. SCAN_CONFIG_FLAG_ALLOW_CHUB_REQS = BIT(3),
  763. SCAN_CONFIG_FLAG_SET_TX_CHAINS = BIT(8),
  764. SCAN_CONFIG_FLAG_SET_RX_CHAINS = BIT(9),
  765. SCAN_CONFIG_FLAG_SET_AUX_STA_ID = BIT(10),
  766. SCAN_CONFIG_FLAG_SET_ALL_TIMES = BIT(11),
  767. SCAN_CONFIG_FLAG_SET_EFFECTIVE_TIMES = BIT(12),
  768. SCAN_CONFIG_FLAG_SET_CHANNEL_FLAGS = BIT(13),
  769. SCAN_CONFIG_FLAG_SET_LEGACY_RATES = BIT(14),
  770. SCAN_CONFIG_FLAG_SET_MAC_ADDR = BIT(15),
  771. SCAN_CONFIG_FLAG_SET_FRAGMENTED = BIT(16),
  772. SCAN_CONFIG_FLAG_CLEAR_FRAGMENTED = BIT(17),
  773. SCAN_CONFIG_FLAG_SET_CAM_MODE = BIT(18),
  774. SCAN_CONFIG_FLAG_CLEAR_CAM_MODE = BIT(19),
  775. SCAN_CONFIG_FLAG_SET_PROMISC_MODE = BIT(20),
  776. SCAN_CONFIG_FLAG_CLEAR_PROMISC_MODE = BIT(21),
  777. /* Bits 26-31 are for num of channels in channel_array */
  778. #define SCAN_CONFIG_N_CHANNELS(n) ((n) << 26)
  779. };
  780. enum scan_config_rates {
  781. /* OFDM basic rates */
  782. SCAN_CONFIG_RATE_6M = BIT(0),
  783. SCAN_CONFIG_RATE_9M = BIT(1),
  784. SCAN_CONFIG_RATE_12M = BIT(2),
  785. SCAN_CONFIG_RATE_18M = BIT(3),
  786. SCAN_CONFIG_RATE_24M = BIT(4),
  787. SCAN_CONFIG_RATE_36M = BIT(5),
  788. SCAN_CONFIG_RATE_48M = BIT(6),
  789. SCAN_CONFIG_RATE_54M = BIT(7),
  790. /* CCK basic rates */
  791. SCAN_CONFIG_RATE_1M = BIT(8),
  792. SCAN_CONFIG_RATE_2M = BIT(9),
  793. SCAN_CONFIG_RATE_5M = BIT(10),
  794. SCAN_CONFIG_RATE_11M = BIT(11),
  795. /* Bits 16-27 are for supported rates */
  796. #define SCAN_CONFIG_SUPPORTED_RATE(rate) ((rate) << 16)
  797. };
  798. enum iwl_channel_flags {
  799. IWL_CHANNEL_FLAG_EBS = BIT(0),
  800. IWL_CHANNEL_FLAG_ACCURATE_EBS = BIT(1),
  801. IWL_CHANNEL_FLAG_EBS_ADD = BIT(2),
  802. IWL_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE = BIT(3),
  803. };
  804. /**
  805. * struct iwl_scan_config
  806. * @hdr: umac command header
  807. * @flags: enum scan_config_flags
  808. * @tx_chains: valid_tx antenna - ANT_* definitions
  809. * @rx_chains: valid_rx antenna - ANT_* definitions
  810. * @legacy_rates: default legacy rates - enum scan_config_rates
  811. * @out_of_channel_time: default max out of serving channel time
  812. * @suspend_time: default max suspend time
  813. * @dwell_active: default dwell time for active scan
  814. * @dwell_passive: default dwell time for passive scan
  815. * @dwell_fragmented: default dwell time for fragmented scan
  816. * @reserved: for future use and alignment
  817. * @mac_addr: default mac address to be used in probes
  818. * @bcast_sta_id: the index of the station in the fw
  819. * @channel_flags: default channel flags - enum iwl_channel_flags
  820. * scan_config_channel_flag
  821. * @channel_array: default supported channels
  822. */
  823. struct iwl_scan_config {
  824. struct iwl_mvm_umac_cmd_hdr hdr;
  825. __le32 flags;
  826. __le32 tx_chains;
  827. __le32 rx_chains;
  828. __le32 legacy_rates;
  829. __le32 out_of_channel_time;
  830. __le32 suspend_time;
  831. u8 dwell_active;
  832. u8 dwell_passive;
  833. u8 dwell_fragmented;
  834. u8 reserved;
  835. u8 mac_addr[ETH_ALEN];
  836. u8 bcast_sta_id;
  837. u8 channel_flags;
  838. u8 channel_array[];
  839. } __packed; /* SCAN_CONFIG_DB_CMD_API_S */
  840. /**
  841. * iwl_umac_scan_flags
  842. *@IWL_UMAC_SCAN_FLAG_PREEMPTIVE: scan process triggered by this scan request
  843. * can be preempted by other scan requests with higher priority.
  844. * The low priority scan is aborted.
  845. *@IWL_UMAC_SCAN_FLAG_START_NOTIF: notification will be sent to the driver
  846. * when scan starts.
  847. */
  848. enum iwl_umac_scan_flags {
  849. IWL_UMAC_SCAN_FLAG_PREEMPTIVE = BIT(0),
  850. IWL_UMAC_SCAN_FLAG_START_NOTIF = BIT(1),
  851. };
  852. enum iwl_umac_scan_uid_offsets {
  853. IWL_UMAC_SCAN_UID_TYPE_OFFSET = 0,
  854. IWL_UMAC_SCAN_UID_SEQ_OFFSET = 8,
  855. };
  856. enum iwl_umac_scan_general_flags {
  857. IWL_UMAC_SCAN_GEN_FLAGS_PERIODIC = BIT(0),
  858. IWL_UMAC_SCAN_GEN_FLAGS_OVER_BT = BIT(1),
  859. IWL_UMAC_SCAN_GEN_FLAGS_PASS_ALL = BIT(2),
  860. IWL_UMAC_SCAN_GEN_FLAGS_PASSIVE = BIT(3),
  861. IWL_UMAC_SCAN_GEN_FLAGS_PRE_CONNECT = BIT(4),
  862. IWL_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE = BIT(5),
  863. IWL_UMAC_SCAN_GEN_FLAGS_MULTIPLE_SSID = BIT(6),
  864. IWL_UMAC_SCAN_GEN_FLAGS_FRAGMENTED = BIT(7),
  865. IWL_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED = BIT(8),
  866. IWL_UMAC_SCAN_GEN_FLAGS_MATCH = BIT(9)
  867. };
  868. /**
  869. * struct iwl_scan_channel_cfg_umac
  870. * @flags: bitmap - 0-19: directed scan to i'th ssid.
  871. * @channel_num: channel number 1-13 etc.
  872. * @iter_count: repetition count for the channel.
  873. * @iter_interval: interval between two scan interations on one channel.
  874. */
  875. struct iwl_scan_channel_cfg_umac {
  876. __le32 flags;
  877. u8 channel_num;
  878. u8 iter_count;
  879. __le16 iter_interval;
  880. } __packed; /* SCAN_CHANNEL_CFG_S_VER2 */
  881. /**
  882. * struct iwl_scan_umac_schedule
  883. * @interval: interval in seconds between scan iterations
  884. * @iter_count: num of scan iterations for schedule plan, 0xff for infinite loop
  885. * @reserved: for alignment and future use
  886. */
  887. struct iwl_scan_umac_schedule {
  888. __le16 interval;
  889. u8 iter_count;
  890. u8 reserved;
  891. } __packed; /* SCAN_SCHED_PARAM_API_S_VER_1 */
  892. /**
  893. * struct iwl_scan_req_umac_tail - the rest of the UMAC scan request command
  894. * parameters following channels configuration array.
  895. * @schedule: two scheduling plans.
  896. * @delay: delay in TUs before starting the first scan iteration
  897. * @reserved: for future use and alignment
  898. * @preq: probe request with IEs blocks
  899. * @direct_scan: list of SSIDs for directed active scan
  900. */
  901. struct iwl_scan_req_umac_tail {
  902. /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */
  903. struct iwl_scan_umac_schedule schedule[2];
  904. __le16 delay;
  905. __le16 reserved;
  906. /* SCAN_PROBE_PARAMS_API_S_VER_1 */
  907. struct iwl_scan_probe_req preq;
  908. struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
  909. } __packed;
  910. /**
  911. * struct iwl_scan_req_umac
  912. * @hdr: umac command header
  913. * @flags: &enum iwl_umac_scan_flags
  914. * @uid: scan id, &enum iwl_umac_scan_uid_offsets
  915. * @ooc_priority: out of channel priority - &enum iwl_scan_priority
  916. * @general_flags: &enum iwl_umac_scan_general_flags
  917. * @reserved1: for future use and alignment
  918. * @active_dwell: dwell time for active scan
  919. * @passive_dwell: dwell time for passive scan
  920. * @fragmented_dwell: dwell time for fragmented passive scan
  921. * @max_out_time: max out of serving channel time
  922. * @suspend_time: max suspend time
  923. * @scan_priority: scan internal prioritization &enum iwl_scan_priority
  924. * @channel_flags: &enum iwl_scan_channel_flags
  925. * @n_channels: num of channels in scan request
  926. * @reserved2: for future use and alignment
  927. * @data: &struct iwl_scan_channel_cfg_umac and
  928. * &struct iwl_scan_req_umac_tail
  929. */
  930. struct iwl_scan_req_umac {
  931. struct iwl_mvm_umac_cmd_hdr hdr;
  932. __le32 flags;
  933. __le32 uid;
  934. __le32 ooc_priority;
  935. /* SCAN_GENERAL_PARAMS_API_S_VER_1 */
  936. __le32 general_flags;
  937. u8 reserved1;
  938. u8 active_dwell;
  939. u8 passive_dwell;
  940. u8 fragmented_dwell;
  941. __le32 max_out_time;
  942. __le32 suspend_time;
  943. __le32 scan_priority;
  944. /* SCAN_CHANNEL_PARAMS_API_S_VER_1 */
  945. u8 channel_flags;
  946. u8 n_channels;
  947. __le16 reserved2;
  948. u8 data[];
  949. } __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */
  950. /**
  951. * struct iwl_umac_scan_abort
  952. * @hdr: umac command header
  953. * @uid: scan id, &enum iwl_umac_scan_uid_offsets
  954. * @flags: reserved
  955. */
  956. struct iwl_umac_scan_abort {
  957. struct iwl_mvm_umac_cmd_hdr hdr;
  958. __le32 uid;
  959. __le32 flags;
  960. } __packed; /* SCAN_ABORT_CMD_UMAC_API_S_VER_1 */
  961. /**
  962. * struct iwl_umac_scan_complete
  963. * @uid: scan id, &enum iwl_umac_scan_uid_offsets
  964. * @last_schedule: last scheduling line
  965. * @last_iter: last scan iteration number
  966. * @scan status: &enum iwl_scan_offload_complete_status
  967. * @ebs_status: &enum iwl_scan_ebs_status
  968. * @time_from_last_iter: time elapsed from last iteration
  969. * @reserved: for future use
  970. */
  971. struct iwl_umac_scan_complete {
  972. __le32 uid;
  973. u8 last_schedule;
  974. u8 last_iter;
  975. u8 status;
  976. u8 ebs_status;
  977. __le32 time_from_last_iter;
  978. __le32 reserved;
  979. } __packed; /* SCAN_COMPLETE_NTF_UMAC_API_S_VER_1 */
  980. #define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN 5
  981. /**
  982. * struct iwl_scan_offload_profile_match - match information
  983. * @bssid: matched bssid
  984. * @channel: channel where the match occurred
  985. * @energy:
  986. * @matching_feature:
  987. * @matching_channels: bitmap of channels that matched, referencing
  988. * the channels passed in tue scan offload request
  989. */
  990. struct iwl_scan_offload_profile_match {
  991. u8 bssid[ETH_ALEN];
  992. __le16 reserved;
  993. u8 channel;
  994. u8 energy;
  995. u8 matching_feature;
  996. u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN];
  997. } __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_1 */
  998. /**
  999. * struct iwl_scan_offload_profiles_query - match results query response
  1000. * @matched_profiles: bitmap of matched profiles, referencing the
  1001. * matches passed in the scan offload request
  1002. * @last_scan_age: age of the last offloaded scan
  1003. * @n_scans_done: number of offloaded scans done
  1004. * @gp2_d0u: GP2 when D0U occurred
  1005. * @gp2_invoked: GP2 when scan offload was invoked
  1006. * @resume_while_scanning: not used
  1007. * @self_recovery: obsolete
  1008. * @reserved: reserved
  1009. * @matches: array of match information, one for each match
  1010. */
  1011. struct iwl_scan_offload_profiles_query {
  1012. __le32 matched_profiles;
  1013. __le32 last_scan_age;
  1014. __le32 n_scans_done;
  1015. __le32 gp2_d0u;
  1016. __le32 gp2_invoked;
  1017. u8 resume_while_scanning;
  1018. u8 self_recovery;
  1019. __le16 reserved;
  1020. struct iwl_scan_offload_profile_match matches[IWL_SCAN_MAX_PROFILES];
  1021. } __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_2 */
  1022. #endif