dp_be_rx.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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_RX_H_
  19. #define _DP_BE_RX_H_
  20. #include <dp_types.h>
  21. #include "dp_be.h"
  22. #ifndef QCA_HOST_MODE_WIFI_DISABLED
  23. /*
  24. * dp_rx_intrabss_fwd_be() - API for intrabss fwd. For EAPOL
  25. * pkt with DA not equal to vdev mac addr, fwd is not allowed.
  26. * @soc: core txrx main context
  27. * @ta_peer: source peer entry
  28. * @rx_tlv_hdr: start address of rx tlvs
  29. * @nbuf: nbuf that has to be intrabss forwarded
  30. * @msdu_metadata: msdu metadata
  31. *
  32. * Return: true if it is forwarded else false
  33. */
  34. bool dp_rx_intrabss_fwd_be(struct dp_soc *soc,
  35. struct dp_peer *ta_peer,
  36. uint8_t *rx_tlv_hdr,
  37. qdf_nbuf_t nbuf,
  38. struct hal_rx_msdu_metadata msdu_metadata);
  39. #endif
  40. uint32_t dp_rx_process_be(struct dp_intr *int_ctx,
  41. hal_ring_handle_t hal_ring_hdl, uint8_t reo_ring_num,
  42. uint32_t quota);
  43. /**
  44. * dp_rx_desc_pool_init_be() - Initialize Rx Descriptor pool(s)
  45. * @soc: Handle to DP Soc structure
  46. * @rx_desc_pool: Rx descriptor pool handler
  47. * @pool_id: Rx descriptor pool ID
  48. *
  49. * Return: QDF_STATUS_SUCCESS - succeeded, others - failed
  50. */
  51. QDF_STATUS dp_rx_desc_pool_init_be(struct dp_soc *soc,
  52. struct rx_desc_pool *rx_desc_pool,
  53. uint32_t pool_id);
  54. /**
  55. * dp_rx_desc_pool_deinit_be() - De-initialize Rx Descriptor pool(s)
  56. * @soc: Handle to DP Soc structure
  57. * @rx_desc_pool: Rx descriptor pool handler
  58. * @pool_id: Rx descriptor pool ID
  59. *
  60. * Return: None
  61. */
  62. void dp_rx_desc_pool_deinit_be(struct dp_soc *soc,
  63. struct rx_desc_pool *rx_desc_pool,
  64. uint32_t pool_id);
  65. /**
  66. * dp_wbm_get_rx_desc_from_hal_desc_be() - Get corresponding Rx Desc
  67. * address from WBM ring Desc
  68. * @soc: Handle to DP Soc structure
  69. * @ring_desc: ring descriptor structure pointer
  70. * @r_rx_desc: pointer to a pointer of Rx Desc
  71. *
  72. * Return: QDF_STATUS_SUCCESS - succeeded, others - failed
  73. */
  74. QDF_STATUS dp_wbm_get_rx_desc_from_hal_desc_be(struct dp_soc *soc,
  75. void *ring_desc,
  76. struct dp_rx_desc **r_rx_desc);
  77. /**
  78. * dp_rx_desc_cookie_2_va_be() - Convert RX Desc cookie ID to VA
  79. * @soc:Handle to DP Soc structure
  80. * @cookie: cookie used to lookup virtual address
  81. *
  82. * Return: Rx descriptor virtual address
  83. */
  84. struct dp_rx_desc *dp_rx_desc_cookie_2_va_be(struct dp_soc *soc,
  85. uint32_t cookie);
  86. #if !defined(DP_FEATURE_HW_COOKIE_CONVERSION) || \
  87. defined(DP_HW_COOKIE_CONVERT_EXCEPTION)
  88. /**
  89. * dp_rx_desc_sw_cc_check() - check if RX desc VA is got correctly,
  90. if not, do SW cookie conversion.
  91. * @soc:Handle to DP Soc structure
  92. * @rx_buf_cookie: RX desc cookie ID
  93. * @r_rx_desc: double pointer for RX desc
  94. *
  95. * Return: None
  96. */
  97. static inline void
  98. dp_rx_desc_sw_cc_check(struct dp_soc *soc,
  99. uint32_t rx_buf_cookie,
  100. struct dp_rx_desc **r_rx_desc)
  101. {
  102. if (qdf_unlikely(!(*r_rx_desc))) {
  103. *r_rx_desc = (struct dp_rx_desc *)
  104. dp_cc_desc_find(soc,
  105. rx_buf_cookie);
  106. }
  107. }
  108. #else
  109. static inline void
  110. dp_rx_desc_sw_cc_check(struct dp_soc *soc,
  111. uint32_t rx_buf_cookie,
  112. struct dp_rx_desc **r_rx_desc)
  113. {
  114. }
  115. #endif /* DP_FEATURE_HW_COOKIE_CONVERSION && DP_HW_COOKIE_CONVERT_EXCEPTION */
  116. #ifdef WLAN_FEATURE_NEAR_FULL_IRQ
  117. /**
  118. * dp_rx_nf_process() - Near Full state handler for RX rings.
  119. * @int_ctx: interrupt context
  120. * @hal_ring_hdl: Rx ring handle
  121. * @reo_ring_num: RX ring number
  122. * @quota: Quota of work to be done
  123. *
  124. * Return: work done in the handler
  125. */
  126. uint32_t dp_rx_nf_process(struct dp_intr *int_ctx,
  127. hal_ring_handle_t hal_ring_hdl,
  128. uint8_t reo_ring_num,
  129. uint32_t quota);
  130. #else
  131. static inline
  132. uint32_t dp_rx_nf_process(struct dp_intr *int_ctx,
  133. hal_ring_handle_t hal_ring_hdl,
  134. uint8_t reo_ring_num,
  135. uint32_t quota)
  136. {
  137. return 0;
  138. }
  139. #endif /*WLAN_FEATURE_NEAR_FULL_IRQ */
  140. #endif