son_ucfg_api.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /*
  2. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 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. /* ucfg_son_cbs_deinit - son cbs deinit
  126. *
  127. * Return: 0 if succeed
  128. */
  129. int ucfg_son_cbs_deinit(void);
  130. /* ucfg_son_set_cbs() - son cbs set
  131. * @vdev: pointer to vdev
  132. * @enable: enable or disable son cbs
  133. *
  134. * Return: 0 if succeed
  135. */
  136. int ucfg_son_set_cbs(struct wlan_objmgr_vdev *vdev,
  137. bool enable);
  138. /* ucfg_son_set_cbs_wait_time() - cbs wait time configure
  139. * @vdev: pointer to vdev
  140. * @val: wait time value
  141. *
  142. * Return: 0 if succeed
  143. */
  144. int ucfg_son_set_cbs_wait_time(struct wlan_objmgr_vdev *vdev,
  145. uint32_t val);
  146. /* ucfg_son_set_cbs_dwell_split_time() - cbs dwell spilt time configure
  147. * @vdev: pointer to vdev
  148. * @val: dwell spilt time value
  149. *
  150. * Return: 0 if succeed
  151. */
  152. int ucfg_son_set_cbs_dwell_split_time(struct wlan_objmgr_vdev *vdev,
  153. uint32_t val);
  154. /**
  155. * ucfg_son_get_max_tx_power() - Gets the max transmit power for peer
  156. * @assoc_req_ies: assoc req ies
  157. *
  158. * Return: Returns the max tx power
  159. */
  160. uint8_t ucfg_son_get_tx_power(struct element_info assoc_req_ies);
  161. /**
  162. * ucfg_get_max_mcs() - calculate the max mcs supported by the node
  163. * @mode: current phy mode
  164. * @supp_idx: max supported idx
  165. * @ext_idx: max extended idx
  166. * @ht_mcs_idx: max mcs index for HT
  167. * @vht_mcs_map: mcs map for VHT
  168. *
  169. * Return: max_mcs for the node
  170. */
  171. uint8_t ucfg_son_get_max_mcs(uint8_t mode, uint8_t supp_idx, uint8_t ext_idx,
  172. uint8_t ht_mcs_idx, uint8_t vht_mcs_map);
  173. /**
  174. * ucfg_son_get_peer_rrm_info() - Get RRM info for peer
  175. * @assoc_req_ies: assoc req ies
  176. * @rrmcaps: rrm capabiities
  177. * @is_beacon_meas_supported: if beacon meas is supported
  178. *
  179. * Return: Returns QDF_STATUS_SUCCESS if succeed
  180. */
  181. QDF_STATUS ucfg_son_get_peer_rrm_info(struct element_info assoc_req_ies,
  182. uint8_t *rrmcaps,
  183. bool *is_beacon_meas_supported);
  184. /**
  185. * ucfg_son_vdev_get_supported_txrx_streams() - get supported spatial streams
  186. * @vdev: pointer to vdev
  187. * @num_tx_streams: pointer to number of tx streams
  188. * @num_rx_streams: pointer to number of rx streams
  189. *
  190. * Return: QDF_STATUS_SUCCESS on Success else failure.
  191. */
  192. QDF_STATUS
  193. ucfg_son_vdev_get_supported_txrx_streams(struct wlan_objmgr_vdev *vdev,
  194. uint32_t *num_tx_streams,
  195. uint32_t *num_rx_streams);
  196. /**
  197. * ucfg_son_get_vht_cap() - get the vht capability ie
  198. * @psoc: psoc object
  199. * @vht_caps: VHT caps bit fields
  200. *
  201. * Return: QDF_STATUS_SUCCESS on Success else failure.
  202. */
  203. QDF_STATUS ucfg_son_get_vht_cap(struct wlan_objmgr_psoc *psoc,
  204. int32_t *vht_caps);
  205. #ifdef WLAN_FEATURE_SON
  206. /* ucfg_son_disable_cbs() - son cbs disable
  207. * @vdev: vdev pointer
  208. *
  209. * Return: 0 if succeed
  210. */
  211. int ucfg_son_disable_cbs(struct wlan_objmgr_vdev *vdev);
  212. #else
  213. static inline int ucfg_son_disable_cbs(struct wlan_objmgr_vdev *vdev)
  214. {
  215. return -EINVAL;
  216. }
  217. #endif
  218. #endif