hal_be_reo.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
  28. static inline void hal_update_stats_counter_index(uint32_t *reo_queue_desc,
  29. uint8_t vdev_stats_id)
  30. {
  31. #ifdef RX_REO_QUEUE_STATISTICS_COUNTER_INDEX_MASK
  32. HAL_DESC_SET_FIELD(reo_queue_desc, RX_REO_QUEUE,
  33. STATISTICS_COUNTER_INDEX, vdev_stats_id);
  34. #endif
  35. }
  36. #else
  37. static inline void hal_update_stats_counter_index(uint32_t *reo_queue_desc,
  38. uint8_t vdev_stats_id)
  39. {
  40. }
  41. #endif
  42. /* Proto-types */
  43. void hal_get_ba_aging_timeout_be(hal_soc_handle_t hal_soc_hdl, uint8_t ac,
  44. uint32_t *value);
  45. void hal_set_ba_aging_timeout_be(hal_soc_handle_t hal_soc_hdl, uint8_t ac,
  46. uint32_t value);
  47. uint32_t hal_get_reo_reg_base_offset_be(void);
  48. int hal_reo_send_cmd_be(hal_soc_handle_t hal_soc_hdl,
  49. hal_ring_handle_t hal_ring_hdl,
  50. enum hal_reo_cmd_type cmd,
  51. void *params);
  52. /* REO status ring routines */
  53. void
  54. hal_reo_queue_stats_status_be(hal_ring_desc_t ring_desc,
  55. void *st_handle,
  56. hal_soc_handle_t hal_soc_hdl);
  57. void
  58. hal_reo_flush_queue_status_be(hal_ring_desc_t ring_desc,
  59. void *st_handle,
  60. hal_soc_handle_t hal_soc_hdl);
  61. void
  62. hal_reo_flush_cache_status_be(hal_ring_desc_t ring_desc,
  63. void *st_handle,
  64. hal_soc_handle_t hal_soc_hdl);
  65. void
  66. hal_reo_unblock_cache_status_be(hal_ring_desc_t ring_desc,
  67. hal_soc_handle_t hal_soc_hdl,
  68. void *st_handle);
  69. void hal_reo_flush_timeout_list_status_be(hal_ring_desc_t ring_desc,
  70. void *st_handle,
  71. hal_soc_handle_t hal_soc_hdl);
  72. void hal_reo_desc_thres_reached_status_be(hal_ring_desc_t ring_desc,
  73. void *st_handle,
  74. hal_soc_handle_t hal_soc_hdl);
  75. void
  76. hal_reo_rx_update_queue_status_be(hal_ring_desc_t ring_desc,
  77. void *st_handle,
  78. hal_soc_handle_t hal_soc_hdl);
  79. /**
  80. * hal_reo_init_cmd_ring_be() - Initialize descriptors of REO command SRNG
  81. * with command number
  82. * @hal_soc: Handle to HAL SoC structure
  83. * @hal_ring: Handle to HAL SRNG structure
  84. *
  85. * Return: none
  86. */
  87. void hal_reo_init_cmd_ring_be(hal_soc_handle_t hal_soc_hdl,
  88. hal_ring_handle_t hal_ring_hdl);
  89. uint8_t hal_get_tlv_hdr_size_be(void);
  90. #endif /* _HAL_REO_BE_H_ */