dp_be_tx.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. * Copyright (c) 2016-2021 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. #ifndef __DP_BE_TX_H
  19. #define __DP_BE_TX_H
  20. /**
  21. * DOC: dp_be_tx.h
  22. *
  23. * BE specific TX Datapath header file. Need not be exposed to common DP code.
  24. *
  25. */
  26. #include <dp_types.h>
  27. #include "dp_be.h"
  28. /* Invalid TX Bank ID value */
  29. #define DP_BE_INVALID_BANK_ID -1
  30. /**
  31. * dp_tx_hw_enqueue_be() - Enqueue to TCL HW for transmit for BE target
  32. * @soc: DP Soc Handle
  33. * @vdev: DP vdev handle
  34. * @tx_desc: Tx Descriptor Handle
  35. * @fw_metadata: Metadata to send to Target Firmware along with frame
  36. * @tx_exc_metadata: Handle that holds exception path meta data
  37. * @msdu_info: msdu_info containing information about TX buffer
  38. *
  39. * Gets the next free TCL HW DMA descriptor and sets up required parameters
  40. * from software Tx descriptor
  41. *
  42. * Return: QDF_STATUS_SUCCESS: success
  43. * QDF_STATUS_E_RESOURCES: Error return
  44. */
  45. QDF_STATUS dp_tx_hw_enqueue_be(struct dp_soc *soc, struct dp_vdev *vdev,
  46. struct dp_tx_desc_s *tx_desc,
  47. uint16_t fw_metadata,
  48. struct cdp_tx_exception_metadata *metadata,
  49. struct dp_tx_msdu_info_s *msdu_info);
  50. /**
  51. * dp_tx_comp_get_params_from_hal_desc_be() - Get TX desc from HAL comp desc
  52. * @soc: DP soc handle
  53. * @tx_comp_hal_desc: HAL TX Comp Descriptor
  54. * @r_tx_desc: SW Tx Descriptor retrieved from HAL desc.
  55. *
  56. * Return: None
  57. */
  58. void dp_tx_comp_get_params_from_hal_desc_be(struct dp_soc *soc,
  59. void *tx_comp_hal_desc,
  60. struct dp_tx_desc_s **r_tx_desc);
  61. /**
  62. * dp_tx_init_bank_profiles() - Init TX bank profiles
  63. * @soc: DP soc handle
  64. *
  65. * Return: QDF_STATUS_SUCCESS or QDF error code.
  66. */
  67. QDF_STATUS dp_tx_init_bank_profiles(struct dp_soc_be *soc);
  68. /**
  69. * dp_tx_deinit_bank_profiles() - De-Init TX bank profiles
  70. * @soc: DP soc handle
  71. *
  72. * Return: None
  73. */
  74. void dp_tx_deinit_bank_profiles(struct dp_soc_be *soc);
  75. /**
  76. * dp_tx_get_bank_profile() - get TX bank profile for vdev
  77. * @soc: DP soc handle
  78. * @be_vdev: BE vdev pointer
  79. *
  80. * Return: bank profile allocated to vdev or DP_BE_INVALID_BANK_ID
  81. */
  82. int dp_tx_get_bank_profile(struct dp_soc_be *soc,
  83. struct dp_vdev_be *be_vdev);
  84. /**
  85. * dp_tx_put_bank_profile() - release TX bank profile for vdev
  86. * @soc: DP soc handle
  87. *
  88. * Return: None
  89. */
  90. void dp_tx_put_bank_profile(struct dp_soc_be *soc, struct dp_vdev_be *be_vdev);
  91. /**
  92. * dp_tx_update_bank_profile() - release existing and allocate new bank profile
  93. * @soc: DP soc handle
  94. * @be_vdev: pointer to be_vdev structure
  95. *
  96. * The function releases the existing bank profile allocated to the vdev and
  97. * looks for a new bank profile based on updated dp_vdev TX params.
  98. *
  99. * Return: None
  100. */
  101. void dp_tx_update_bank_profile(struct dp_soc_be *be_soc,
  102. struct dp_vdev_be *be_vdev);
  103. /**
  104. * dp_tx_desc_pool_init_be() - Initialize Tx Descriptor pool(s)
  105. * @soc: Handle to DP Soc structure
  106. * @num_elem: number of descriptor in pool
  107. * @pool_id: pool ID to allocate
  108. *
  109. * Return: QDF_STATUS_SUCCESS - success, others - failure
  110. */
  111. QDF_STATUS dp_tx_desc_pool_init_be(struct dp_soc *soc,
  112. uint16_t num_elem,
  113. uint8_t pool_id);
  114. /**
  115. * dp_tx_desc_pool_deinit_be() - De-initialize Tx Descriptor pool(s)
  116. * @soc: Handle to DP Soc structure
  117. * @tx_desc_pool: Tx descriptor pool handler
  118. * @pool_id: pool ID to deinit
  119. *
  120. * Return: None
  121. */
  122. void dp_tx_desc_pool_deinit_be(struct dp_soc *soc,
  123. struct dp_tx_desc_pool_s *tx_desc_pool,
  124. uint8_t pool_id);
  125. #ifdef WLAN_FEATURE_NEAR_FULL_IRQ
  126. /**
  127. * dp_tx_comp_nf_handler() - Tx completion ring Near full scenario handler
  128. * @int_ctx: Interrupt context
  129. * @soc: Datapath SoC handle
  130. * @hal_ring_hdl: TX completion ring handle
  131. * @ring_id: TX completion ring number
  132. * @quota: Quota of the work to be done
  133. *
  134. * Return: work done
  135. */
  136. uint32_t dp_tx_comp_nf_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
  137. hal_ring_handle_t hal_ring_hdl, uint8_t ring_id,
  138. uint32_t quota);
  139. #else
  140. static inline
  141. uint32_t dp_tx_comp_nf_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
  142. hal_ring_handle_t hal_ring_hdl, uint8_t ring_id,
  143. uint32_t quota)
  144. {
  145. return 0;
  146. }
  147. #endif /* WLAN_FEATURE_NEAR_FULL_IRQ */
  148. #endif