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