hal_be_reo.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Copyright (c) 2017-2019, 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 _HAL_REO_BE_H_
  20. #define _HAL_REO_BE_H_
  21. #include "hal_be_hw_headers.h"
  22. #include "hal_rx.h"
  23. #include "hal_reo.h"
  24. #define HAL_REO_QUEUE_EXT_DESC 10
  25. #define HAL_MAX_REO2SW_RINGS 8
  26. #define HAL_NUM_RX_RING_PER_IX_MAP 8
  27. #if defined(QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT) && \
  28. defined(RX_REO_QUEUE_STATISTICS_COUNTER_INDEX_MASK)
  29. static inline void hal_update_stats_counter_index(uint32_t *reo_queue_desc,
  30. uint8_t vdev_stats_id)
  31. {
  32. HAL_DESC_SET_FIELD(reo_queue_desc, RX_REO_QUEUE,
  33. STATISTICS_COUNTER_INDEX, vdev_stats_id);
  34. }
  35. #else
  36. static inline void hal_update_stats_counter_index(uint32_t *reo_queue_desc,
  37. uint8_t vdev_stats_id)
  38. {
  39. }
  40. #endif
  41. /* Proto-types */
  42. uint32_t hal_get_reo_reg_base_offset_be(void);
  43. int hal_reo_send_cmd_be(hal_soc_handle_t hal_soc_hdl,
  44. hal_ring_handle_t hal_ring_hdl,
  45. enum hal_reo_cmd_type cmd,
  46. void *params);
  47. /* REO status ring routines */
  48. void
  49. hal_reo_queue_stats_status_be(hal_ring_desc_t ring_desc,
  50. void *st_handle,
  51. hal_soc_handle_t hal_soc_hdl);
  52. void
  53. hal_reo_flush_queue_status_be(hal_ring_desc_t ring_desc,
  54. void *st_handle,
  55. hal_soc_handle_t hal_soc_hdl);
  56. void
  57. hal_reo_flush_cache_status_be(hal_ring_desc_t ring_desc,
  58. void *st_handle,
  59. hal_soc_handle_t hal_soc_hdl);
  60. void
  61. hal_reo_unblock_cache_status_be(hal_ring_desc_t ring_desc,
  62. hal_soc_handle_t hal_soc_hdl,
  63. void *st_handle);
  64. void hal_reo_flush_timeout_list_status_be(hal_ring_desc_t ring_desc,
  65. void *st_handle,
  66. hal_soc_handle_t hal_soc_hdl);
  67. void hal_reo_desc_thres_reached_status_be(hal_ring_desc_t ring_desc,
  68. void *st_handle,
  69. hal_soc_handle_t hal_soc_hdl);
  70. void
  71. hal_reo_rx_update_queue_status_be(hal_ring_desc_t ring_desc,
  72. void *st_handle,
  73. hal_soc_handle_t hal_soc_hdl);
  74. /**
  75. * hal_reo_init_cmd_ring_be() - Initialize descriptors of REO command SRNG
  76. * with command number
  77. * @hal_soc_hdl: Handle to HAL SoC structure
  78. * @hal_ring_hdl: Handle to HAL SRNG structure
  79. *
  80. * Return: none
  81. */
  82. void hal_reo_init_cmd_ring_be(hal_soc_handle_t hal_soc_hdl,
  83. hal_ring_handle_t hal_ring_hdl);
  84. uint8_t hal_get_tlv_hdr_size_be(void);
  85. #endif /* _HAL_REO_BE_H_ */