wlan_spectral_tgt_api.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. /*
  2. * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
  3. *
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #ifndef _WLAN_SPECTRAL_TGT_API_H_
  20. #define _WLAN_SPECTRAL_TGT_API_H_
  21. #include <wlan_objmgr_cmn.h>
  22. #include <qdf_types.h>
  23. #include "../../core/spectral_cmn_api_i.h"
  24. /**
  25. * tgt_get_target_handle() - Get target_if handle
  26. * @pdev: Pointer to pdev
  27. *
  28. * Get handle to target_if internal Spectral data
  29. *
  30. * Return: Handle to target_if internal Spectral data on success, NULL on
  31. * failure
  32. */
  33. void *tgt_get_target_handle(struct wlan_objmgr_pdev *pdev);
  34. /**
  35. * tgt_spectral_control()- handler for demultiplexing requests from higher layer
  36. * @pdev: reference to global pdev object
  37. * @sscan_req: pointer to Spectral scan request
  38. *
  39. * This function processes the spectral config command
  40. * and appropriate handlers are invoked.
  41. *
  42. * Return: 0 success else failure
  43. */
  44. int tgt_spectral_control(struct wlan_objmgr_pdev *pdev,
  45. struct spectral_cp_request *sscan_req);
  46. /**
  47. * tgt_pdev_spectral_init() - implementation for spectral init
  48. * @pdev: Pointer to pdev
  49. *
  50. * Return: On success, pointer to Spectral target_if internal private data, on
  51. * failure, NULL
  52. */
  53. void *tgt_pdev_spectral_init(struct wlan_objmgr_pdev *pdev);
  54. /**
  55. * tgt_pdev_spectral_deinit() - implementation for spectral de-init
  56. * @pdev: Pointer to pdev
  57. *
  58. * Return: None
  59. */
  60. void tgt_pdev_spectral_deinit(struct wlan_objmgr_pdev *pdev);
  61. /**
  62. * tgt_set_spectral_config() - Set spectral config
  63. * @pdev: Pointer to pdev object
  64. * @threshtype: spectral parameter type
  65. * @value: value to be configured for the given spectral parameter
  66. *
  67. * Implementation for setting spectral config
  68. *
  69. * Return: 0 on success else failure
  70. */
  71. int tgt_set_spectral_config(struct wlan_objmgr_pdev *pdev,
  72. const u_int32_t threshtype,
  73. const u_int32_t value);
  74. /**
  75. * tgt_get_spectral_config() - Get spectral configuration
  76. * @pdev: Pointer to pdev object
  77. * @param: Pointer to spectral_config structure in which the configuration
  78. * should be returned
  79. *
  80. * Implementation for getting the current spectral configuration
  81. *
  82. * Return: None
  83. */
  84. void tgt_get_spectral_config(struct wlan_objmgr_pdev *pdev,
  85. struct spectral_config *sptrl_config);
  86. /**
  87. * tgt_start_spectral_scan() - Start spectral scan
  88. * @pdev: Pointer to pdev object
  89. *
  90. * Implementation for starting spectral scan
  91. *
  92. * Return: 0 in case of success, -1 on failure
  93. */
  94. int tgt_start_spectral_scan(struct wlan_objmgr_pdev *pdev);
  95. /**
  96. * tgt_stop_spectral_scan() - Stop spectral scan
  97. * @pdev: Pointer to pdev object
  98. *
  99. * Implementation for stop spectral scan
  100. *
  101. * Return: None
  102. */
  103. void tgt_stop_spectral_scan(struct wlan_objmgr_pdev *pdev);
  104. /**
  105. * tgt_is_spectral_active() - Get whether Spectral is active
  106. * @pdev: Pointer to pdev object
  107. *
  108. * Implementation to get whether Spectral is active
  109. *
  110. * Return: True if Spectral is active, false if Spectral is not active
  111. */
  112. bool tgt_is_spectral_active(struct wlan_objmgr_pdev *pdev);
  113. /**
  114. * tgt_is_spectral_enabled() - Get whether Spectral is active
  115. * @pdev: Pointer to pdev object
  116. *
  117. * Implementation to get whether Spectral is active
  118. *
  119. * Return: True if Spectral is active, false if Spectral is not active
  120. */
  121. bool tgt_is_spectral_enabled(struct wlan_objmgr_pdev *pdev);
  122. /**
  123. * tgt_set_debug_level() - Set debug level for Spectral
  124. * @pdev: Pointer to pdev object
  125. * @debug_level: Debug level
  126. *
  127. * Implementation to set the debug level for Spectral
  128. *
  129. * Return: 0 in case of success
  130. */
  131. int tgt_set_debug_level(struct wlan_objmgr_pdev *pdev, u_int32_t debug_level);
  132. /**
  133. * tgt_get_debug_level() - Get debug level for Spectral
  134. * @pdev: Pointer to pdev object
  135. *
  136. * Implementation to get the debug level for Spectral
  137. *
  138. * Return: Current debug level
  139. */
  140. uint32_t tgt_get_debug_level(struct wlan_objmgr_pdev *pdev);
  141. /**
  142. * tgt_get_spectral_capinfo() - Get Spectral capability information
  143. * @pdev: Pointer to pdev object
  144. * @outdata: Buffer into which data should be copied
  145. *
  146. * Implementation to get the spectral capability information
  147. *
  148. * Return: void
  149. */
  150. void tgt_get_spectral_capinfo(struct wlan_objmgr_pdev *pdev, void *outdata);
  151. /**
  152. * tgt_get_spectral_diagstats() - Get Spectral diagnostic statistics
  153. * @pdev: Pointer to pdev object
  154. * @outdata: Buffer into which data should be copied
  155. *
  156. * Implementation to get the spectral diagnostic statistics
  157. *
  158. * Return: void
  159. */
  160. void tgt_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev, void *outdata);
  161. /**
  162. * tgt_register_wmi_spectral_cmd_ops() - Register wmi_spectral_cmd_ops
  163. * @cmd_ops: Pointer to the structure having wmi_spectral_cmd function pointers
  164. * @pdev: Pointer to pdev object
  165. *
  166. * Implementation to register wmi_spectral_cmd_ops in spectral
  167. * internal data structure
  168. *
  169. * Return: void
  170. */
  171. void tgt_register_wmi_spectral_cmd_ops(struct wlan_objmgr_pdev *pdev,
  172. struct wmi_spectral_cmd_ops *cmd_ops);
  173. /**
  174. * tgt_spectral_register_nl_cb() - Register Netlink callbacks
  175. * @pdev: Pointer to pdev object
  176. * @nl_cb: Netlink callbacks to register
  177. *
  178. * Return: void
  179. */
  180. void tgt_spectral_register_nl_cb(struct wlan_objmgr_pdev *pdev,
  181. struct spectral_nl_cb *nl_cb);
  182. /**
  183. * tgt_spectral_use_nl_bcast() - Get whether to use broadcast/unicast while
  184. * sending Netlink messages to the application layer
  185. * @pdev: Pointer to pdev object
  186. *
  187. * Return: true for broadcast, false for unicast
  188. */
  189. bool tgt_spectral_use_nl_bcast(struct wlan_objmgr_pdev *pdev);
  190. /**
  191. * tgt_spectral_deregister_nl_cb() - De-register Netlink callbacks
  192. * @pdev: Pointer to pdev object
  193. *
  194. * Return: void
  195. */
  196. void tgt_spectral_deregister_nl_cb(struct wlan_objmgr_pdev *pdev);
  197. /**
  198. * tgt_spectral_process_report() - Process spectral report
  199. * @pdev: Pointer to pdev object
  200. * @payload: Pointer to spectral report buffer
  201. *
  202. * Return: status
  203. */
  204. int
  205. tgt_spectral_process_report(struct wlan_objmgr_pdev *pdev,
  206. void *payload);
  207. /**
  208. * tgt_spectral_register_to_dbr() - Register to direct DMA
  209. * @pdev: Pointer to pdev object
  210. *
  211. * Return: QDF_STATUS
  212. */
  213. QDF_STATUS
  214. tgt_spectral_register_to_dbr(struct wlan_objmgr_pdev *pdev);
  215. /**
  216. * tgt_spectral_unregister_to_dbr() - Register to direct DMA
  217. * @pdev: Pointer to pdev object
  218. *
  219. * Return: QDF_STATUS
  220. */
  221. QDF_STATUS
  222. tgt_spectral_unregister_to_dbr(struct wlan_objmgr_pdev *pdev);
  223. /**
  224. * tgt_spectral_get_target_type() - Get target type
  225. * @psoc: Pointer to psoc object
  226. *
  227. * Return: target type
  228. */
  229. uint32_t
  230. tgt_spectral_get_target_type(struct wlan_objmgr_psoc *psoc);
  231. #endif /* _WLAN_SPECTRAL_TGT_API_H_ */