dp_be_tx.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. /*
  2. * Copyright (c) 2016-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
  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 __DP_BE_TX_H
  20. #define __DP_BE_TX_H
  21. /**
  22. * DOC: dp_be_tx.h
  23. *
  24. * BE specific TX Datapath header file. Need not be exposed to common DP code.
  25. *
  26. */
  27. #include <dp_types.h>
  28. #include "dp_be.h"
  29. struct __attribute__((__packed__)) dp_tx_comp_peer_id {
  30. uint16_t peer_id:13,
  31. ml_peer_valid:1,
  32. reserved:2;
  33. };
  34. /* Invalid TX Bank ID value */
  35. #define DP_BE_INVALID_BANK_ID -1
  36. /**
  37. * dp_tx_hw_enqueue_be() - Enqueue to TCL HW for transmit for BE target
  38. * @soc: DP Soc Handle
  39. * @vdev: DP vdev handle
  40. * @tx_desc: Tx Descriptor Handle
  41. * @fw_metadata: Metadata to send to Target Firmware along with frame
  42. * @tx_exc_metadata: Handle that holds exception path meta data
  43. * @msdu_info: msdu_info containing information about TX buffer
  44. *
  45. * Gets the next free TCL HW DMA descriptor and sets up required parameters
  46. * from software Tx descriptor
  47. *
  48. * Return: QDF_STATUS_SUCCESS: success
  49. * QDF_STATUS_E_RESOURCES: Error return
  50. */
  51. QDF_STATUS dp_tx_hw_enqueue_be(struct dp_soc *soc, struct dp_vdev *vdev,
  52. struct dp_tx_desc_s *tx_desc,
  53. uint16_t fw_metadata,
  54. struct cdp_tx_exception_metadata *metadata,
  55. struct dp_tx_msdu_info_s *msdu_info);
  56. /**
  57. * dp_tx_comp_get_params_from_hal_desc_be() - Get TX desc from HAL comp desc
  58. * @soc: DP soc handle
  59. * @tx_comp_hal_desc: HAL TX Comp Descriptor
  60. * @r_tx_desc: SW Tx Descriptor retrieved from HAL desc.
  61. *
  62. * Return: None
  63. */
  64. void dp_tx_comp_get_params_from_hal_desc_be(struct dp_soc *soc,
  65. void *tx_comp_hal_desc,
  66. struct dp_tx_desc_s **r_tx_desc);
  67. /**
  68. * dp_tx_process_htt_completion_be() - Tx HTT Completion Indication Handler
  69. * @soc: Handle to DP soc structure
  70. * @tx_desc: software descriptor head pointer
  71. * @status : Tx completion status from HTT descriptor
  72. * @ring_id: ring number
  73. *
  74. * This function will process HTT Tx indication messages from Target
  75. *
  76. * Return: none
  77. */
  78. void dp_tx_process_htt_completion_be(struct dp_soc *soc,
  79. struct dp_tx_desc_s *tx_desc,
  80. uint8_t *status,
  81. uint8_t ring_id);
  82. /**
  83. * dp_tx_init_bank_profiles() - Init TX bank profiles
  84. * @soc: DP soc handle
  85. *
  86. * Return: QDF_STATUS_SUCCESS or QDF error code.
  87. */
  88. QDF_STATUS dp_tx_init_bank_profiles(struct dp_soc_be *soc);
  89. /**
  90. * dp_tx_deinit_bank_profiles() - De-Init TX bank profiles
  91. * @soc: DP soc handle
  92. *
  93. * Return: None
  94. */
  95. void dp_tx_deinit_bank_profiles(struct dp_soc_be *soc);
  96. /**
  97. * dp_tx_get_bank_profile() - get TX bank profile for vdev
  98. * @soc: DP soc handle
  99. * @be_vdev: BE vdev pointer
  100. *
  101. * Return: bank profile allocated to vdev or DP_BE_INVALID_BANK_ID
  102. */
  103. int dp_tx_get_bank_profile(struct dp_soc_be *soc,
  104. struct dp_vdev_be *be_vdev);
  105. /**
  106. * dp_tx_put_bank_profile() - release TX bank profile for vdev
  107. * @soc: DP soc handle
  108. *
  109. * Return: None
  110. */
  111. void dp_tx_put_bank_profile(struct dp_soc_be *soc, struct dp_vdev_be *be_vdev);
  112. /**
  113. * dp_tx_update_bank_profile() - release existing and allocate new bank profile
  114. * @soc: DP soc handle
  115. * @be_vdev: pointer to be_vdev structure
  116. *
  117. * The function releases the existing bank profile allocated to the vdev and
  118. * looks for a new bank profile based on updated dp_vdev TX params.
  119. *
  120. * Return: None
  121. */
  122. void dp_tx_update_bank_profile(struct dp_soc_be *be_soc,
  123. struct dp_vdev_be *be_vdev);
  124. /**
  125. * dp_tx_desc_pool_init_be() - Initialize Tx Descriptor pool(s)
  126. * @soc: Handle to DP Soc structure
  127. * @num_elem: number of descriptor in pool
  128. * @pool_id: pool ID to allocate
  129. *
  130. * Return: QDF_STATUS_SUCCESS - success, others - failure
  131. */
  132. QDF_STATUS dp_tx_desc_pool_init_be(struct dp_soc *soc,
  133. uint32_t num_elem,
  134. uint8_t pool_id);
  135. /**
  136. * dp_tx_desc_pool_deinit_be() - De-initialize Tx Descriptor pool(s)
  137. * @soc: Handle to DP Soc structure
  138. * @tx_desc_pool: Tx descriptor pool handler
  139. * @pool_id: pool ID to deinit
  140. *
  141. * Return: None
  142. */
  143. void dp_tx_desc_pool_deinit_be(struct dp_soc *soc,
  144. struct dp_tx_desc_pool_s *tx_desc_pool,
  145. uint8_t pool_id);
  146. #ifdef WLAN_FEATURE_11BE_MLO
  147. /**
  148. * dp_tx_mlo_mcast_handler_be() - Tx handler for Mcast packets
  149. * @soc: Handle to DP Soc structure
  150. * @vdev: DP vdev handle
  151. * @nbuf: nbuf to be enqueued
  152. *
  153. * Return: None
  154. */
  155. void dp_tx_mlo_mcast_handler_be(struct dp_soc *soc,
  156. struct dp_vdev *vdev,
  157. qdf_nbuf_t nbuf);
  158. #ifdef WLAN_MCAST_MLO
  159. #ifdef WLAN_MLO_MULTI_CHIP
  160. /**
  161. * dp_tx_mlo_mcast_pkt_send() - handler to send MLO Mcast packets
  162. * @be_vdev: Handle to DP be_vdev structure
  163. * @ptnr_vdev: DP ptnr_vdev handle
  164. * @nbuf: nbuf to be enqueued
  165. *
  166. * Return: None
  167. */
  168. void dp_tx_mlo_mcast_pkt_send(struct dp_vdev_be *be_vdev,
  169. struct dp_vdev *ptnr_vdev,
  170. void *arg);
  171. /**
  172. * dp_tx_mcast_mlo_reinject_routing_set() - mlo mcast reinject routing handler
  173. * @be_vdev: Handle to DP be_vdev structure
  174. * @cmd: cmd to set TQM/FW based reinjection
  175. *
  176. * Return: None
  177. */
  178. void dp_tx_mcast_mlo_reinject_routing_set(struct dp_soc *soc, void *arg);
  179. #endif
  180. #endif
  181. #endif
  182. #ifdef WLAN_FEATURE_NEAR_FULL_IRQ
  183. /**
  184. * dp_tx_comp_nf_handler() - Tx completion ring Near full scenario handler
  185. * @int_ctx: Interrupt context
  186. * @soc: Datapath SoC handle
  187. * @hal_ring_hdl: TX completion ring handle
  188. * @ring_id: TX completion ring number
  189. * @quota: Quota of the work to be done
  190. *
  191. * Return: work done
  192. */
  193. uint32_t dp_tx_comp_nf_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
  194. hal_ring_handle_t hal_ring_hdl, uint8_t ring_id,
  195. uint32_t quota);
  196. #else
  197. static inline
  198. uint32_t dp_tx_comp_nf_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
  199. hal_ring_handle_t hal_ring_hdl, uint8_t ring_id,
  200. uint32_t quota)
  201. {
  202. return 0;
  203. }
  204. #endif /* WLAN_FEATURE_NEAR_FULL_IRQ */
  205. #endif