hal_be_api.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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_BE_API_H_
  19. #define _HAL_BE_API_H_
  20. #include "hal_hw_headers.h"
  21. #include "hal_rx.h"
  22. struct hal_hw_cc_config {
  23. uint32_t lut_base_addr_31_0;
  24. uint32_t cc_global_en:1,
  25. page_4k_align:1,
  26. cookie_offset_msb:5,
  27. cookie_page_msb:5,
  28. lut_base_addr_39_32:8,
  29. wbm2sw6_cc_en:1,
  30. wbm2sw5_cc_en:1,
  31. wbm2sw4_cc_en:1,
  32. wbm2sw3_cc_en:1,
  33. wbm2sw2_cc_en:1,
  34. wbm2sw1_cc_en:1,
  35. wbm2sw0_cc_en:1,
  36. wbm2fw_cc_en:1,
  37. reserved:4;
  38. };
  39. #define HAL_RX_MSDU_EXT_DESC_INFO_GET(msdu_details_ptr) \
  40. ((struct rx_msdu_ext_desc_info *) \
  41. _OFFSET_TO_BYTE_PTR(msdu_details_ptr, \
  42. RX_MSDU_DETAILS_RX_MSDU_EXT_DESC_INFO_DETAILS_RESERVED_0A_OFFSET))
  43. /**
  44. * hal_reo_setup_generic_be - Initialize HW REO block
  45. *
  46. * @hal_soc: Opaque HAL SOC handle
  47. * @reo_params: parameters needed by HAL for REO config
  48. */
  49. void hal_reo_setup_generic_be(struct hal_soc *soc,
  50. void *reoparams);
  51. void hal_tx_desc_set_search_index_generic_be(void *desc, uint32_t search_index);
  52. /**
  53. * hal_tx_desc_set_cache_set_num_generic_be - Set the cache-set-num value
  54. * @desc: Handle to Tx Descriptor
  55. * @cache_num: Cache set number that should be used to cache the index
  56. * based search results, for address and flow search.
  57. * This value should be equal to LSB four bits of the hash value
  58. * of match data, in case of search index points to an entry
  59. * which may be used in content based search also. The value can
  60. * be anything when the entry pointed by search index will not be
  61. * used for content based search.
  62. *
  63. * Return: void
  64. */
  65. void hal_tx_desc_set_cache_set_num_generic_be(void *desc,
  66. uint8_t cache_num);
  67. /**
  68. * hal_rx_msdu_ext_desc_info_get_ptr_be() - Get the msdu extension
  69. * descriptor pointer.
  70. * @msdu_details_ptr: msdu details
  71. *
  72. * Return: msdu exntension descriptor pointer.
  73. */
  74. void *hal_rx_msdu_ext_desc_info_get_ptr_be(void *msdu_details_ptr);
  75. /**
  76. * hal_set_link_desc_addr_be - Setup link descriptor in a buffer_addr_info
  77. * HW structure
  78. *
  79. * @desc: Descriptor entry (from WBM_IDLE_LINK ring)
  80. * @cookie: SW cookie for the buffer/descriptor
  81. * @link_desc_paddr: Physical address of link descriptor entry
  82. *
  83. */
  84. void hal_set_link_desc_addr_be(void *desc, uint32_t cookie,
  85. qdf_dma_addr_t link_desc_paddr);
  86. /**
  87. * hal_hw_txrx_default_ops_attach_be(): Add default ops for BE chips
  88. * @ hal_soc_hdl: hal_soc handle
  89. *
  90. * Return: None
  91. */
  92. void hal_hw_txrx_default_ops_attach_be(struct hal_soc *soc);
  93. uint32_t hal_tx_comp_get_buffer_source_generic_be(void *hal_desc);
  94. uint8_t hal_rx_ret_buf_manager_get_be(hal_ring_desc_t ring_desc);
  95. void hal_rx_wbm_err_info_get_generic_be(void *wbm_desc, void *wbm_er_info1);
  96. /**
  97. * hal_reo_qdesc_setup - Setup HW REO queue descriptor
  98. *
  99. * @hal_soc: Opaque HAL SOC handle
  100. * @ba_window_size: BlockAck window size
  101. * @start_seq: Starting sequence number
  102. * @hw_qdesc_vaddr: Virtual address of REO queue descriptor memory
  103. * @hw_qdesc_paddr: Physical address of REO queue descriptor memory
  104. * @pn_type: PN type (one of the types defined in 'enum hal_pn_type')
  105. *
  106. */
  107. void hal_reo_qdesc_setup_be(hal_soc_handle_t hal_soc_hdl,
  108. int tid, uint32_t ba_window_size,
  109. uint32_t start_seq, void *hw_qdesc_vaddr,
  110. qdf_dma_addr_t hw_qdesc_paddr,
  111. int pn_type);
  112. /**
  113. * hal_cookie_conversion_reg_cfg_be() - set cookie conversion relevant register
  114. * for REO/WBM
  115. * @soc: HAL soc handle
  116. * @cc_cfg: structure pointer for HW cookie conversion configuration
  117. *
  118. * Return: None
  119. */
  120. void hal_cookie_conversion_reg_cfg_be(hal_soc_handle_t hal_soc_hdl,
  121. struct hal_hw_cc_config *cc_cfg);
  122. #endif /* _HAL_BE_API_H_ */