wlan_scan_api.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. /*
  2. * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /*
  19. * DOC: contains scan api
  20. */
  21. #ifndef _WLAN_SCAN_API_H_
  22. #define _WLAN_SCAN_API_H_
  23. #include <wlan_objmgr_psoc_obj.h>
  24. #include <wlan_objmgr_pdev_obj.h>
  25. #include <wlan_objmgr_vdev_obj.h>
  26. #include "../../core/src/wlan_scan_main.h"
  27. /**
  28. * wlan_scan_cfg_set_active_2g_dwelltime() - API to set scan active 2g dwelltime
  29. * @psoc: pointer to psoc object
  30. * @dwell_time: scan active dwell time
  31. *
  32. * Return: none
  33. */
  34. void wlan_scan_cfg_set_active_2g_dwelltime(struct wlan_objmgr_psoc *psoc,
  35. uint32_t dwell_time);
  36. /**
  37. * wlan_scan_cfg_get_active_2g_dwelltime() - API to get active 2g dwelltime
  38. * @psoc: pointer to psoc object
  39. * @dwell_time: scan active dwelltime
  40. *
  41. * Return: scan active dwell time
  42. */
  43. void wlan_scan_cfg_get_active_2g_dwelltime(struct wlan_objmgr_psoc *psoc,
  44. uint32_t *dwell_time);
  45. /**
  46. * wlan_scan_cfg_set_active_dwelltime() - API to set scan active dwelltime
  47. * @psoc: pointer to psoc object
  48. * @dwell_time: scan active dwell time
  49. *
  50. * Return: none
  51. */
  52. void wlan_scan_cfg_set_active_dwelltime(struct wlan_objmgr_psoc *psoc,
  53. uint32_t dwell_time);
  54. /**
  55. * wlan_scan_cfg_get_active_dwelltime() - API to get active dwelltime
  56. * @psoc: pointer to psoc object
  57. * @dwell_time: scan active dwelltime
  58. *
  59. * Return: scan active dwell time
  60. */
  61. void wlan_scan_cfg_get_active_dwelltime(struct wlan_objmgr_psoc *psoc,
  62. uint32_t *dwell_time);
  63. /**
  64. * wlan_scan_cfg_set_passive_dwelltime() - API to set scan passive dwelltime
  65. * @psoc: pointer to psoc object
  66. * @dwell_time: scan passive dwell time
  67. *
  68. * Return: none
  69. */
  70. void wlan_scan_cfg_set_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
  71. uint32_t dwell_time);
  72. /**
  73. * wlan_scan_cfg_get_passive_dwelltime() - API to get passive dwelltime
  74. * @psoc: pointer to psoc object
  75. * @dwell_time: scan passive dwelltime
  76. *
  77. * Return: scan passive dwell time
  78. */
  79. void wlan_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
  80. uint32_t *dwell_time);
  81. /**
  82. * wlan_scan_cfg_get_conc_active_dwelltime() - Get concurrent active dwelltime
  83. * @psoc: pointer to psoc object
  84. * @dwell_time: scan active dwelltime
  85. *
  86. * Return: scan concurrent active dwell time
  87. */
  88. void wlan_scan_cfg_get_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
  89. uint32_t *dwell_time);
  90. /**
  91. * wlan_scan_cfg_set_conc_active_dwelltime() - Set concurrent active dwelltime
  92. * @psoc: pointer to psoc object
  93. * @dwell_time: scan active dwelltime
  94. *
  95. * Return: scan concurrent active dwell time
  96. */
  97. void wlan_scan_cfg_set_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
  98. uint32_t dwell_time);
  99. /**
  100. * wlan_scan_cfg_get_conc_passive_dwelltime() - Get passive concurrent dwelltime
  101. * @psoc: pointer to psoc object
  102. * @dwell_time: scan passive dwelltime
  103. *
  104. * Return: scan concurrent passive dwell time
  105. */
  106. void wlan_scan_cfg_get_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
  107. uint32_t *dwell_time);
  108. /**
  109. * wlan_scan_cfg_set_conc_passive_dwelltime() - Set passive concurrent dwelltime
  110. * @psoc: pointer to psoc object
  111. * @dwell_time: scan passive dwelltime
  112. *
  113. * Return: scan concurrent passive dwell time
  114. */
  115. void wlan_scan_cfg_set_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
  116. uint32_t dwell_time);
  117. /**
  118. * wlan_scan_cfg_honour_nl_scan_policy_flags() - API to get nl scan policy
  119. * flags honoured
  120. * @psoc: pointer to psoc object
  121. *
  122. * Return: nl scan policy flags honoured or not
  123. */
  124. bool wlan_scan_cfg_honour_nl_scan_policy_flags(struct wlan_objmgr_psoc *psoc);
  125. /**
  126. * wlan_scan_cfg_get_conc_max_resttime() - API to get max rest time
  127. * @psoc: pointer to psoc object
  128. * @rest_time: scan concurrent max resttime
  129. *
  130. * Return: scan concurrent max rest time
  131. */
  132. void wlan_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc,
  133. uint32_t *rest_time);
  134. /**
  135. * wlan_scan_cfg_get_dfs_chan_scan_allowed() - API to get dfs scan enabled
  136. * @psoc: pointer to psoc object
  137. * @enable_dfs_scan: DFS scan enabled or not.
  138. *
  139. * Return: None
  140. */
  141. void wlan_scan_cfg_get_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc,
  142. bool *enable_dfs_scan);
  143. /**
  144. * wlan_scan_cfg_set_dfs_chan_scan_allowed() - API to set dfs scan enabled.
  145. * @psoc: pointer to psoc object
  146. * @enable_dfs_scan: Set dfs scan enabled or not.
  147. *
  148. * Return: None
  149. */
  150. void wlan_scan_cfg_set_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc,
  151. bool enable_dfs_scan);
  152. /**
  153. * wlan_scan_cfg_get_conc_min_resttime() - API to get concurrent min rest time
  154. * @psoc: pointer to psoc object
  155. * @rest_time: scan concurrent min rest time
  156. *
  157. * Return: scan concurrent min rest time
  158. */
  159. void wlan_scan_cfg_get_conc_min_resttime(struct wlan_objmgr_psoc *psoc,
  160. uint32_t *rest_time);
  161. /**
  162. * wlan_scan_is_snr_monitor_enabled() - API to get SNR monitoring enabled or not
  163. * @psoc: pointer to psoc object
  164. *
  165. * Return: enable/disable snr monitor mode.
  166. */
  167. bool wlan_scan_is_snr_monitor_enabled(struct wlan_objmgr_psoc *psoc);
  168. /**
  169. * wlan_scan_process_bcn_probe_rx_sync() - handle bcn without posting to
  170. * scheduler thread
  171. * @psoc: psoc context
  172. * @buf: frame buf
  173. * @params: rx event params
  174. * @frm_type: frame type
  175. *
  176. * handle bcn without posting to scheduler thread, this should be called
  177. * while caller is already in scheduler thread context
  178. *
  179. * Return: success or error code.
  180. */
  181. QDF_STATUS
  182. wlan_scan_process_bcn_probe_rx_sync(struct wlan_objmgr_psoc *psoc,
  183. qdf_nbuf_t buf,
  184. struct mgmt_rx_event_params *rx_param,
  185. enum mgmt_frame_type frm_type);
  186. /**
  187. * wlan_scan_get_aging_time - Get the scan aging time config
  188. * @psoc: psoc context
  189. *
  190. * Return: Scan aging time config
  191. */
  192. qdf_time_t wlan_scan_get_aging_time(struct wlan_objmgr_psoc *psoc);
  193. /**
  194. * wlan_scan_purge_results() - purge the scan list
  195. * @scan_list: scan list to be purged
  196. *
  197. * This function purge the temp scan list
  198. *
  199. * Return: QDF_STATUS
  200. */
  201. static inline QDF_STATUS wlan_scan_purge_results(qdf_list_t *scan_list)
  202. {
  203. return scm_purge_scan_results(scan_list);
  204. }
  205. /**
  206. * wlan_scan_get_result() - The Public API to get scan results
  207. * @pdev: pdev info
  208. * @filter: Filters
  209. *
  210. * This function fetches scan result
  211. *
  212. * Return: scan list pointer
  213. */
  214. static inline qdf_list_t *wlan_scan_get_result(struct wlan_objmgr_pdev *pdev,
  215. struct scan_filter *filter)
  216. {
  217. return scm_get_scan_result(pdev, filter);
  218. }
  219. /**
  220. * wlan_scan_start() - Public API to start a scan
  221. * @req: start scan req params
  222. *
  223. * The Public API to start a scan. Post a msg to target_if queue
  224. *
  225. * Return: QDF_STATUS.
  226. */
  227. QDF_STATUS wlan_scan_start(struct scan_start_request *req);
  228. /**
  229. * wlan_scan_cancel() - Public API to stop a scan
  230. * @req: stop scan request params
  231. *
  232. * The Public API to stop a scan. Post a msg to target_if queue
  233. *
  234. * Return: QDF_STATUS.
  235. */
  236. QDF_STATUS wlan_scan_cancel(struct scan_cancel_request *req);
  237. #endif