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