xref: /wlan-dirver/qca-wifi-host-cmn/wlan_cfg/wlan_cfg.h (revision 1f55ed1a9f5050d8da228aa8dd3fff7c0242aa71)
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 #define WLAN_CFG_RXDMA1_ENABLE 1
30 /*
31  * This mask defines how many transmit frames account for 1 NAPI work unit
32  * 0 means each tx completion is 1 unit
33  */
34 #define DP_TX_NAPI_BUDGET_DIV_MASK 0
35 
36 /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
37 #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x1FFF
38 
39 #define NUM_RXDMA_RINGS_PER_PDEV 2
40 #else
41 #define MAX_PDEV_CNT 3
42 #define WLAN_CFG_INT_NUM_CONTEXTS 11
43 #define WLAN_CFG_RXDMA1_ENABLE 1
44 /*
45  * This mask defines how many transmit frames account for 1 NAPI work unit
46  * 0xFFFF means each 64K tx frame completions account for 1 unit of NAPI budget
47  */
48 #define DP_TX_NAPI_BUDGET_DIV_MASK 0xFFFF
49 
50 /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */
51 #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0xFFFF
52 
53 #define NUM_RXDMA_RINGS_PER_PDEV 1
54 #endif
55 
56 /* Tx configuration */
57 #define MAX_LINK_DESC_BANKS 8
58 #define MAX_TXDESC_POOLS 4
59 #define MAX_TCL_DATA_RINGS 4
60 
61 /* Rx configuration */
62 #define MAX_RXDESC_POOLS 4
63 #define MAX_REO_DEST_RINGS 4
64 #define MAX_RX_MAC_RINGS 2
65 
66 /* DP process status */
67 #ifdef CONFIG_MCL
68 #define CONFIG_PROCESS_RX_STATUS 1
69 #define CONFIG_PROCESS_TX_STATUS 1
70 #else
71 #define CONFIG_PROCESS_RX_STATUS 0
72 #define CONFIG_PROCESS_TX_STATUS 0
73 #endif
74 
75 /* Miscellaneous configuration */
76 #define MAX_IDLE_SCATTER_BUFS 16
77 #define DP_MAX_IRQ_PER_CONTEXT 12
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
111  *                            each 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  * @lro_enabled: enable/disable LRO feature
117  * @sg_enabled: enable disable scatter gather feature
118  * @gro_enabled: enable disable GRO feature
119  * @ipa_enabled: Flag indicating if IPA is enabled
120  * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled
121  * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled
122  * @rawmode_enabled: Flag indicating if RAW mode is enabled
123  * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled
124  * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets
125  * @tcp_udp_checksumoffload: enable/disable checksum offload
126  * @nss_cfg: nss configuration
127  * @rx_defrag_min_timeout: rx defrag minimum timeout
128  * @wbm_release_ring: wbm release ring size
129  * @tcl_cmd_ring: tcl cmd ring size
130  * @tcl_status_ring: tcl status ring size
131  * @reo_reinject_ring: reo reinject ring
132  * @rx_release_ring: rx release ring size
133  * @reo_exception_ring: reo exception ring size
134  * @reo_cmd_ring: reo cmd ring size
135  * @reo_status_ring: reo status ting size
136  * @rxdma_refill_ring: rxdma refill ring size
137  * @rxdma_err_dst_ring: rxdma error detination ring size
138  * @raw_mode_war: enable/disable raw mode war
139  */
140 struct wlan_cfg_dp_soc_ctxt {
141 	int num_int_ctxts;
142 	int max_clients;
143 	int max_alloc_size;
144 	int per_pdev_tx_ring;
145 	int num_tcl_data_rings;
146 	int per_pdev_rx_ring;
147 	int per_pdev_lmac_ring;
148 	int num_reo_dest_rings;
149 	int num_tx_desc_pool;
150 	int num_tx_ext_desc_pool;
151 	int num_tx_desc;
152 	int num_tx_ext_desc;
153 	int max_peer_id;
154 	int htt_packet_type;
155 	int int_batch_threshold_tx;
156 	int int_timer_threshold_tx;
157 	int int_batch_threshold_rx;
158 	int int_timer_threshold_rx;
159 	int int_batch_threshold_other;
160 	int int_timer_threshold_other;
161 	int int_timer_threshold_mon;
162 	int tx_ring_size;
163 	int tx_comp_ring_size;
164 	int tx_comp_ring_size_nss;
165 	int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
166 	int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
167 	int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
168 	int int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
169 	int int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
170 	int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
171 	int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
172 	int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
173 	int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
174 	int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
175 	int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
176 	int hw_macid[MAX_PDEV_CNT];
177 	int base_hw_macid;
178 	bool rx_hash;
179 	bool tso_enabled;
180 	bool lro_enabled;
181 	bool sg_enabled;
182 	bool gro_enabled;
183 	bool ipa_enabled;
184 	bool ol_tx_csum_enabled;
185 	bool ol_rx_csum_enabled;
186 	bool rawmode_enabled;
187 	bool peer_flow_ctrl_enabled;
188 	bool napi_enabled;
189 	bool tcp_udp_checksumoffload;
190 	bool defrag_timeout_check;
191 	int nss_cfg;
192 	uint32_t tx_flow_stop_queue_threshold;
193 	uint32_t tx_flow_start_queue_offset;
194 	int rx_defrag_min_timeout;
195 	int reo_dst_ring_size;
196 	int wbm_release_ring;
197 	int tcl_cmd_ring;
198 	int tcl_status_ring;
199 	int reo_reinject_ring;
200 	int rx_release_ring;
201 	int reo_exception_ring;
202 	int reo_cmd_ring;
203 	int reo_status_ring;
204 	int rxdma_refill_ring;
205 	int rxdma_err_dst_ring;
206 	bool raw_mode_war;
207 	bool enable_data_stall_detection;
208 	bool disable_intra_bss_fwd;
209 	bool rxdma1_enable;
210 };
211 
212 /**
213  * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio)
214  * @rx_dma_buf_ring_size - Size of RxDMA buffer ring
215  * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring
216  * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring
217  * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring
218  * @rxdma_monitor_desc_ring - rxdma monitor desc ring size
219  */
220 struct wlan_cfg_dp_pdev_ctxt {
221 	int rx_dma_buf_ring_size;
222 	int dma_mon_buf_ring_size;
223 	int dma_mon_dest_ring_size;
224 	int dma_mon_status_ring_size;
225 	int rxdma_monitor_desc_ring;
226 	int num_mac_rings;
227 	int nss_enabled;
228 };
229 
230 /**
231  * wlan_cfg_soc_attach() - Attach configuration interface for SoC
232  * @ctrl_obj - PSOC object
233  *
234  * Allocates context for Soc configuration parameters,
235  * Read configuration information from device tree/ini file and
236  * returns back handle
237  *
238  * Return: Handle to configuration context
239  */
240 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void *ctrl_obj);
241 
242 /**
243  * wlan_cfg_soc_detach() - Detach soc configuration handle
244  * @wlan_cfg_ctx: soc configuration handle
245  *
246  * De-allocates memory allocated for SoC configuration
247  *
248  * Return:none
249  */
250 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
251 
252 /**
253  * wlan_cfg_pdev_attach() Attach configuration interface for pdev
254  * @ctrl_obj - PSOC object
255  *
256  * Allocates context for pdev configuration parameters,
257  * Read configuration information from device tree/ini file and
258  * returns back handle
259  *
260  * Return: Handle to configuration context
261  */
262 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void *ctrl_obj);
263 
264 /**
265  * wlan_cfg_pdev_detach() Detach and free pdev configuration handle
266  * @wlan_cfg_pdev_ctx - PDEV Configuration Handle
267  *
268  * Return: void
269  */
270 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
271 
272 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num);
273 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
274 			       int context, int mask);
275 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
276 			       int context, int mask);
277 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
278 				   int context, int mask);
279 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
280 			       int context, int mask);
281 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
282 				  int mask);
283 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val);
284 
285 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
286 				int context, int mask);
287 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
288 					int context, int mask);
289 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
290 					int context, int mask);
291 /**
292  * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered
293  * @wlan_cfg_ctx - Configuration Handle
294  *
295  * For WIN,  DP_NUM_INTERRUPT_CONTEXTS will be equal to  number of CPU cores.
296  * Each context (for linux it is a NAPI context) will have a tx_ring_mask,
297  * rx_ring_mask ,and rx_monitor_ring mask  to indicate the rings
298  * that are processed by the handler.
299  *
300  * Return: num_contexts
301  */
302 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
303 
304 /**
305  * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an
306  *				 interrupt context
307  * @wlan_cfg_ctx - Configuration Handle
308  * @context - Numerical ID identifying the Interrupt/NAPI context
309  *
310  * Return: int_tx_ring_mask[context]
311  */
312 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
313 		int context);
314 
315 /**
316  * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an
317  *				 interrupt context
318  * @wlan_cfg_ctx - Configuration Handle
319  * @context - Numerical ID identifying the Interrupt/NAPI context
320  *
321  * Return: int_rx_ring_mask[context]
322  */
323 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
324 		int context);
325 
326 /**
327  * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask
328  *				   mapped to an interrupt context
329  * @wlan_cfg_ctx - Configuration Handle
330  * @context - Numerical ID identifying the Interrupt/NAPI context
331  *
332  * Return: int_rx_mon_ring_mask[context]
333  */
334 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
335 		int context);
336 
337 /**
338  * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask
339  *				   for the given interrupt context
340  * @wlan_cfg_ctx - Configuration Handle
341  * @context - Numerical ID identifying the Interrupt/NAPI context
342  *
343  */
344 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
345 	int context, int mask);
346 
347 /**
348  * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host 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_rxdma2host_ring_mask[context]
354  */
355 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
356 	int context);
357 
358 /**
359  * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask
360  *				   for the given interrupt context
361  * @wlan_cfg_ctx - Configuration Handle
362  * @context - Numerical ID identifying the Interrupt/NAPI context
363  *
364  */
365 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
366 	int context, int mask);
367 
368 /**
369  * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask
370  *				   mapped to an interrupt context
371  * @wlan_cfg_ctx - Configuration Handle
372  * @context - Numerical ID identifying the Interrupt/NAPI context
373  *
374  * Return: int_host2rxdma_ring_mask[context]
375  */
376 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
377 	int context);
378 
379 /**
380  * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
381  *                                interrupt mask for the given interrupt context
382  * @wlan_cfg_ctx - Configuration Handle
383  * @context - Numerical ID identifying the Interrupt/NAPI context
384  *
385  */
386 void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
387 					   int context, int mask);
388 
389 /**
390  * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring
391  *                               interrupt mask mapped to an interrupt context
392  * @wlan_cfg_ctx - Configuration Handle
393  * @context - Numerical ID identifying the Interrupt/NAPI context
394  *
395  * Return: int_host2rxdma_mon_ring_mask[context]
396  */
397 int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
398 					  int context);
399 
400 /**
401  * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor
402  *				   destination ring interrupt mask
403  *				   for the given interrupt context
404  * @wlan_cfg_ctx - Configuration Handle
405  * @context - Numerical ID identifying the Interrupt/NAPI context
406  *
407  */
408 void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
409 					   int context, int mask);
410 
411 /**
412  * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor
413  *				   destination ring interrupt mask
414  *				   mapped to an interrupt context
415  * @wlan_cfg_ctx - Configuration Handle
416  * @context - Numerical ID identifying the Interrupt/NAPI context
417  *
418  * Return: int_rxdma2host_mon_ring_mask[context]
419  */
420 int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
421 					  int context);
422 
423 /**
424  * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index
425  *
426  * @wlan_cfg_ctx - Configuration Handle
427  * @pdev_idx - Index of SW PDEV
428  * @hw_macid - HW MAC Id
429  *
430  */
431 void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
432 	int hw_macid);
433 
434 /**
435  * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index
436  *
437  * @wlan_cfg_ctx - Configuration Handle
438  * @pdev_idx - Index of SW PDEV
439  *
440  * Return: HW MAC Id
441  */
442 int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
443 
444 /**
445  * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given
446  * PDEV index
447  *
448  * @wlan_cfg_ctx - Configuration Handle
449  * @pdev_idx - Index of SW PDEV
450  *
451  * Return: HW MAC index
452  */
453 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx);
454 
455 /**
456  * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask
457  *					   mapped to an interrupt context
458  * @wlan_cfg_ctx - Configuration Handle
459  * @context - Numerical ID identifying the Interrupt/NAPI context
460  *
461  * Return: int_rx_err_ring_mask[context]
462  */
463 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
464 				  context);
465 
466 /**
467  * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask
468  *					   mapped to an interrupt context
469  * @wlan_cfg_ctx - Configuration Handle
470  * @context - Numerical ID identifying the Interrupt/NAPI context
471  *
472  * Return: int_wbm_rel_ring_mask[context]
473  */
474 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
475 				      context);
476 
477 /**
478  * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask
479  *					   mapped to an interrupt context
480  * @wlan_cfg_ctx - Configuration Handle
481  * @context - Numerical ID identifying the Interrupt/NAPI context
482  *
483  * Return: int_reo_status_ring_mask[context]
484  */
485 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int
486 				      context);
487 
488 /**
489  * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask
490  *				mapped to an interrupt context
491  * @wlan_cfg_ctx - Configuration Handle
492  * @context - Numerical ID identifying the Interrupt/NAPI context
493  *
494  * Return: int_ce_ring_mask[context]
495  */
496 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
497 		int context);
498 
499 /**
500  * wlan_cfg_get_max_clients() - Return maximum number of peers/stations
501  *				supported by device
502  * @wlan_cfg_ctx - Configuration Handle
503  *
504  * Return: max_clients
505  */
506 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
507 
508 /**
509  * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic
510  *			    memory allocation request for this device
511  * @wlan_cfg_ctx - Configuration Handle
512  *
513  * Return: max_alloc_size
514  */
515 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
516 
517 /*
518  * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as
519  *			       one per radio
520  * @wlan_cfg_ctx - Configuration Handle
521  *
522  * Return: per_pdev_tx_ring
523  */
524 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
525 
526 /*
527  * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device
528  * @wlan_cfg_ctx
529  *
530  * Return: num_tcl_data_rings
531  */
532 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
533 
534 /*
535  * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as
536  *                              one per radio
537  * @wlan_cfg_ctx
538  *
539  * Return: per_pdev_rx_ring
540  */
541 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
542 
543 /*
544  * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as
545  *                              one per radio
546  * @wlan_cfg_ctx
547  *
548  * Return: return 1 if per pdev error ring else 0
549  */
550 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
551 
552 /*
553  * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device
554  * @wlan_cfg_ctx - Configuration Handle
555  *
556  * Return: num_reo_dest_rings
557  */
558 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
559 
560 /*
561  * wlan_cfg_pkt_type() - Default 802.11 encapsulation type
562  * @wlan_cfg_ctx - Configuration Handle
563  *
564  * Return: htt_pkt_type_ethernet
565  */
566 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
567 
568 /*
569  * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the
570  *					device
571  * @wlan_cfg_ctx - Configuration Handle
572  *
573  * Return: num_tx_desc_pool
574  */
575 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
576 
577 /*
578  * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the
579  *					device
580  * @wlan_cfg_ctx - Configuration Handle
581  * @num_pool - Number of pool
582  */
583 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
584 
585 /*
586  * wlan_cfg_get_num_tx_ext_desc_pool() -  Number of Tx MSDU ext Descriptor
587  *					pools
588  * @wlan_cfg_ctx - Configuration Handle
589  *
590  * Return: num_tx_ext_desc_pool
591  */
592 int wlan_cfg_get_num_tx_ext_desc_pool(
593 		struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
594 
595 /*
596  * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
597  *
598  * @wlan_cfg_ctx - Configuration Handle
599  *
600  * Return: reo_dst_ring_size
601  */
602 int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
603 
604 /*
605  * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
606  *
607  * @wlan_cfg_ctx - Configuration Handle
608  * @reo_dst_ring_size - REO Destination ring size
609  */
610 void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
611 				    int reo_dst_ring_size);
612 
613 /*
614  * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration
615  *
616  * @wlan_cfg_ctx - Configuration Handle
617  * @raw_mode_war - raw mode war configuration
618  */
619 void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
620 			       bool raw_mode_war);
621 
622 /*
623  * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration
624  *
625  * @wlan_cfg_ctx - Configuration Handle
626  *
627  * Return: reo_dst_ring_size
628  */
629 bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg);
630 
631 /*
632  * wlan_cfg_set_num_tx_ext_desc_pool() -  Set the number of Tx MSDU ext Descriptor
633  *					pools
634  * @wlan_cfg_ctx - Configuration Handle
635  * @num_pool - Number of pool
636  */
637 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool);
638 
639 /*
640  * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool
641  * @wlan_cfg_ctx - Configuration Handle
642  *
643  * Return: num_tx_desc
644  */
645 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
646 
647 /*
648  * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool
649  *
650  * @wlan_cfg_ctx - Configuration Handle
651  * @num_desc: Number of descriptor
652  */
653 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc);
654 
655 /*
656  * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors
657  *					per pool
658  * @wlan_cfg_ctx - Configuration Handle
659  *
660  * Return: num_tx_ext_desc
661  */
662 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
663 
664 /*
665  * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors
666  *					per pool
667  * @wlan_cfg_ctx - Configuration Handle
668  * @num_desc: Number of descriptor
669  */
670 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc);
671 
672 /*
673  * wlan_cfg_max_peer_id() - Get maximum peer ID
674  * @cfg: Configuration Handle
675  *
676  * Return: maximum peer ID
677  */
678 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg);
679 
680 /*
681  * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring
682  * @wlan_cfg_pdev_ctx
683  *
684  * Return: dma_mon_buf_ring_size
685  */
686 int wlan_cfg_get_dma_mon_buf_ring_size(
687 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
688 
689 /*
690  * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor
691  *					Destination ring
692  * @wlan_cfg_pdev_ctx
693  *
694  * Return: dma_mon_dest_size
695  */
696 int wlan_cfg_get_dma_mon_dest_ring_size(
697 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
698 
699 /*
700  * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring
701  * @wlan_cfg_pdev_ctx
702  *
703  * Return: dma_mon_stat_ring_size
704  */
705 int wlan_cfg_get_dma_mon_stat_ring_size(
706 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
707 
708 /*
709  * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size
710  * @wlan_cfg_soc_ctx
711  *
712  * Return: rxdma monitor desc ring size
713  */
714 int
715 wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg);
716 
717 /*
718  * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring
719  * @wlan_cfg_pdev_ctx
720  *
721  * Return: rx_dma_buf_ring_size
722  */
723 int wlan_cfg_get_rx_dma_buf_ring_size(
724 		struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx);
725 
726 /*
727  * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings
728  * per pdev
729  * @wlan_cfg_pdev_ctx
730  *
731  * Return: number of mac DMA rings per pdev
732  */
733 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg);
734 
735 /*
736  * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled
737  * @wlan_cfg_dp_soc_ctxt
738  *
739  * Return: true - LRO enabled false - LRO disabled
740  */
741 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
742 
743 /*
744  * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled
745  * @wlan_cfg_dp_soc_ctxt
746  *
747  * Return: true - GRO enabled false - GRO disabled
748  */
749 bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
750 
751 /*
752  * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled
753  * @wlan_cfg_dp_soc_ctxt
754  *
755  * Return: true - enabled false - disabled
756  */
757 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
758 
759 /*
760  * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled
761  * @wlan_cfg_dp_soc_ctxt
762  *
763  * Return: true - enabled false - disabled
764  */
765 bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
766 
767 /*
768  * wlan_cfg_set_rx_hash - set rx hash enabled/disabled
769  * @wlan_cfg_soc_ctx
770  * @rx_hash
771  */
772 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash);
773 
774 /*
775  * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled
776  * @wlan_cfg_pdev_ctx
777  *
778  * Return: 1 - enabled 0 - disabled
779  */
780 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg);
781 
782 /*
783  * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled
784  * @wlan_cfg_pdev_ctx
785  */
786 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled);
787 
788 /*
789  * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config
790  * @wlan_cfg_pdev_ctx
791  *
792  * Return: nss_cfg
793  */
794 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg);
795 
796 /*
797  * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config
798  * @wlan_cfg_pdev_ctx
799  *
800  */
801 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg);
802 
803 /*
804  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx
805  * @wlan_cfg_soc_ctx
806  *
807  * Return: Batch threshold
808  */
809 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
810 
811 /*
812  * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx
813  * @wlan_cfg_soc_ctx
814  *
815  * Return: Timer threshold
816  */
817 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg);
818 
819 /*
820  * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
821  * @wlan_cfg_soc_ctx
822  *
823  * Return: Batch threshold
824  */
825 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
826 
827 /*
828  * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx
829  * @wlan_cfg_soc_ctx
830  *
831  * Return: Timer threshold
832  */
833 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
834 
835 /*
836  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
837  * @wlan_cfg_soc_ctx
838  *
839  * Return: Batch threshold
840  */
841 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
842 
843 /*
844  * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs
845  * @wlan_cfg_soc_ctx
846  *
847  * Return: Timer threshold
848  */
849 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg);
850 
851 /*
852  * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs
853  * @wlan_cfg_soc_ctx
854  *
855  * Return: Timer threshold
856  */
857 int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg);
858 
859 /*
860  * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status
861  * @wlan_cfg_soc_ctx
862  *
863  * Return: Checksum offload enable or disable
864  */
865 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg);
866 
867 /*
868  * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring)
869  * @wlan_cfg_soc_ctx
870  *
871  * Return: Tx Ring Size
872  */
873 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
874 
875 /*
876  * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring)
877  * @wlan_cfg_soc_ctx
878  *
879  * Return: Tx Completion ring size
880  */
881 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
882 
883 /*
884  * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size
885  * @wlan_cfg_soc_ctx
886  *
887  * Return: wbm_release_ring size
888  */
889 int
890 wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
891 
892 /*
893  * wlan_cfg_get_dp_soc_tcl_cmd_ring_size - Get tcl_cmd_ring size
894  * @wlan_cfg_soc_ctx
895  *
896  * Return: tcl_cmd_ring size
897  */
898 int
899 wlan_cfg_get_dp_soc_tcl_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
900 
901 /*
902  * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size
903  * @wlan_cfg_soc_ctx
904  *
905  * Return: tcl_status_ring size
906  */
907 int
908 wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
909 
910 /*
911  * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size
912  * @wlan_cfg_soc_ctx
913  *
914  * Return: reo_reinject_ring size
915  */
916 int
917 wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
918 
919 /*
920  * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size
921  * @wlan_cfg_soc_ctx
922  *
923  * Return: rx_release_ring size
924  */
925 int
926 wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
927 
928 /*
929  * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size
930  * @wlan_cfg_soc_ctx
931  *
932  * Return: reo_exception_ring size
933  */
934 int
935 wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
936 
937 /*
938  * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size
939  * @wlan_cfg_soc_ctx
940  *
941  * Return: reo_cmd_ring size
942  */
943 int
944 wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
945 
946 /*
947  * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size
948  * @wlan_cfg_soc_ctx
949  *
950  * Return: reo_status_ring size
951  */
952 int
953 wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
954 
955 /*
956  * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
957  * @wlan_cfg_soc_ctx
958  *
959  * Return: rxdma refill ring size
960  */
961 int
962 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
963 
964 /*
965  * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size
966  * @wlan_cfg_soc_ctx
967  *
968  * Return: rxdma error dst ring size
969  */
970 int
971 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
972 
973 /*
974  * wlan_cfg_get_dp_caps - Get dp capablities
975  * @wlan_cfg_soc_ctx
976  * @dp_caps: enum for dp capablities
977  *
978  * Return: bool if a dp capabilities is enabled
979  */
980 bool
981 wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
982 		     enum cdp_capabilities dp_caps);
983 
984 #ifdef QCA_LL_TX_FLOW_CONTROL_V2
985 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);
986 
987 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg);
988 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
989 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg);
990 
991 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg);
992 #endif
993