dp_li_rx.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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_LI_RX_H_
  19. #define _DP_LI_RX_H_
  20. #include <dp_types.h>
  21. #include <dp_rx.h>
  22. #include "dp_li.h"
  23. uint32_t dp_rx_process_li(struct dp_intr *int_ctx,
  24. hal_ring_handle_t hal_ring_hdl, uint8_t reo_ring_num,
  25. uint32_t quota);
  26. /**
  27. * dp_rx_desc_pool_init_li() - Initialize Rx Descriptor pool(s)
  28. * @soc: Handle to DP Soc structure
  29. * @rx_desc_pool: Rx descriptor pool handler
  30. * @pool_id: Rx descriptor pool ID
  31. *
  32. * Return: None
  33. */
  34. QDF_STATUS dp_rx_desc_pool_init_li(struct dp_soc *soc,
  35. struct rx_desc_pool *rx_desc_pool,
  36. uint32_t pool_id);
  37. /**
  38. * dp_rx_desc_pool_deinit_li() - De-initialize Rx Descriptor pool(s)
  39. * @soc: Handle to DP Soc structure
  40. * @rx_desc_pool: Rx descriptor pool handler
  41. * @pool_id: Rx descriptor pool ID
  42. *
  43. * Return: None
  44. */
  45. void dp_rx_desc_pool_deinit_li(struct dp_soc *soc,
  46. struct rx_desc_pool *rx_desc_pool,
  47. uint32_t pool_id);
  48. /**
  49. * dp_wbm_get_rx_desc_from_hal_desc_li() - Get corresponding Rx Desc
  50. * address from WBM ring Desc
  51. * @soc: Handle to DP Soc structure
  52. * @ring_desc: ring descriptor structure pointer
  53. * @r_rx_desc: pointer to a pointer of Rx Desc
  54. *
  55. * Return: QDF_STATUS_SUCCESS - succeeded, others - failed
  56. */
  57. QDF_STATUS dp_wbm_get_rx_desc_from_hal_desc_li(
  58. struct dp_soc *soc,
  59. void *ring_desc,
  60. struct dp_rx_desc **r_rx_desc);
  61. /**
  62. * dp_rx_desc_cookie_2_va_li() - Convert RX Desc cookie ID to VA
  63. * @soc:Handle to DP Soc structure
  64. * @cookie: cookie used to lookup virtual address
  65. *
  66. * Return: Rx descriptor virtual address
  67. */
  68. static inline
  69. struct dp_rx_desc *dp_rx_desc_cookie_2_va_li(struct dp_soc *soc,
  70. uint32_t cookie)
  71. {
  72. return dp_rx_cookie_2_va_rxdma_buf(soc, cookie);
  73. }
  74. #endif