hal_be_api.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. error_path_cookie_conv_en:1,
  38. release_path_cookie_conv_en:1,
  39. reserved:2;
  40. };
  41. #define HAL_RX_MSDU_EXT_DESC_INFO_GET(msdu_details_ptr) \
  42. ((struct rx_msdu_ext_desc_info *) \
  43. _OFFSET_TO_BYTE_PTR(msdu_details_ptr, \
  44. RX_MSDU_DETAILS_RX_MSDU_EXT_DESC_INFO_DETAILS_RESERVED_0A_OFFSET))
  45. /**
  46. * hal_reo_setup_generic_be - Initialize HW REO block
  47. *
  48. * @hal_soc: Opaque HAL SOC handle
  49. * @reo_params: parameters needed by HAL for REO config
  50. */
  51. void hal_reo_setup_generic_be(struct hal_soc *soc,
  52. void *reoparams);
  53. /**
  54. * hal_rx_msdu_ext_desc_info_get_ptr_be() - Get the msdu extension
  55. * descriptor pointer.
  56. * @msdu_details_ptr: msdu details
  57. *
  58. * Return: msdu exntension descriptor pointer.
  59. */
  60. void *hal_rx_msdu_ext_desc_info_get_ptr_be(void *msdu_details_ptr);
  61. /**
  62. * hal_set_link_desc_addr_be - Setup link descriptor in a buffer_addr_info
  63. * HW structure
  64. *
  65. * @desc: Descriptor entry (from WBM_IDLE_LINK ring)
  66. * @cookie: SW cookie for the buffer/descriptor
  67. * @link_desc_paddr: Physical address of link descriptor entry
  68. *
  69. */
  70. void hal_set_link_desc_addr_be(void *desc, uint32_t cookie,
  71. qdf_dma_addr_t link_desc_paddr);
  72. /**
  73. * hal_hw_txrx_default_ops_attach_be(): Add default ops for BE chips
  74. * @ hal_soc_hdl: hal_soc handle
  75. *
  76. * Return: None
  77. */
  78. void hal_hw_txrx_default_ops_attach_be(struct hal_soc *soc);
  79. uint32_t hal_tx_comp_get_buffer_source_generic_be(void *hal_desc);
  80. uint8_t hal_rx_ret_buf_manager_get_be(hal_ring_desc_t ring_desc);
  81. void hal_rx_wbm_err_info_get_generic_be(void *wbm_desc, void *wbm_er_info1);
  82. /**
  83. * hal_reo_qdesc_setup - Setup HW REO queue descriptor
  84. *
  85. * @hal_soc: Opaque HAL SOC handle
  86. * @ba_window_size: BlockAck window size
  87. * @start_seq: Starting sequence number
  88. * @hw_qdesc_vaddr: Virtual address of REO queue descriptor memory
  89. * @hw_qdesc_paddr: Physical address of REO queue descriptor memory
  90. * @pn_type: PN type (one of the types defined in 'enum hal_pn_type')
  91. *
  92. */
  93. void hal_reo_qdesc_setup_be(hal_soc_handle_t hal_soc_hdl,
  94. int tid, uint32_t ba_window_size,
  95. uint32_t start_seq, void *hw_qdesc_vaddr,
  96. qdf_dma_addr_t hw_qdesc_paddr,
  97. int pn_type);
  98. /**
  99. * hal_cookie_conversion_reg_cfg_be() - set cookie conversion relevant register
  100. * for REO/WBM
  101. * @soc: HAL soc handle
  102. * @cc_cfg: structure pointer for HW cookie conversion configuration
  103. *
  104. * Return: None
  105. */
  106. void hal_cookie_conversion_reg_cfg_be(hal_soc_handle_t hal_soc_hdl,
  107. struct hal_hw_cc_config *cc_cfg);
  108. #endif /* _HAL_BE_API_H_ */