dp_rh_rx.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. /*
  2. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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_RH_RX_H_
  19. #define _DP_RH_RX_H_
  20. #include <dp_types.h>
  21. #include <dp_rx.h>
  22. #include "dp_rh.h"
  23. /**
  24. * dp_rx_desc_pool_init_rh() - Initialize Rx Descriptor pool(s)
  25. * @soc: Handle to DP Soc structure
  26. * @rx_desc_pool: Rx descriptor pool handler
  27. * @pool_id: Rx descriptor pool ID
  28. *
  29. * Return: None
  30. */
  31. QDF_STATUS dp_rx_desc_pool_init_rh(struct dp_soc *soc,
  32. struct rx_desc_pool *rx_desc_pool,
  33. uint32_t pool_id);
  34. /**
  35. * dp_rx_desc_pool_deinit_rh() - De-initialize Rx Descriptor pool(s)
  36. * @soc: Handle to DP Soc structure
  37. * @rx_desc_pool: Rx descriptor pool handler
  38. * @pool_id: Rx descriptor pool ID
  39. *
  40. * Return: None
  41. */
  42. void dp_rx_desc_pool_deinit_rh(struct dp_soc *soc,
  43. struct rx_desc_pool *rx_desc_pool,
  44. uint32_t pool_id);
  45. /**
  46. * dp_rx_desc_cookie_2_va_rh() - Convert RX Desc cookie ID to VA
  47. * @soc:Handle to DP Soc structure
  48. * @cookie: cookie used to lookup virtual address
  49. *
  50. * Return: Rx descriptor virtual address
  51. */
  52. static inline
  53. struct dp_rx_desc *dp_rx_desc_cookie_2_va_rh(struct dp_soc *soc,
  54. uint32_t cookie)
  55. {
  56. return dp_rx_cookie_2_va_rxdma_buf(soc, cookie);
  57. }
  58. #define DP_PEER_METADATA_VDEV_ID_MASK 0x003f0000
  59. #define DP_PEER_METADATA_VDEV_ID_SHIFT 16
  60. #define DP_PEER_METADATA_OFFLOAD_MASK 0x01000000
  61. #define DP_PEER_METADATA_OFFLOAD_SHIFT 24
  62. #define DP_PEER_METADATA_VDEV_ID_GET_RH(_peer_metadata) \
  63. (((_peer_metadata) & DP_PEER_METADATA_VDEV_ID_MASK) \
  64. >> DP_PEER_METADATA_VDEV_ID_SHIFT)
  65. #define DP_PEER_METADATA_OFFLOAD_GET_RH(_peer_metadata) \
  66. (((_peer_metadata) & DP_PEER_METADATA_OFFLOAD_MASK) \
  67. >> DP_PEER_METADATA_OFFLOAD_SHIFT)
  68. static inline uint16_t
  69. dp_rx_peer_metadata_peer_id_get_rh(struct dp_soc *soc, uint32_t peer_metadata)
  70. {
  71. struct htt_rx_peer_metadata_v0 *metadata =
  72. (struct htt_rx_peer_metadata_v0 *)&peer_metadata;
  73. return metadata->peer_id;
  74. }
  75. /**
  76. * dp_rx_data_flush() - Flush RX data after reaping from RX rings
  77. *
  78. * @data: reference to flush RX data
  79. *
  80. * Return: None
  81. */
  82. void
  83. dp_rx_data_flush(void *data);
  84. /**
  85. * dp_rx_data_indication_handler() - Indicate when RX data is available in rings
  86. *
  87. * @soc:DP soc reference
  88. * @data_ind: Data indication message info
  89. * @vdev_id: Vdev id
  90. * @peer_id: Peer id
  91. * @msdu_count: Number of MSDUs available in message
  92. *
  93. * Return: None
  94. */
  95. void
  96. dp_rx_data_indication_handler(struct dp_soc *soc, qdf_nbuf_t data_ind,
  97. uint16_t vdev_id, uint16_t peer_id,
  98. uint16_t msdu_count);
  99. /**
  100. * dp_rx_frag_indication_handler() - Indicate when RX frag data is available in ring
  101. *
  102. * @soc:DP soc reference
  103. * @data_ind: Data indication message info
  104. * @vdev_id: Vdev id
  105. * @peer_id: Peer id
  106. *
  107. * Return: None
  108. */
  109. void
  110. dp_rx_frag_indication_handler(struct dp_soc *soc, qdf_nbuf_t data_ind,
  111. uint16_t vdev_id, uint16_t peer_id);
  112. static inline bool
  113. dp_rx_intrabss_handle_nawds_rh(struct dp_soc *soc, struct dp_txrx_peer *ta_peer,
  114. qdf_nbuf_t nbuf_copy,
  115. struct cdp_tid_rx_stats *tid_stats,
  116. uint8_t link_id)
  117. {
  118. return false;
  119. }
  120. /**
  121. * dp_wbm_get_rx_desc_from_hal_desc_rh() - NOP in RH arch implementation
  122. *
  123. * @soc: Handle to DP Soc structure
  124. * @ring_desc: ring descriptor structure pointer
  125. * @r_rx_desc: pointer to a pointer of Rx Desc
  126. *
  127. * Return: QDF_STATUS_SUCCESS - succeeded, others - failed
  128. */
  129. static inline
  130. QDF_STATUS dp_wbm_get_rx_desc_from_hal_desc_rh(
  131. struct dp_soc *soc,
  132. void *ring_desc,
  133. struct dp_rx_desc **r_rx_desc)
  134. {
  135. return QDF_STATUS_SUCCESS;
  136. }
  137. static inline
  138. void dp_rx_word_mask_subscribe_rh(struct dp_soc *soc,
  139. uint32_t *msg_word,
  140. void *rx_filter)
  141. {
  142. }
  143. static inline
  144. void dp_peer_get_reo_hash_rh(struct dp_vdev *vdev,
  145. struct cdp_peer_setup_info *setup_info,
  146. enum cdp_host_reo_dest_ring *reo_dest,
  147. bool *hash_based,
  148. uint8_t *lmac_peer_id_msb)
  149. {
  150. }
  151. static inline
  152. bool dp_reo_remap_config_rh(struct dp_soc *soc,
  153. uint32_t *remap0,
  154. uint32_t *remap1,
  155. uint32_t *remap2)
  156. {
  157. return false;
  158. }
  159. /**
  160. * dp_rx_prefetch_hw_sw_nbuf_desc() - function to prefetch HW and SW desc
  161. * @soc: DP soc structure
  162. * @hal_soc: Handle to HAL Soc structure
  163. * @quota: quota to process
  164. * @hal_ring_hdl: Destination ring pointer
  165. * @last_prefetched_hw_desc: pointer to the last prefetched HW descriptor
  166. * @last_prefetched_sw_desc: input & output param of last prefetch SW desc
  167. *
  168. * Return: None
  169. */
  170. static inline
  171. void dp_rx_prefetch_hw_sw_nbuf_desc(struct dp_soc *soc,
  172. hal_soc_handle_t hal_soc,
  173. uint32_t quota,
  174. hal_ring_handle_t hal_ring_hdl,
  175. hal_ring_desc_t *last_prefetched_hw_desc,
  176. struct dp_rx_desc **last_prefetched_sw_desc)
  177. {
  178. }
  179. /**
  180. * dp_peer_rx_reorder_queue_setup_rh() - NOP for RH arch implementation
  181. * @soc: Handle to HAL Soc structure
  182. * @peer: DP peer structure
  183. * @tid_bitmap: tids to be set up
  184. * @ba_window_size: BA window size
  185. *
  186. * Return: None
  187. */
  188. static inline
  189. QDF_STATUS dp_peer_rx_reorder_queue_setup_rh(struct dp_soc *soc,
  190. struct dp_peer *peer,
  191. uint32_t tid_bitmap,
  192. uint32_t ba_window_size)
  193. {
  194. return QDF_STATUS_SUCCESS;
  195. }
  196. #endif