wlan_spectral_tgt_api.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /*
  2. * Copyright (c) 2017-2018 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_send_phydata() - Send Spectral PHY data
  26. * @pdev: Pointer to pdev
  27. * @sock: Netlink socket to use
  28. * @nbuf: Network buffer containing PHY data to send
  29. *
  30. * Send spectral PHY data over netlink
  31. *
  32. * Return: 0 on success, negative value on failure
  33. */
  34. int tgt_send_phydata(struct wlan_objmgr_pdev *pdev,
  35. struct sock *sock, qdf_nbuf_t nbuf);
  36. /**
  37. * tgt_get_target_handle() - Get target_if handle
  38. * @pdev: Pointer to pdev
  39. *
  40. * Get handle to target_if internal Spectral data
  41. *
  42. * Return: Handle to target_if internal Spectral data on success, NULL on
  43. * failure
  44. */
  45. void *tgt_get_target_handle(struct wlan_objmgr_pdev *pdev);
  46. /**
  47. * tgt_spectral_control()- handler for demultiplexing requests from higher layer
  48. * @pdev: reference to global pdev object
  49. * @id: spectral config command id
  50. * @indata: reference to input data
  51. * @insize: input data size
  52. * @outdata: reference to output data
  53. * @outsize: output data size
  54. *
  55. * This function processes the spectral config command
  56. * and appropriate handlers are invoked.
  57. *
  58. * Return: 0 success else failure
  59. */
  60. int
  61. tgt_spectral_control(
  62. struct wlan_objmgr_pdev *pdev,
  63. u_int id,
  64. void *indata,
  65. u_int32_t insize, void *outdata, u_int32_t *outsize);
  66. /**
  67. * tgt_pdev_spectral_init() - implementation for spectral init
  68. * @pdev: Pointer to pdev
  69. *
  70. * Return: On success, pointer to Spectral target_if internal private data, on
  71. * failure, NULL
  72. */
  73. void *
  74. tgt_pdev_spectral_init(struct wlan_objmgr_pdev *pdev);
  75. /**
  76. * tgt_pdev_spectral_deinit() - implementation for spectral de-init
  77. * @pdev: Pointer to pdev
  78. *
  79. * Return: None
  80. */
  81. void
  82. tgt_pdev_spectral_deinit(struct wlan_objmgr_pdev *pdev);
  83. /**
  84. * tgt_set_spectral_config() - Set spectral config
  85. * @pdev: Pointer to pdev object
  86. * @threshtype: spectral parameter type
  87. * @value: value to be configured for the given spectral parameter
  88. *
  89. * Implementation for setting spectral config
  90. *
  91. * Return: 0 on success else failure
  92. */
  93. int
  94. tgt_set_spectral_config(
  95. struct wlan_objmgr_pdev *pdev,
  96. const u_int32_t threshtype, const u_int32_t value);
  97. /**
  98. * tgt_get_spectral_config() - Get spectral configuration
  99. * @pdev: Pointer to pdev object
  100. * @param: Pointer to spectral_config structure in which the configuration
  101. * should be returned
  102. *
  103. * Implementation for getting the current spectral configuration
  104. *
  105. * Return: None
  106. */
  107. void
  108. tgt_get_spectral_config(
  109. struct wlan_objmgr_pdev *pdev,
  110. struct spectral_config *sptrl_config);
  111. /**
  112. * tgt_start_spectral_scan() - Start spectral scan
  113. * @pdev: Pointer to pdev object
  114. *
  115. * Implementation for starting spectral scan
  116. *
  117. * Return: 0 in case of success, -1 on failure
  118. */
  119. int
  120. tgt_start_spectral_scan(struct wlan_objmgr_pdev *pdev);
  121. /**
  122. * tgt_stop_spectral_scan() - Stop spectral scan
  123. * @pdev: Pointer to pdev object
  124. *
  125. * Implementation for stop spectral scan
  126. *
  127. * Return: None
  128. */
  129. void
  130. tgt_stop_spectral_scan(struct wlan_objmgr_pdev *pdev);
  131. /**
  132. * tgt_is_spectral_active() - Get whether Spectral is active
  133. * @pdev: Pointer to pdev object
  134. *
  135. * Implementation to get whether Spectral is active
  136. *
  137. * Return: True if Spectral is active, false if Spectral is not active
  138. */
  139. bool
  140. tgt_is_spectral_active(struct wlan_objmgr_pdev *pdev);
  141. /**
  142. * tgt_is_spectral_enabled() - Get whether Spectral is active
  143. * @pdev: Pointer to pdev object
  144. *
  145. * Implementation to get whether Spectral is active
  146. *
  147. * Return: True if Spectral is active, false if Spectral is not active
  148. */
  149. bool
  150. tgt_is_spectral_enabled(struct wlan_objmgr_pdev *pdev);
  151. /**
  152. * tgt_set_debug_level() - Set debug level for Spectral
  153. * @pdev: Pointer to pdev object
  154. * @debug_level: Debug level
  155. *
  156. * Implementation to set the debug level for Spectral
  157. *
  158. * Return: 0 in case of success
  159. */
  160. int
  161. tgt_set_debug_level(struct wlan_objmgr_pdev *pdev, u_int32_t debug_level);
  162. /**
  163. * tgt_get_debug_level() - Get debug level for Spectral
  164. * @pdev: Pointer to pdev object
  165. *
  166. * Implementation to get the debug level for Spectral
  167. *
  168. * Return: Current debug level
  169. */
  170. u_int32_t
  171. tgt_get_debug_level(struct wlan_objmgr_pdev *pdev);
  172. /**
  173. * tgt_get_spectral_capinfo() - Get Spectral capability information
  174. * @pdev: Pointer to pdev object
  175. * @outdata: Buffer into which data should be copied
  176. *
  177. * Implementation to get the spectral capability information
  178. *
  179. * Return: void
  180. */
  181. void
  182. tgt_get_spectral_capinfo(struct wlan_objmgr_pdev *pdev, void *outdata);
  183. /**
  184. * tgt_get_spectral_diagstats() - Get Spectral diagnostic statistics
  185. * @pdev: Pointer to pdev object
  186. * @outdata: Buffer into which data should be copied
  187. *
  188. * Implementation to get the spectral diagnostic statistics
  189. *
  190. * Return: void
  191. */
  192. void
  193. tgt_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev, void *outdata);
  194. /**
  195. * tgt_register_wmi_spectral_cmd_ops() - Register wmi_spectral_cmd_ops
  196. * @cmd_ops: Pointer to the structure having wmi_spectral_cmd function pointers
  197. * @pdev: Pointer to pdev object
  198. *
  199. * Implementation to register wmi_spectral_cmd_ops in spectral
  200. * internal data structure
  201. *
  202. * Return: void
  203. */
  204. void
  205. tgt_register_wmi_spectral_cmd_ops(
  206. struct wlan_objmgr_pdev *pdev,
  207. struct wmi_spectral_cmd_ops *cmd_ops);
  208. #endif /* _WLAN_SPECTRAL_TGT_API_H_ */