xref: /wlan-dirver/qca-wifi-host-cmn/wlan_cfg/wlan_cfg.h (revision 2ea97ac98512848a8d721c76dddf82576e7c417e)
1 /*
2  * Copyright (c) 2013-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 __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  * @p2p_tcp_udp_checksumoffload: enable/disable checksum offload for P2P mode
144  * @nan_tcp_udp_checksumoffload: enable/disable checksum offload for NAN mode
145  * @tcp_udp_checksumoffload: enable/disable checksum offload
146  * @nss_cfg: nss configuration
147  * @rx_defrag_min_timeout: rx defrag minimum timeout
148  * @wbm_release_ring: wbm release ring size
149  * @tcl_cmd_credit_ring: tcl command/credit ring size
150  * @tcl_status_ring: tcl status ring size
151  * @reo_reinject_ring: reo reinject ring
152  * @rx_release_ring: rx release ring size
153  * @reo_exception_ring: reo exception ring size
154  * @reo_cmd_ring: reo cmd ring size
155  * @reo_status_ring: reo status ting size
156  * @rxdma_refill_ring: rxdma refill ring size
157  * @rxdma_err_dst_ring: rxdma error detination ring size
158  * @raw_mode_war: enable/disable raw mode war
159  * @enable_data_stall_detection: flag to enable data stall detection
160  * @enable_force_rx_64_ba: flag to enable force 64 blockack in RX
161  * @disable_intra_bss_fwd: flag to disable intra bss forwarding
162  * @rxdma1_enable: flag to indicate if rxdma1 is enabled
163  * @delay_mon_replenish: delay monitor buffer replenish
164  * @tx_desc_limit_0: tx_desc limit for 5G H
165  * @tx_desc_limit_1: tx_desc limit for 2G
166  * @tx_desc_limit_2: tx_desc limit for 5G L
167  * @tx_device_limit: tx device limit
168  * @tx_sw_internode_queue: tx sw internode queue
169  * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
170  * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
171  * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
172  * @rx_enable_eol_data_check: flag to enable check for more ring data at end of
173  *                            dp_rx_process loop
174  * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data
175  *                                at end of tx_comp_handler loop.
176  * @rx_sw_desc_weight: rx sw descriptor weight configuration
177  * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or
178  *                                       flow tagging in monitor/mon-lite mode
179  * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE
180  * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev
181  *                                    table should be used
182  * @rx_flow_search_table_size: indicates the number of flows in the flow search
183  *                             table
184  * @rx_flow_max_search: max skid length for each hash entry
185  * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over
186  *                        5 tuple flow entry
187  * @pktlog_buffer_size: packet log buffer size
188  * @is_rx_fisa_enabled: flag to enable/disable FISA Rx
189  * @pext_stats_enabled: Flag to enable and disabled peer extended stats
190  * @is_rx_buff_pool_enabled: flag to enable/disable emergency RX buffer
191  *                           pool support
192  * @is_rx_refill_buff_pool_enabled: flag to enable/disable RX refill buffer
193  *                           pool support
194  * @rx_pending_high_threshold: threshold of starting pkt drop
195  * @rx_pending_low_threshold: threshold of stopping pkt drop
196  * @is_swlm_enabled: flag to enable/disable SWLM
197  * @tx_per_pkt_vdev_id_check: Enable tx perpkt vdev id check
198  * @wow_check_rx_pending_enable: Enable RX frame pending check in WoW
199  */
200 struct wlan_cfg_dp_soc_ctxt {
201 	int num_int_ctxts;
202 	int max_clients;
203 	int max_alloc_size;
204 	int per_pdev_tx_ring;
205 	int num_tcl_data_rings;
206 	int num_nss_tcl_data_rings;
207 	int per_pdev_rx_ring;
208 	int per_pdev_lmac_ring;
209 	int num_reo_dest_rings;
210 	int num_nss_reo_dest_rings;
211 	int num_tx_desc_pool;
212 	int num_tx_ext_desc_pool;
213 	int num_tx_desc;
214 	int min_tx_desc;
215 	int num_tx_ext_desc;
216 	int max_peer_id;
217 	int htt_packet_type;
218 	int int_batch_threshold_tx;
219 	int int_timer_threshold_tx;
220 	int int_batch_threshold_rx;
221 	int int_timer_threshold_rx;
222 	int int_batch_threshold_other;
223 	int int_timer_threshold_other;
224 	int int_timer_threshold_mon;
225 	int tx_ring_size;
226 	int tx_comp_ring_size;
227 	int tx_comp_ring_size_nss;
228 	uint8_t int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
229 	uint8_t int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
230 	uint8_t int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
231 	uint8_t int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
232 	uint8_t int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
233 	uint8_t int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
234 	uint8_t int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
235 	uint8_t int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
236 	uint8_t int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
237 	uint8_t int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
238 	uint8_t int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
239 	int hw_macid[MAX_PDEV_CNT];
240 	int hw_macid_pdev_id_map[MAX_NUM_LMAC_HW];
241 	int base_hw_macid;
242 	bool rx_hash;
243 	bool tso_enabled;
244 	bool lro_enabled;
245 	bool sg_enabled;
246 	bool gro_enabled;
247 	bool ipa_enabled;
248 	bool ol_tx_csum_enabled;
249 	bool ol_rx_csum_enabled;
250 	bool rawmode_enabled;
251 	bool peer_flow_ctrl_enabled;
252 	bool napi_enabled;
253 	bool p2p_tcp_udp_checksumoffload;
254 	bool nan_tcp_udp_checksumoffload;
255 	bool tcp_udp_checksumoffload;
256 	bool legacy_mode_checksumoffload_disable;
257 	bool defrag_timeout_check;
258 	int nss_cfg;
259 	uint32_t tx_flow_stop_queue_threshold;
260 	uint32_t tx_flow_start_queue_offset;
261 	int rx_defrag_min_timeout;
262 	int reo_dst_ring_size;
263 	int wbm_release_ring;
264 	int tcl_cmd_credit_ring;
265 	int tcl_status_ring;
266 	int reo_reinject_ring;
267 	int rx_release_ring;
268 	int reo_exception_ring;
269 	int reo_cmd_ring;
270 	int reo_status_ring;
271 	int rxdma_refill_ring;
272 	int rxdma_err_dst_ring;
273 	uint32_t per_pkt_trace;
274 	bool raw_mode_war;
275 	bool enable_data_stall_detection;
276 	bool enable_force_rx_64_ba;
277 	bool disable_intra_bss_fwd;
278 	bool rxdma1_enable;
279 	bool delay_mon_replenish;
280 	int max_ast_idx;
281 	int tx_desc_limit_0;
282 	int tx_desc_limit_1;
283 	int tx_desc_limit_2;
284 	int tx_device_limit;
285 	int tx_sw_internode_queue;
286 	int mon_drop_thresh;
287 #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
288 	uint32_t tx_comp_loop_pkt_limit;
289 	uint32_t rx_reap_loop_pkt_limit;
290 	uint32_t rx_hp_oos_update_limit;
291 	bool rx_enable_eol_data_check;
292 	bool tx_comp_enable_eol_data_check;
293 #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */
294 	int rx_sw_desc_weight;
295 	int rx_sw_desc_num;
296 	bool is_rx_mon_protocol_flow_tag_enabled;
297 	bool is_rx_flow_tag_enabled;
298 	bool is_rx_flow_search_table_per_pdev;
299 	uint16_t rx_flow_search_table_size;
300 	uint16_t rx_flow_max_search;
301 	uint8_t *rx_toeplitz_hash_key;
302 	uint8_t pktlog_buffer_size;
303 	uint8_t is_rx_fisa_enabled;
304 	bool is_tso_desc_attach_defer;
305 	uint32_t delayed_replenish_entries;
306 	uint32_t reo_rings_mapping;
307 	bool pext_stats_enabled;
308 	bool is_rx_buff_pool_enabled;
309 	bool is_rx_refill_buff_pool_enabled;
310 	uint32_t rx_pending_high_threshold;
311 	uint32_t rx_pending_low_threshold;
312 	bool is_poll_mode_enabled;
313 	uint8_t is_swlm_enabled;
314 	bool fst_in_cmem;
315 	bool tx_per_pkt_vdev_id_check;
316 	uint8_t radio0_rx_default_reo;
317 	uint8_t radio1_rx_default_reo;
318 	uint8_t radio2_rx_default_reo;
319 	bool wow_check_rx_pending_enable;
320 };
321 
322 /**
323  * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
324  * @rx_dma_buf_ring_size - Size of RxDMA buffer ring
325  * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring
326  * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring
327  * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring
328  * @rxdma_monitor_desc_ring - rxdma monitor desc ring size
329  */
330 struct wlan_cfg_dp_pdev_ctxt {
331 	int rx_dma_buf_ring_size;
332 	int dma_mon_buf_ring_size;
333 	int dma_mon_dest_ring_size;
334 	int dma_mon_status_ring_size;
335 	int rxdma_monitor_desc_ring;
336 	int num_mac_rings;
337 	int nss_enabled;
338 };
339 
340 /**
341  * wlan_cfg_soc_attach() - Attach configuration interface for SoC
342  * @ctrl_obj - PSOC object
343  *
344  * Allocates context for Soc configuration parameters,
345  * Read configuration information from device tree/ini file and
346  * returns back handle
347  *
348  * Return: Handle to configuration context
349  */
350 struct wlan_cfg_dp_soc_ctxt *
351 wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
352 
353 /**
354  * wlan_cfg_soc_detach() - Detach soc configuration handle
355  * @wlan_cfg_ctx: soc configuration handle
356  *
357  * De-allocates memory allocated for SoC configuration
358  *
359  * Return:none
360  */
361 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
362 
363 /**
364  * wlan_cfg_pdev_attach() Attach configuration interface for pdev
365  * @ctrl_obj - PSOC object
366  *
367  * Allocates context for pdev configuration parameters,
368  * Read configuration information from device tree/ini file and
369  * returns back handle
370  *
371  * Return: Handle to configuration context
372  */
373 struct wlan_cfg_dp_pdev_ctxt *
374 wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
375 
376 /**
377  * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
378  * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
379  *
380  * Return: void
381  */
382 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
383 
384 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
385 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
386 			       int context, int mask);
387 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
388 			       int context, int mask);
389 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
390 				   int context, int mask);
391 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
392 			       int context, int mask);
393 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
394 				  int mask);
395 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
396 void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
397 int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg);
398 int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg);
399 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
400 				int context, int mask);
401 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
402 					int context, int mask);
403 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
404 					int context, int mask);
405 
406 /**
407  * wlan_cfg_set_mon_delayed_replenish_entries() - number of buffers to replenish
408  *				for monitor buffer ring at initialization
409  * @wlan_cfg_ctx - Configuration Handle
410  * @replenish_entries - number of entries to replenish at initialization
411  *
412  */
413 void wlan_cfg_set_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
414 						*wlan_cfg_ctx,
415 						uint32_t replenish_entries);
416 
417 /**
418  * wlan_cfg_get_mon_delayed_replenish_entries() - get num of buffer to replenish
419  *				for monitor buffer ring at initialization
420  * @wlan_cfg_ctx - Configuration Handle
421  * @replenish_entries - number of entries to replenish at initialization
422  *
423  * Return: delayed_replenish_entries;
424  */
425 int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
426 					       *wlan_cfg_ctx);
427 /**
428  * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
429  * @wlan_cfg_ctx - Configuration Handle
430  *
431  * For WIN,  DP_NUM_INTERRUPT_CONTEXTS will be equal to  number of CPU cores.
432  * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
433  * rx_ring_mask ,and rx_monitor_ring mask  to indicate the rings
434  * that are processed by the handler.
435  *
436  * Return: num_contexts
437  */
438 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
439 
440 /**
441  * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
442  *				 interrupt context
443  * @wlan_cfg_ctx - Configuration Handle
444  * @context - Numerical ID identifying the Interrupt/NAPI context
445  *
446  * Return: int_tx_ring_mask[context]
447  */
448 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
449 		int context);
450 
451 /**
452  * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
453  *				 interrupt context
454  * @wlan_cfg_ctx - Configuration Handle
455  * @context - Numerical ID identifying the Interrupt/NAPI context
456  *
457  * Return: int_rx_ring_mask[context]
458  */
459 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
460 		int context);
461 
462 /**
463  * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
464  *				   mapped to an interrupt context
465  * @wlan_cfg_ctx - Configuration Handle
466  * @context - Numerical ID identifying the Interrupt/NAPI context
467  *
468  * Return: int_rx_mon_ring_mask[context]
469  */
470 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
471 		int context);
472 
473 /**
474  * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
475  *				   for the given interrupt context
476  * @wlan_cfg_ctx - Configuration Handle
477  * @context - Numerical ID identifying the Interrupt/NAPI context
478  *
479  */
480 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
481 	int context, int mask);
482 
483 /**
484  * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
485  *				   mapped to an interrupt context
486  * @wlan_cfg_ctx - Configuration Handle
487  * @context - Numerical ID identifying the Interrupt/NAPI context
488  *
489  * Return: int_rxdma2host_ring_mask[context]
490  */
491 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
492 	int context);
493 
494 /**
495  * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
496  *				   for the given interrupt context
497  * @wlan_cfg_ctx - Configuration Handle
498  * @context - Numerical ID identifying the Interrupt/NAPI context
499  *
500  */
501 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
502 	int context, int mask);
503 
504 /**
505  * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
506  *				   mapped to an interrupt context
507  * @wlan_cfg_ctx - Configuration Handle
508  * @context - Numerical ID identifying the Interrupt/NAPI context
509  *
510  * Return: int_host2rxdma_ring_mask[context]
511  */
512 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
513 	int context);
514 
515 /**
516  * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
517  *                                interrupt mask for the given interrupt context
518  * @wlan_cfg_ctx - Configuration Handle
519  * @context - Numerical ID identifying the Interrupt/NAPI context
520  *
521  */
522 void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
523 					   int context, int mask);
524 
525 /**
526  * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring
527  *                               interrupt mask mapped to an interrupt context
528  * @wlan_cfg_ctx - Configuration Handle
529  * @context - Numerical ID identifying the Interrupt/NAPI context
530  *
531  * Return: int_host2rxdma_mon_ring_mask[context]
532  */
533 int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
534 					  int context);
535 
536 /**
537  * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor
538  *				   destination ring interrupt mask
539  *				   for the given interrupt context
540  * @wlan_cfg_ctx - Configuration Handle
541  * @context - Numerical ID identifying the Interrupt/NAPI context
542  *
543  */
544 void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
545 					   int context, int mask);
546 
547 /**
548  * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor
549  *				   destination ring interrupt mask
550  *				   mapped to an interrupt context
551  * @wlan_cfg_ctx - Configuration Handle
552  * @context - Numerical ID identifying the Interrupt/NAPI context
553  *
554  * Return: int_rxdma2host_mon_ring_mask[context]
555  */
556 int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
557 					  int context);
558 
559 /**
560  * wlan_cfg_set_hw_macidx() - Set HW MAC Idx for the given PDEV index
561  *
562  * @wlan_cfg_ctx - Configuration Handle
563  * @pdev_idx - Index of SW PDEV
564  * @hw_macid - HW MAC Id
565  *
566  */
567 void wlan_cfg_set_hw_mac_idx
568 	(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
569 
570 /**
571  * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
572  * PDEV index
573  *
574  * @wlan_cfg_ctx - Configuration Handle
575  * @pdev_idx - Index of SW PDEV
576  *
577  * Return: HW MAC index
578  */
579 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
580 
581 /**
582  * wlan_cfg_get_target_pdev_id() - Get target PDEV ID for HW MAC ID
583  *
584  * @wlan_cfg_ctx - Configuration Handle
585  * @hw_macid - Index of hw mac
586  *
587  * Return: PDEV ID
588  */
589 int
590 wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
591 
592 /**
593  * wlan_cfg_set_pdev_idx() - Set 0 based host PDEV index for the given
594  * hw mac index
595  *
596  * @wlan_cfg_ctx - Configuration Handle
597  * @pdev_idx - Index of SW PDEV
598  * @hw_macid - Index of hw mac
599  *
600  * Return: PDEV index
601  */
602 void wlan_cfg_set_pdev_idx
603 	(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
604 
605 /**
606  * wlan_cfg_get_pdev_idx() - Get 0 based PDEV index for the given
607  * hw mac index
608  *
609  * @wlan_cfg_ctx - Configuration Handle
610  * @hw_macid - Index of hw mac
611  *
612  * Return: PDEV index
613  */
614 int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
615 
616 /**
617  * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
618  *					   mapped to an interrupt context
619  * @wlan_cfg_ctx - Configuration Handle
620  * @context - Numerical ID identifying the Interrupt/NAPI context
621  *
622  * Return: int_rx_err_ring_mask[context]
623  */
624 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
625 				  context);
626 
627 /**
628  * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
629  *					   mapped to an interrupt context
630  * @wlan_cfg_ctx - Configuration Handle
631  * @context - Numerical ID identifying the Interrupt/NAPI context
632  *
633  * Return: int_wbm_rel_ring_mask[context]
634  */
635 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
636 				      context);
637 
638 /**
639  * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
640  *					   mapped to an interrupt context
641  * @wlan_cfg_ctx - Configuration Handle
642  * @context - Numerical ID identifying the Interrupt/NAPI context
643  *
644  * Return: int_reo_status_ring_mask[context]
645  */
646 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
647 				      context);
648 
649 /**
650  * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
651  *				mapped to an interrupt context
652  * @wlan_cfg_ctx - Configuration Handle
653  * @context - Numerical ID identifying the Interrupt/NAPI context
654  *
655  * Return: int_ce_ring_mask[context]
656  */
657 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
658 		int context);
659 
660 /**
661  * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
662  *				supported by device
663  * @wlan_cfg_ctx - Configuration Handle
664  *
665  * Return: max_clients
666  */
667 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
668 
669 /**
670  * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
671  *			    memory allocation request for this device
672  * @wlan_cfg_ctx - Configuration Handle
673  *
674  * Return: max_alloc_size
675  */
676 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
677 
678 /*
679  * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
680  *			       one per radio
681  * @wlan_cfg_ctx - Configuration Handle
682  *
683  * Return: per_pdev_tx_ring
684  */
685 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
686 
687 /*
688  * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings (HOST mode)
689  * @wlan_cfg_ctx
690  *
691  * Return: num_tcl_data_rings
692  */
693 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
694 
695 /*
696  * wlan_cfg_num_nss_tcl_data_rings() - Number of TCL Data rings (NSS offload)
697  * @wlan_cfg_ctx
698  *
699  * Return: num_tcl_data_rings
700  */
701 int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
702 
703 /*
704  * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
705  *                              one per radio
706  * @wlan_cfg_ctx
707  *
708  * Return: per_pdev_rx_ring
709  */
710 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
711 
712 /*
713  * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
714  *                              one per radio
715  * @wlan_cfg_ctx
716  *
717  * Return: return 1 if per pdev error ring else 0
718  */
719 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
720 
721 /*
722  * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings (HOST mode)
723  * @wlan_cfg_ctx - Configuration Handle
724  *
725  * Return: num_reo_dest_rings
726  */
727 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
728 
729 /*
730  * wlan_cfg_num_nss_reo_dest_rings() - Number of REO Data rings (NSS offload)
731  * @wlan_cfg_ctx - Configuration Handle
732  *
733  * Return: num_reo_dest_rings
734  */
735 int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
736 
737 /*
738  * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
739  * @wlan_cfg_ctx - Configuration Handle
740  *
741  * Return: htt_pkt_type_ethernet
742  */
743 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
744 
745 /*
746  * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
747  *					device
748  * @wlan_cfg_ctx - Configuration Handle
749  *
750  * Return: num_tx_desc_pool
751  */
752 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
753 
754 /*
755  * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
756  *					device
757  * @wlan_cfg_ctx - Configuration Handle
758  * @num_pool - Number of pool
759  */
760 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
761 
762 /*
763  * wlan_cfg_get_num_tx_ext_desc_pool() -  Number of Tx MSDU ext Descriptor
764  *					pools
765  * @wlan_cfg_ctx - Configuration Handle
766  *
767  * Return: num_tx_ext_desc_pool
768  */
769 int wlan_cfg_get_num_tx_ext_desc_pool(
770 		struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
771 
772 /*
773  * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
774  *
775  * @wlan_cfg_ctx - Configuration Handle
776  *
777  * Return: reo_dst_ring_size
778  */
779 int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
780 
781 /*
782  * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
783  *
784  * @wlan_cfg_ctx - Configuration Handle
785  * @reo_dst_ring_size - REO Destination ring size
786  */
787 void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
788 				    int reo_dst_ring_size);
789 
790 /*
791  * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
792  *
793  * @wlan_cfg_ctx - Configuration Handle
794  * @raw_mode_war - raw mode war configuration
795  */
796 void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
797 			       bool raw_mode_war);
798 
799 /*
800  * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
801  *
802  * @wlan_cfg_ctx - Configuration Handle
803  *
804  * Return: reo_dst_ring_size
805  */
806 bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
807 
808 /*
809  * wlan_cfg_set_num_tx_ext_desc_pool() -  Set the number of Tx MSDU ext Descriptor
810  *					pools
811  * @wlan_cfg_ctx - Configuration Handle
812  * @num_pool - Number of pool
813  */
814 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
815 
816 /*
817  * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
818  * @wlan_cfg_ctx - Configuration Handle
819  *
820  * Return: num_tx_desc
821  */
822 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
823 
824 /*
825  * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool
826  * @wlan_cfg_ctx - Configuration Handle
827  *
828  * Return: num_tx_desc
829  */
830 int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
831 
832 /*
833  * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
834  *
835  * @wlan_cfg_ctx - Configuration Handle
836  * @num_desc: Number of descriptor
837  */
838 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
839 
840 /*
841  * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
842  *					per pool
843  * @wlan_cfg_ctx - Configuration Handle
844  *
845  * Return: num_tx_ext_desc
846  */
847 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
848 
849 /*
850  * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
851  *					per pool
852  * @wlan_cfg_ctx - Configuration Handle
853  * @num_desc: Number of descriptor
854  */
855 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
856 
857 /*
858  * wlan_cfg_max_peer_id() - Get maximum peer ID
859  * @cfg: Configuration Handle
860  *
861  * Return: maximum peer ID
862  */
863 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
864 
865 /*
866  * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
867  * @wlan_cfg_pdev_ctx
868  *
869  * Return: dma_mon_buf_ring_size
870  */
871 int wlan_cfg_get_dma_mon_buf_ring_size(
872 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
873 
874 /*
875  * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
876  *					Destination ring
877  * @wlan_cfg_pdev_ctx
878  *
879  * Return: dma_mon_dest_size
880  */
881 int wlan_cfg_get_dma_mon_dest_ring_size(
882 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
883 
884 /*
885  * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
886  * @wlan_cfg_pdev_ctx
887  *
888  * Return: dma_mon_stat_ring_size
889  */
890 int wlan_cfg_get_dma_mon_stat_ring_size(
891 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
892 
893 /*
894  * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
895  * @wlan_cfg_soc_ctx
896  *
897  * Return: rxdma monitor desc ring size
898  */
899 int
900 wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
901 
902 /*
903  * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
904  * @wlan_cfg_pdev_ctx
905  *
906  * Return: rx_dma_buf_ring_size
907  */
908 int wlan_cfg_get_rx_dma_buf_ring_size(
909 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
910 
911 /*
912  * wlan_cfg_rx_pending_hl_threshold() - Return high threshold of rx pending
913  * @wlan_cfg_pdev_ctx
914  *
915  * Return: rx_pending_high_threshold
916  */
917 uint32_t
918 wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
919 
920 /*
921  * wlan_cfg_rx_pending_lo_threshold() - Return low threshold of rx pending
922  * @wlan_cfg_pdev_ctx
923  *
924  * Return: rx_pending_low_threshold
925  */
926 uint32_t
927 wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
928 
929 /*
930  * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
931  * per pdev
932  * @wlan_cfg_pdev_ctx
933  *
934  * Return: number of mac DMA rings per pdev
935  */
936 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
937 
938 /*
939  * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
940  * @wlan_cfg_dp_soc_ctxt
941  *
942  * Return: true - LRO enabled false - LRO disabled
943  */
944 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
945 
946 /*
947  * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled
948  * @wlan_cfg_dp_soc_ctxt
949  *
950  * Return: true - GRO enabled false - GRO disabled
951  */
952 bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
953 
954 /*
955  * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
956  * @wlan_cfg_dp_soc_ctxt
957  *
958  * Return: true - enabled false - disabled
959  */
960 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
961 
962 /*
963  * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
964  * @wlan_cfg_dp_soc_ctxt
965  *
966  * Return: true - enabled false - disabled
967  */
968 bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
969 
970 /*
971  * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
972  * @wlan_cfg_soc_ctx
973  * @rx_hash
974  */
975 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
976 
977 /*
978  * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
979  * @wlan_cfg_pdev_ctx
980  *
981  * Return: 1 - enabled 0 - disabled
982  */
983 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
984 
985 /*
986  * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
987  * @wlan_cfg_pdev_ctx
988  */
989 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
990 
991 /*
992  * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
993  * @wlan_cfg_pdev_ctx
994  *
995  * Return: nss_cfg
996  */
997 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
998 
999 /*
1000  * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
1001  * @wlan_cfg_pdev_ctx
1002  *
1003  */
1004 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
1005 
1006 /*
1007  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
1008  * @wlan_cfg_soc_ctx
1009  *
1010  * Return: Batch threshold
1011  */
1012 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
1013 
1014 /*
1015  * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
1016  * @wlan_cfg_soc_ctx
1017  *
1018  * Return: Timer threshold
1019  */
1020 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
1021 
1022 /*
1023  * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
1024  * @wlan_cfg_soc_ctx
1025  *
1026  * Return: Batch threshold
1027  */
1028 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
1029 
1030 /*
1031  * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
1032  * @wlan_cfg_soc_ctx
1033  *
1034  * Return: Timer threshold
1035  */
1036 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
1037 
1038 /*
1039  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
1040  * @wlan_cfg_soc_ctx
1041  *
1042  * Return: Batch threshold
1043  */
1044 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
1045 
1046 /*
1047  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
1048  * @wlan_cfg_soc_ctx
1049  *
1050  * Return: Timer threshold
1051  */
1052 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
1053 
1054 /*
1055  * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs
1056  * @wlan_cfg_soc_ctx
1057  *
1058  * Return: Timer threshold
1059  */
1060 int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
1061 
1062 /*
1063  * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
1064  * @wlan_cfg_soc_ctx
1065  *
1066  * Return: Checksum offload enable or disable
1067  */
1068 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
1069 
1070 /*
1071  * wlan_cfg_get_nan_checksum_offload - Get checksum offload enable/disable val
1072  * @wlan_cfg_soc_ctx
1073  *
1074  * Return: Checksum offload enable or disable value for NAN mode
1075  */
1076 int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
1077 
1078 /*
1079  * wlan_cfg_get_p2p_checksum_offload - Get checksum offload enable/disable val
1080  * @wlan_cfg_soc_ctx
1081  *
1082  * Return: Checksum offload enable or disable value for P2P mode
1083  */
1084 int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
1085 
1086 /*
1087  * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
1088  * @wlan_cfg_soc_ctx
1089  *
1090  * Return: Tx Ring Size
1091  */
1092 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1093 
1094 /*
1095  * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
1096  * @wlan_cfg_soc_ctx
1097  *
1098  * Return: Tx Completion ring size
1099  */
1100 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1101 
1102 /*
1103  * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
1104  * @wlan_cfg_soc_ctx
1105  *
1106  * Return: wbm_release_ring size
1107  */
1108 int
1109 wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1110 
1111 /*
1112  * wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size - Get command/credit ring size
1113  * @wlan_cfg_soc_ctx
1114  *
1115  * Return: tcl_cmd_credit_ring size
1116  */
1117 int
1118 wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1119 
1120 /*
1121  * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
1122  * @wlan_cfg_soc_ctx
1123  *
1124  * Return: tcl_status_ring size
1125  */
1126 int
1127 wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1128 
1129 /*
1130  * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
1131  * @wlan_cfg_soc_ctx
1132  *
1133  * Return: reo_reinject_ring size
1134  */
1135 int
1136 wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1137 
1138 /*
1139  * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
1140  * @wlan_cfg_soc_ctx
1141  *
1142  * Return: rx_release_ring size
1143  */
1144 int
1145 wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1146 
1147 /*
1148  * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
1149  * @wlan_cfg_soc_ctx
1150  *
1151  * Return: reo_exception_ring size
1152  */
1153 int
1154 wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1155 
1156 /*
1157  * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
1158  * @wlan_cfg_soc_ctx
1159  *
1160  * Return: reo_cmd_ring size
1161  */
1162 int
1163 wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1164 
1165 /*
1166  * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
1167  * @wlan_cfg_soc_ctx
1168  *
1169  * Return: reo_status_ring size
1170  */
1171 int
1172 wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1173 
1174 /*
1175  * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H
1176  * @wlan_cfg_soc_ctx
1177  *
1178  * Return: tx desc limit for 5G H
1179  */
1180 int
1181 wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg);
1182 
1183 /*
1184  * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G
1185  * @wlan_cfg_soc_ctx
1186  *
1187  * Return: tx desc limit for 2G
1188  */
1189 int
1190 wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg);
1191 
1192 /*
1193  * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L
1194  * @wlan_cfg_soc_ctx
1195  *
1196  * Return: tx desc limit for 5G L
1197  */
1198 int
1199 wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg);
1200 
1201 /*
1202  * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit
1203  * @wlan_cfg_soc_ctx
1204  *
1205  * Return: tx device limit
1206  */
1207 int
1208 wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
1209 
1210 /*
1211  * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue
1212  * @wlan_cfg_soc_ctx
1213  *
1214  * Return: tx sw internode queue
1215  */
1216 int
1217 wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg);
1218 
1219 /*
1220  * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
1221  * @wlan_cfg_soc_ctx
1222  *
1223  * Return: rxdma refill ring size
1224  */
1225 int
1226 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1227 
1228 /*
1229  * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
1230  * @wlan_cfg_soc_ctx
1231  *
1232  * Return: rxdma error dst ring size
1233  */
1234 int
1235 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1236 
1237 /*
1238  * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight
1239  * @wlan_cfg_soc_ctx
1240  *
1241  * Return: rx_sw_desc_weight
1242  */
1243 int
1244 wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg);
1245 
1246 /*
1247  * wlan_cfg_get_dp_soc_rx_sw_desc_num - Get rx sw desc num
1248  * @wlan_cfg_soc_ctx
1249  *
1250  * Return: rx_sw_desc_num
1251  */
1252 int
1253 wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg);
1254 
1255 /*
1256  * wlan_cfg_get_dp_caps - Get dp capablities
1257  * @wlan_cfg_soc_ctx
1258  * @dp_caps: enum for dp capablities
1259  *
1260  * Return: bool if a dp capabilities is enabled
1261  */
1262 bool
1263 wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
1264 		     enum cdp_capabilities dp_caps);
1265 
1266 /**
1267  * wlan_set_srng_cfg() - Fill per ring specific
1268  * configuration parameters
1269  * @wlan_cfg: global srng configuration table
1270  *
1271  * Return: None
1272  */
1273 void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg);
1274 
1275 #ifdef QCA_LL_TX_FLOW_CONTROL_V2
1276 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
1277 
1278 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
1279 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
1280 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
1281 
1282 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
1283 
1284 /**
1285  * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST
1286  *                                            in number of entries
1287  *
1288  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1289  *
1290  * Return: rx_fst_size
1291  */
1292 uint16_t
1293 wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1294 
1295 /**
1296  * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search
1297  *
1298  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1299  *
1300  * Return: max_search
1301  */
1302 uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg);
1303 
1304 /**
1305  * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST
1306  *                                  search
1307  *
1308  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1309  *
1310  * Return: 320-bit Hash Key
1311  */
1312 uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg);
1313 
1314 /**
1315  * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in
1316  *                                      DP soc context
1317  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1318  * @val: Rx flow tag feature flag value
1319  *
1320  * Return: None
1321  */
1322 void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
1323 				      bool val);
1324 
1325 /**
1326  * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from
1327  *                                     DP soc context
1328  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1329  *
1330  * Return: true if feature is enabled, else false
1331  */
1332 bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1333 
1334 /**
1335  * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that
1336  *                                                Rx FST is per pdev
1337  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1338  * @val: boolean flag indicating Rx FST per pdev or per SOC
1339  *
1340  * Return: None
1341  */
1342 void
1343 wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
1344 					   bool val);
1345 
1346 /**
1347  * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev
1348  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1349  *
1350  * Return: true if Rx FST is per pdev, else false
1351  */
1352 bool
1353 wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg);
1354 
1355 /**
1356  * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context
1357  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1358  * @val: Rx FST size in number of entries
1359  *
1360  * Return: None
1361  */
1362 void
1363 wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
1364 				       uint16_t val);
1365 
1366 /**
1367  * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag
1368  *                                                   in DP soc context
1369  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1370  * @val: Rx protocol or flow tag feature flag value in monitor mode from INI
1371  *
1372  * Return: None
1373  */
1374 void
1375 wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
1376 					      bool val);
1377 
1378 /**
1379  * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag
1380  *                                                  from DP soc context
1381  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1382  *
1383  * Return: true if feature is enabled in monitor mode for protocol or flow
1384  * tagging in INI, false otherwise
1385  */
1386 bool
1387 wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1388 
1389 /**
1390  * wlan_cfg_set_tx_per_pkt_vdev_id_check() - set flag to enable perpkt
1391  *                                              vdev id check in tx.
1392  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1393  * @val: feature flag value
1394  *
1395  * Return: None
1396  */
1397 void
1398 wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
1399 				      bool val);
1400 
1401 /**
1402  * wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled() - get flag to check if
1403  *                              perpkt vdev id check is enabled in tx.
1404  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1405  *
1406  * Return: true if feature is enabled, false otherwise
1407  */
1408 bool
1409 wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1410 
1411 /**
1412  * wlan_cfg_fill_interrupt_mask() - set interrupt mask
1413  *
1414  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1415  * @num_dp_msi: Number of DP interrupts available (0 for integrated)
1416  * @interrupt_mode: Type of interrupt
1417  * @is_monitor_mode: is monitor mode enabled
1418  *
1419  * Return: void
1420  */
1421 void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
1422 				  int num_dp_msi, int interrupt_mode,
1423 				  bool is_monitor_mode);
1424 
1425 /**
1426  * wlan_cfg_is_rx_fisa_enabled() - Get Rx FISA enabled flag
1427  *
1428  *
1429  * @cfg: soc configuration context
1430  *
1431  * Return: true if enabled, false otherwise.
1432  */
1433 bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1434 
1435 /**
1436  * wlan_cfg_is_rx_buffer_pool_enabled() - Get RX buffer pool enabled flag
1437  *
1438  *
1439  * @cfg: soc configuration context
1440  *
1441  * Return: true if enabled, false otherwise.
1442  */
1443 bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1444 
1445 /**
1446  * wlan_cfg_is_rx_refill_buffer_pool_enabled() - Get RX refill buffer pool enabled flag
1447  *
1448  *
1449  * @cfg: soc configuration context
1450  *
1451  * Return: true if enabled, false otherwise.
1452  */
1453 bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1454 
1455 
1456 void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
1457 					bool val);
1458 
1459 bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg);
1460 
1461 /**
1462  * wlan_cfg_get_reo_rings_mapping() - Get Reo destination ring bitmap
1463  *
1464  *
1465  * @cfg: soc configuration context
1466  *
1467  * Return: reo ring bitmap.
1468  */
1469 uint32_t wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg);
1470 
1471 /**
1472  * wlan_cfg_set_peer_ext_stats() - set peer extended stats
1473  *
1474  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1475  * @val: Flag value read from INI
1476  *
1477  * Return: void
1478  */
1479 void
1480 wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
1481 			    bool val);
1482 
1483 /**
1484  * wlan_cfg_is_peer_ext_stats_enabled() - Check if peer extended
1485  *                                        stats are enabled
1486  *
1487  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1488  *
1489  * Return: bool
1490  */
1491 bool
1492 wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1493 
1494 /**
1495  * wlan_cfg_is_poll_mode_enabled() - Check if poll mode is enabled
1496  *
1497  * @wlan_cfg_dp_soc_ctxt: soc configuration context
1498  *
1499  * Return: bool
1500  */
1501 
1502 bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1503 
1504 /**
1505  * wlan_cfg_is_fst_in_cmem_enabled() - Check if FST in CMEM is enabled
1506  * @cfg: soc configuration context
1507  *
1508  * Return: true if enabled, false otherwise.
1509  */
1510 bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1511 
1512 /**
1513  * wlan_cfg_is_swlm_enabled() - Get SWLMenabled flag
1514  * @cfg: soc configuration context
1515  *
1516  * Return: true if enabled, false otherwise.
1517  */
1518 bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1519 
1520 /**
1521  * wlan_cfg_is_dp_force_rx_64_ba() - Get force use 64 BA flag
1522  * @cfg: config context
1523  *
1524  * Return: force use 64 BA flag
1525  */
1526 bool wlan_cfg_is_dp_force_rx_64_ba(struct wlan_cfg_dp_soc_ctxt *cfg);
1527 #endif
1528 
1529 /**
1530  * wlan_cfg_radio0_default_reo_get -  Get Radio0 default REO
1531  * @cfg: soc configuration context
1532  *
1533  * Return: .
1534  */
1535 uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
1536 
1537 /**
1538  * wlan_cfg_radio1_default_reo_get - Get Radio1 default REO
1539  * @cfg: soc configuration context
1540  *
1541  * Return: .
1542  */
1543 uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
1544 
1545 /**
1546  * wlan_cfg_radio2_default_reo_get() - Get Radio2 default REO
1547  * @cfg: soc configuration context
1548  *
1549  * Return: .
1550  */
1551 uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
1552 
1553 /**
1554  * wlan_cfg_set_rxdma1_enable() - Enable rxdma1
1555  * @cfg: soc configuration context
1556  *
1557  * Return: .
1558  */
1559 void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1560 
1561 /**
1562  * wlan_cfg_is_delay_mon_replenish() - Get if delayed monitor replenish
1563  * is enabled
1564  * @cfg: soc configuration context
1565  *
1566  * Return: true if enabled, false otherwise.
1567  */
1568 bool
1569 wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg);
1570 
1571 /**
1572  * wlan_cfg_set_delay_mon_replenish() - Set delayed monitor replenish
1573  * @cfg: soc configuration context
1574  * @val: val to set
1575  *
1576  * Return: .
1577  */
1578 void
1579 wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg, bool val);
1580 
1581 /**
1582  * wlan_cfg_dp_soc_ctx_dump() - Dump few DP cfg soc parameters
1583  * @cfg: soc configuration context
1584  *
1585  * Return:
1586  */
1587 void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg);
1588