xref: /wlan-dirver/qca-wifi-host-cmn/wlan_cfg/wlan_cfg.h (revision 6ecd284e5a94a1c96e26d571dd47419ac305990d)
1 /*
2 * * Copyright (c) 2013-2018 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(CONFIG_MCL)
27 #define MAX_PDEV_CNT 1
28 #define WLAN_CFG_INT_NUM_CONTEXTS 7
29 /*
30  * This mask defines how many transmit frames account for 1 NAPI work unit
31  * 0 means each tx completion is 1 unit
32  */
33 #define DP_TX_NAPI_BUDGET_DIV_MASK 0
34 
35 /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
36 #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x1FFF
37 
38 #define NUM_RXDMA_RINGS_PER_PDEV 2
39 #else
40 #define MAX_PDEV_CNT 3
41 #define WLAN_CFG_INT_NUM_CONTEXTS 7
42 /*
43  * This mask defines how many transmit frames account for 1 NAPI work unit
44  * 0xFFFF means each 64K tx frame completions account for 1 unit of NAPI budget
45  */
46 #define DP_TX_NAPI_BUDGET_DIV_MASK 0xFFFF
47 
48 /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
49 #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0xFFFF
50 
51 #define NUM_RXDMA_RINGS_PER_PDEV 1
52 #endif
53 
54 /* Tx configuration */
55 #define MAX_LINK_DESC_BANKS 8
56 #define MAX_TXDESC_POOLS 4
57 #define MAX_TCL_DATA_RINGS 4
58 
59 /* Rx configuration */
60 #define MAX_RXDESC_POOLS 4
61 #define MAX_REO_DEST_RINGS 4
62 #define MAX_RX_MAC_RINGS 2
63 
64 /* DP process status */
65 #ifdef CONFIG_MCL
66 #define CONFIG_PROCESS_RX_STATUS 1
67 #define CONFIG_PROCESS_TX_STATUS 1
68 #else
69 #define CONFIG_PROCESS_RX_STATUS 0
70 #define CONFIG_PROCESS_TX_STATUS 0
71 #endif
72 
73 /* Miscellaneous configuration */
74 #define MAX_IDLE_SCATTER_BUFS 16
75 #define DP_MAX_IRQ_PER_CONTEXT 12
76 #define DP_MAX_INTERRUPT_CONTEXTS 8
77 #define DP_MAX_INTERRUPT_CONTEXTS 8
78 #define MAX_HTT_METADATA_LEN 32
79 #define MAX_NUM_PEER_ID_PER_PEER 8
80 #define DP_MAX_TIDS 17
81 #define DP_NON_QOS_TID 16
82 
83 struct wlan_cfg_dp_pdev_ctxt;
84 
85 /**
86  * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx)
87  * @num_int_ctxts - Number of NAPI/Interrupt contexts to be registered for DP
88  * @max_clients - Maximum number of peers/stations supported by device
89  * @max_alloc_size - Maximum allocation size for any dynamic memory
90  *			allocation request for this device
91  * @per_pdev_tx_ring - 0 - TCL ring is not mapped per radio
92  *		       1 - Each TCL ring is mapped to one radio/pdev
93  * @num_tcl_data_rings - Number of TCL Data rings supported by device
94  * @per_pdev_rx_ring - 0 - REO ring is not mapped per radio
95  *		       1 - Each REO ring is mapped to one radio/pdev
96  * @num_tx_desc_pool - Number of Tx Descriptor pools
97  * @num_tx_ext_desc_pool - Number of Tx MSDU extension Descriptor pools
98  * @num_tx_desc - Number of Tx Descriptors per pool
99  * @num_tx_ext_desc - Number of Tx MSDU extension Descriptors per pool
100  * @max_peer_id - Maximum value of peer id that FW can assign for a client
101  * @htt_packet_type - Default 802.11 encapsulation type for any VAP created
102  * @int_tx_ring_mask - Bitmap of Tx interrupts mapped to each NAPI/Intr context
103  * @int_rx_ring_mask - Bitmap of Rx interrupts mapped to each NAPI/Intr context
104  * @int_rx_mon_ring_mask - Bitmap of Rx monitor ring interrupts mapped to each
105  *			  NAPI/Intr context
106  * @int_rx_err_ring_mask - Bitmap of Rx err ring interrupts mapped to each
107  *			  NAPI/Intr context
108  * @int_wbm_rel_ring_mask - Bitmap of wbm rel ring interrupts mapped to each
109  *			  NAPI/Intr context
110  * @int_reo_status_ring_mask - Bitmap of reo status ring interrupts mapped to each
111  *                        NAPI/Intr context
112  * @int_ce_ring_mask - Bitmap of CE interrupts mapped to each NAPI/Intr context
113  * @lro_enabled - enable/disable lro feature
114  * @rx_hash - Enable hash based steering of rx packets
115  * @tso_enabled - enable/disable tso feature
116  * @napi_enabled - enable/disable interrupt mode for reaping tx and rx packets
117  * @tcp_Udp_Checksumoffload - enable/disable checksum offload
118  * @nss_cfg - nss configuration
119  */
120 struct wlan_cfg_dp_soc_ctxt {
121 	int num_int_ctxts;
122 	int max_clients;
123 	int max_alloc_size;
124 	int per_pdev_tx_ring;
125 	int num_tcl_data_rings;
126 	int per_pdev_rx_ring;
127 	int per_pdev_lmac_ring;
128 	int num_reo_dest_rings;
129 	int num_tx_desc_pool;
130 	int num_tx_ext_desc_pool;
131 	int num_tx_desc;
132 	int num_tx_ext_desc;
133 	int max_peer_id;
134 	int htt_packet_type;
135 	int int_batch_threshold_tx;
136 	int int_timer_threshold_tx;
137 	int int_batch_threshold_rx;
138 	int int_timer_threshold_rx;
139 	int int_batch_threshold_other;
140 	int int_timer_threshold_other;
141 	int tx_ring_size;
142 	int tx_comp_ring_size;
143 	int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
144 	int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
145 	int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
146 	int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
147 	int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
148 	int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
149 	int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
150 	int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
151 	int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
152 	int hw_macid[MAX_PDEV_CNT];
153 	int base_hw_macid;
154 	bool lro_enabled;
155 	bool rx_hash;
156 	bool tso_enabled;
157 	bool napi_enabled;
158 	bool tcp_udp_checksumoffload;
159 	bool defrag_timeout_check;
160 	int nss_cfg;
161 #ifdef QCA_LL_TX_FLOW_CONTROL_V2
162 	uint32_t tx_flow_stop_queue_threshold;
163 	uint32_t tx_flow_start_queue_offset;
164 #endif
165 	uint32_t rx_defrag_min_timeout;
166 };
167 
168 /**
169  * wlan_cfg_soc_attach() - Attach configuration interface for SoC
170  *
171  * Allocates context for Soc configuration parameters,
172  * Read configuration information from device tree/ini file and
173  * returns back handle
174  *
175  * Return: Handle to configuration context
176  */
177 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void);
178 
179 /**
180  * wlan_cfg_soc_detach() - Detach soc configuration handle
181  * @wlan_cfg_ctx: soc configuration handle
182  *
183  * De-allocates memory allocated for SoC configuration
184  *
185  * Return:none
186  */
187 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
188 
189 /**
190  * wlan_cfg_pdev_attach() Attach configuration interface for pdev
191  *
192  * Allocates context for pdev configuration parameters,
193  * Read configuration information from device tree/ini file and
194  * returns back handle
195  *
196  * Return: Handle to configuration context
197  */
198 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void);
199 
200 /**
201  * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
202  * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
203  *
204  * Return: void
205  */
206 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
207 
208 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
209 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
210 			       int context, int mask);
211 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
212 			       int context, int mask);
213 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
214 				   int context, int mask);
215 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
216 			       int context, int mask);
217 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
218 				  int mask);
219 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
220 
221 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
222 				int context, int mask);
223 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
224 					int context, int mask);
225 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
226 					int context, int mask);
227 /**
228  * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
229  * @wlan_cfg_ctx - Configuration Handle
230  *
231  * For WIN,  DP_NUM_INTERRUPT_CONTEXTS will be equal to  number of CPU cores.
232  * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
233  * rx_ring_mask ,and rx_monitor_ring mask  to indicate the rings
234  * that are processed by the handler.
235  *
236  * Return: num_contexts
237  */
238 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
239 
240 /**
241  * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
242  *				 interrupt context
243  * @wlan_cfg_ctx - Configuration Handle
244  * @context - Numerical ID identifying the Interrupt/NAPI context
245  *
246  * Return: int_tx_ring_mask[context]
247  */
248 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
249 		int context);
250 
251 /**
252  * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
253  *				 interrupt context
254  * @wlan_cfg_ctx - Configuration Handle
255  * @context - Numerical ID identifying the Interrupt/NAPI context
256  *
257  * Return: int_rx_ring_mask[context]
258  */
259 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
260 		int context);
261 
262 /**
263  * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
264  *				   mapped to an interrupt context
265  * @wlan_cfg_ctx - Configuration Handle
266  * @context - Numerical ID identifying the Interrupt/NAPI context
267  *
268  * Return: int_rx_mon_ring_mask[context]
269  */
270 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
271 		int context);
272 
273 /**
274  * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
275  *				   for the given interrupt context
276  * @wlan_cfg_ctx - Configuration Handle
277  * @context - Numerical ID identifying the Interrupt/NAPI context
278  *
279  */
280 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
281 	int context, int mask);
282 
283 /**
284  * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask
285  *				   mapped to an interrupt context
286  * @wlan_cfg_ctx - Configuration Handle
287  * @context - Numerical ID identifying the Interrupt/NAPI context
288  *
289  * Return: int_rxdma2host_ring_mask[context]
290  */
291 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
292 	int context);
293 
294 /**
295  * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
296  *				   for the given interrupt context
297  * @wlan_cfg_ctx - Configuration Handle
298  * @context - Numerical ID identifying the Interrupt/NAPI context
299  *
300  */
301 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
302 	int context, int mask);
303 
304 /**
305  * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
306  *				   mapped to an interrupt context
307  * @wlan_cfg_ctx - Configuration Handle
308  * @context - Numerical ID identifying the Interrupt/NAPI context
309  *
310  * Return: int_host2rxdma_ring_mask[context]
311  */
312 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
313 	int context);
314 
315 /**
316  * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
317  *
318  * @wlan_cfg_ctx - Configuration Handle
319  * @pdev_idx - Index of SW PDEV
320  * @hw_macid - HW MAC Id
321  *
322  */
323 void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
324 	int hw_macid);
325 
326 /**
327  * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
328  *
329  * @wlan_cfg_ctx - Configuration Handle
330  * @pdev_idx - Index of SW PDEV
331  *
332  * Return: HW MAC Id
333  */
334 int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
335 
336 /**
337  * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
338  * PDEV index
339  *
340  * @wlan_cfg_ctx - Configuration Handle
341  * @pdev_idx - Index of SW PDEV
342  *
343  * Return: HW MAC index
344  */
345 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
346 
347 /**
348  * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
349  *					   mapped to an interrupt context
350  * @wlan_cfg_ctx - Configuration Handle
351  * @context - Numerical ID identifying the Interrupt/NAPI context
352  *
353  * Return: int_rx_err_ring_mask[context]
354  */
355 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
356 				  context);
357 
358 /**
359  * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
360  *					   mapped to an interrupt context
361  * @wlan_cfg_ctx - Configuration Handle
362  * @context - Numerical ID identifying the Interrupt/NAPI context
363  *
364  * Return: int_wbm_rel_ring_mask[context]
365  */
366 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
367 				      context);
368 
369 /**
370  * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
371  *					   mapped to an interrupt context
372  * @wlan_cfg_ctx - Configuration Handle
373  * @context - Numerical ID identifying the Interrupt/NAPI context
374  *
375  * Return: int_reo_status_ring_mask[context]
376  */
377 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
378 				      context);
379 
380 /**
381  * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
382  *				mapped to an interrupt context
383  * @wlan_cfg_ctx - Configuration Handle
384  * @context - Numerical ID identifying the Interrupt/NAPI context
385  *
386  * Return: int_ce_ring_mask[context]
387  */
388 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
389 		int context);
390 
391 /**
392  * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
393  *				supported by device
394  * @wlan_cfg_ctx - Configuration Handle
395  *
396  * Return: max_clients
397  */
398 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
399 
400 /**
401  * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
402  *			    memory allocation request for this device
403  * @wlan_cfg_ctx - Configuration Handle
404  *
405  * Return: max_alloc_size
406  */
407 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
408 
409 /*
410  * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
411  *			       one per radio
412  * @wlan_cfg_ctx - Configuration Handle
413  *
414  * Return: per_pdev_tx_ring
415  */
416 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
417 
418 /*
419  * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
420  * @wlan_cfg_ctx
421  *
422  * Return: num_tcl_data_rings
423  */
424 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
425 
426 /*
427  * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
428  *                              one per radio
429  * @wlan_cfg_ctx
430  *
431  * Return: per_pdev_rx_ring
432  */
433 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
434 
435 /*
436  * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
437  *                              one per radio
438  * @wlan_cfg_ctx
439  *
440  * Return: return 1 if per pdev error ring else 0
441  */
442 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
443 
444 /*
445  * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
446  * @wlan_cfg_ctx - Configuration Handle
447  *
448  * Return: num_reo_dest_rings
449  */
450 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
451 
452 /*
453  * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
454  * @wlan_cfg_ctx - Configuration Handle
455  *
456  * Return: htt_pkt_type_ethernet
457  */
458 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
459 
460 /*
461  * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
462  *					device
463  * @wlan_cfg_ctx - Configuration Handle
464  *
465  * Return: num_tx_desc_pool
466  */
467 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
468 
469 /*
470  * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
471  *					device
472  * @wlan_cfg_ctx - Configuration Handle
473  * @num_pool - Number of pool
474  */
475 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
476 
477 /*
478  * wlan_cfg_get_num_tx_ext_desc_pool() -  Number of Tx MSDU ext Descriptor
479  *					pools
480  * @wlan_cfg_ctx - Configuration Handle
481  *
482  * Return: num_tx_ext_desc_pool
483  */
484 int wlan_cfg_get_num_tx_ext_desc_pool(
485 		struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
486 
487 /*
488  * wlan_cfg_set_num_tx_ext_desc_pool() -  Set the number of Tx MSDU ext Descriptor
489  *					pools
490  * @wlan_cfg_ctx - Configuration Handle
491  * @num_pool - Number of pool
492  */
493 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
494 
495 /*
496  * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
497  * @wlan_cfg_ctx - Configuration Handle
498  *
499  * Return: num_tx_desc
500  */
501 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
502 
503 /*
504  * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
505  *
506  * @wlan_cfg_ctx - Configuration Handle
507  * @num_desc: Number of descriptor
508  */
509 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
510 
511 /*
512  * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
513  *					per pool
514  * @wlan_cfg_ctx - Configuration Handle
515  *
516  * Return: num_tx_ext_desc
517  */
518 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
519 
520 /*
521  * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
522  *					per pool
523  * @wlan_cfg_ctx - Configuration Handle
524  * @num_desc: Number of descriptor
525  */
526 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
527 
528 /*
529  * wlan_cfg_max_peer_id() - Get maximum peer ID
530  * @cfg: Configuration Handle
531  *
532  * Return: maximum peer ID
533  */
534 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
535 
536 /*
537  * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
538  * @wlan_cfg_pdev_ctx
539  *
540  * Return: dma_mon_buf_ring_size
541  */
542 int wlan_cfg_get_dma_mon_buf_ring_size(
543 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
544 
545 /*
546  * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
547  *					Destination ring
548  * @wlan_cfg_pdev_ctx
549  *
550  * Return: dma_mon_dest_size
551  */
552 int wlan_cfg_get_dma_mon_dest_ring_size(
553 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
554 
555 /*
556  * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
557  * @wlan_cfg_pdev_ctx
558  *
559  * Return: dma_mon_stat_ring_size
560  */
561 int wlan_cfg_get_dma_mon_stat_ring_size(
562 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
563 
564 /*
565  * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
566  * @wlan_cfg_pdev_ctx
567  *
568  * Return: rx_dma_buf_ring_size
569  */
570 int wlan_cfg_get_rx_dma_buf_ring_size(
571 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
572 
573 /*
574  * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
575  * per pdev
576  * @wlan_cfg_pdev_ctx
577  *
578  * Return: number of mac DMA rings per pdev
579  */
580 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
581 
582 /*
583  * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
584  * @wlan_cfg_pdev_ctx
585  *
586  * Return: true - LRO enabled false - LRO disabled
587  */
588 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
589 
590 /*
591  * wlan_cfg_is_lro_enabled - Return RX hash enabled/disabled
592  * @wlan_cfg_pdev_ctx
593  *
594  * Return: true - enabled false - disabled
595  */
596 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
597 
598 /*
599  * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
600  * @wlan_cfg_soc_ctx
601  * @rx_hash
602  */
603 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
604 
605 /*
606  * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
607  * @wlan_cfg_pdev_ctx
608  *
609  * Return: 1 - enabled 0 - disabled
610  */
611 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
612 
613 /*
614  * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
615  * @wlan_cfg_pdev_ctx
616  */
617 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
618 
619 /*
620  * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
621  * @wlan_cfg_pdev_ctx
622  *
623  * Return: nss_cfg
624  */
625 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
626 
627 /*
628  * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
629  * @wlan_cfg_pdev_ctx
630  *
631  */
632 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
633 
634 /*
635  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
636  * @wlan_cfg_soc_ctx
637  *
638  * Return: Batch threshold
639  */
640 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
641 
642 /*
643  * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
644  * @wlan_cfg_soc_ctx
645  *
646  * Return: Timer threshold
647  */
648 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
649 
650 /*
651  * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
652  * @wlan_cfg_soc_ctx
653  *
654  * Return: Batch threshold
655  */
656 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
657 
658 /*
659  * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
660  * @wlan_cfg_soc_ctx
661  *
662  * Return: Timer threshold
663  */
664 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
665 
666 /*
667  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
668  * @wlan_cfg_soc_ctx
669  *
670  * Return: Batch threshold
671  */
672 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
673 
674 /*
675  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
676  * @wlan_cfg_soc_ctx
677  *
678  * Return: Timer threshold
679  */
680 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
681 
682 /*
683  * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
684  * @wlan_cfg_soc_ctx
685  *
686  * Return: Checksum offload enable or disable
687  */
688 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
689 
690 /*
691  * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
692  * @wlan_cfg_soc_ctx
693  *
694  * Return: Tx Ring Size
695  */
696 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
697 
698 /*
699  * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
700  * @wlan_cfg_soc_ctx
701  *
702  * Return: Tx Completion ring size
703  */
704 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
705 #ifdef QCA_LL_TX_FLOW_CONTROL_V2
706 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
707 
708 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
709 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
710 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
711 
712 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
713 #endif
714