son_ucfg_api.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. /*
  2. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /**
  17. * DOC: contains interface prototypes for OS_IF layer
  18. */
  19. #ifndef _SON_UCFG_API_H_
  20. #define _SON_UCFG_API_H_
  21. #include <qdf_trace.h>
  22. #include <wlan_objmgr_pdev_obj.h>
  23. #include <wlan_mlme_ucfg_api.h>
  24. #include <son_api.h>
  25. /**
  26. * ucfg_son_get_operation_chan_freq_vdev_id() - get operating chan freq of
  27. * given vdev id
  28. * @pdev: Pointer to pdev
  29. * @vdev_id: vdev id
  30. *
  31. * Return: chan freq of given vdev id
  32. */
  33. qdf_freq_t
  34. ucfg_son_get_operation_chan_freq_vdev_id(struct wlan_objmgr_pdev *pdev,
  35. uint8_t vdev_id);
  36. /**
  37. * ucfg_son_get_min_and_max_power() - get min and max power
  38. * @psoc: pointer to psoc
  39. * @max_tx_power: max tx power(dBm units) to get.
  40. * @min_tx_power: min tx power(dBm units) to get.
  41. *
  42. * Return: Void
  43. */
  44. void ucfg_son_get_min_and_max_power(struct wlan_objmgr_psoc *psoc,
  45. int8_t *max_tx_power,
  46. int8_t *min_tx_power);
  47. /**
  48. * ucfg_son_is_cac_in_progress() - whether cac in progress or not
  49. * @vdev: Pointer to vdev
  50. *
  51. * Return: whether vdev in cac or not
  52. */
  53. bool ucfg_son_is_cac_in_progress(struct wlan_objmgr_vdev *vdev);
  54. /**
  55. * ucfg_son_get_sta_count() - get sta count
  56. * @vdev: Pointer to vdev
  57. *
  58. * Return: sta count
  59. */
  60. uint32_t ucfg_son_get_sta_count(struct wlan_objmgr_vdev *vdev);
  61. /**
  62. * ucfg_son_get_chan_flag() - get chan flag
  63. * @pdev: pointer to pdev
  64. * @freq: qdf_freq_t
  65. * @flag_160: whether 160 band width is enabled or not
  66. * @chan_params: chan parameters
  67. *
  68. * Return: chan flag
  69. */
  70. uint32_t ucfg_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
  71. qdf_freq_t freq, bool flag_160,
  72. struct ch_params *chan_params);
  73. /**
  74. * ucfg_son_get_he_supported() - get he supported
  75. * @psoc: pointer to psoc
  76. * @he_supported: he supported or not
  77. *
  78. * Return: void
  79. */
  80. #ifdef WLAN_FEATURE_11AX
  81. void ucfg_son_get_he_supported(struct wlan_objmgr_psoc *psoc,
  82. bool *he_supported);
  83. #else
  84. static inline void ucfg_son_get_he_supported(struct wlan_objmgr_psoc *psoc,
  85. bool *he_supported)
  86. {
  87. *he_supported = false;
  88. }
  89. #endif /*WLAN_FEATURE_11AX*/
  90. /**
  91. * ucfg_son_set_peer_kickout_allow() - set the peer is allowed to kickout
  92. * @vdev: pointer to vdev
  93. * @peer: pointer to peer
  94. * @kickout_allow: kickout_allow to set
  95. *
  96. * Return: QDF_STATUS_SUCCESS on Success else failure.
  97. */
  98. QDF_STATUS ucfg_son_set_peer_kickout_allow(struct wlan_objmgr_vdev *vdev,
  99. struct wlan_objmgr_peer *peer,
  100. bool kickout_allow);
  101. /**
  102. * ucfg_son_register_deliver_opmode_cb() - register deliver opmode cb
  103. * @psoc: pointer to psoc
  104. * @cb: deliver opmode callback
  105. *
  106. * Return: QDF_STATUS_SUCCESS on Success else failure.
  107. */
  108. QDF_STATUS ucfg_son_register_deliver_opmode_cb(struct wlan_objmgr_psoc *psoc,
  109. mlme_deliver_cb cb);
  110. /**
  111. * ucfg_son_register_deliver_smps_cb() - register deliver smps cb
  112. * @psoc: pointer to psoc
  113. * @cb: deliver smps callback
  114. *
  115. * Return: QDF_STATUS_SUCCESS on Success else failure.
  116. */
  117. QDF_STATUS ucfg_son_register_deliver_smps_cb(struct wlan_objmgr_psoc *psoc,
  118. mlme_deliver_cb cb);
  119. /**
  120. * ucfg_son_cbs_init() - son cbs init
  121. *
  122. * Return: 0 if succeed
  123. */
  124. int ucfg_son_cbs_init(void);
  125. /**
  126. * ucfg_son_cbs_deinit() - son cbs deinit
  127. *
  128. * Return: 0 if succeed
  129. */
  130. int ucfg_son_cbs_deinit(void);
  131. /**
  132. * ucfg_son_set_cbs() - son cbs set
  133. * @vdev: pointer to vdev
  134. * @enable: enable or disable son cbs
  135. *
  136. * Return: 0 if succeed
  137. */
  138. int ucfg_son_set_cbs(struct wlan_objmgr_vdev *vdev,
  139. bool enable);
  140. /**
  141. * ucfg_son_set_cbs_wait_time() - cbs wait time configure
  142. * @vdev: pointer to vdev
  143. * @val: wait time value
  144. *
  145. * Return: 0 if succeed
  146. */
  147. int ucfg_son_set_cbs_wait_time(struct wlan_objmgr_vdev *vdev,
  148. uint32_t val);
  149. /**
  150. * ucfg_son_set_cbs_dwell_split_time() - cbs dwell spilt time configure
  151. * @vdev: pointer to vdev
  152. * @val: dwell spilt time value
  153. *
  154. * Return: 0 if succeed
  155. */
  156. int ucfg_son_set_cbs_dwell_split_time(struct wlan_objmgr_vdev *vdev,
  157. uint32_t val);
  158. /**
  159. * ucfg_son_get_tx_power() - Gets the max transmit power for peer
  160. * @assoc_req_ies: assoc req ies
  161. *
  162. * Return: Returns the max tx power
  163. */
  164. uint8_t ucfg_son_get_tx_power(struct element_info assoc_req_ies);
  165. /**
  166. * ucfg_son_get_peer_rrm_info() - Get RRM info for peer
  167. * @assoc_req_ies: assoc req ies
  168. * @rrmcaps: rrm capabilities
  169. * @is_beacon_meas_supported: if beacon meas is supported
  170. *
  171. * Return: Returns QDF_STATUS_SUCCESS if succeed
  172. */
  173. QDF_STATUS ucfg_son_get_peer_rrm_info(struct element_info assoc_req_ies,
  174. uint8_t *rrmcaps,
  175. bool *is_beacon_meas_supported);
  176. /**
  177. * ucfg_son_vdev_get_supported_txrx_streams() - get supported spatial streams
  178. * @vdev: pointer to vdev
  179. * @num_tx_streams: pointer to number of tx streams
  180. * @num_rx_streams: pointer to number of rx streams
  181. *
  182. * Return: QDF_STATUS_SUCCESS on Success else failure.
  183. */
  184. QDF_STATUS
  185. ucfg_son_vdev_get_supported_txrx_streams(struct wlan_objmgr_vdev *vdev,
  186. uint32_t *num_tx_streams,
  187. uint32_t *num_rx_streams);
  188. /**
  189. * ucfg_son_get_vht_cap() - get the vht capability ie
  190. * @psoc: psoc object
  191. * @vht_caps: VHT caps bit fields
  192. *
  193. * Return: QDF_STATUS_SUCCESS on Success else failure.
  194. */
  195. QDF_STATUS ucfg_son_get_vht_cap(struct wlan_objmgr_psoc *psoc,
  196. int32_t *vht_caps);
  197. #ifdef WLAN_FEATURE_SON
  198. /* ucfg_son_disable_cbs() - son cbs disable
  199. * @vdev: vdev pointer
  200. *
  201. * Return: 0 if succeed
  202. */
  203. int ucfg_son_disable_cbs(struct wlan_objmgr_vdev *vdev);
  204. #else
  205. static inline int ucfg_son_disable_cbs(struct wlan_objmgr_vdev *vdev)
  206. {
  207. return -EINVAL;
  208. }
  209. #endif
  210. #endif