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