hal_be_reo.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (c) 2017-2019, 2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021 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. void hal_get_ba_aging_timeout_be(hal_soc_handle_t hal_soc_hdl, uint8_t ac,
  43. uint32_t *value);
  44. void hal_set_ba_aging_timeout_be(hal_soc_handle_t hal_soc_hdl, uint8_t ac,
  45. uint32_t value);
  46. uint32_t hal_get_reo_reg_base_offset_be(void);
  47. int hal_reo_send_cmd_be(hal_soc_handle_t hal_soc_hdl,
  48. hal_ring_handle_t hal_ring_hdl,
  49. enum hal_reo_cmd_type cmd,
  50. void *params);
  51. /* REO status ring routines */
  52. void
  53. hal_reo_queue_stats_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_queue_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_flush_cache_status_be(hal_ring_desc_t ring_desc,
  62. void *st_handle,
  63. hal_soc_handle_t hal_soc_hdl);
  64. void
  65. hal_reo_unblock_cache_status_be(hal_ring_desc_t ring_desc,
  66. hal_soc_handle_t hal_soc_hdl,
  67. void *st_handle);
  68. void hal_reo_flush_timeout_list_status_be(hal_ring_desc_t ring_desc,
  69. void *st_handle,
  70. hal_soc_handle_t hal_soc_hdl);
  71. void hal_reo_desc_thres_reached_status_be(hal_ring_desc_t ring_desc,
  72. void *st_handle,
  73. hal_soc_handle_t hal_soc_hdl);
  74. void
  75. hal_reo_rx_update_queue_status_be(hal_ring_desc_t ring_desc,
  76. void *st_handle,
  77. hal_soc_handle_t hal_soc_hdl);
  78. /**
  79. * hal_reo_init_cmd_ring_be() - Initialize descriptors of REO command SRNG
  80. * with command number
  81. * @hal_soc: Handle to HAL SoC structure
  82. * @hal_ring: Handle to HAL SRNG structure
  83. *
  84. * Return: none
  85. */
  86. void hal_reo_init_cmd_ring_be(hal_soc_handle_t hal_soc_hdl,
  87. hal_ring_handle_t hal_ring_hdl);
  88. uint8_t hal_get_tlv_hdr_size_be(void);
  89. #endif /* _HAL_REO_BE_H_ */