xref: /wlan-dirver/qca-wifi-host-cmn/wlan_cfg/wlan_cfg.h (revision 11f5a63a6cbdda84849a730de22f0a71e635d58c)
1 /*
2  * Copyright (c) 2013-2019 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 __WLAN_CFG_H
20 #define __WLAN_CFG_H
21 
22 /*
23  * Temporary place holders. These should come either from target config
24  * or platform configuration
25  */
26 #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
27 #define WLAN_CFG_DST_RING_CACHED_DESC 0
28 #define MAX_PDEV_CNT 1
29 #define WLAN_CFG_INT_NUM_CONTEXTS 7
30 #define WLAN_CFG_RXDMA1_ENABLE 1
31 /*
32  * This mask defines how many transmit frames account for 1 NAPI work unit
33  * 0 means each tx completion is 1 unit
34  */
35 #define DP_TX_NAPI_BUDGET_DIV_MASK 0
36 
37 /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
38 #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x3FFF
39 
40 #define NUM_RXDMA_RINGS_PER_PDEV 2
41 #else
42 #define WLAN_CFG_DST_RING_CACHED_DESC 1
43 #define MAX_PDEV_CNT 3
44 #define WLAN_CFG_INT_NUM_CONTEXTS 11
45 #define NUM_RXDMA_RINGS_PER_PDEV 1
46 #endif
47 
48 #define WLAN_CFG_INT_NUM_CONTEXTS_MAX 11
49 
50 /* Tx configuration */
51 #define MAX_LINK_DESC_BANKS 8
52 #define MAX_TXDESC_POOLS 4
53 #define MAX_TCL_DATA_RINGS 4
54 
55 /* Rx configuration */
56 #define MAX_RXDESC_POOLS 4
57 #define MAX_REO_DEST_RINGS 4
58 #define MAX_RX_MAC_RINGS 2
59 
60 /* DP process status */
61 #if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1)
62 #define CONFIG_PROCESS_RX_STATUS 1
63 #define CONFIG_PROCESS_TX_STATUS 1
64 #else
65 #define CONFIG_PROCESS_RX_STATUS 0
66 #define CONFIG_PROCESS_TX_STATUS 0
67 #endif
68 
69 /* Miscellaneous configuration */
70 #define MAX_IDLE_SCATTER_BUFS 16
71 #define DP_MAX_IRQ_PER_CONTEXT 12
72 #define MAX_HTT_METADATA_LEN 32
73 #define MAX_NUM_PEER_ID_PER_PEER 8
74 #define DP_MAX_TIDS 17
75 #define DP_NON_QOS_TID 16
76 
77 #define WLAN_CFG_RX_FST_MAX_SEARCH 2
78 #define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40
79 
80 struct wlan_cfg_dp_pdev_ctxt;
81 
82 /**
83  * struct wlan_srng_cfg - Per ring configuration parameters
84  * @timer_threshold: Config to control interrupts based on timer duration
85  * @batch_count_threshold: Config to control interrupts based on
86  * number of packets in the ring
87  * @low_threshold: Config to control low threshold interrupts for SRC rings
88  */
89 struct wlan_srng_cfg {
90 	uint32_t timer_threshold;
91 	uint32_t batch_count_threshold;
92 	uint32_t low_threshold;
93 };
94 
95 /**
96  * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
97  * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP
98  * @max_clients: Maximum number of peers/stations supported by device
99  * @max_alloc_size: Maximum allocation size for any dynamic memory
100  *			allocation request for this device
101  * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio
102  *		       1: Each TCL ring is mapped to one radio/pdev
103  * @num_tcl_data_rings: Number of TCL Data rings supported by device
104  * @per_pdev_rx_ring: 0: REO ring is not mapped per radio
105  *		       1: Each REO ring is mapped to one radio/pdev
106  * @num_tx_desc_pool: Number of Tx Descriptor pools
107  * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools
108  * @num_tx_desc: Number of Tx Descriptors per pool
109  * @min_tx_desc: Minimum number of Tx Descriptors per pool
110  * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool
111  * @max_peer_id: Maximum value of peer id that FW can assign for a client
112  * @htt_packet_type: Default 802.11 encapsulation type for any VAP created
113  * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context
114  * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context
115  * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each
116  *			  NAPI/Intr context
117  * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each
118  *			  NAPI/Intr context
119  * @int_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each
120  *			  NAPI/Intr context
121  * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to
122  *                            each NAPI/Intr context
123  * @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context
124  * @lro_enabled: enable/disable lro feature
125  * @rx_hash: Enable hash based steering of rx packets
126  * @tso_enabled: enable/disable tso feature
127  * @lro_enabled: enable/disable LRO feature
128  * @sg_enabled: enable disable scatter gather feature
129  * @gro_enabled: enable disable GRO feature
130  * @ipa_enabled: Flag indicating if IPA is enabled
131  * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled
132  * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled
133  * @rawmode_enabled: Flag indicating if RAW mode is enabled
134  * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled
135  * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets
136  * @tcp_udp_checksumoffload: enable/disable checksum offload
137  * @nss_cfg: nss configuration
138  * @rx_defrag_min_timeout: rx defrag minimum timeout
139  * @wbm_release_ring: wbm release ring size
140  * @tcl_cmd_ring: tcl cmd ring size
141  * @tcl_status_ring: tcl status ring size
142  * @reo_reinject_ring: reo reinject ring
143  * @rx_release_ring: rx release ring size
144  * @reo_exception_ring: reo exception ring size
145  * @reo_cmd_ring: reo cmd ring size
146  * @reo_status_ring: reo status ting size
147  * @rxdma_refill_ring: rxdma refill ring size
148  * @rxdma_err_dst_ring: rxdma error detination ring size
149  * @raw_mode_war: enable/disable raw mode war
150  * @enable_data_stall_detection: flag to enable data stall detection
151  * @disable_intra_bss_fwd: flag to disable intra bss forwarding
152  * @rxdma1_enable: flag to indicate if rxdma1 is enabled
153  * @tx_desc_limit_0: tx_desc limit for 5G H
154  * @tx_desc_limit_1: tx_desc limit for 2G
155  * @tx_desc_limit_2: tx_desc limit for 5G L
156  * @tx_device_limit: tx device limit
157  * @tx_sw_internode_queue: tx sw internode queue
158  * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
159  * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
160  * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
161  * @rx_enable_eol_data_check: flag to enable check for more ring data at end of
162  *                            dp_rx_process loop
163  * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data
164  *                                at end of tx_comp_handler loop.
165  * @rx_sw_desc_weight: rx sw descriptor weight configuration
166  * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or
167  *                                       flow tagging in monitor/mon-lite mode
168  * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE
169  * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev
170  *                                    table should be used
171  * @rx_flow_search_table_size: indicates the number of flows in the flow search
172  *                             table
173  * @rx_flow_max_search: max skid length for each hash entry
174  * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over
175  *                        5 tuple flow entry
176  */
177 struct wlan_cfg_dp_soc_ctxt {
178 	int num_int_ctxts;
179 	int max_clients;
180 	int max_alloc_size;
181 	int per_pdev_tx_ring;
182 	int num_tcl_data_rings;
183 	int per_pdev_rx_ring;
184 	int per_pdev_lmac_ring;
185 	int num_reo_dest_rings;
186 	int num_tx_desc_pool;
187 	int num_tx_ext_desc_pool;
188 	int num_tx_desc;
189 	int min_tx_desc;
190 	int num_tx_ext_desc;
191 	int max_peer_id;
192 	int htt_packet_type;
193 	int int_batch_threshold_tx;
194 	int int_timer_threshold_tx;
195 	int int_batch_threshold_rx;
196 	int int_timer_threshold_rx;
197 	int int_batch_threshold_other;
198 	int int_timer_threshold_other;
199 	int int_timer_threshold_mon;
200 	int tx_ring_size;
201 	int tx_comp_ring_size;
202 	int tx_comp_ring_size_nss;
203 	int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
204 	int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
205 	int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
206 	int int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
207 	int int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
208 	int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
209 	int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
210 	int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
211 	int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
212 	int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
213 	int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
214 	int hw_macid[MAX_PDEV_CNT];
215 	int base_hw_macid;
216 	bool rx_hash;
217 	bool tso_enabled;
218 	bool lro_enabled;
219 	bool sg_enabled;
220 	bool gro_enabled;
221 	bool ipa_enabled;
222 	bool ol_tx_csum_enabled;
223 	bool ol_rx_csum_enabled;
224 	bool rawmode_enabled;
225 	bool peer_flow_ctrl_enabled;
226 	bool napi_enabled;
227 	bool tcp_udp_checksumoffload;
228 	bool defrag_timeout_check;
229 	int nss_cfg;
230 	uint32_t tx_flow_stop_queue_threshold;
231 	uint32_t tx_flow_start_queue_offset;
232 	int rx_defrag_min_timeout;
233 	int reo_dst_ring_size;
234 	int wbm_release_ring;
235 	int tcl_cmd_ring;
236 	int tcl_status_ring;
237 	int reo_reinject_ring;
238 	int rx_release_ring;
239 	int reo_exception_ring;
240 	int reo_cmd_ring;
241 	int reo_status_ring;
242 	int rxdma_refill_ring;
243 	int rxdma_err_dst_ring;
244 	uint32_t per_pkt_trace;
245 	bool raw_mode_war;
246 	bool enable_data_stall_detection;
247 	bool disable_intra_bss_fwd;
248 	bool rxdma1_enable;
249 	int max_ast_idx;
250 	int tx_desc_limit_0;
251 	int tx_desc_limit_1;
252 	int tx_desc_limit_2;
253 	int tx_device_limit;
254 	int tx_sw_internode_queue;
255 	int mon_drop_thresh;
256 #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
257 	uint32_t tx_comp_loop_pkt_limit;
258 	uint32_t rx_reap_loop_pkt_limit;
259 	uint32_t rx_hp_oos_update_limit;
260 	bool rx_enable_eol_data_check;
261 	bool tx_comp_enable_eol_data_check;
262 #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */
263 	int rx_sw_desc_weight;
264 	bool is_rx_mon_protocol_flow_tag_enabled;
265 	bool is_rx_flow_tag_enabled;
266 	bool is_rx_flow_search_table_per_pdev;
267 	uint16_t rx_flow_search_table_size;
268 	uint16_t rx_flow_max_search;
269 	uint8_t *rx_toeplitz_hash_key;
270 };
271 
272 /**
273  * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
274  * @rx_dma_buf_ring_size - Size of RxDMA buffer ring
275  * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring
276  * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring
277  * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring
278  * @rxdma_monitor_desc_ring - rxdma monitor desc ring size
279  */
280 struct wlan_cfg_dp_pdev_ctxt {
281 	int rx_dma_buf_ring_size;
282 	int dma_mon_buf_ring_size;
283 	int dma_mon_dest_ring_size;
284 	int dma_mon_status_ring_size;
285 	int rxdma_monitor_desc_ring;
286 	int num_mac_rings;
287 	int nss_enabled;
288 };
289 
290 /**
291  * wlan_cfg_soc_attach() - Attach configuration interface for SoC
292  * @ctrl_obj - PSOC object
293  *
294  * Allocates context for Soc configuration parameters,
295  * Read configuration information from device tree/ini file and
296  * returns back handle
297  *
298  * Return: Handle to configuration context
299  */
300 struct wlan_cfg_dp_soc_ctxt *
301 wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
302 
303 /**
304  * wlan_cfg_soc_detach() - Detach soc configuration handle
305  * @wlan_cfg_ctx: soc configuration handle
306  *
307  * De-allocates memory allocated for SoC configuration
308  *
309  * Return:none
310  */
311 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
312 
313 /**
314  * wlan_cfg_pdev_attach() Attach configuration interface for pdev
315  * @ctrl_obj - PSOC object
316  *
317  * Allocates context for pdev configuration parameters,
318  * Read configuration information from device tree/ini file and
319  * returns back handle
320  *
321  * Return: Handle to configuration context
322  */
323 struct wlan_cfg_dp_pdev_ctxt *
324 wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
325 
326 /**
327  * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
328  * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
329  *
330  * Return: void
331  */
332 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
333 
334 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
335 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
336 			       int context, int mask);
337 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
338 			       int context, int mask);
339 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
340 				   int context, int mask);
341 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
342 			       int context, int mask);
343 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
344 				  int mask);
345 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
346 void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
347 int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg);
348 int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg);
349 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
350 				int context, int mask);
351 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
352 					int context, int mask);
353 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
354 					int context, int mask);
355 /**
356  * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
357  * @wlan_cfg_ctx - Configuration Handle
358  *
359  * For WIN,  DP_NUM_INTERRUPT_CONTEXTS will be equal to  number of CPU cores.
360  * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
361  * rx_ring_mask ,and rx_monitor_ring mask  to indicate the rings
362  * that are processed by the handler.
363  *
364  * Return: num_contexts
365  */
366 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
367 
368 /**
369  * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
370  *				 interrupt context
371  * @wlan_cfg_ctx - Configuration Handle
372  * @context - Numerical ID identifying the Interrupt/NAPI context
373  *
374  * Return: int_tx_ring_mask[context]
375  */
376 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
377 		int context);
378 
379 /**
380  * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
381  *				 interrupt context
382  * @wlan_cfg_ctx - Configuration Handle
383  * @context - Numerical ID identifying the Interrupt/NAPI context
384  *
385  * Return: int_rx_ring_mask[context]
386  */
387 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
388 		int context);
389 
390 /**
391  * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
392  *				   mapped to an interrupt context
393  * @wlan_cfg_ctx - Configuration Handle
394  * @context - Numerical ID identifying the Interrupt/NAPI context
395  *
396  * Return: int_rx_mon_ring_mask[context]
397  */
398 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
399 		int context);
400 
401 /**
402  * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
403  *				   for the given interrupt context
404  * @wlan_cfg_ctx - Configuration Handle
405  * @context - Numerical ID identifying the Interrupt/NAPI context
406  *
407  */
408 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
409 	int context, int mask);
410 
411 /**
412  * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
413  *				   mapped to an interrupt context
414  * @wlan_cfg_ctx - Configuration Handle
415  * @context - Numerical ID identifying the Interrupt/NAPI context
416  *
417  * Return: int_rxdma2host_ring_mask[context]
418  */
419 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
420 	int context);
421 
422 /**
423  * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
424  *				   for the given interrupt context
425  * @wlan_cfg_ctx - Configuration Handle
426  * @context - Numerical ID identifying the Interrupt/NAPI context
427  *
428  */
429 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
430 	int context, int mask);
431 
432 /**
433  * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
434  *				   mapped to an interrupt context
435  * @wlan_cfg_ctx - Configuration Handle
436  * @context - Numerical ID identifying the Interrupt/NAPI context
437  *
438  * Return: int_host2rxdma_ring_mask[context]
439  */
440 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
441 	int context);
442 
443 /**
444  * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
445  *                                interrupt mask for the given interrupt context
446  * @wlan_cfg_ctx - Configuration Handle
447  * @context - Numerical ID identifying the Interrupt/NAPI context
448  *
449  */
450 void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
451 					   int context, int mask);
452 
453 /**
454  * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring
455  *                               interrupt mask mapped to an interrupt context
456  * @wlan_cfg_ctx - Configuration Handle
457  * @context - Numerical ID identifying the Interrupt/NAPI context
458  *
459  * Return: int_host2rxdma_mon_ring_mask[context]
460  */
461 int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
462 					  int context);
463 
464 /**
465  * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor
466  *				   destination ring interrupt mask
467  *				   for the given interrupt context
468  * @wlan_cfg_ctx - Configuration Handle
469  * @context - Numerical ID identifying the Interrupt/NAPI context
470  *
471  */
472 void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
473 					   int context, int mask);
474 
475 /**
476  * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor
477  *				   destination ring interrupt mask
478  *				   mapped to an interrupt context
479  * @wlan_cfg_ctx - Configuration Handle
480  * @context - Numerical ID identifying the Interrupt/NAPI context
481  *
482  * Return: int_rxdma2host_mon_ring_mask[context]
483  */
484 int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
485 					  int context);
486 
487 /**
488  * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
489  *
490  * @wlan_cfg_ctx - Configuration Handle
491  * @pdev_idx - Index of SW PDEV
492  * @hw_macid - HW MAC Id
493  *
494  */
495 void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
496 	int hw_macid);
497 
498 /**
499  * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
500  *
501  * @wlan_cfg_ctx - Configuration Handle
502  * @pdev_idx - Index of SW PDEV
503  *
504  * Return: HW MAC Id
505  */
506 int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
507 
508 /**
509  * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
510  * PDEV index
511  *
512  * @wlan_cfg_ctx - Configuration Handle
513  * @pdev_idx - Index of SW PDEV
514  *
515  * Return: HW MAC index
516  */
517 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
518 
519 /**
520  * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
521  *					   mapped to an interrupt context
522  * @wlan_cfg_ctx - Configuration Handle
523  * @context - Numerical ID identifying the Interrupt/NAPI context
524  *
525  * Return: int_rx_err_ring_mask[context]
526  */
527 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
528 				  context);
529 
530 /**
531  * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
532  *					   mapped to an interrupt context
533  * @wlan_cfg_ctx - Configuration Handle
534  * @context - Numerical ID identifying the Interrupt/NAPI context
535  *
536  * Return: int_wbm_rel_ring_mask[context]
537  */
538 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
539 				      context);
540 
541 /**
542  * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
543  *					   mapped to an interrupt context
544  * @wlan_cfg_ctx - Configuration Handle
545  * @context - Numerical ID identifying the Interrupt/NAPI context
546  *
547  * Return: int_reo_status_ring_mask[context]
548  */
549 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
550 				      context);
551 
552 /**
553  * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
554  *				mapped to an interrupt context
555  * @wlan_cfg_ctx - Configuration Handle
556  * @context - Numerical ID identifying the Interrupt/NAPI context
557  *
558  * Return: int_ce_ring_mask[context]
559  */
560 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
561 		int context);
562 
563 /**
564  * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
565  *				supported by device
566  * @wlan_cfg_ctx - Configuration Handle
567  *
568  * Return: max_clients
569  */
570 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
571 
572 /**
573  * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
574  *			    memory allocation request for this device
575  * @wlan_cfg_ctx - Configuration Handle
576  *
577  * Return: max_alloc_size
578  */
579 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
580 
581 /*
582  * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
583  *			       one per radio
584  * @wlan_cfg_ctx - Configuration Handle
585  *
586  * Return: per_pdev_tx_ring
587  */
588 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
589 
590 /*
591  * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
592  * @wlan_cfg_ctx
593  *
594  * Return: num_tcl_data_rings
595  */
596 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
597 
598 /*
599  * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
600  *                              one per radio
601  * @wlan_cfg_ctx
602  *
603  * Return: per_pdev_rx_ring
604  */
605 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
606 
607 /*
608  * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
609  *                              one per radio
610  * @wlan_cfg_ctx
611  *
612  * Return: return 1 if per pdev error ring else 0
613  */
614 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
615 
616 /*
617  * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
618  * @wlan_cfg_ctx - Configuration Handle
619  *
620  * Return: num_reo_dest_rings
621  */
622 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
623 
624 /*
625  * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
626  * @wlan_cfg_ctx - Configuration Handle
627  *
628  * Return: htt_pkt_type_ethernet
629  */
630 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
631 
632 /*
633  * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
634  *					device
635  * @wlan_cfg_ctx - Configuration Handle
636  *
637  * Return: num_tx_desc_pool
638  */
639 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
640 
641 /*
642  * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
643  *					device
644  * @wlan_cfg_ctx - Configuration Handle
645  * @num_pool - Number of pool
646  */
647 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
648 
649 /*
650  * wlan_cfg_get_num_tx_ext_desc_pool() -  Number of Tx MSDU ext Descriptor
651  *					pools
652  * @wlan_cfg_ctx - Configuration Handle
653  *
654  * Return: num_tx_ext_desc_pool
655  */
656 int wlan_cfg_get_num_tx_ext_desc_pool(
657 		struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
658 
659 /*
660  * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
661  *
662  * @wlan_cfg_ctx - Configuration Handle
663  *
664  * Return: reo_dst_ring_size
665  */
666 int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
667 
668 /*
669  * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
670  *
671  * @wlan_cfg_ctx - Configuration Handle
672  * @reo_dst_ring_size - REO Destination ring size
673  */
674 void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
675 				    int reo_dst_ring_size);
676 
677 /*
678  * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
679  *
680  * @wlan_cfg_ctx - Configuration Handle
681  * @raw_mode_war - raw mode war configuration
682  */
683 void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
684 			       bool raw_mode_war);
685 
686 /*
687  * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
688  *
689  * @wlan_cfg_ctx - Configuration Handle
690  *
691  * Return: reo_dst_ring_size
692  */
693 bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
694 
695 /*
696  * wlan_cfg_set_num_tx_ext_desc_pool() -  Set the number of Tx MSDU ext Descriptor
697  *					pools
698  * @wlan_cfg_ctx - Configuration Handle
699  * @num_pool - Number of pool
700  */
701 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
702 
703 /*
704  * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
705  * @wlan_cfg_ctx - Configuration Handle
706  *
707  * Return: num_tx_desc
708  */
709 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
710 
711 /*
712  * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool
713  * @wlan_cfg_ctx - Configuration Handle
714  *
715  * Return: num_tx_desc
716  */
717 int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
718 
719 /*
720  * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
721  *
722  * @wlan_cfg_ctx - Configuration Handle
723  * @num_desc: Number of descriptor
724  */
725 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
726 
727 /*
728  * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
729  *					per pool
730  * @wlan_cfg_ctx - Configuration Handle
731  *
732  * Return: num_tx_ext_desc
733  */
734 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
735 
736 /*
737  * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
738  *					per pool
739  * @wlan_cfg_ctx - Configuration Handle
740  * @num_desc: Number of descriptor
741  */
742 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
743 
744 /*
745  * wlan_cfg_max_peer_id() - Get maximum peer ID
746  * @cfg: Configuration Handle
747  *
748  * Return: maximum peer ID
749  */
750 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
751 
752 /*
753  * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
754  * @wlan_cfg_pdev_ctx
755  *
756  * Return: dma_mon_buf_ring_size
757  */
758 int wlan_cfg_get_dma_mon_buf_ring_size(
759 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
760 
761 /*
762  * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
763  *					Destination ring
764  * @wlan_cfg_pdev_ctx
765  *
766  * Return: dma_mon_dest_size
767  */
768 int wlan_cfg_get_dma_mon_dest_ring_size(
769 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
770 
771 /*
772  * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
773  * @wlan_cfg_pdev_ctx
774  *
775  * Return: dma_mon_stat_ring_size
776  */
777 int wlan_cfg_get_dma_mon_stat_ring_size(
778 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
779 
780 /*
781  * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
782  * @wlan_cfg_soc_ctx
783  *
784  * Return: rxdma monitor desc ring size
785  */
786 int
787 wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
788 
789 /*
790  * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
791  * @wlan_cfg_pdev_ctx
792  *
793  * Return: rx_dma_buf_ring_size
794  */
795 int wlan_cfg_get_rx_dma_buf_ring_size(
796 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
797 
798 /*
799  * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
800  * per pdev
801  * @wlan_cfg_pdev_ctx
802  *
803  * Return: number of mac DMA rings per pdev
804  */
805 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
806 
807 /*
808  * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
809  * @wlan_cfg_dp_soc_ctxt
810  *
811  * Return: true - LRO enabled false - LRO disabled
812  */
813 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
814 
815 /*
816  * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled
817  * @wlan_cfg_dp_soc_ctxt
818  *
819  * Return: true - GRO enabled false - GRO disabled
820  */
821 bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
822 
823 /*
824  * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
825  * @wlan_cfg_dp_soc_ctxt
826  *
827  * Return: true - enabled false - disabled
828  */
829 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
830 
831 /*
832  * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
833  * @wlan_cfg_dp_soc_ctxt
834  *
835  * Return: true - enabled false - disabled
836  */
837 bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
838 
839 /*
840  * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
841  * @wlan_cfg_soc_ctx
842  * @rx_hash
843  */
844 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
845 
846 /*
847  * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
848  * @wlan_cfg_pdev_ctx
849  *
850  * Return: 1 - enabled 0 - disabled
851  */
852 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
853 
854 /*
855  * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
856  * @wlan_cfg_pdev_ctx
857  */
858 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
859 
860 /*
861  * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
862  * @wlan_cfg_pdev_ctx
863  *
864  * Return: nss_cfg
865  */
866 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
867 
868 /*
869  * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
870  * @wlan_cfg_pdev_ctx
871  *
872  */
873 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
874 
875 /*
876  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
877  * @wlan_cfg_soc_ctx
878  *
879  * Return: Batch threshold
880  */
881 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
882 
883 /*
884  * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
885  * @wlan_cfg_soc_ctx
886  *
887  * Return: Timer threshold
888  */
889 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
890 
891 /*
892  * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
893  * @wlan_cfg_soc_ctx
894  *
895  * Return: Batch threshold
896  */
897 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
898 
899 /*
900  * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
901  * @wlan_cfg_soc_ctx
902  *
903  * Return: Timer threshold
904  */
905 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
906 
907 /*
908  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
909  * @wlan_cfg_soc_ctx
910  *
911  * Return: Batch threshold
912  */
913 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
914 
915 /*
916  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
917  * @wlan_cfg_soc_ctx
918  *
919  * Return: Timer threshold
920  */
921 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
922 
923 /*
924  * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs
925  * @wlan_cfg_soc_ctx
926  *
927  * Return: Timer threshold
928  */
929 int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
930 
931 /*
932  * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
933  * @wlan_cfg_soc_ctx
934  *
935  * Return: Checksum offload enable or disable
936  */
937 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
938 
939 /*
940  * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
941  * @wlan_cfg_soc_ctx
942  *
943  * Return: Tx Ring Size
944  */
945 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
946 
947 /*
948  * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
949  * @wlan_cfg_soc_ctx
950  *
951  * Return: Tx Completion ring size
952  */
953 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
954 
955 /*
956  * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
957  * @wlan_cfg_soc_ctx
958  *
959  * Return: wbm_release_ring size
960  */
961 int
962 wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
963 
964 /*
965  * wlan_cfg_get_dp_soc_tcl_cmd_ring_size - Get tcl_cmd_ring size
966  * @wlan_cfg_soc_ctx
967  *
968  * Return: tcl_cmd_ring size
969  */
970 int
971 wlan_cfg_get_dp_soc_tcl_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
972 
973 /*
974  * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
975  * @wlan_cfg_soc_ctx
976  *
977  * Return: tcl_status_ring size
978  */
979 int
980 wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
981 
982 /*
983  * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
984  * @wlan_cfg_soc_ctx
985  *
986  * Return: reo_reinject_ring size
987  */
988 int
989 wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
990 
991 /*
992  * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
993  * @wlan_cfg_soc_ctx
994  *
995  * Return: rx_release_ring size
996  */
997 int
998 wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
999 
1000 /*
1001  * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
1002  * @wlan_cfg_soc_ctx
1003  *
1004  * Return: reo_exception_ring size
1005  */
1006 int
1007 wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1008 
1009 /*
1010  * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
1011  * @wlan_cfg_soc_ctx
1012  *
1013  * Return: reo_cmd_ring size
1014  */
1015 int
1016 wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1017 
1018 /*
1019  * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
1020  * @wlan_cfg_soc_ctx
1021  *
1022  * Return: reo_status_ring size
1023  */
1024 int
1025 wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1026 
1027 /*
1028  * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H
1029  * @wlan_cfg_soc_ctx
1030  *
1031  * Return: tx desc limit for 5G H
1032  */
1033 int
1034 wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg);
1035 
1036 /*
1037  * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G
1038  * @wlan_cfg_soc_ctx
1039  *
1040  * Return: tx desc limit for 2G
1041  */
1042 int
1043 wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg);
1044 
1045 /*
1046  * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L
1047  * @wlan_cfg_soc_ctx
1048  *
1049  * Return: tx desc limit for 5G L
1050  */
1051 int
1052 wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg);
1053 
1054 /*
1055  * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit
1056  * @wlan_cfg_soc_ctx
1057  *
1058  * Return: tx device limit
1059  */
1060 int
1061 wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
1062 
1063 /*
1064  * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue
1065  * @wlan_cfg_soc_ctx
1066  *
1067  * Return: tx sw internode queue
1068  */
1069 int
1070 wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg);
1071 
1072 /*
1073  * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
1074  * @wlan_cfg_soc_ctx
1075  *
1076  * Return: rxdma refill ring size
1077  */
1078 int
1079 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1080 
1081 /*
1082  * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
1083  * @wlan_cfg_soc_ctx
1084  *
1085  * Return: rxdma error dst ring size
1086  */
1087 int
1088 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1089 
1090 /*
1091  * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight
1092  * @wlan_cfg_soc_ctx
1093  *
1094  * Return: rx_sw_desc_weight
1095  */
1096 int
1097 wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg);
1098 
1099 /*
1100  * wlan_cfg_get_dp_caps - Get dp capablities
1101  * @wlan_cfg_soc_ctx
1102  * @dp_caps: enum for dp capablities
1103  *
1104  * Return: bool if a dp capabilities is enabled
1105  */
1106 bool
1107 wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
1108 		     enum cdp_capabilities dp_caps);
1109 
1110 /**
1111  * wlan_set_srng_cfg() - Fill per ring specific
1112  * configuration parameters
1113  * @wlan_cfg: global srng configuration table
1114  *
1115  * Return: None
1116  */
1117 void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg);
1118 
1119 #ifdef QCA_LL_TX_FLOW_CONTROL_V2
1120 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
1121 
1122 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
1123 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
1124 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
1125 
1126 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
1127 
1128 /**
1129  * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST
1130  *                                            in number of entries
1131  *
1132  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1133  *
1134  * Return: rx_fst_size
1135  */
1136 uint16_t
1137 wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1138 
1139 /**
1140  * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search
1141  *
1142  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1143  *
1144  * Return: max_search
1145  */
1146 uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg);
1147 
1148 /**
1149  * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST
1150  *                                  search
1151  *
1152  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1153  *
1154  * Return: 320-bit Hash Key
1155  */
1156 uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg);
1157 
1158 /**
1159  * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in
1160  *                                      DP soc context
1161  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1162  * @val: Rx flow tag feature flag value
1163  *
1164  * Return: None
1165  */
1166 void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
1167 				      bool val);
1168 
1169 /**
1170  * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from
1171  *                                     DP soc context
1172  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1173  *
1174  * Return: true if feature is enabled, else false
1175  */
1176 bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1177 
1178 /**
1179  * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that
1180  *                                                Rx FST is per pdev
1181  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1182  * @val: boolean flag indicating Rx FST per pdev or per SOC
1183  *
1184  * Return: None
1185  */
1186 void
1187 wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
1188 					   bool val);
1189 
1190 /**
1191  * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev
1192  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1193  *
1194  * Return: true if Rx FST is per pdev, else false
1195  */
1196 bool
1197 wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg);
1198 
1199 /**
1200  * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context
1201  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1202  * @val: Rx FST size in number of entries
1203  *
1204  * Return: None
1205  */
1206 void
1207 wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
1208 				       uint16_t val);
1209 
1210 /**
1211  * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag
1212  *                                                   in DP soc context
1213  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1214  * @val: Rx protocol or flow tag feature flag value in monitor mode from INI
1215  *
1216  * Return: None
1217  */
1218 void
1219 wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
1220 					      bool val);
1221 
1222 /**
1223  * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag
1224  *                                                  from DP soc context
1225  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1226  *
1227  * Return: true if feature is enabled in monitor mode for protocol or flow
1228  * tagging in INI, false otherwise
1229  */
1230 bool
1231 wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1232 #endif
1233