hal_li_api.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 _HAL_LI_API_H_
  19. #define _HAL_LI_API_H_
  20. #include "hal_li_hw_headers.h"
  21. #include "hal_api.h"
  22. /**
  23. * hal_reo_setup_generic_li - Initialize HW REO block
  24. *
  25. * @hal_soc: Opaque HAL SOC handle
  26. * @reo_params: parameters needed by HAL for REO config
  27. */
  28. void hal_reo_setup_generic_li(struct hal_soc *soc,
  29. void *reoparams);
  30. /**
  31. * hal_set_link_desc_addr_li - Setup link descriptor in a buffer_addr_info
  32. * HW structure
  33. *
  34. * @desc: Descriptor entry (from WBM_IDLE_LINK ring)
  35. * @cookie: SW cookie for the buffer/descriptor
  36. * @link_desc_paddr: Physical address of link descriptor entry
  37. *
  38. */
  39. void hal_set_link_desc_addr_li(void *desc, uint32_t cookie,
  40. qdf_dma_addr_t link_desc_paddr);
  41. /**
  42. * hal_tx_desc_set_search_type_generic_li - Set the search type value
  43. * @desc: Handle to Tx Descriptor
  44. * @search_type: search type
  45. * 0 – Normal search
  46. * 1 – Index based address search
  47. * 2 – Index based flow search
  48. *
  49. * Return: void
  50. */
  51. void hal_tx_desc_set_search_type_generic_li(void *desc,
  52. uint8_t search_type);
  53. /**
  54. * hal_tx_desc_set_search_index_generic_li - Set the search index value
  55. * @desc: Handle to Tx Descriptor
  56. * @search_index: The index that will be used for index based address or
  57. * flow search. The field is valid when 'search_type' is
  58. * 1 0r 2
  59. *
  60. * Return: void
  61. */
  62. void hal_tx_desc_set_search_index_generic_li(void *desc,
  63. uint32_t search_index);
  64. /**
  65. * hal_tx_desc_set_cache_set_num_generic_li - Set the cache-set-num value
  66. * @desc: Handle to Tx Descriptor
  67. * @cache_num: Cache set number that should be used to cache the index
  68. * based search results, for address and flow search.
  69. * This value should be equal to LSB four bits of the hash value
  70. * of match data, in case of search index points to an entry
  71. * which may be used in content based search also. The value can
  72. * be anything when the entry pointed by search index will not be
  73. * used for content based search.
  74. *
  75. * Return: void
  76. */
  77. void hal_tx_desc_set_cache_set_num_generic_li(void *desc,
  78. uint8_t cache_num);
  79. /**
  80. * hal_tx_init_data_ring_li() - Initialize all the TCL Descriptors in SRNG
  81. * @hal_soc_hdl: Handle to HAL SoC structure
  82. * @hal_srng: Handle to HAL SRNG structure
  83. *
  84. * Return: none
  85. */
  86. void hal_tx_init_data_ring_li(hal_soc_handle_t hal_soc_hdl,
  87. hal_ring_handle_t hal_ring_hdl);
  88. /**
  89. * hal_hw_txrx_default_ops_attach_li(): Add default ops for Lithium chips
  90. * @ hal_soc_hdl: hal_soc handle
  91. *
  92. * Return: None
  93. */
  94. void hal_hw_txrx_default_ops_attach_li(struct hal_soc *soc);
  95. uint32_t hal_rx_wbm_err_src_get_li(hal_ring_desc_t ring_desc);
  96. uint8_t hal_rx_ret_buf_manager_get_li(hal_ring_desc_t ring_desc);
  97. /**
  98. * hal_reo_qdesc_setup - Setup HW REO queue descriptor
  99. *
  100. * @hal_soc: Opaque HAL SOC handle
  101. * @ba_window_size: BlockAck window size
  102. * @start_seq: Starting sequence number
  103. * @hw_qdesc_vaddr: Virtual address of REO queue descriptor memory
  104. * @hw_qdesc_paddr: Physical address of REO queue descriptor memory
  105. * @pn_type: PN type (one of the types defined in 'enum hal_pn_type')
  106. *
  107. */
  108. void hal_reo_qdesc_setup_li(hal_soc_handle_t hal_soc_hdl,
  109. int tid, uint32_t ba_window_size,
  110. uint32_t start_seq, void *hw_qdesc_vaddr,
  111. qdf_dma_addr_t hw_qdesc_paddr,
  112. int pn_type);
  113. #endif /* _HAL_LI_API_H_ */