wmi_unified_extscan_api.c 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. /*
  2. * Copyright (c) 2016-2018 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. #include "wmi_unified_priv.h"
  19. /**
  20. * wmi_unified_reset_passpoint_network_list_cmd() - reset passpoint network list
  21. * @wmi_hdl: wmi handle
  22. * @req: passpoint network request structure
  23. *
  24. * This function sends down WMI command with network id set to wildcard id.
  25. * firmware shall clear all the config entries
  26. *
  27. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  28. */
  29. QDF_STATUS wmi_unified_reset_passpoint_network_list_cmd(void *wmi_hdl,
  30. struct wifi_passpoint_req_param *req)
  31. {
  32. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  33. if (wmi_handle->ops->send_reset_passpoint_network_list_cmd)
  34. return wmi_handle->ops->send_reset_passpoint_network_list_cmd(wmi_handle,
  35. req);
  36. return QDF_STATUS_E_FAILURE;
  37. }
  38. /**
  39. * wmi_unified_set_passpoint_network_list_cmd() - set passpoint network list
  40. * @wmi_hdl: wmi handle
  41. * @req: passpoint network request structure
  42. *
  43. * This function reads the incoming @req and fill in the destination
  44. * WMI structure and send down the passpoint configs down to the firmware
  45. *
  46. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  47. */
  48. QDF_STATUS wmi_unified_set_passpoint_network_list_cmd(void *wmi_hdl,
  49. struct wifi_passpoint_req_param *req)
  50. {
  51. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  52. if (wmi_handle->ops->send_set_passpoint_network_list_cmd)
  53. return wmi_handle->ops->send_set_passpoint_network_list_cmd(wmi_handle,
  54. req);
  55. return QDF_STATUS_E_FAILURE;
  56. }
  57. /** wmi_unified_set_epno_network_list_cmd() - set epno network list
  58. * @wmi_hdl: wmi handle
  59. * @req: epno config params request structure
  60. *
  61. * This function reads the incoming epno config request structure
  62. * and constructs the WMI message to the firmware.
  63. *
  64. * Returns: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures,
  65. * error number otherwise
  66. */
  67. QDF_STATUS wmi_unified_set_epno_network_list_cmd(void *wmi_hdl,
  68. struct wifi_enhanced_pno_params *req)
  69. {
  70. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  71. if (wmi_handle->ops->send_set_epno_network_list_cmd)
  72. return wmi_handle->ops->send_set_epno_network_list_cmd(wmi_handle,
  73. req);
  74. return QDF_STATUS_E_FAILURE;
  75. }
  76. /**
  77. * wmi_unified_extscan_get_capabilities_cmd() - extscan get capabilities
  78. * @wmi_hdl: wmi handle
  79. * @pgetcapab: get capabilities params
  80. *
  81. * This function send request to fw to get extscan capabilities.
  82. *
  83. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  84. */
  85. QDF_STATUS wmi_unified_extscan_get_capabilities_cmd(void *wmi_hdl,
  86. struct extscan_capabilities_params *pgetcapab)
  87. {
  88. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  89. if (wmi_handle->ops->send_extscan_get_capabilities_cmd)
  90. return wmi_handle->ops->send_extscan_get_capabilities_cmd(wmi_handle,
  91. pgetcapab);
  92. return QDF_STATUS_E_FAILURE;
  93. }
  94. /**
  95. * wmi_unified_extscan_get_cached_results_cmd() - extscan get cached results
  96. * @wmi_hdl: wmi handle
  97. * @pcached_results: cached results parameters
  98. *
  99. * This function send request to fw to get cached results.
  100. *
  101. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  102. */
  103. QDF_STATUS wmi_unified_extscan_get_cached_results_cmd(void *wmi_hdl,
  104. struct extscan_cached_result_params *pcached_results)
  105. {
  106. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  107. if (wmi_handle->ops->send_extscan_get_cached_results_cmd)
  108. return wmi_handle->ops->send_extscan_get_cached_results_cmd(wmi_handle,
  109. pcached_results);
  110. return QDF_STATUS_E_FAILURE;
  111. }
  112. /**
  113. * wmi_unified_extscan_stop_change_monitor_cmd() - send stop change monitor cmd
  114. * @wmi_hdl: wmi handle
  115. * @reset_req: Reset change request params
  116. *
  117. * This function sends stop change monitor request to fw.
  118. *
  119. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  120. */
  121. QDF_STATUS wmi_unified_extscan_stop_change_monitor_cmd(void *wmi_hdl,
  122. struct extscan_capabilities_reset_params *reset_req)
  123. {
  124. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  125. if (wmi_handle->ops->send_extscan_stop_change_monitor_cmd)
  126. return wmi_handle->ops->send_extscan_stop_change_monitor_cmd(wmi_handle,
  127. reset_req);
  128. return QDF_STATUS_E_FAILURE;
  129. }
  130. /**
  131. * wmi_unified_extscan_start_change_monitor_cmd() - start change monitor cmd
  132. * @wmi_hdl: wmi handle
  133. * @psigchange: change monitor request params
  134. *
  135. * This function sends start change monitor request to fw.
  136. *
  137. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  138. */
  139. QDF_STATUS wmi_unified_extscan_start_change_monitor_cmd(void *wmi_hdl,
  140. struct extscan_set_sig_changereq_params *
  141. psigchange)
  142. {
  143. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  144. if (wmi_handle->ops->send_extscan_start_change_monitor_cmd)
  145. return wmi_handle->ops->send_extscan_start_change_monitor_cmd(wmi_handle,
  146. psigchange);
  147. return QDF_STATUS_E_FAILURE;
  148. }
  149. /**
  150. * wmi_unified_extscan_stop_hotlist_monitor_cmd() - stop hotlist monitor
  151. * @wmi_hdl: wmi handle
  152. * @photlist_reset: hotlist reset params
  153. *
  154. * This function configures hotlist monitor to stop in fw.
  155. *
  156. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  157. */
  158. QDF_STATUS wmi_unified_extscan_stop_hotlist_monitor_cmd(void *wmi_hdl,
  159. struct extscan_bssid_hotlist_reset_params *photlist_reset)
  160. {
  161. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  162. if (wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd)
  163. return wmi_handle->ops->send_extscan_stop_hotlist_monitor_cmd(wmi_handle,
  164. photlist_reset);
  165. return QDF_STATUS_E_FAILURE;
  166. }
  167. QDF_STATUS wmi_unified_extscan_start_hotlist_monitor_cmd(void *wmi_hdl,
  168. struct extscan_bssid_hotlist_set_params *params)
  169. {
  170. wmi_unified_t wmi_handle = wmi_hdl;
  171. if (wmi_handle->ops->send_extscan_start_hotlist_monitor_cmd)
  172. return wmi_handle->ops->send_extscan_start_hotlist_monitor_cmd(wmi_handle,
  173. params);
  174. return QDF_STATUS_E_FAILURE;
  175. }
  176. /**
  177. * wmi_unified_stop_extscan_cmd() - stop extscan command to fw.
  178. * @wmi_hdl: wmi handle
  179. * @pstopcmd: stop scan command request params
  180. *
  181. * This function sends stop extscan request to fw.
  182. *
  183. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure.
  184. */
  185. QDF_STATUS wmi_unified_stop_extscan_cmd(void *wmi_hdl,
  186. struct extscan_stop_req_params *pstopcmd)
  187. {
  188. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  189. if (wmi_handle->ops->send_stop_extscan_cmd)
  190. return wmi_handle->ops->send_stop_extscan_cmd(wmi_handle,
  191. pstopcmd);
  192. return QDF_STATUS_E_FAILURE;
  193. }
  194. /**
  195. * wmi_unified_start_extscan_cmd() - start extscan command to fw.
  196. * @wmi_hdl: wmi handle
  197. * @pstart: scan command request params
  198. *
  199. * This function sends start extscan request to fw.
  200. *
  201. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure.
  202. */
  203. QDF_STATUS wmi_unified_start_extscan_cmd(void *wmi_hdl,
  204. struct wifi_scan_cmd_req_params *pstart)
  205. {
  206. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  207. if (wmi_handle->ops->send_start_extscan_cmd)
  208. return wmi_handle->ops->send_start_extscan_cmd(wmi_handle,
  209. pstart);
  210. return QDF_STATUS_E_FAILURE;
  211. }
  212. /**
  213. * wmi_unified_get_buf_extscan_hotlist_cmd() - prepare hotlist command
  214. * @wmi_hdl: wmi handle
  215. * @photlist: hotlist command params
  216. * @buf_len: buffer length
  217. *
  218. * This function fills individual elements for hotlist request and
  219. * TLV for bssid entries
  220. *
  221. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure.
  222. */
  223. QDF_STATUS wmi_unified_get_buf_extscan_hotlist_cmd(void *wmi_hdl,
  224. struct ext_scan_setbssid_hotlist_params *
  225. photlist, int *buf_len)
  226. {
  227. wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
  228. if (wmi_handle->ops->send_get_buf_extscan_hotlist_cmd)
  229. return wmi_handle->ops->send_get_buf_extscan_hotlist_cmd(wmi_handle,
  230. photlist, buf_len);
  231. return QDF_STATUS_E_FAILURE;
  232. }