dp_li_tx.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 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_LI_TX_H
  20. #define __DP_LI_TX_H
  21. #include <dp_types.h>
  22. /**
  23. * dp_tx_hw_enqueue_li() - Enqueue to TCL HW for transmit
  24. * @soc: DP Soc Handle
  25. * @vdev: DP vdev handle
  26. * @tx_desc: Tx Descriptor Handle
  27. * @fw_metadata: Metadata to send to Target Firmware along with frame
  28. * @tx_exc_metadata: Handle that holds exception path meta data
  29. * @msdu_info: MSDU information
  30. *
  31. * Gets the next free TCL HW DMA descriptor and sets up required parameters
  32. * from software Tx descriptor
  33. *
  34. * Return: QDF_STATUS_SUCCESS: success
  35. * QDF_STATUS_E_RESOURCES: Error return
  36. */
  37. QDF_STATUS
  38. dp_tx_hw_enqueue_li(struct dp_soc *soc, struct dp_vdev *vdev,
  39. struct dp_tx_desc_s *tx_desc, uint16_t fw_metadata,
  40. struct cdp_tx_exception_metadata *tx_exc_metadata,
  41. struct dp_tx_msdu_info_s *msdu_info);
  42. /**
  43. * dp_tx_comp_get_params_from_hal_desc_li() - Get TX desc from HAL comp desc
  44. * @soc: DP soc handle
  45. * @tx_comp_hal_desc: HAL TX Comp Descriptor
  46. * @r_tx_desc: SW Tx Descriptor retrieved from HAL desc.
  47. *
  48. * Return: QDF_STATUS
  49. */
  50. QDF_STATUS
  51. dp_tx_comp_get_params_from_hal_desc_li(struct dp_soc *soc,
  52. void *tx_comp_hal_desc,
  53. struct dp_tx_desc_s **r_tx_desc);
  54. /**
  55. * dp_tx_process_htt_completion_li() - Tx HTT Completion Indication Handler
  56. * @soc: Handle to DP soc structure
  57. * @tx_desc: software descriptor head pointer
  58. * @status: Tx completion status from HTT descriptor
  59. * @ring_id: ring number
  60. *
  61. * This function will process HTT Tx indication messages from Target
  62. *
  63. * Return: none
  64. */
  65. void dp_tx_process_htt_completion_li(struct dp_soc *soc,
  66. struct dp_tx_desc_s *tx_desc,
  67. uint8_t *status,
  68. uint8_t ring_id);
  69. /**
  70. * dp_tx_desc_pool_init_li() - Initialize Tx Descriptor pool(s)
  71. * @soc: Handle to DP Soc structure
  72. * @num_elem: pool descriptor number
  73. * @pool_id: pool to allocate
  74. * @spcl_tx_desc: if special desc
  75. *
  76. * Return: QDF_STATUS_SUCCESS - success, others - failure
  77. */
  78. QDF_STATUS dp_tx_desc_pool_init_li(struct dp_soc *soc,
  79. uint32_t num_elem,
  80. uint8_t pool_id,
  81. bool spcl_tx_desc);
  82. /**
  83. * dp_tx_desc_pool_deinit_li() - De-initialize Tx Descriptor pool(s)
  84. * @soc: Handle to DP Soc structure
  85. * @tx_desc_pool: Tx descriptor pool handler
  86. * @pool_id: pool to deinit
  87. * @spcl_tx_desc: if special desc
  88. *
  89. * Return: None.
  90. */
  91. void dp_tx_desc_pool_deinit_li(struct dp_soc *soc,
  92. struct dp_tx_desc_pool_s *tx_desc_pool,
  93. uint8_t pool_id, bool spcl_tx_desc);
  94. /**
  95. * dp_tx_compute_tx_delay_li() - Compute HW Tx completion delay
  96. * @soc: Handle to DP Soc structure
  97. * @vdev: vdev
  98. * @ts: Tx completion status
  99. * @delay_us: Delay to be calculated in microseconds
  100. *
  101. * Return: QDF_STATUS
  102. */
  103. QDF_STATUS dp_tx_compute_tx_delay_li(struct dp_soc *soc,
  104. struct dp_vdev *vdev,
  105. struct hal_tx_completion_status *ts,
  106. uint32_t *delay_us);
  107. /**
  108. * dp_tx_desc_pool_alloc_li() - Allocate TX descriptor pool
  109. * @soc: Handle to DP Soc structure
  110. * @num_elem: Number of elements to allocate
  111. * @pool_id: TCL descriptor pool ID
  112. *
  113. * Return: QDF_STATUS
  114. */
  115. QDF_STATUS dp_tx_desc_pool_alloc_li(struct dp_soc *soc, uint32_t num_elem,
  116. uint8_t pool_id);
  117. /**
  118. * dp_tx_desc_pool_free_li() - Free TX descriptor pool
  119. * @soc: Handle to DP Soc structure
  120. * @pool_id: TCL descriptor pool ID
  121. *
  122. * Return: none
  123. */
  124. void dp_tx_desc_pool_free_li(struct dp_soc *soc, uint8_t pool_id);
  125. #endif