xref: /wlan-dirver/qca-wifi-host-cmn/wlan_cfg/wlan_cfg.h (revision 06d0b5348967845f004ebe7c2348bf8f467ad2f9)
1 /*
2  * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef __WLAN_CFG_H
21 #define __WLAN_CFG_H
22 
23 #include <wlan_init_cfg.h>
24 
25 /* DP process status */
26 #if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1)
27 #define CONFIG_PROCESS_RX_STATUS 1
28 #define CONFIG_PROCESS_TX_STATUS 1
29 #else
30 #define CONFIG_PROCESS_RX_STATUS 0
31 #define CONFIG_PROCESS_TX_STATUS 0
32 #endif
33 
34 /* Miscellaneous configuration */
35 #define MAX_IDLE_SCATTER_BUFS 16
36 #define DP_MAX_IRQ_PER_CONTEXT 12
37 #define MAX_HTT_METADATA_LEN 32
38 #define DP_MAX_TIDS 17
39 #define DP_NON_QOS_TID 16
40 #define DP_NULL_DATA_TID 17
41 
42 #ifdef CONFIG_BERYLLIUM
43 #define WLAN_CFG_RX_FST_MAX_SEARCH 16
44 #else
45 #define WLAN_CFG_RX_FST_MAX_SEARCH 2
46 #endif
47 #define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40
48 
49 #define INVALID_PDEV_ID 0xFF
50 
51 #define WLAN_CFG_RX_RING_MASK_0 0x1
52 #define WLAN_CFG_RX_RING_MASK_1 0x2
53 #define WLAN_CFG_RX_RING_MASK_2 0x4
54 #define WLAN_CFG_RX_RING_MASK_3 0x8
55 #define WLAN_CFG_RX_RING_MASK_4 0x10
56 #define WLAN_CFG_RX_RING_MASK_5 0x20
57 #define WLAN_CFG_RX_RING_MASK_6 0x40
58 #define WLAN_CFG_RX_RING_MASK_7 0x80
59 
60 #ifdef WLAN_FEATURE_NEAR_FULL_IRQ
61 #ifdef IPA_OFFLOAD
62 #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1 (WLAN_CFG_RX_RING_MASK_0 |	\
63 					  WLAN_CFG_RX_RING_MASK_1 |	\
64 					  WLAN_CFG_RX_RING_MASK_2)
65 
66 #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_2 (WLAN_CFG_RX_RING_MASK_4 |	\
67 					  WLAN_CFG_RX_RING_MASK_5 |	\
68 					  WLAN_CFG_RX_RING_MASK_6)
69 
70 #define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0 | \
71 					     WLAN_CFG_TX_RING_MASK_4 | \
72 					     WLAN_CFG_TX_RING_MASK_2)
73 
74 #else
75 #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1 (WLAN_CFG_RX_RING_MASK_0 |	\
76 					  WLAN_CFG_RX_RING_MASK_1 |	\
77 					  WLAN_CFG_RX_RING_MASK_2 |	\
78 					  WLAN_CFG_RX_RING_MASK_3)
79 
80 #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_2 (WLAN_CFG_RX_RING_MASK_4 |	\
81 					  WLAN_CFG_RX_RING_MASK_5 |	\
82 					  WLAN_CFG_RX_RING_MASK_6 |	\
83 					  WLAN_CFG_RX_RING_MASK_7)
84 
85 #ifdef QCA_WIFI_KIWI_V2
86 #define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0 | \
87 					     WLAN_CFG_TX_RING_MASK_4 | \
88 					     WLAN_CFG_TX_RING_MASK_2 | \
89 					     WLAN_CFG_TX_RING_MASK_5 | \
90 					     WLAN_CFG_TX_RING_MASK_6)
91 #else /* !QCA_WIFI_KIWI_V2 */
92 #define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0 | \
93 					     WLAN_CFG_TX_RING_MASK_4 | \
94 					     WLAN_CFG_TX_RING_MASK_2 | \
95 					     WLAN_CFG_TX_RING_MASK_6 | \
96 					     WLAN_CFG_TX_RING_MASK_7)
97 #endif /* QCA_WIFI_KIWI_V2 */
98 #endif
99 #endif
100 
101 /* Max number of chips that can participate in MLO */
102 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
103 #define WLAN_MAX_MLO_CHIPS 4
104 #define WLAN_MAX_MLO_LINKS_PER_SOC 2
105 #else
106 #define WLAN_MAX_MLO_CHIPS 1
107 #endif
108 
109 struct wlan_cfg_dp_pdev_ctxt;
110 
111 /**
112  * struct wlan_cfg_tcl_wbm_ring_num_map - TCL WBM Ring number mapping
113  * @tcl_ring_num: TCL Ring number
114  * @wbm_ring_num: WBM Ring number
115  * @wbm_rbm_id: WBM RBM ID to be used when enqueuing to TCL
116  * @for_ipa: whether this TCL/WBM for IPA use or not
117  */
118 struct wlan_cfg_tcl_wbm_ring_num_map {
119 	uint8_t tcl_ring_num;
120 	uint8_t wbm_ring_num;
121 	uint8_t wbm_rbm_id;
122 	uint8_t for_ipa;
123 };
124 
125 /**
126  * struct wlan_srng_cfg - Per ring configuration parameters
127  * @timer_threshold: Config to control interrupts based on timer duration
128  * @batch_count_threshold: Config to control interrupts based on
129  * number of packets in the ring
130  * @low_threshold: Config to control low threshold interrupts for SRC rings
131  */
132 struct wlan_srng_cfg {
133 	uint32_t timer_threshold;
134 	uint32_t batch_count_threshold;
135 	uint32_t low_threshold;
136 };
137 
138 /**
139  * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
140  * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP
141  * @max_clients: Maximum number of peers/stations supported by device
142  * @max_alloc_size: Maximum allocation size for any dynamic memory
143  *			allocation request for this device
144  * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio
145  *		       1: Each TCL ring is mapped to one radio/pdev
146  * @num_tx_comp_rings: Number of Tx comp rings supported by device
147  * @num_tcl_data_rings: Number of TCL Data rings supported by device
148  * @num_nss_tcl_data_rings:
149  * @per_pdev_rx_ring: 0: REO ring is not mapped per radio
150  *		       1: Each REO ring is mapped to one radio/pdev
151  * @per_pdev_lmac_ring:
152  * @num_reo_dest_rings:
153  * @num_nss_reo_dest_rings:
154  * @num_tx_desc_pool: Number of Tx Descriptor pools
155  * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools
156  * @num_tx_desc: Number of Tx Descriptors per pool
157  * @num_tx_spl_desc: Number of Tx Descriptors per pool to handle special frames
158  * @min_tx_desc: Minimum number of Tx Descriptors per pool
159  * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool
160  * @max_peer_id: Maximum value of peer id that FW can assign for a client
161  * @htt_packet_type: Default 802.11 encapsulation type for any VAP created
162  * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context
163  * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context
164  * @int_batch_threshold_ppe2tcl:
165  * @int_timer_threshold_ppe2tcl:
166  * @int_batch_threshold_tx:
167  * @int_timer_threshold_tx:
168  * @int_batch_threshold_rx:
169  * @int_timer_threshold_rx:
170  * @int_batch_threshold_other:
171  * @int_timer_threshold_other:
172  * @int_timer_threshold_mon:
173  * @tx_ring_size:
174  * @time_control_bp:
175  * @tx_comp_ring_size:
176  * @tx_comp_ring_size_nss:
177  * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each
178  *			  NAPI/Intr context
179  * @int_tx_mon_ring_mask: Bitmap of Tx monitor ring interrupts mapped to each
180  *			  NAPI/Intr context
181  * @int_host2rxdma_mon_ring_mask:
182  * @int_rxdma2host_mon_ring_mask:
183  * @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context
184  * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each
185  *			  NAPI/Intr context
186  * @int_rx_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each
187  *			      NAPI/Intr context
188  * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to
189  *                            each NAPI/Intr context
190  * @int_rxdma2host_ring_mask:
191  * @int_host2rxdma_ring_mask:
192  * @int_rx_ring_near_full_irq_1_mask: Bitmap of REO DST ring near full interrupt
193  *				mapped to each NAPI/INTR context
194  * @int_rx_ring_near_full_irq_2_mask: Bitmap of REO DST ring near full interrupt
195  *				mapped to each NAPI/INTR context
196  * @int_tx_ring_near_full_irq_mask: Bitmap of Tx completion ring near full
197  *				interrupt mapped to each NAPI/INTR context
198  * @int_host2txmon_ring_mask: Bitmap of Tx monitor source ring interrupt
199  *				mapped to each NAPI/INTR context
200  * @int_ppeds_wbm_release_ring_mask:
201  * @int_ppe2tcl_ring_mask:
202  * @int_reo2ppe_ring_mask:
203  * @int_umac_reset_intr_mask: Bitmap of UMAC reset interrupt mapped to each
204  * NAPI/INTR context
205  * @hw_macid:
206  * @hw_macid_pdev_id_map:
207  * @base_hw_macid:
208  * @rx_hash: Enable hash based steering of rx packets
209  * @tso_enabled: enable/disable tso feature
210  * @lro_enabled: enable/disable LRO feature
211  * @sg_enabled: enable disable scatter gather feature
212  * @gro_enabled: enable disable GRO feature
213  * @tc_based_dynamic_gro: enable/disable tc based dynamic gro
214  * @tc_ingress_prio: ingress prio to be checked for dynamic gro
215  * @ipa_enabled: Flag indicating if IPA is enabled
216  * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled
217  * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled
218  * @rawmode_enabled: Flag indicating if RAW mode is enabled
219  * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled
220  * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets
221  * @p2p_tcp_udp_checksumoffload: enable/disable checksum offload for P2P mode
222  * @nan_tcp_udp_checksumoffload: enable/disable checksum offload for NAN mode
223  * @tcp_udp_checksumoffload: enable/disable checksum offload
224  * @legacy_mode_checksumoffload_disable:
225  * @defrag_timeout_check:
226  * @nss_cfg: nss configuration
227  * @tx_flow_stop_queue_threshold:
228  * @tx_flow_start_queue_offset:
229  * @rx_defrag_min_timeout: rx defrag minimum timeout
230  * @reo_dst_ring_size:
231  * @wbm_release_ring: wbm release ring size
232  * @tcl_cmd_credit_ring: tcl command/credit ring size
233  * @tcl_status_ring: tcl status ring size
234  * @reo_reinject_ring: reo reinject ring
235  * @rx_release_ring: rx release ring size
236  * @reo_exception_ring: reo exception ring size
237  * @reo_cmd_ring: reo cmd ring size
238  * @reo_status_ring: reo status ting size
239  * @rxdma_refill_ring: rxdma refill ring size
240  * @rxdma_refill_lt_disable: rxdma refill low threshold disable
241  * @rxdma_err_dst_ring: rxdma error destination ring size
242  * @per_pkt_trace:
243  * @raw_mode_war: enable/disable raw mode war
244  * @enable_data_stall_detection: enable/disable specific data stall detection
245  * @disable_intra_bss_fwd: flag to disable intra bss forwarding
246  * @rxdma1_enable: flag to indicate if rxdma1 is enabled
247  * @delay_mon_replenish: delay monitor buffer replenish
248  * @max_ast_idx:
249  * @tx_desc_limit_0: tx_desc limit for 5 GHz High
250  * @tx_desc_limit_1: tx_desc limit for 2 GHz
251  * @tx_desc_limit_2: tx_desc limit for 5 GHz Low
252  * @tx_device_limit: tx device limit
253  * @tx_spl_device_limit: tx device limit for special frames
254  * @tx_sw_internode_queue: tx sw internode queue
255  * @mon_drop_thresh:
256  * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
257  * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
258  * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
259  * @rx_enable_eol_data_check: flag to enable check for more ring data at end of
260  *                            dp_rx_process loop
261  * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data
262  *                                at end of tx_comp_handler loop.
263  * @rx_sw_desc_weight: rx sw descriptor weight configuration
264  * @rx_sw_desc_num:
265  * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or
266  *                                       flow tagging in monitor/mon-lite mode
267  * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE
268  * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev
269  *                                    table should be used
270  * @rx_flow_search_table_size: indicates the number of flows in the flow search
271  *                             table
272  * @rx_flow_max_search: max skid length for each hash entry
273  * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over
274  *                        5 tuple flow entry
275  * @pktlog_buffer_size: packet log buffer size
276  * @is_rx_fisa_enabled: flag to enable/disable FISA Rx
277  * @is_rx_fisa_lru_del_enabled:
278  * @is_tso_desc_attach_defer:
279  * @delayed_replenish_entries:
280  * @reo_rings_mapping:
281  * @pext_stats_enabled: Flag to enable and disabled peer extended stats
282  * @is_rx_buff_pool_enabled: flag to enable/disable emergency RX buffer
283  *                           pool support
284  * @is_rx_refill_buff_pool_enabled: flag to enable/disable RX refill buffer
285  *                           pool support
286  * @rx_pending_high_threshold: threshold of starting pkt drop
287  * @rx_pending_low_threshold: threshold of stopping pkt drop
288  * @is_poll_mode_enabled:
289  * @is_swlm_enabled: flag to enable/disable SWLM
290  * @fst_in_cmem:
291  * @tx_per_pkt_vdev_id_check: Enable tx perpkt vdev id check
292  * @radio0_rx_default_reo:
293  * @radio1_rx_default_reo:
294  * @radio2_rx_default_reo:
295  * @wow_check_rx_pending_enable: Enable RX frame pending check in WoW
296  * @jitter_stats_enabled: true if jitter stats are enabled
297  * @ipa_tx_ring_size: IPA tx ring size
298  * @ipa_tx_comp_ring_size: IPA tx completion ring size
299  * @ipa_tx_alt_ring_size: IPA tx alt ring size
300  * @ipa_tx_alt_comp_ring_size: IPA tx alt completion ring size
301  * @hw_cc_enabled: cookie conversion enabled
302  * @tcl_wbm_map_array: TCL-WBM map array
303  * @ppeds_enable: Enable PPE Direct Switch feature
304  * @reo2ppe_ring: REO2PPE ring size
305  * @ppe2tcl_ring: PPE2TCL ring size
306  * @ppeds_num_tx_desc: Number of tx descs for PPE DS
307  * @ppeds_tx_comp_napi_budget: Napi budget for tx completions
308  * @pkt_capture_mode: Packet capture mode config
309  * @rx_mon_buf_ring_size: Rx monitor buf ring size
310  * @tx_mon_buf_ring_size: Tx monitor buf ring size
311  * @rx_rel_wbm2sw_ring_id: Rx WBM2SW ring id
312  * @tx_rings_grp_bitmap: bitmap of group intr contexts which have
313  *                       non-zero tx ring mask
314  * @mlo_chip_rx_ring_map: map of chip_id to rx ring map
315  * @vdev_stats_hw_offload_config: HW vdev stats config
316  * @vdev_stats_hw_offload_timer: HW vdev stats timer duration
317  * @num_rxdma_dst_rings_per_pdev: Number of Rx DMA rings per pdev
318  * @txmon_hw_support: TxMON HW support
319  * @txmon_sw_peer_filtering: TxMON sw peer filtering support
320  * @num_rxdma_status_rings_per_pdev: Num RXDMA status rings
321  * @tx_capt_max_mem_allowed: Max memory for Tx packet capture
322  * @sawf_enabled:  Is SAWF enabled
323  * @sawf_stats: SAWF Statistics
324  * @mpdu_retry_threshold_1: MPDU retry threshold 1 to increment tx bad count
325  * @mpdu_retry_threshold_2: MPDU retry threshold 2 to increment tx bad count
326  * @napi_scale_factor: scaling factor to be used for napi polls
327  * @notify_frame_support: flag indicating capability to mark notify frames
328  * @is_handle_invalid_decap_type_disabled: flag to indicate if invalid decap
329  *                                         type handling is disabled
330  */
331 struct wlan_cfg_dp_soc_ctxt {
332 	int num_int_ctxts;
333 	int max_clients;
334 	int max_alloc_size;
335 	int per_pdev_tx_ring;
336 	int num_tx_comp_rings;
337 	int num_tcl_data_rings;
338 	int num_nss_tcl_data_rings;
339 	int per_pdev_rx_ring;
340 	int per_pdev_lmac_ring;
341 	int num_reo_dest_rings;
342 	int num_nss_reo_dest_rings;
343 	int num_tx_desc_pool;
344 	int num_tx_ext_desc_pool;
345 	int num_tx_desc;
346 	int num_tx_spl_desc;
347 	int min_tx_desc;
348 	int num_tx_ext_desc;
349 	int max_peer_id;
350 	int htt_packet_type;
351 	int int_batch_threshold_ppe2tcl;
352 	int int_timer_threshold_ppe2tcl;
353 	int int_batch_threshold_tx;
354 	int int_timer_threshold_tx;
355 	int int_batch_threshold_rx;
356 	int int_timer_threshold_rx;
357 	int int_batch_threshold_other;
358 	int int_timer_threshold_other;
359 	int int_timer_threshold_mon;
360 	int tx_ring_size;
361 	int time_control_bp;
362 	int tx_comp_ring_size;
363 	int tx_comp_ring_size_nss;
364 	uint8_t int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
365 	uint8_t int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
366 	uint8_t int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
367 	uint8_t int_tx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
368 	uint8_t int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
369 	uint8_t int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
370 	uint8_t int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
371 	uint8_t int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
372 	uint8_t int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
373 	uint8_t int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
374 	uint8_t int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
375 	uint8_t int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
376 	uint8_t int_rx_ring_near_full_irq_1_mask[WLAN_CFG_INT_NUM_CONTEXTS];
377 	uint8_t int_rx_ring_near_full_irq_2_mask[WLAN_CFG_INT_NUM_CONTEXTS];
378 	uint8_t int_tx_ring_near_full_irq_mask[WLAN_CFG_INT_NUM_CONTEXTS];
379 	uint8_t int_host2txmon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
380 	uint8_t int_ppeds_wbm_release_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
381 	uint8_t int_ppe2tcl_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
382 	uint8_t int_reo2ppe_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
383 	uint8_t int_umac_reset_intr_mask[WLAN_CFG_INT_NUM_CONTEXTS];
384 	int hw_macid[MAX_PDEV_CNT];
385 	int hw_macid_pdev_id_map[MAX_NUM_LMAC_HW];
386 	int base_hw_macid;
387 	bool rx_hash;
388 	bool tso_enabled;
389 	bool lro_enabled;
390 	bool sg_enabled;
391 	bool gro_enabled;
392 	bool tc_based_dynamic_gro;
393 	uint32_t tc_ingress_prio;
394 	bool ipa_enabled;
395 	bool ol_tx_csum_enabled;
396 	bool ol_rx_csum_enabled;
397 	bool rawmode_enabled;
398 	bool peer_flow_ctrl_enabled;
399 	bool napi_enabled;
400 	bool p2p_tcp_udp_checksumoffload;
401 	bool nan_tcp_udp_checksumoffload;
402 	bool tcp_udp_checksumoffload;
403 	bool legacy_mode_checksumoffload_disable;
404 	bool defrag_timeout_check;
405 	int nss_cfg;
406 	uint32_t tx_flow_stop_queue_threshold;
407 	uint32_t tx_flow_start_queue_offset;
408 	int rx_defrag_min_timeout;
409 	int reo_dst_ring_size;
410 	int wbm_release_ring;
411 	int tcl_cmd_credit_ring;
412 	int tcl_status_ring;
413 	int reo_reinject_ring;
414 	int rx_release_ring;
415 	int reo_exception_ring;
416 	int reo_cmd_ring;
417 	int reo_status_ring;
418 	int rxdma_refill_ring;
419 	bool rxdma_refill_lt_disable;
420 	int rxdma_err_dst_ring;
421 	uint32_t per_pkt_trace;
422 	bool raw_mode_war;
423 	uint32_t enable_data_stall_detection;
424 	bool disable_intra_bss_fwd;
425 	bool rxdma1_enable;
426 	bool delay_mon_replenish;
427 	int max_ast_idx;
428 	int tx_desc_limit_0;
429 	int tx_desc_limit_1;
430 	int tx_desc_limit_2;
431 	int tx_device_limit;
432 	int tx_spl_device_limit;
433 	int tx_sw_internode_queue;
434 	int mon_drop_thresh;
435 #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
436 	uint32_t tx_comp_loop_pkt_limit;
437 	uint32_t rx_reap_loop_pkt_limit;
438 	uint32_t rx_hp_oos_update_limit;
439 	bool rx_enable_eol_data_check;
440 	bool tx_comp_enable_eol_data_check;
441 #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */
442 	int rx_sw_desc_weight;
443 	int rx_sw_desc_num;
444 	bool is_rx_mon_protocol_flow_tag_enabled;
445 	bool is_rx_flow_tag_enabled;
446 	bool is_rx_flow_search_table_per_pdev;
447 	uint16_t rx_flow_search_table_size;
448 	uint16_t rx_flow_max_search;
449 	uint8_t *rx_toeplitz_hash_key;
450 	uint8_t pktlog_buffer_size;
451 	uint8_t is_rx_fisa_enabled;
452 	bool is_rx_fisa_lru_del_enabled;
453 	bool is_tso_desc_attach_defer;
454 	uint32_t delayed_replenish_entries;
455 	uint32_t reo_rings_mapping;
456 	bool pext_stats_enabled;
457 	bool is_rx_buff_pool_enabled;
458 	bool is_rx_refill_buff_pool_enabled;
459 	uint32_t rx_pending_high_threshold;
460 	uint32_t rx_pending_low_threshold;
461 	bool is_poll_mode_enabled;
462 	uint8_t is_swlm_enabled;
463 	bool fst_in_cmem;
464 	bool tx_per_pkt_vdev_id_check;
465 	uint8_t radio0_rx_default_reo;
466 	uint8_t radio1_rx_default_reo;
467 	uint8_t radio2_rx_default_reo;
468 	bool wow_check_rx_pending_enable;
469 	bool jitter_stats_enabled;
470 #ifdef IPA_OFFLOAD
471 	uint32_t ipa_tx_ring_size;
472 	uint32_t ipa_tx_comp_ring_size;
473 #ifdef IPA_WDI3_TX_TWO_PIPES
474 	int ipa_tx_alt_ring_size;
475 	int ipa_tx_alt_comp_ring_size;
476 #endif /* IPA_WDI3_TX_TWO_PIPES */
477 #endif /* IPA_OFFLOAD */
478 	bool hw_cc_enabled;
479 	struct wlan_cfg_tcl_wbm_ring_num_map *tcl_wbm_map_array;
480 #ifdef WLAN_SUPPORT_PPEDS
481 	bool ppeds_enable;
482 	int reo2ppe_ring;
483 	int ppe2tcl_ring;
484 	int ppeds_num_tx_desc;
485 	int ppeds_tx_comp_napi_budget;
486 #endif
487 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
488 	uint32_t pkt_capture_mode;
489 #endif
490 	uint32_t rx_mon_buf_ring_size;
491 	uint32_t tx_mon_buf_ring_size;
492 	uint8_t rx_rel_wbm2sw_ring_id;
493 	uint32_t tx_rings_grp_bitmap;
494 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
495 	uint8_t mlo_chip_rx_ring_map;
496 #endif
497 #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
498 	bool vdev_stats_hw_offload_config;
499 	int vdev_stats_hw_offload_timer;
500 #endif
501 	uint8_t num_rxdma_dst_rings_per_pdev;
502 	bool txmon_hw_support;
503 	bool txmon_sw_peer_filtering;
504 	uint8_t num_rxdma_status_rings_per_pdev;
505 #ifdef WLAN_TX_PKT_CAPTURE_ENH
506 	uint32_t tx_capt_max_mem_allowed;
507 #endif
508 #ifdef CONFIG_SAWF
509 	bool sawf_enabled;
510 #endif
511 #ifdef CONFIG_SAWF_STATS
512 	uint8_t sawf_stats;
513 #endif
514 	uint8_t mpdu_retry_threshold_1;
515 	uint8_t mpdu_retry_threshold_2;
516 	uint8_t napi_scale_factor;
517 	uint8_t notify_frame_support;
518 	bool is_handle_invalid_decap_type_disabled;
519 };
520 
521 /**
522  * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
523  * @rx_dma_buf_ring_size: Size of RxDMA buffer ring
524  * @dma_mon_buf_ring_size: Size of RxDMA Monitor buffer ring
525  * @dma_rx_mon_dest_ring_size: Size of RxDMA Monitor Destination ring
526  * @dma_tx_mon_dest_ring_size: Size of Tx Monitor Destination ring
527  * @dma_mon_status_ring_size: Size of RxDMA Monitor Status ring
528  * @rxdma_monitor_desc_ring: rxdma monitor desc ring size
529  * @num_mac_rings: Number of mac rings
530  * @nss_enabled: 1 - NSS enabled, 0 - NSS disabled
531  * @dma_tx_mon_buf_ring_size: Tx monitor BUF Ring size
532  */
533 struct wlan_cfg_dp_pdev_ctxt {
534 	int rx_dma_buf_ring_size;
535 	int dma_mon_buf_ring_size;
536 	int dma_rx_mon_dest_ring_size;
537 	int dma_tx_mon_dest_ring_size;
538 	int dma_mon_status_ring_size;
539 	int rxdma_monitor_desc_ring;
540 	int num_mac_rings;
541 	int nss_enabled;
542 	int dma_tx_mon_buf_ring_size;
543 };
544 
545 /**
546  * struct wlan_dp_prealloc_cfg - DP prealloc related config
547  * @num_tx_ring_entries: num of tcl data ring entries
548  * @num_tx_comp_ring_entries: num of tx comp ring entries
549  * @num_wbm_rel_ring_entries: num of wbm err ring entries
550  * @num_rxdma_err_dst_ring_entries: num of rxdma err ring entries
551  * @num_reo_exception_ring_entries: num of rx exception ring entries
552  * @num_tx_desc: num of tx descriptors
553  * @num_tx_ext_desc: num of tx ext descriptors
554  * @num_reo_dst_ring_entries: Number of entries in REO destination ring
555  * @num_rxdma_buf_ring_entries: Number of entries in rxdma buf ring
556  * @num_rxdma_refill_ring_entries: Number of entries in rxdma refill ring
557  * @num_reo_status_ring_entries: Number of entries in REO status ring
558  * @num_mon_status_ring_entries: Number of entries in monitor status ring
559  */
560 struct wlan_dp_prealloc_cfg {
561 	int num_tx_ring_entries;
562 	int num_tx_comp_ring_entries;
563 	int num_wbm_rel_ring_entries;
564 	int num_rxdma_err_dst_ring_entries;
565 	int num_reo_exception_ring_entries;
566 	int num_tx_desc;
567 	int num_tx_ext_desc;
568 	int num_reo_dst_ring_entries;
569 	int num_rxdma_buf_ring_entries;
570 	int num_rxdma_refill_ring_entries;
571 	int num_reo_status_ring_entries;
572 	int num_mon_status_ring_entries;
573 };
574 
575 /**
576  * wlan_cfg_soc_attach() - Attach configuration interface for SoC
577  * @psoc: PSOC object
578  *
579  * Allocates context for Soc configuration parameters,
580  * Read configuration information from device tree/ini file and
581  * returns back handle
582  *
583  * Return: Handle to configuration context
584  */
585 struct wlan_cfg_dp_soc_ctxt *
586 wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc);
587 
588 /**
589  * wlan_cfg_soc_detach() - Detach soc configuration handle
590  * @wlan_cfg_ctx: soc configuration handle
591  *
592  * De-allocates memory allocated for SoC configuration
593  *
594  * Return:none
595  */
596 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
597 
598 /**
599  * wlan_cfg_pdev_attach() - Attach configuration interface for pdev
600  * @ctrl_obj: PSOC object
601  *
602  * Allocates context for pdev configuration parameters,
603  * Read configuration information from device tree/ini file and
604  * returns back handle
605  *
606  * Return: Handle to configuration context
607  */
608 struct wlan_cfg_dp_pdev_ctxt *
609 wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj);
610 
611 /**
612  * wlan_cfg_pdev_detach() - Detach and free pdev configuration handle
613  * @wlan_cfg_pdev_ctx: PDEV Configuration Handle
614  *
615  * Return: void
616  */
617 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
618 
619 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
620 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
621 			       int context, int mask);
622 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
623 			       int context, int mask);
624 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
625 				   int context, int mask);
626 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
627 			       int context, int mask);
628 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
629 				  int mask);
630 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
631 void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
632 int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg);
633 int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg);
634 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
635 				int context, int mask);
636 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
637 					int context, int mask);
638 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
639 					int context, int mask);
640 
641 /**
642  * wlan_cfg_set_mon_delayed_replenish_entries() - number of buffers to replenish
643  *				for monitor buffer ring at initialization
644  * @wlan_cfg_ctx: Configuration Handle
645  * @replenish_entries: number of entries to replenish at initialization
646  *
647  */
648 void wlan_cfg_set_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
649 						*wlan_cfg_ctx,
650 						uint32_t replenish_entries);
651 
652 /**
653  * wlan_cfg_get_mon_delayed_replenish_entries() - get num of buffer to replenish
654  *				for monitor buffer ring at initialization
655  * @wlan_cfg_ctx: Configuration Handle
656  *
657  * Return: delayed_replenish_entries;
658  */
659 int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt
660 					       *wlan_cfg_ctx);
661 /**
662  * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
663  * @wlan_cfg_ctx: Configuration Handle
664  *
665  * For WIN,  DP_NUM_INTERRUPT_CONTEXTS will be equal to  number of CPU cores.
666  * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
667  * rx_ring_mask ,and rx_monitor_ring mask  to indicate the rings
668  * that are processed by the handler.
669  *
670  * Return: num_contexts
671  */
672 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
673 
674 /**
675  * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
676  *				 interrupt context
677  * @wlan_cfg_ctx: Configuration Handle
678  * @context: Numerical ID identifying the Interrupt/NAPI context
679  *
680  * Return: int_tx_ring_mask[context]
681  */
682 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
683 		int context);
684 
685 /**
686  * wlan_cfg_get_tcl_wbm_ring_num_for_index() - Get TCL/WBM ring number for index
687  * @wlan_cfg_ctx: Configuration Handle
688  * @index: index for which TCL/WBM ring numbers are needed
689  * @tcl: pointer to TCL ring number, to be filled
690  * @wbm: pointer to WBM ring number to be filled
691  *
692  * The function fills in tcl/wbm input pointers with TCL/WBM ring numbers for a
693  * given index corresponding to soc->tcl_data_ring or soc->tx_comp_ring. This
694  * is needed since WBM/TCL rings may not be sequentially available for HOST
695  * to use. The function returns values as stored in tcl_wbm_map_array global
696  * array.
697  *
698  * Return: None
699  */
700 static inline
701 void wlan_cfg_get_tcl_wbm_ring_num_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
702 					     int index, int *tcl, int *wbm)
703 {
704 	*tcl = wlan_cfg_ctx->tcl_wbm_map_array[index].tcl_ring_num;
705 	*wbm = wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_ring_num;
706 }
707 
708 /**
709  * wlan_cfg_get_wbm_ring_num_for_index() - Get WBM ring number for index
710  * @wlan_cfg_ctx: Configuration Handle
711  * @index: index for which WBM ring numbers is needed
712  *
713  * Return: WBM Ring number for the index
714  */
715 static inline
716 int wlan_cfg_get_wbm_ring_num_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
717 					int index)
718 {
719 	return wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_ring_num;
720 }
721 
722 /**
723  * wlan_cfg_get_rbm_id_for_index() - Get WBM RBM ID for TX ring index
724  * @wlan_cfg_ctx: Configuration Handle
725  * @index: TCL index for which WBM rbm value is needed
726  *
727  * The function fills in wbm rbm value corresponding to a TX ring index in
728  * soc->tcl_data_ring. This is needed since WBM ring numbers donot map
729  * sequentially to wbm rbm values.
730  * The function returns rbm id values as stored in tcl_wbm_map_array global
731  * array.
732  *
733  * Return: WBM rbm value corresnponding to TX ring index
734  */
735 static inline
736 int wlan_cfg_get_rbm_id_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, int index)
737 {
738 	return wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_rbm_id;
739 }
740 
741 /**
742  * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
743  *				 interrupt context
744  * @wlan_cfg_ctx: Configuration Handle
745  * @context: Numerical ID identifying the Interrupt/NAPI context
746  *
747  * Return: int_rx_ring_mask[context]
748  */
749 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
750 		int context);
751 
752 /**
753  * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
754  *				   mapped to an interrupt context
755  * @wlan_cfg_ctx: Configuration Handle
756  * @context: Numerical ID identifying the Interrupt/NAPI context
757  *
758  * Return: int_rx_mon_ring_mask[context]
759  */
760 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
761 		int context);
762 
763 /**
764  * wlan_cfg_set_tx_mon_ring_mask() - Set Tx monitor ring interrupt mask
765  *				   mapped to an interrupt context
766  * @cfg: Configuration Handle
767  * @context: Numerical ID identifying the Interrupt/NAPI context
768  * @mask: Interrupt mask
769  *
770  * Return: None
771  */
772 void wlan_cfg_set_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
773 				   int context, int mask);
774 
775 /**
776  * wlan_cfg_get_tx_mon_ring_mask() - Return Tx monitor ring interrupt mask
777  *				   mapped to an interrupt context
778  * @wlan_cfg_ctx: Configuration Handle
779  * @context: Numerical ID identifying the Interrupt/NAPI context
780  *
781  * Return: int_tx_mon_ring_mask[context]
782  */
783 int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
784 				  int context);
785 
786 /**
787  * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
788  *				   for the given interrupt context
789  * @cfg: Configuration Handle
790  * @context: Numerical ID identifying the Interrupt/NAPI context
791  * @mask: Interrupt mask
792  *
793  */
794 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
795 				       int context, int mask);
796 
797 /**
798  * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
799  *				   mapped to an interrupt context
800  * @cfg: Configuration Handle
801  * @context: Numerical ID identifying the Interrupt/NAPI context
802  *
803  * Return: int_rxdma2host_ring_mask[context]
804  */
805 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
806 				      int context);
807 
808 /**
809  * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
810  *				   for the given interrupt context
811  * @cfg: Configuration Handle
812  * @context: Numerical ID identifying the Interrupt/NAPI context
813  * @mask: Interrupt mask
814  *
815  */
816 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
817 				       int context, int mask);
818 
819 /**
820  * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
821  *				   mapped to an interrupt context
822  * @cfg: Configuration Handle
823  * @context: Numerical ID identifying the Interrupt/NAPI context
824  *
825  * Return: int_host2rxdma_ring_mask[context]
826  */
827 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
828 				      int context);
829 
830 /**
831  * wlan_cfg_get_rx_near_full_grp_1_mask() - Return REO near full interrupt mask
832  *					mapped to an interrupt context
833  * @cfg: Configuration Handle
834  * @context: Numerical ID identifying the Interrupt/NAPI context
835  *
836  * Return: REO near full interrupt mask[context]
837  */
838 int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
839 					 int context);
840 
841 /**
842  * wlan_cfg_get_rx_near_full_grp_2_mask() - Return REO near full interrupt mask
843  *					mapped to an interrupt context
844  * @cfg: Configuration Handle
845  * @context: Numerical ID identifying the Interrupt/NAPI context
846  *
847  * Return: REO near full interrupt mask[context]
848  */
849 int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
850 					 int context);
851 
852 /**
853  * wlan_cfg_get_tx_ring_near_full_mask() - Return tx completion ring near full
854  *				interrupt mask mapped to an interrupt context
855  * @cfg: Configuration Handle
856  * @context: Numerical ID identifying the Interrupt/NAPI context
857  *
858  * Return: tx completion near full interrupt mask[context]
859  */
860 int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
861 					int context);
862 /**
863  * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
864  *                                interrupt mask for the given interrupt context
865  * @cfg: Configuration Handle
866  * @context: Numerical ID identifying the Interrupt/NAPI context
867  * @mask: Interrupt mask
868  *
869  */
870 void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
871 					   int context, int mask);
872 
873 /**
874  * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring
875  *                               interrupt mask mapped to an interrupt context
876  * @cfg: Configuration Handle
877  * @context: Numerical ID identifying the Interrupt/NAPI context
878  *
879  * Return: int_host2rxdma_mon_ring_mask[context]
880  */
881 int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
882 					  int context);
883 
884 /**
885  * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor
886  *				   destination ring interrupt mask
887  *				   for the given interrupt context
888  * @cfg: Configuration Handle
889  * @context: Numerical ID identifying the Interrupt/NAPI context
890  * @mask: Interrupt mask
891  *
892  */
893 void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
894 					   int context, int mask);
895 
896 /**
897  * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor
898  *				   destination ring interrupt mask
899  *				   mapped to an interrupt context
900  * @cfg: Configuration Handle
901  * @context: Numerical ID identifying the Interrupt/NAPI context
902  *
903  * Return: int_rxdma2host_mon_ring_mask[context]
904  */
905 int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
906 					  int context);
907 
908 /**
909  * wlan_cfg_set_hw_mac_idx() - Set HW MAC Idx for the given PDEV index
910  *
911  * @cfg: Configuration Handle
912  * @pdev_idx: Index of SW PDEV
913  * @hw_macid: HW MAC Id
914  *
915  */
916 void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg,
917 			     int pdev_idx, int hw_macid);
918 
919 /**
920  * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
921  * PDEV index
922  *
923  * @cfg: Configuration Handle
924  * @pdev_idx: Index of SW PDEV
925  *
926  * Return: HW MAC index
927  */
928 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
929 
930 /**
931  * wlan_cfg_get_target_pdev_id() - Get target PDEV ID for HW MAC ID
932  *
933  * @cfg: Configuration Handle
934  * @hw_macid: Index of hw mac
935  *
936  * Return: PDEV ID
937  */
938 int
939 wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
940 
941 /**
942  * wlan_cfg_set_pdev_idx() - Set 0 based host PDEV index for the given
943  * hw mac index
944  *
945  * @cfg: Configuration Handle
946  * @pdev_idx: Index of SW PDEV
947  * @hw_macid: Index of hw mac
948  *
949  * Return: PDEV index
950  */
951 void wlan_cfg_set_pdev_idx
952 	(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid);
953 
954 /**
955  * wlan_cfg_get_pdev_idx() - Get 0 based PDEV index for the given
956  * hw mac index
957  *
958  * @cfg: Configuration Handle
959  * @hw_macid: Index of hw mac
960  *
961  * Return: PDEV index
962  */
963 int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid);
964 
965 /**
966  * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
967  *					   mapped to an interrupt context
968  * @cfg: Configuration Handle
969  * @context: Numerical ID identifying the Interrupt/NAPI context
970  *
971  * Return: int_rx_err_ring_mask[context]
972  */
973 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
974 				  context);
975 
976 /**
977  * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
978  *					   mapped to an interrupt context
979  * @cfg: Configuration Handle
980  * @context: Numerical ID identifying the Interrupt/NAPI context
981  *
982  * Return: int_wbm_rel_ring_mask[context]
983  */
984 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
985 				      context);
986 
987 /**
988  * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
989  *					   mapped to an interrupt context
990  * @cfg: Configuration Handle
991  * @context: Numerical ID identifying the Interrupt/NAPI context
992  *
993  * Return: int_reo_status_ring_mask[context]
994  */
995 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
996 				      context);
997 
998 /**
999  * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
1000  *				mapped to an interrupt context
1001  * @wlan_cfg_ctx: Configuration Handle
1002  * @context: Numerical ID identifying the Interrupt/NAPI context
1003  *
1004  * Return: int_ce_ring_mask[context]
1005  */
1006 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
1007 		int context);
1008 
1009 /**
1010  * wlan_cfg_get_umac_reset_intr_mask() - Get UMAC reset interrupt mask
1011  * mapped to an interrupt context
1012  * @cfg: Configuration Handle
1013  * @context: Numerical ID identifying the Interrupt/NAPI context
1014  *
1015  * Return: int_umac_reset_intr_mask[context]
1016  */
1017 int wlan_cfg_get_umac_reset_intr_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
1018 				      int context);
1019 /**
1020  * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
1021  *				supported by device
1022  * @wlan_cfg_ctx: Configuration Handle
1023  *
1024  * Return: max_clients
1025  */
1026 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1027 
1028 /**
1029  * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
1030  *			    memory allocation request for this device
1031  * @wlan_cfg_ctx: Configuration Handle
1032  *
1033  * Return: max_alloc_size
1034  */
1035 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1036 
1037 /**
1038  * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
1039  *			       one per radio
1040  * @wlan_cfg_ctx: Configuration Handle
1041  *
1042  * Return: per_pdev_tx_ring
1043  */
1044 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1045 
1046 /**
1047  * wlan_cfg_num_tx_comp_rings() - Number of Tx comp rings (HOST mode)
1048  * @wlan_cfg_ctx: Configuration Handle
1049  *
1050  * Return: num_tx_comp_rings
1051  */
1052 int wlan_cfg_num_tx_comp_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1053 
1054 /**
1055  * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings (HOST mode)
1056  * @wlan_cfg_ctx: Configuration Handle
1057  *
1058  * Return: num_tcl_data_rings
1059  */
1060 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1061 
1062 /**
1063  * wlan_cfg_num_nss_tcl_data_rings() - Number of TCL Data rings (NSS offload)
1064  * @wlan_cfg_ctx: Configuration Handle
1065  *
1066  * Return: num_tcl_data_rings
1067  */
1068 int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1069 
1070 /**
1071  * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
1072  *                              one per radio
1073  * @wlan_cfg_ctx: Configuration Handle
1074  *
1075  * Return: per_pdev_rx_ring
1076  */
1077 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1078 
1079 /**
1080  * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
1081  *                              one per radio
1082  * @wlan_cfg_ctx: Configuration Handle
1083  *
1084  * Return: return 1 if per pdev error ring else 0
1085  */
1086 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1087 
1088 /**
1089  * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings (HOST mode)
1090  * @wlan_cfg_ctx: Configuration Handle
1091  *
1092  * Return: num_reo_dest_rings
1093  */
1094 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1095 
1096 /**
1097  * wlan_cfg_num_nss_reo_dest_rings() - Number of REO Data rings (NSS offload)
1098  * @wlan_cfg_ctx: Configuration Handle
1099  *
1100  * Return: num_reo_dest_rings
1101  */
1102 int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1103 
1104 /**
1105  * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
1106  * @wlan_cfg_ctx: Configuration Handle
1107  *
1108  * Return: htt_pkt_type_ethernet
1109  */
1110 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1111 
1112 /**
1113  * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
1114  *					device
1115  * @wlan_cfg_ctx: Configuration Handle
1116  *
1117  * Return: num_tx_desc_pool
1118  */
1119 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1120 
1121 /**
1122  * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
1123  *					device
1124  * @cfg: Configuration Handle
1125  * @num_pool: Number of pool
1126  */
1127 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
1128 
1129 /**
1130  * wlan_cfg_get_num_tx_ext_desc_pool() -  Number of Tx MSDU ext Descriptor
1131  *					pools
1132  * @wlan_cfg_ctx: Configuration Handle
1133  *
1134  * Return: num_tx_ext_desc_pool
1135  */
1136 int wlan_cfg_get_num_tx_ext_desc_pool(
1137 		struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1138 
1139 /**
1140  * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
1141  *
1142  * @cfg: Configuration Handle
1143  *
1144  * Return: reo_dst_ring_size
1145  */
1146 int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1147 
1148 /**
1149  * wlan_cfg_set_reo_dst_ring_size() - Set the REO Destination ring size
1150  *
1151  * @cfg: Configuration Handle
1152  * @reo_dst_ring_size: REO Destination ring size
1153  */
1154 void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
1155 				    int reo_dst_ring_size);
1156 
1157 /**
1158  * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
1159  *
1160  * @cfg: Configuration Handle
1161  * @raw_mode_war: raw mode war configuration
1162  */
1163 void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
1164 			       bool raw_mode_war);
1165 
1166 /**
1167  * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
1168  *
1169  * @cfg: Configuration Handle
1170  *
1171  * Return: reo_dst_ring_size
1172  */
1173 bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
1174 
1175 /**
1176  * wlan_cfg_set_num_tx_ext_desc_pool() -  Set the number of Tx MSDU ext Descriptor
1177  *					pools
1178  * @cfg: Configuration Handle
1179  * @num_pool: Number of pool
1180  */
1181 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
1182 
1183 /**
1184  * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
1185  * @wlan_cfg_ctx: Configuration Handle
1186  *
1187  * Return: num_tx_desc
1188  */
1189 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1190 
1191 /**
1192  * wlan_cfg_get_num_tx_spl_desc() - Number of Tx Descriptors for special
1193  *				    frames per pool
1194  * @wlan_cfg_ctx: Configuration Handle
1195  *
1196  * Return: num_tx_desc
1197  */
1198 int wlan_cfg_get_num_tx_spl_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1199 
1200 /**
1201  * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool
1202  * @wlan_cfg_ctx: Configuration Handle
1203  *
1204  * Return: num_tx_desc
1205  */
1206 int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1207 
1208 /**
1209  * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
1210  *
1211  * @cfg: Configuration Handle
1212  * @num_desc: Number of descriptor
1213  */
1214 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
1215 
1216 /**
1217  * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
1218  *					per pool
1219  * @wlan_cfg_ctx: Configuration Handle
1220  *
1221  * Return: num_tx_ext_desc
1222  */
1223 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
1224 
1225 /**
1226  * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension
1227  *                                  Descriptors per pool
1228  * @cfg: Configuration Handle
1229  * @num_ext_desc: Number of descriptor
1230  */
1231 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg,
1232 				  int num_ext_desc);
1233 
1234 /**
1235  * wlan_cfg_max_peer_id() - Get maximum peer ID
1236  * @cfg: Configuration Handle
1237  *
1238  * Return: maximum peer ID
1239  */
1240 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
1241 
1242 /**
1243  * wlan_cfg_get_dma_mon_buf_ring_size(): Return Size of monitor buffer ring
1244  * @wlan_cfg_pdev_ctx: pdev configuration context
1245  *
1246  * Return: dma_mon_buf_ring_size
1247  */
1248 int wlan_cfg_get_dma_mon_buf_ring_size(
1249 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
1250 
1251 /**
1252  * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
1253  * @wlan_cfg_pdev_ctx: pdev configuration context
1254  *
1255  * Return: dma_mon_stat_ring_size
1256  */
1257 int wlan_cfg_get_dma_mon_stat_ring_size(
1258 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
1259 
1260 /**
1261  * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
1262  * @cfg: soc configuration context
1263  *
1264  * Return: rxdma monitor desc ring size
1265  */
1266 int
1267 wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
1268 
1269 /**
1270  * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
1271  * @wlan_cfg_pdev_ctx: pdev configuration context
1272  *
1273  * Return: rx_dma_buf_ring_size
1274  */
1275 int wlan_cfg_get_rx_dma_buf_ring_size(
1276 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
1277 
1278 /**
1279  * wlan_cfg_rx_pending_hl_threshold() - Return high threshold of rx pending
1280  * @cfg: pdev configuration context
1281  *
1282  * Return: rx_pending_high_threshold
1283  */
1284 uint32_t
1285 wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
1286 
1287 /**
1288  * wlan_cfg_rx_pending_lo_threshold() - Return low threshold of rx pending
1289  * @cfg: soc configuration context
1290  *
1291  * Return: rx_pending_low_threshold
1292  */
1293 uint32_t
1294 wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg);
1295 
1296 /**
1297  * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
1298  * per pdev
1299  * @cfg: pdev configuration context
1300  *
1301  * Return: number of mac DMA rings per pdev
1302  */
1303 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
1304 
1305 /**
1306  * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
1307  * @cfg: soc configuration context
1308  *
1309  * Return: true - LRO enabled false - LRO disabled
1310  */
1311 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1312 
1313 /**
1314  * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled
1315  * @cfg: soc configuration context
1316  *
1317  * Return: true - GRO enabled false - GRO disabled
1318  */
1319 bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1320 
1321 /**
1322  * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
1323  * @cfg: soc configuration context
1324  *
1325  * Return: true - enabled false - disabled
1326  */
1327 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1328 
1329 /**
1330  * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
1331  * @cfg: soc configuration context
1332  *
1333  * Return: true - enabled false - disabled
1334  */
1335 bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1336 
1337 /**
1338  * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
1339  * @cfg: soc configuration context
1340  * @rx_hash: true - enabled false - disabled
1341  */
1342 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
1343 
1344 /**
1345  * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
1346  * @cfg: pdev configuration context
1347  *
1348  * Return: 1 - enabled 0 - disabled
1349  */
1350 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
1351 
1352 /**
1353  * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
1354  * @cfg: pdev configuration context
1355  * @nss_enabled: 1 - enabled 0 - disabled
1356  */
1357 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg,
1358 				      int nss_enabled);
1359 
1360 /**
1361  * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
1362  * @cfg: soc configuration context
1363  *
1364  * Return: nss_cfg
1365  */
1366 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
1367 
1368 /**
1369  * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
1370  * @cfg: soc configuration context
1371  * @nss_cfg: NSS configuration
1372  *
1373  */
1374 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
1375 
1376 /**
1377  * wlan_cfg_get_int_timer_threshold_ppe2tcl - Get intr mitigation for ppe2tcl
1378  * @cfg: soc configuration context
1379  *
1380  * Return: Timer threshold
1381  */
1382 int wlan_cfg_get_int_timer_threshold_ppe2tcl(struct wlan_cfg_dp_soc_ctxt *cfg);
1383 
1384 /**
1385  * wlan_cfg_get_int_batch_threshold_ppe2tcl - Get intr mitigation for ppe2tcl
1386  * @cfg: soc configuration context
1387  *
1388  * Return: Batch threshold
1389  */
1390 int wlan_cfg_get_int_batch_threshold_ppe2tcl(struct wlan_cfg_dp_soc_ctxt *cfg);
1391 
1392 /**
1393  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
1394  * @cfg: soc configuration context
1395  *
1396  * Return: Batch threshold
1397  */
1398 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
1399 
1400 /**
1401  * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
1402  * @cfg: soc configuration context
1403  *
1404  * Return: Timer threshold
1405  */
1406 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
1407 
1408 /**
1409  * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
1410  * @cfg: soc configuration context
1411  *
1412  * Return: Batch threshold
1413  */
1414 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
1415 
1416 /**
1417  * wlan_cfg_get_int_timer_threshold_rx - Get interrupt mitigation cfg for Rx
1418  * @cfg: soc configuration context
1419  *
1420  * Return: Timer threshold
1421  */
1422 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
1423 
1424 /**
1425  * wlan_cfg_get_int_batch_threshold_other - Get interrupt mitigation cfg for
1426  *                                          other srngs
1427  * @cfg: soc configuration context
1428  *
1429  * Return: Batch threshold
1430  */
1431 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
1432 
1433 /**
1434  * wlan_cfg_get_int_timer_threshold_other - Get interrupt mitigation cfg for
1435  *                                          other srngs
1436  * @cfg: soc configuration context
1437  *
1438  * Return: Timer threshold
1439  */
1440 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
1441 
1442 /**
1443  * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs
1444  * @cfg: soc configuration context
1445  *
1446  * Return: Timer threshold
1447  */
1448 int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
1449 
1450 /**
1451  * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
1452  * @cfg: soc configuration context
1453  *
1454  * Return: Checksum offload enable or disable
1455  */
1456 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
1457 
1458 /**
1459  * wlan_cfg_get_nan_checksum_offload - Get checksum offload enable/disable val
1460  * @cfg: soc configuration context
1461  *
1462  * Return: Checksum offload enable or disable value for NAN mode
1463  */
1464 int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
1465 
1466 /**
1467  * wlan_cfg_get_p2p_checksum_offload - Get checksum offload enable/disable val
1468  * @cfg: soc configuration context
1469  *
1470  * Return: Checksum offload enable or disable value for P2P mode
1471  */
1472 int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
1473 
1474 /**
1475  * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
1476  * @cfg: soc configuration context
1477  *
1478  * Return: Tx Ring Size
1479  */
1480 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1481 
1482 /**
1483  * wlan_cfg_time_control_bp - Get time for interval in bp prints
1484  * @cfg: soc configuration context
1485  *
1486  * Return: interval time
1487  */
1488 int wlan_cfg_time_control_bp(struct wlan_cfg_dp_soc_ctxt *cfg);
1489 
1490 /**
1491  * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
1492  * @cfg: soc configuration context
1493  *
1494  * Return: Tx Completion ring size
1495  */
1496 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1497 
1498 /**
1499  * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
1500  * @cfg: soc configuration context
1501  *
1502  * Return: wbm_release_ring size
1503  */
1504 int
1505 wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1506 
1507 /**
1508  * wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size - Get command/credit ring size
1509  * @cfg: soc configuration context
1510  *
1511  * Return: tcl_cmd_credit_ring size
1512  */
1513 int
1514 wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1515 
1516 /**
1517  * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
1518  * @cfg: soc configuration context
1519  *
1520  * Return: tcl_status_ring size
1521  */
1522 int
1523 wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1524 
1525 /**
1526  * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
1527  * @cfg: soc configuration context
1528  *
1529  * Return: reo_reinject_ring size
1530  */
1531 int
1532 wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1533 
1534 /**
1535  * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
1536  * @cfg: soc configuration context
1537  *
1538  * Return: rx_release_ring size
1539  */
1540 int
1541 wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1542 
1543 /**
1544  * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
1545  * @cfg: soc configuration context
1546  *
1547  * Return: reo_exception_ring size
1548  */
1549 int
1550 wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1551 
1552 /**
1553  * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
1554  * @cfg: soc configuration context
1555  *
1556  * Return: reo_cmd_ring size
1557  */
1558 int
1559 wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1560 
1561 /**
1562  * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
1563  * @cfg: soc configuration context
1564  *
1565  * Return: reo_status_ring size
1566  */
1567 int
1568 wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1569 
1570 /**
1571  * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H
1572  * @cfg: soc configuration context
1573  *
1574  * Return: tx desc limit for 5G H
1575  */
1576 int
1577 wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg);
1578 
1579 /**
1580  * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G
1581  * @cfg: soc configuration context
1582  *
1583  * Return: tx desc limit for 2G
1584  */
1585 int
1586 wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg);
1587 
1588 /**
1589  * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L
1590  * @cfg: soc configuration context
1591  *
1592  * Return: tx desc limit for 5G L
1593  */
1594 int
1595 wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg);
1596 
1597 /**
1598  * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit
1599  * @cfg: soc configuration context
1600  *
1601  * Return: tx device limit
1602  */
1603 int
1604 wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
1605 
1606 /**
1607  * wlan_cfg_get_dp_soc_tx_spl_device_limit - Get tx device limit for special
1608  *					     frames
1609  * @cfg: Configuration Handle
1610  *
1611  * Return: tx device limit for special frames
1612  */
1613 int
1614 wlan_cfg_get_dp_soc_tx_spl_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
1615 
1616 /**
1617  * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue
1618  * @cfg: soc configuration context
1619  *
1620  * Return: tx sw internode queue
1621  */
1622 int
1623 wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg);
1624 
1625 /**
1626  * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
1627  * @cfg: soc configuration context
1628  *
1629  * Return: rxdma refill ring size
1630  */
1631 int
1632 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1633 
1634 /**
1635  * wlan_cfg_get_dp_soc_rxdma_refill_lt_disable - Get RxDMA refill LT status
1636  * @cfg: soc configuration context
1637  *
1638  * Return: true if Low threshold disable else false
1639  */
1640 bool
1641 wlan_cfg_get_dp_soc_rxdma_refill_lt_disable(struct wlan_cfg_dp_soc_ctxt *cfg);
1642 
1643 /**
1644  * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
1645  * @cfg: soc configuration context
1646  *
1647  * Return: rxdma error dst ring size
1648  */
1649 int
1650 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1651 
1652 /**
1653  * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight
1654  * @cfg: soc configuration context
1655  *
1656  * Return: rx_sw_desc_weight
1657  */
1658 int
1659 wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg);
1660 
1661 /**
1662  * wlan_cfg_get_dp_soc_rx_sw_desc_num - Get rx sw desc num
1663  * @cfg: soc configuration context
1664  *
1665  * Return: rx_sw_desc_num
1666  */
1667 int
1668 wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg);
1669 
1670 /**
1671  * wlan_cfg_get_dp_caps - Get dp capabilities
1672  * @cfg: soc configuration context
1673  * @dp_caps: enum for dp capabilities
1674  *
1675  * Return: bool if a dp capabilities is enabled
1676  */
1677 bool
1678 wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
1679 		     enum cdp_capabilities dp_caps);
1680 
1681 /**
1682  * wlan_set_srng_cfg() - Fill per ring specific
1683  * configuration parameters
1684  * @wlan_cfg: global srng configuration table
1685  *
1686  * Return: None
1687  */
1688 void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg);
1689 
1690 #ifdef QCA_LL_TX_FLOW_CONTROL_V2
1691 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
1692 
1693 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
1694 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
1695 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
1696 
1697 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
1698 
1699 /**
1700  * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST
1701  *                                            in number of entries
1702  *
1703  * @cfg: soc configuration context
1704  *
1705  * Return: rx_fst_size
1706  */
1707 uint16_t
1708 wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1709 
1710 /**
1711  * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search
1712  *
1713  * @cfg: soc configuration context
1714  *
1715  * Return: max_search
1716  */
1717 uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg);
1718 
1719 /**
1720  * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST
1721  *                                  search
1722  *
1723  * @cfg: soc configuration context
1724  *
1725  * Return: 320-bit Hash Key
1726  */
1727 uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg);
1728 
1729 /**
1730  * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in
1731  *                                      DP soc context
1732  * @cfg: soc configuration context
1733  * @val: Rx flow tag feature flag value
1734  *
1735  * Return: None
1736  */
1737 void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
1738 				      bool val);
1739 
1740 /**
1741  * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from
1742  *                                     DP soc context
1743  * @cfg: soc configuration context
1744  *
1745  * Return: true if feature is enabled, else false
1746  */
1747 bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1748 
1749 /**
1750  * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that
1751  *                                                Rx FST is per pdev
1752  * @cfg: soc configuration context
1753  * @val: boolean flag indicating Rx FST per pdev or per SOC
1754  *
1755  * Return: None
1756  */
1757 void
1758 wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
1759 					   bool val);
1760 
1761 /**
1762  * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev
1763  * @cfg: soc configuration context
1764  *
1765  * Return: true if Rx FST is per pdev, else false
1766  */
1767 bool
1768 wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg);
1769 
1770 /**
1771  * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context
1772  * @cfg: soc configuration context
1773  * @val: Rx FST size in number of entries
1774  *
1775  * Return: None
1776  */
1777 void
1778 wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
1779 				       uint16_t val);
1780 
1781 /**
1782  * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag
1783  *                                                   in DP soc context
1784  * @cfg: soc configuration context
1785  * @val: Rx protocol or flow tag feature flag value in monitor mode from INI
1786  *
1787  * Return: None
1788  */
1789 void
1790 wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
1791 					      bool val);
1792 
1793 /**
1794  * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag
1795  *                                                  from DP soc context
1796  * @cfg: soc configuration context
1797  *
1798  * Return: true if feature is enabled in monitor mode for protocol or flow
1799  * tagging in INI, false otherwise
1800  */
1801 bool
1802 wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1803 
1804 /**
1805  * wlan_cfg_set_tx_per_pkt_vdev_id_check() - set flag to enable perpkt
1806  *                                              vdev id check in tx.
1807  * @cfg: soc configuration context
1808  * @val: feature flag value
1809  *
1810  * Return: None
1811  */
1812 void
1813 wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
1814 				      bool val);
1815 
1816 /**
1817  * wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled() - get flag to check if
1818  *                              perpkt vdev id check is enabled in tx.
1819  * @cfg: soc configuration context
1820  *
1821  * Return: true if feature is enabled, false otherwise
1822  */
1823 bool
1824 wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1825 
1826 /**
1827  * wlan_cfg_fill_interrupt_mask() - set interrupt mask
1828  *
1829  * @wlan_cfg_ctx: soc configuration context
1830  * @num_dp_msi: Number of DP interrupts available (0 for integrated)
1831  * @interrupt_mode: Type of interrupt
1832  * @is_monitor_mode: is monitor mode enabled
1833  *
1834  * Return: void
1835  */
1836 void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
1837 				  int num_dp_msi, int interrupt_mode,
1838 				  bool is_monitor_mode);
1839 
1840 /**
1841  * wlan_cfg_is_rx_fisa_enabled() - Get Rx FISA enabled flag
1842  *
1843  *
1844  * @cfg: soc configuration context
1845  *
1846  * Return: true if enabled, false otherwise.
1847  */
1848 bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1849 
1850 /**
1851  * wlan_cfg_is_rx_fisa_lru_del_enabled() - Get Rx FISA LRU del enabled flag
1852  *
1853  *
1854  * @cfg: soc configuration context
1855  *
1856  * Return: true if enabled, false otherwise.
1857  */
1858 bool wlan_cfg_is_rx_fisa_lru_del_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1859 
1860 /**
1861  * wlan_cfg_is_rx_buffer_pool_enabled() - Get RX buffer pool enabled flag
1862  *
1863  *
1864  * @cfg: soc configuration context
1865  *
1866  * Return: true if enabled, false otherwise.
1867  */
1868 bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1869 
1870 /**
1871  * wlan_cfg_is_rx_refill_buffer_pool_enabled() - Get RX refill buffer pool enabled flag
1872  *
1873  *
1874  * @cfg: soc configuration context
1875  *
1876  * Return: true if enabled, false otherwise.
1877  */
1878 bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1879 
1880 
1881 void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
1882 					bool val);
1883 
1884 bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg);
1885 
1886 /**
1887  * wlan_cfg_get_reo_rings_mapping() - Get Reo destination ring bitmap
1888  *
1889  *
1890  * @cfg: soc configuration context
1891  *
1892  * Return: reo ring bitmap.
1893  */
1894 uint32_t wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg);
1895 
1896 /**
1897  * wlan_cfg_set_peer_ext_stats() - set peer extended stats
1898  *
1899  * @cfg: soc configuration context
1900  * @val: Flag value read from INI
1901  *
1902  * Return: void
1903  */
1904 void
1905 wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
1906 			    bool val);
1907 
1908 /**
1909  * wlan_cfg_set_peer_jitter_stats() - set peer jitter stats
1910  *
1911  * @cfg: soc configuration context
1912  * @val: Flag value read from INI
1913  *
1914  * Return: bool
1915  */
1916 void
1917 wlan_cfg_set_peer_jitter_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
1918 			       bool val);
1919 
1920 /**
1921  * wlan_cfg_is_peer_ext_stats_enabled() - Check if peer extended
1922  *                                        stats are enabled
1923  *
1924  * @cfg: soc configuration context
1925  *
1926  * Return: bool
1927  */
1928 bool
1929 wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1930 
1931 /**
1932  * wlan_cfg_is_peer_jitter_stats_enabled() - check if jitter stats are enabled
1933  *
1934  * @cfg: soc configuration context
1935  *
1936  * Return: bool
1937  */
1938 bool
1939 wlan_cfg_is_peer_jitter_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1940 
1941 /**
1942  * wlan_cfg_is_poll_mode_enabled() - Check if poll mode is enabled
1943  *
1944  * @cfg: soc configuration context
1945  *
1946  * Return: bool
1947  */
1948 
1949 bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1950 
1951 /**
1952  * wlan_cfg_is_fst_in_cmem_enabled() - Check if FST in CMEM is enabled
1953  * @cfg: soc configuration context
1954  *
1955  * Return: true if enabled, false otherwise.
1956  */
1957 bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1958 
1959 /**
1960  * wlan_cfg_is_swlm_enabled() - Get SWLMenabled flag
1961  * @cfg: soc configuration context
1962  *
1963  * Return: true if enabled, false otherwise.
1964  */
1965 bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
1966 
1967 #ifdef IPA_OFFLOAD
1968 /**
1969  * wlan_cfg_ipa_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
1970  * @cfg: dp cfg context
1971  *
1972  * Return: IPA Tx Ring Size
1973  */
1974 uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1975 
1976 /**
1977  * wlan_cfg_ipa_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
1978  * @cfg: dp cfg context
1979  *
1980  * Return: IPA Tx Completion ring size
1981  */
1982 uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1983 
1984 /**
1985  * wlan_cfg_ipa_tx_alt_ring_size - Get Tx alt DMA ring size (TCL Data Ring)
1986  * @cfg: dp cfg context
1987  *
1988  * Return: IPA Tx alt Ring Size
1989  */
1990 int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
1991 
1992 /**
1993  * wlan_cfg_ipa_tx_alt_comp_ring_size - Get Tx alt comp DMA ring size
1994  *  (TCL Data Ring)
1995  * @cfg: dp cfg context
1996  *
1997  * Return: IPA Tx alt comp Ring Size
1998  */
1999 int
2000 wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
2001 
2002 #else
2003 static inline
2004 uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2005 {
2006 	return 0;
2007 }
2008 
2009 static inline
2010 uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2011 {
2012 	return 0;
2013 }
2014 #endif
2015 
2016 /**
2017  * wlan_cfg_radio0_default_reo_get -  Get Radio0 default REO
2018  * @cfg: soc configuration context
2019  *
2020  * Return: None
2021  */
2022 uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
2023 
2024 /**
2025  * wlan_cfg_radio1_default_reo_get - Get Radio1 default REO
2026  * @cfg: soc configuration context
2027  *
2028  * Return: None
2029  */
2030 uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
2031 
2032 /**
2033  * wlan_cfg_radio2_default_reo_get() - Get Radio2 default REO
2034  * @cfg: soc configuration context
2035  *
2036  * Return: None
2037  */
2038 uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg);
2039 
2040 /**
2041  * wlan_cfg_set_rxdma1_enable() - Enable rxdma1
2042  * @wlan_cfg_ctx: soc configuration context
2043  *
2044  * Return: None
2045  */
2046 void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
2047 
2048 /**
2049  * wlan_cfg_is_delay_mon_replenish() - Get if delayed monitor replenish
2050  * is enabled
2051  * @cfg: soc configuration context
2052  *
2053  * Return: true if enabled, false otherwise.
2054  */
2055 bool
2056 wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg);
2057 
2058 /**
2059  * wlan_cfg_set_delay_mon_replenish() - Set delayed monitor replenish
2060  * @cfg: soc configuration context
2061  * @val: val to set
2062  *
2063  * Return: None
2064  */
2065 void
2066 wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg, bool val);
2067 
2068 /**
2069  * wlan_cfg_dp_soc_ctx_dump() - Dump few DP cfg soc parameters
2070  * @cfg: soc configuration context
2071  *
2072  * Return:
2073  */
2074 void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg);
2075 
2076 #ifdef WLAN_SUPPORT_PPEDS
2077 /**
2078  * wlan_cfg_get_dp_soc_is_ppeds_enabled() - API to get ppe enable flag
2079  * @cfg: Configuration Handle
2080  *
2081  * Return: true if ppe is enabled else return false
2082  */
2083 bool
2084 wlan_cfg_get_dp_soc_is_ppeds_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
2085 
2086 /**
2087  * wlan_cfg_get_dp_soc_reo2ppe_ring_size() - get ppe rx ring size
2088  * @cfg: Configuration Handle
2089  *
2090  * Return: size of reo2ppe ring
2091  */
2092 int
2093 wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
2094 
2095 /**
2096  * wlan_cfg_get_dp_soc_ppe2tcl_ring_size() - get ppe tx ring size
2097  * @cfg: Configuration Handle
2098  *
2099  * Return: size of ppe2tcl ring
2100  */
2101 int
2102 wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
2103 
2104 /**
2105  * wlan_cfg_get_dp_soc_ppeds_num_tx_desc() - Number of ppeds tx Descriptors
2106  * @cfg: Configuration Handle
2107  *
2108  * Return: num_tx_desc
2109  */
2110 int
2111 wlan_cfg_get_dp_soc_ppeds_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg);
2112 
2113 /**
2114  * wlan_cfg_get_dp_soc_ppeds_tx_comp_napi_budget() - ppeds Tx comp napi budget
2115  * @cfg: Configuration Handle
2116  *
2117  * Return: napi budget
2118  */
2119 int
2120 wlan_cfg_get_dp_soc_ppeds_tx_comp_napi_budget(struct wlan_cfg_dp_soc_ctxt *cfg);
2121 #else
2122 static inline bool
2123 wlan_cfg_get_dp_soc_is_ppeds_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
2124 {
2125 	return false;
2126 }
2127 
2128 static inline int
2129 wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2130 {
2131 	return 0;
2132 }
2133 
2134 static inline int
2135 wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2136 {
2137 	return 0;
2138 }
2139 
2140 static inline int
2141 wlan_cfg_get_dp_soc_ppeds_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
2142 {
2143 	return 0;
2144 }
2145 
2146 static inline int
2147 wlan_cfg_get_dp_soc_ppeds_tx_comp_napi_budget(struct wlan_cfg_dp_soc_ctxt *cfg)
2148 {
2149 	return 0;
2150 }
2151 #endif
2152 
2153 /**
2154  * wlan_cfg_get_prealloc_cfg() - Get dp prealloc related cfg param
2155  * @ctrl_psoc: PSOC object
2156  * @cfg: cfg ctx where values will be populated
2157  *
2158  * Return: None
2159  */
2160 void
2161 wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
2162 			  struct wlan_dp_prealloc_cfg *cfg);
2163 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
2164 /**
2165  * wlan_cfg_get_pkt_capture_mode() - Get packet capture mode config
2166  * @cfg: config context
2167  *
2168  * Return: value of packet capture mode
2169  */
2170 uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg);
2171 #else
2172 static inline
2173 uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg)
2174 {
2175 	return 0;
2176 }
2177 #endif
2178 
2179 /**
2180  * wlan_cfg_get_dp_soc_rx_mon_buf_ring_size() - Rx MON buf ring size
2181  * @cfg:  Configuration Handle
2182  *
2183  * Return: Size of Rx MON buf ring size
2184  */
2185 uint32_t
2186 wlan_cfg_get_dp_soc_rx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
2187 
2188 /**
2189  * wlan_cfg_get_dp_soc_tx_mon_buf_ring_size() - Tx MON buf ring size
2190  * @cfg:  Configuration Handle
2191  *
2192  * Return: Size of Tx MON buf ring size
2193  */
2194 uint32_t
2195 wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
2196 
2197 /**
2198  * wlan_cfg_get_dma_rx_mon_dest_ring_size() - Rx MON dest ring size
2199  * @cfg:  Configuration Handle
2200  *
2201  * Return: Size of Rx MON dest ring size
2202  */
2203 int wlan_cfg_get_dma_rx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
2204 
2205 /**
2206  * wlan_cfg_get_dma_tx_mon_dest_ring_size() - Tx MON dest ring size
2207  * @cfg:  Configuration Handle
2208  *
2209  * Return: Size of Tx MON dest ring size
2210  */
2211 int wlan_cfg_get_dma_tx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
2212 
2213 /**
2214  * wlan_cfg_get_rx_rel_ring_id() - get wbm2sw ring id for Rx release ring
2215  * @cfg: Configuration Handle
2216  *
2217  * Return: wbm2sw ring id
2218  */
2219 uint8_t
2220 wlan_cfg_get_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg);
2221 
2222 /**
2223  * wlan_cfg_set_rx_rel_ring_id() - set wbm2sw ring id for Rx release ring
2224  * @cfg: soc configuration context
2225  * @wbm2sw_ring_id: wbm2sw ring id
2226  *
2227  * Return: None
2228  */
2229 void
2230 wlan_cfg_set_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg,
2231 			    uint8_t wbm2sw_ring_id);
2232 
2233 /**
2234  * wlan_cfg_set_vdev_stats_hw_offload_config() - Set hw vdev stats offload
2235  *						 config
2236  * @cfg: config context
2237  * @value: value to be set
2238  *
2239  * Return: none
2240  */
2241 void
2242 wlan_cfg_set_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg,
2243 					  bool value);
2244 
2245 /**
2246  * wlan_cfg_get_vdev_stats_hw_offload_config() - Get hw vdev stats offload
2247  *						 config
2248  * @cfg: config context
2249  *
2250  * Return: value of hw vdev stats config
2251  */
2252 bool
2253 wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg);
2254 
2255 /**
2256  * wlan_cfg_get_vdev_stats_hw_offload_timer()- Get hw vdev stats timer duration
2257  * @cfg: config context
2258  *
2259  * Return: value of hw vdev stats timer duration
2260  */
2261 int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg);
2262 
2263 /**
2264  * wlan_cfg_set_sawf_config() - Set SAWF config enable/disable
2265  * @cfg: config context
2266  * @value: value to be set
2267  *
2268  * Return: none
2269  */
2270 void
2271 wlan_cfg_set_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg, bool value);
2272 
2273 /**
2274  * wlan_cfg_get_sawf_config() - Get SAWF config enable/disable
2275  * @cfg: config context
2276  *
2277  * Return: true or false
2278  */
2279 bool
2280 wlan_cfg_get_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg);
2281 
2282 /**
2283  * wlan_cfg_set_sawf_stats_config() - Set SAWF stats config
2284  * @cfg: config context
2285  * @value: value to be set
2286  *
2287  * Return: void
2288  */
2289 void
2290 wlan_cfg_set_sawf_stats_config(struct wlan_cfg_dp_soc_ctxt *cfg, uint8_t value);
2291 
2292 /**
2293  * wlan_cfg_get_sawf_stats_config() - Get SAWF stats config
2294  * @cfg: config context
2295  *
2296  * Return: value for sawf_stats_config
2297  */
2298 uint8_t
2299 wlan_cfg_get_sawf_stats_config(struct wlan_cfg_dp_soc_ctxt *cfg);
2300 
2301 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
2302 /**
2303  * wlan_cfg_mlo_rx_ring_map_get() - get rx ring map
2304  * @cfg: soc configuration context
2305  *
2306  * Return: rx_ring_map
2307  */
2308 uint8_t
2309 wlan_cfg_mlo_rx_ring_map_get(struct wlan_cfg_dp_soc_ctxt *cfg);
2310 #endif
2311 
2312 /**
2313  * wlan_cfg_set_host2txmon_ring_mask() - Set host2txmon ring
2314  *                               interrupt mask mapped to an interrupt context
2315  * @cfg: Configuration Handle
2316  * @context: interrupt context
2317  * @mask: interrupt mask
2318  *
2319  * Return: None
2320  */
2321 void wlan_cfg_set_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2322 				       int context, int mask);
2323 /**
2324  * wlan_cfg_get_host2txmon_ring_mask() - Return host2txmon ring
2325  *                               interrupt mask mapped to an interrupt context
2326  * @cfg: Configuration Handle
2327  * @context: Numerical ID identifying the Interrupt/NAPI context
2328  *
2329  * Return: int_host2txmon_ring_mask[context]
2330  */
2331 int wlan_cfg_get_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2332 				      int context);
2333 /**
2334  * wlan_cfg_set_txmon_hw_support () - Set txmon hw support
2335  * @cfg:  Configuration Handle
2336  * @txmon_hw_support: value to set
2337  *
2338  * Return: None
2339  */
2340 void wlan_cfg_set_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg,
2341 				   bool txmon_hw_support);
2342 
2343 /**
2344  * wlan_cfg_get_txmon_hw_support () - Get txmon hw support
2345  * @cfg:  Configuration Handle
2346  *
2347  * Return: txmon_hw_support
2348  */
2349 bool wlan_cfg_get_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg);
2350 
2351 void wlan_cfg_set_txmon_sw_peer_filtering(struct wlan_cfg_dp_soc_ctxt *cfg,
2352 					  bool txmon_sw_peer_filtering);
2353 bool wlan_cfg_get_txmon_sw_peer_filtering(struct wlan_cfg_dp_soc_ctxt *cfg);
2354 
2355 #ifdef WLAN_TX_PKT_CAPTURE_ENH
2356 /**
2357  * wlan_cfg_get_tx_capt_max_mem - Get max memory allowed for TX capture feature
2358  * @cfg: Configuration Handle
2359  *
2360  * Return: user given size in bytes
2361  */
2362 static inline int
2363 wlan_cfg_get_tx_capt_max_mem(struct wlan_cfg_dp_soc_ctxt *cfg)
2364 {
2365 	return cfg->tx_capt_max_mem_allowed;
2366 }
2367 #endif /* WLAN_TX_PKT_CAPTURE_ENH */
2368 
2369 /**
2370  * wlan_cfg_get_napi_scale_factor() - Get napi scale factor
2371  * @cfg: soc configuration context
2372  *
2373  * Return: napi scale factor
2374  */
2375 uint8_t wlan_cfg_get_napi_scale_factor(struct wlan_cfg_dp_soc_ctxt *cfg);
2376 
2377 /**
2378  * wlan_cfg_soc_update_tgt_params() - Update band specific params
2379  * @wlan_cfg_ctx: SOC cfg context
2380  * @ctrl_obj: PSOC object
2381  *
2382  * Return: void
2383  */
2384 void
2385 wlan_cfg_soc_update_tgt_params(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
2386 			       struct cdp_ctrl_objmgr_psoc *ctrl_obj);
2387 #endif /*__WLAN_CFG_H*/
2388