wlan_ipa_ucfg_api.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. #else
  121. static inline bool ucfg_ipa_is_present(void)
  122. {
  123. return false;
  124. }
  125. static inline void ucfg_ipa_update_config(struct wlan_ipa_config *config)
  126. {
  127. }
  128. static inline
  129. QDF_STATUS ucfg_ipa_set_dp_handle(struct wlan_objmgr_psoc *psoc,
  130. void *dp_soc)
  131. {
  132. return QDF_STATUS_SUCCESS;
  133. }
  134. static inline
  135. QDF_STATUS ucfg_ipa_set_txrx_handle(struct wlan_objmgr_psoc *psoc,
  136. void *txrx_handle)
  137. {
  138. return QDF_STATUS_SUCCESS;
  139. }
  140. static inline
  141. QDF_STATUS ucfg_ipa_set_perf_level(struct wlan_objmgr_pdev *pdev,
  142. uint64_t tx_packets, uint64_t rx_packets)
  143. {
  144. return QDF_STATUS_SUCCESS;
  145. }
  146. static inline
  147. void ucfg_ipa_uc_info(struct wlan_objmgr_pdev *pdev)
  148. {
  149. }
  150. static inline
  151. void ucfg_ipa_uc_stat(struct wlan_objmgr_pdev *pdev)
  152. {
  153. }
  154. static inline
  155. void ucfg_ipa_uc_rt_debug_host_dump(struct wlan_objmgr_pdev *pdev)
  156. {
  157. }
  158. static inline
  159. void ucfg_ipa_dump_info(struct wlan_objmgr_pdev *pdev)
  160. {
  161. }
  162. static inline
  163. void ucfg_ipa_uc_stat_request(struct wlan_objmgr_pdev *pdev,
  164. uint8_t reason)
  165. {
  166. }
  167. static inline
  168. void ucfg_ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev,
  169. uint32_t *ipa_tx_diff, uint32_t *ipa_rx_diff)
  170. {
  171. }
  172. #endif /* IPA_OFFLOAD */
  173. #endif /* _WLAN_IPA_UCFG_API_H_ */