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