hal_be_api.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. #define HAL_RX_MSDU_EXT_DESC_INFO_GET(msdu_details_ptr) \
  23. ((struct rx_msdu_ext_desc_info *) \
  24. _OFFSET_TO_BYTE_PTR(msdu_details_ptr, \
  25. RX_MSDU_DETAILS_RX_MSDU_EXT_DESC_INFO_DETAILS_RESERVED_0A_OFFSET))
  26. /**
  27. * hal_reo_setup_generic_be - Initialize HW REO block
  28. *
  29. * @hal_soc: Opaque HAL SOC handle
  30. * @reo_params: parameters needed by HAL for REO config
  31. */
  32. void hal_reo_setup_generic_be(struct hal_soc *soc,
  33. void *reoparams);
  34. void hal_tx_desc_set_search_index_generic_be(void *desc, uint32_t search_index);
  35. /**
  36. * hal_tx_desc_set_cache_set_num_generic_be - Set the cache-set-num value
  37. * @desc: Handle to Tx Descriptor
  38. * @cache_num: Cache set number that should be used to cache the index
  39. * based search results, for address and flow search.
  40. * This value should be equal to LSB four bits of the hash value
  41. * of match data, in case of search index points to an entry
  42. * which may be used in content based search also. The value can
  43. * be anything when the entry pointed by search index will not be
  44. * used for content based search.
  45. *
  46. * Return: void
  47. */
  48. void hal_tx_desc_set_cache_set_num_generic_be(void *desc,
  49. uint8_t cache_num);
  50. /**
  51. * hal_rx_msdu_ext_desc_info_get_ptr_be() - Get the msdu extension
  52. * descriptor pointer.
  53. * @msdu_details_ptr: msdu details
  54. *
  55. * Return: msdu exntension descriptor pointer.
  56. */
  57. void *hal_rx_msdu_ext_desc_info_get_ptr_be(void *msdu_details_ptr);
  58. /**
  59. * hal_set_link_desc_addr_be - Setup link descriptor in a buffer_addr_info
  60. * HW structure
  61. *
  62. * @desc: Descriptor entry (from WBM_IDLE_LINK ring)
  63. * @cookie: SW cookie for the buffer/descriptor
  64. * @link_desc_paddr: Physical address of link descriptor entry
  65. *
  66. */
  67. void hal_set_link_desc_addr_be(void *desc, uint32_t cookie,
  68. qdf_dma_addr_t link_desc_paddr);
  69. /**
  70. * hal_hw_txrx_default_ops_attach_be(): Add default ops for BE chips
  71. * @ hal_soc_hdl: hal_soc handle
  72. *
  73. * Return: None
  74. */
  75. void hal_hw_txrx_default_ops_attach_be(struct hal_soc *soc);
  76. uint32_t hal_tx_comp_get_buffer_source_generic_be(void *hal_desc);
  77. uint8_t hal_rx_ret_buf_manager_get_be(hal_ring_desc_t ring_desc);
  78. void hal_rx_wbm_err_info_get_generic_be(void *wbm_desc, void *wbm_er_info1);
  79. /**
  80. * hal_reo_qdesc_setup - Setup HW REO queue descriptor
  81. *
  82. * @hal_soc: Opaque HAL SOC handle
  83. * @ba_window_size: BlockAck window size
  84. * @start_seq: Starting sequence number
  85. * @hw_qdesc_vaddr: Virtual address of REO queue descriptor memory
  86. * @hw_qdesc_paddr: Physical address of REO queue descriptor memory
  87. * @pn_type: PN type (one of the types defined in 'enum hal_pn_type')
  88. *
  89. */
  90. void hal_reo_qdesc_setup_be(hal_soc_handle_t hal_soc_hdl,
  91. int tid, uint32_t ba_window_size,
  92. uint32_t start_seq, void *hw_qdesc_vaddr,
  93. qdf_dma_addr_t hw_qdesc_paddr,
  94. int pn_type);
  95. #endif /* _HAL_BE_API_H_ */