wlan_ipa_ucfg_api.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. /*
  2. * Copyright (c) 2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: Declare public API related to the wlan ipa called by north bound
  20. */
  21. #ifndef _WLAN_IPA_UCFG_API_H_
  22. #define _WLAN_IPA_UCFG_API_H_
  23. #include "wlan_ipa_public_struct.h"
  24. #include "wlan_ipa_obj_mgmt_api.h"
  25. #include "wlan_objmgr_pdev_obj.h"
  26. #ifdef IPA_OFFLOAD
  27. /**
  28. * ucfg_ipa_is_present() - get IPA hw status
  29. *
  30. * ipa_uc_reg_rdyCB is not directly designed to check
  31. * ipa hw status. This is an undocumented function which
  32. * has confirmed with IPA team.
  33. *
  34. * Return: true - ipa hw present
  35. * false - ipa hw not present
  36. */
  37. bool ucfg_ipa_is_present(void);
  38. /**
  39. * ucfg_ipa_update_config() - Update IPA component config
  40. *
  41. * Return: None
  42. */
  43. void ucfg_ipa_update_config(struct wlan_ipa_config *config);
  44. /**
  45. * ucfg_ipa_set_dp_handle() - register DP handle
  46. * @psoc: psoc handle
  47. * @dp_soc: data path soc handle
  48. *
  49. * Return: None
  50. */
  51. void ucfg_ipa_set_dp_handle(struct wlan_objmgr_psoc *psoc,
  52. void *dp_soc);
  53. /**
  54. * ucfg_ipa_set_txrx_handle() - register pdev txrx handler
  55. * @psoc: psoc handle
  56. * @psoc: psoc obj
  57. * @txrx_handle: data path pdev txrx handle
  58. *
  59. * Return: None
  60. */
  61. void ucfg_ipa_set_txrx_handle(struct wlan_objmgr_psoc *psoc,
  62. void *txrx_handle);
  63. /**
  64. * ucfg_ipa_set_perf_level() - Set IPA perf level
  65. * @pdev: pdev obj
  66. * @tx_packets: Number of packets transmitted in the last sample period
  67. * @rx_packets: Number of packets received in the last sample period
  68. *
  69. * Return: QDF_STATUS_SUCCESS on success
  70. */
  71. QDF_STATUS ucfg_ipa_set_perf_level(struct wlan_objmgr_pdev *pdev,
  72. uint64_t tx_packets, uint64_t rx_packets);
  73. /**
  74. * ucfg_ipa_uc_info() - Print IPA uC resource and session information
  75. * @pdev: pdev obj
  76. *
  77. * Return: None
  78. */
  79. void ucfg_ipa_uc_info(struct wlan_objmgr_pdev *pdev);
  80. /**
  81. * ucfg_ipa_uc_stat() - Print IPA uC stats
  82. * @pdev: pdev obj
  83. *
  84. * Return: None
  85. */
  86. void ucfg_ipa_uc_stat(struct wlan_objmgr_pdev *pdev);
  87. /**
  88. * ucfg_ipa_uc_rt_debug_host_dump() - IPA rt debug host dump
  89. * @pdev: pdev obj
  90. *
  91. * Return: None
  92. */
  93. void ucfg_ipa_uc_rt_debug_host_dump(struct wlan_objmgr_pdev *pdev);
  94. /**
  95. * ucfg_ipa_dump_info() - Dump IPA context information
  96. * @pdev: pdev obj
  97. *
  98. * Return: None
  99. */
  100. void ucfg_ipa_dump_info(struct wlan_objmgr_pdev *pdev);
  101. /**
  102. * ucfg_ipa_uc_stat_request() - Get IPA stats from IPA.
  103. * @pdev: pdev obj
  104. * @reason: STAT REQ Reason
  105. *
  106. * Return: None
  107. */
  108. void ucfg_ipa_uc_stat_request(struct wlan_objmgr_pdev *pdev,
  109. uint8_t reason);
  110. /**
  111. * ucfg_ipa_uc_stat_query() - Query the IPA stats
  112. * @pdev: pdev obj
  113. * @ipa_tx_diff: tx packet count diff from previous tx packet count
  114. * @ipa_rx_diff: rx packet count diff from previous rx packet count
  115. *
  116. * Return: None
  117. */
  118. void ucfg_ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev,
  119. uint32_t *ipa_tx_diff, uint32_t *ipa_rx_diff);
  120. /**
  121. * ucfg_ipa_reg_sap_xmit_cb() - Register upper layer SAP cb to transmit
  122. * @pdev: pdev obj
  123. * @cb: callback
  124. *
  125. * Return: None
  126. */
  127. void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb);
  128. /**
  129. * ucfg_ipa_reg_send_to_nw_cb() - Register cb to send IPA Rx packet to network
  130. * @pdev: pdev obj
  131. * @cb: callback
  132. *
  133. * Return: None
  134. */
  135. void ucfg_ipa_reg_send_to_nw_cb(struct wlan_objmgr_pdev *pdev, void *cb);
  136. /**
  137. * ucfg_ipa_set_mcc_mode() - Set MCC mode
  138. * @pdev: pdev obj
  139. * @mcc_mode: 0=MCC/1=SCC
  140. *
  141. * Return: void
  142. */
  143. void ucfg_ipa_set_mcc_mode(struct wlan_objmgr_pdev *pdev, bool mcc_mode);
  144. /**
  145. * ucfg_ipa_set_dfs_cac_tx() - Set DFS cac tx block
  146. * @pdev: pdev obj
  147. * @tx_block: dfs cac tx block
  148. *
  149. * Return: void
  150. */
  151. void ucfg_ipa_set_dfs_cac_tx(struct wlan_objmgr_pdev *pdev, bool tx_block);
  152. /**
  153. * ucfg_ipa_set_ap_ibss_fwd() - Set AP intra bss forward
  154. * @pdev: pdev obj
  155. * @intra_bss: enable or disable ap intra bss forward
  156. *
  157. * Return: void
  158. */
  159. void ucfg_ipa_set_ap_ibss_fwd(struct wlan_objmgr_pdev *pdev, bool intra_bss);
  160. /**
  161. * ucfg_ipa_uc_force_pipe_shutdown() - Force shutdown IPA pipe
  162. * @pdev: pdev obj
  163. *
  164. * Return: void
  165. */
  166. void ucfg_ipa_uc_force_pipe_shutdown(struct wlan_objmgr_pdev *pdev);
  167. #else
  168. static inline bool ucfg_ipa_is_present(void)
  169. {
  170. return false;
  171. }
  172. static inline void ucfg_ipa_update_config(struct wlan_ipa_config *config)
  173. {
  174. }
  175. static inline
  176. QDF_STATUS ucfg_ipa_set_dp_handle(struct wlan_objmgr_psoc *psoc,
  177. void *dp_soc)
  178. {
  179. return QDF_STATUS_SUCCESS;
  180. }
  181. static inline
  182. QDF_STATUS ucfg_ipa_set_txrx_handle(struct wlan_objmgr_psoc *psoc,
  183. void *txrx_handle)
  184. {
  185. return QDF_STATUS_SUCCESS;
  186. }
  187. static inline
  188. QDF_STATUS ucfg_ipa_set_perf_level(struct wlan_objmgr_pdev *pdev,
  189. uint64_t tx_packets, uint64_t rx_packets)
  190. {
  191. return QDF_STATUS_SUCCESS;
  192. }
  193. static inline
  194. void ucfg_ipa_uc_info(struct wlan_objmgr_pdev *pdev)
  195. {
  196. }
  197. static inline
  198. void ucfg_ipa_uc_stat(struct wlan_objmgr_pdev *pdev)
  199. {
  200. }
  201. static inline
  202. void ucfg_ipa_uc_rt_debug_host_dump(struct wlan_objmgr_pdev *pdev)
  203. {
  204. }
  205. static inline
  206. void ucfg_ipa_dump_info(struct wlan_objmgr_pdev *pdev)
  207. {
  208. }
  209. static inline
  210. void ucfg_ipa_uc_stat_request(struct wlan_objmgr_pdev *pdev,
  211. uint8_t reason)
  212. {
  213. }
  214. static inline
  215. void ucfg_ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev,
  216. uint32_t *ipa_tx_diff, uint32_t *ipa_rx_diff)
  217. {
  218. }
  219. static inline
  220. void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb)
  221. {
  222. }
  223. static inline
  224. void ucfg_ipa_reg_send_to_nw_cb(struct wlan_objmgr_pdev *pdev, void *cb)
  225. {
  226. }
  227. static inline
  228. void ucfg_ipa_set_mcc_mode(struct wlan_objmgr_pdev *pdev, bool mcc_mode)
  229. {
  230. }
  231. static inline
  232. void ucfg_ipa_set_dfs_cac_tx(struct wlan_objmgr_pdev *pdev, bool tx_block)
  233. {
  234. }
  235. static inline
  236. void ucfg_ipa_set_ap_ibss_fwd(struct wlan_objmgr_pdev *pdev, bool intra_bss)
  237. {
  238. }
  239. static inline
  240. void ucfg_ipa_uc_force_pipe_shutdown(struct wlan_objmgr_pdev *pdev)
  241. {
  242. }
  243. #endif /* IPA_OFFLOAD */
  244. #endif /* _WLAN_IPA_UCFG_API_H_ */