wlan_spectral_tgt_api.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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. * @id: spectral config command id
  38. * @indata: reference to input data
  39. * @insize: input data size
  40. * @outdata: reference to output data
  41. * @outsize: output data size
  42. *
  43. * This function processes the spectral config command
  44. * and appropriate handlers are invoked.
  45. *
  46. * Return: 0 success else failure
  47. */
  48. int tgt_spectral_control(struct wlan_objmgr_pdev *pdev,
  49. u_int id, void *indata, u_int32_t insize,
  50. void *outdata, u_int32_t *outsize);
  51. /**
  52. * tgt_pdev_spectral_init() - implementation for spectral init
  53. * @pdev: Pointer to pdev
  54. *
  55. * Return: On success, pointer to Spectral target_if internal private data, on
  56. * failure, NULL
  57. */
  58. void *tgt_pdev_spectral_init(struct wlan_objmgr_pdev *pdev);
  59. /**
  60. * tgt_pdev_spectral_deinit() - implementation for spectral de-init
  61. * @pdev: Pointer to pdev
  62. *
  63. * Return: None
  64. */
  65. void tgt_pdev_spectral_deinit(struct wlan_objmgr_pdev *pdev);
  66. /**
  67. * tgt_set_spectral_config() - Set spectral config
  68. * @pdev: Pointer to pdev object
  69. * @threshtype: spectral parameter type
  70. * @value: value to be configured for the given spectral parameter
  71. *
  72. * Implementation for setting spectral config
  73. *
  74. * Return: 0 on success else failure
  75. */
  76. int tgt_set_spectral_config(struct wlan_objmgr_pdev *pdev,
  77. const u_int32_t threshtype,
  78. const u_int32_t value);
  79. /**
  80. * tgt_get_spectral_config() - Get spectral configuration
  81. * @pdev: Pointer to pdev object
  82. * @param: Pointer to spectral_config structure in which the configuration
  83. * should be returned
  84. *
  85. * Implementation for getting the current spectral configuration
  86. *
  87. * Return: None
  88. */
  89. void tgt_get_spectral_config(struct wlan_objmgr_pdev *pdev,
  90. struct spectral_config *sptrl_config);
  91. /**
  92. * tgt_start_spectral_scan() - Start spectral scan
  93. * @pdev: Pointer to pdev object
  94. *
  95. * Implementation for starting spectral scan
  96. *
  97. * Return: 0 in case of success, -1 on failure
  98. */
  99. int tgt_start_spectral_scan(struct wlan_objmgr_pdev *pdev);
  100. /**
  101. * tgt_stop_spectral_scan() - Stop spectral scan
  102. * @pdev: Pointer to pdev object
  103. *
  104. * Implementation for stop spectral scan
  105. *
  106. * Return: None
  107. */
  108. void tgt_stop_spectral_scan(struct wlan_objmgr_pdev *pdev);
  109. /**
  110. * tgt_is_spectral_active() - Get whether Spectral is active
  111. * @pdev: Pointer to pdev object
  112. *
  113. * Implementation to get whether Spectral is active
  114. *
  115. * Return: True if Spectral is active, false if Spectral is not active
  116. */
  117. bool tgt_is_spectral_active(struct wlan_objmgr_pdev *pdev);
  118. /**
  119. * tgt_is_spectral_enabled() - Get whether Spectral is active
  120. * @pdev: Pointer to pdev object
  121. *
  122. * Implementation to get whether Spectral is active
  123. *
  124. * Return: True if Spectral is active, false if Spectral is not active
  125. */
  126. bool tgt_is_spectral_enabled(struct wlan_objmgr_pdev *pdev);
  127. /**
  128. * tgt_set_debug_level() - Set debug level for Spectral
  129. * @pdev: Pointer to pdev object
  130. * @debug_level: Debug level
  131. *
  132. * Implementation to set the debug level for Spectral
  133. *
  134. * Return: 0 in case of success
  135. */
  136. int tgt_set_debug_level(struct wlan_objmgr_pdev *pdev, u_int32_t debug_level);
  137. /**
  138. * tgt_get_debug_level() - Get debug level for Spectral
  139. * @pdev: Pointer to pdev object
  140. *
  141. * Implementation to get the debug level for Spectral
  142. *
  143. * Return: Current debug level
  144. */
  145. uint32_t tgt_get_debug_level(struct wlan_objmgr_pdev *pdev);
  146. /**
  147. * tgt_get_spectral_capinfo() - Get Spectral capability information
  148. * @pdev: Pointer to pdev object
  149. * @outdata: Buffer into which data should be copied
  150. *
  151. * Implementation to get the spectral capability information
  152. *
  153. * Return: void
  154. */
  155. void tgt_get_spectral_capinfo(struct wlan_objmgr_pdev *pdev, void *outdata);
  156. /**
  157. * tgt_get_spectral_diagstats() - Get Spectral diagnostic statistics
  158. * @pdev: Pointer to pdev object
  159. * @outdata: Buffer into which data should be copied
  160. *
  161. * Implementation to get the spectral diagnostic statistics
  162. *
  163. * Return: void
  164. */
  165. void tgt_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev, void *outdata);
  166. /**
  167. * tgt_register_wmi_spectral_cmd_ops() - Register wmi_spectral_cmd_ops
  168. * @cmd_ops: Pointer to the structure having wmi_spectral_cmd function pointers
  169. * @pdev: Pointer to pdev object
  170. *
  171. * Implementation to register wmi_spectral_cmd_ops in spectral
  172. * internal data structure
  173. *
  174. * Return: void
  175. */
  176. void tgt_register_wmi_spectral_cmd_ops(struct wlan_objmgr_pdev *pdev,
  177. struct wmi_spectral_cmd_ops *cmd_ops);
  178. /**
  179. * tgt_spectral_register_nl_cb() - Register Netlink callbacks
  180. * @pdev: Pointer to pdev object
  181. * @nl_cb: Netlink callbacks to register
  182. *
  183. * Return: void
  184. */
  185. void tgt_spectral_register_nl_cb(struct wlan_objmgr_pdev *pdev,
  186. struct spectral_nl_cb *nl_cb);
  187. /**
  188. * tgt_spectral_use_nl_bcast() - Get whether to use broadcast/unicast while
  189. * sending Netlink messages to the application layer
  190. * @pdev: Pointer to pdev object
  191. *
  192. * Return: true for broadcast, false for unicast
  193. */
  194. bool tgt_spectral_use_nl_bcast(struct wlan_objmgr_pdev *pdev);
  195. /**
  196. * tgt_spectral_deregister_nl_cb() - De-register Netlink callbacks
  197. * @pdev: Pointer to pdev object
  198. *
  199. * Return: void
  200. */
  201. void tgt_spectral_deregister_nl_cb(struct wlan_objmgr_pdev *pdev);
  202. /**
  203. * tgt_spectral_process_report() - Process spectral report
  204. * @pdev: Pointer to pdev object
  205. * @payload: Pointer to spectral report buffer
  206. *
  207. * Return: status
  208. */
  209. int
  210. tgt_spectral_process_report(struct wlan_objmgr_pdev *pdev,
  211. void *payload);
  212. /**
  213. * tgt_spectral_register_to_dbr() - Register to direct DMA
  214. * @pdev: Pointer to pdev object
  215. *
  216. * Return: QDF_STATUS
  217. */
  218. QDF_STATUS
  219. tgt_spectral_register_to_dbr(struct wlan_objmgr_pdev *pdev);
  220. /**
  221. * tgt_spectral_unregister_to_dbr() - Register to direct DMA
  222. * @pdev: Pointer to pdev object
  223. *
  224. * Return: QDF_STATUS
  225. */
  226. QDF_STATUS
  227. tgt_spectral_unregister_to_dbr(struct wlan_objmgr_pdev *pdev);
  228. /**
  229. * tgt_spectral_get_target_type() - Get target type
  230. * @psoc: Pointer to psoc object
  231. *
  232. * Return: target type
  233. */
  234. uint32_t
  235. tgt_spectral_get_target_type(struct wlan_objmgr_psoc *psoc);
  236. #endif /* _WLAN_SPECTRAL_TGT_API_H_ */