xref: /wlan-dirver/qca-wifi-host-cmn/wlan_cfg/wlan_cfg.c (revision 97f44cd39e4ff816eaa1710279d28cf6b9e65ad9)
1 /*
2  * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #if defined(CONFIG_HL_SUPPORT)
20 #include "wlan_tgt_def_config_hl.h"
21 #else
22 #include "wlan_tgt_def_config.h"
23 #endif
24 
25 #include "qdf_trace.h"
26 #include "qdf_mem.h"
27 #include <cdp_txrx_ops.h>
28 #include "wlan_cfg.h"
29 #include "cfg_ucfg_api.h"
30 #include "hal_api.h"
31 #include "dp_types.h"
32 
33 /*
34  * FIX THIS -
35  * For now, all these configuration parameters are hardcoded.
36  * Many of these should actually be coming from dts file/ini file
37  */
38 
39 /*
40  * The max allowed size for tx comp ring is 8191.
41  * This is limitted by h/w ring max size.
42  * As this is not a power of 2 it does not work with nss offload so the
43  * nearest available size which is power of 2 is 4096 chosen for nss
44  */
45 
46 #define WLAN_CFG_TX_RING_MASK_0 0x1
47 #define WLAN_CFG_TX_RING_MASK_1 0x2
48 #define WLAN_CFG_TX_RING_MASK_2 0x4
49 #define WLAN_CFG_TX_RING_MASK_3 0x0
50 
51 #define WLAN_CFG_RX_RING_MASK_0 0x1
52 #define WLAN_CFG_RX_RING_MASK_1 0x2
53 #define WLAN_CFG_RX_RING_MASK_2 0x4
54 #define WLAN_CFG_RX_RING_MASK_3 0x8
55 
56 #define WLAN_CFG_RX_MON_RING_MASK_0 0x1
57 #define WLAN_CFG_RX_MON_RING_MASK_1 0x2
58 #define WLAN_CFG_RX_MON_RING_MASK_2 0x4
59 #define WLAN_CFG_RX_MON_RING_MASK_3 0x0
60 
61 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 0x1
62 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 0x2
63 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2 0x4
64 
65 #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 0x1
66 #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 0x2
67 #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2 0x4
68 
69 #define WLAN_CFG_RX_ERR_RING_MASK_0 0x1
70 #define WLAN_CFG_RX_ERR_RING_MASK_1 0x0
71 #define WLAN_CFG_RX_ERR_RING_MASK_2 0x0
72 #define WLAN_CFG_RX_ERR_RING_MASK_3 0x0
73 
74 #define WLAN_CFG_RX_WBM_REL_RING_MASK_0 0x1
75 #define WLAN_CFG_RX_WBM_REL_RING_MASK_1 0x0
76 #define WLAN_CFG_RX_WBM_REL_RING_MASK_2 0x0
77 #define WLAN_CFG_RX_WBM_REL_RING_MASK_3 0x0
78 
79 #define WLAN_CFG_REO_STATUS_RING_MASK_0 0x1
80 #define WLAN_CFG_REO_STATUS_RING_MASK_1 0x0
81 #define WLAN_CFG_REO_STATUS_RING_MASK_2 0x0
82 #define WLAN_CFG_REO_STATUS_RING_MASK_3 0x0
83 
84 #define WLAN_CFG_RXDMA2HOST_RING_MASK_0 0x1
85 #define WLAN_CFG_RXDMA2HOST_RING_MASK_1 0x2
86 #define WLAN_CFG_RXDMA2HOST_RING_MASK_2 0x4
87 #define WLAN_CFG_RXDMA2HOST_RING_MASK_3 0x0
88 
89 #define WLAN_CFG_HOST2RXDMA_RING_MASK_0 0x1
90 #define WLAN_CFG_HOST2RXDMA_RING_MASK_1 0x2
91 #define WLAN_CFG_HOST2RXDMA_RING_MASK_2 0x4
92 #define WLAN_CFG_HOST2RXDMA_RING_MASK_3 0x0
93 
94 #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
95 static const int tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
96 	WLAN_CFG_TX_RING_MASK_0, 0, 0, 0, 0, 0, 0};
97 
98 #ifndef IPA_OFFLOAD
99 static const int rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
100 	0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1, WLAN_CFG_RX_RING_MASK_2, WLAN_CFG_RX_RING_MASK_3, 0, 0};
101 #else
102 static const int rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
103 	0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1, WLAN_CFG_RX_RING_MASK_2, 0, 0, 0};
104 #endif
105 
106 static const int rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
107 	0, WLAN_CFG_RX_MON_RING_MASK_0, WLAN_CFG_RX_MON_RING_MASK_1, 0, 0, 0, 0};
108 
109 static const int host2rxdma_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
110 	0, 0, 0, 0, 0, 0, 0};
111 
112 static const int rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
113 	0, 0, 0, 0, 0, WLAN_CFG_RXDMA2HOST_RING_MASK_0, WLAN_CFG_RXDMA2HOST_RING_MASK_1};
114 
115 static const int host2rxdma_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
116 	0, 0, 0, 0, 0, 0, 0};
117 
118 static const int rxdma2host_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
119 	0, 0, 0, 0, 0, 0, 0};
120 
121 static const int rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
122 	0, 0, 0, 0, 0, 0, WLAN_CFG_RX_ERR_RING_MASK_0};
123 
124 static const int rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
125 	0, 0, 0, 0, 0, 0, WLAN_CFG_RX_WBM_REL_RING_MASK_0};
126 
127 static const int reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
128 	0, 0, 0, 0, 0, 0, WLAN_CFG_REO_STATUS_RING_MASK_0};
129 
130 static const int tx_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
131 	0, 0, 0, 0, 0, 0, 0};
132 
133 static const int rx_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
134 	0, 0, 0, 0, 0, 0, 0};
135 
136 static const int rx_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
137 	0, 0, 0, 0, 0, 0, 0};
138 
139 static const int host2rxdma_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
140 	0, 0, 0, 0, 0, 0, 0};
141 
142 static const int rxdma2host_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
143 	0, 0, 0, 0, 0, 0, 0};
144 
145 static const int host2rxdma_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
146 	0, 0, 0, 0, 0, 0, 0};
147 
148 static const int rxdma2host_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
149 	0, 0, 0, 0, 0, 0, 0};
150 
151 static const int rx_err_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
152 	0, 0, 0, 0, 0, 0, 0};
153 
154 static const int rx_wbm_rel_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
155 	0, 0, 0, 0, 0, 0, 0};
156 
157 static const int reo_status_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
158 	0, 0, 0, 0, 0, 0, 0};
159 
160 #else
161 
162 static const int tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
163 						WLAN_CFG_TX_RING_MASK_0,
164 						WLAN_CFG_TX_RING_MASK_1,
165 						WLAN_CFG_TX_RING_MASK_2,
166 						WLAN_CFG_TX_RING_MASK_3};
167 
168 static const int rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
169 					0,
170 					0,
171 					0,
172 					0,
173 					WLAN_CFG_RX_RING_MASK_0,
174 					WLAN_CFG_RX_RING_MASK_1,
175 					WLAN_CFG_RX_RING_MASK_2,
176 					WLAN_CFG_RX_RING_MASK_3};
177 
178 static const int rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
179 					0,
180 					0,
181 					0,
182 					WLAN_CFG_RX_MON_RING_MASK_0,
183 					WLAN_CFG_RX_MON_RING_MASK_1,
184 					WLAN_CFG_RX_MON_RING_MASK_2};
185 
186 static const int host2rxdma_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
187 					0,
188 					0,
189 					0,
190 					WLAN_CFG_HOST2RXDMA_RING_MASK_0,
191 					WLAN_CFG_HOST2RXDMA_RING_MASK_1,
192 					WLAN_CFG_HOST2RXDMA_RING_MASK_2,
193 					WLAN_CFG_HOST2RXDMA_RING_MASK_3};
194 
195 static const int rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
196 					0,
197 					0,
198 					0,
199 					WLAN_CFG_RXDMA2HOST_RING_MASK_0,
200 					WLAN_CFG_RXDMA2HOST_RING_MASK_1,
201 					WLAN_CFG_RXDMA2HOST_RING_MASK_2,
202 					WLAN_CFG_RXDMA2HOST_RING_MASK_3};
203 
204 static const int host2rxdma_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
205 					0,
206 					0,
207 					0,
208 					WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
209 					WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
210 					WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2};
211 
212 static const int rxdma2host_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
213 					0,
214 					0,
215 					0,
216 					WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
217 					WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
218 					WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2};
219 
220 static const int rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
221 					0,
222 					0,
223 					0,
224 					WLAN_CFG_RX_ERR_RING_MASK_0,
225 					WLAN_CFG_RX_ERR_RING_MASK_1,
226 					WLAN_CFG_RX_ERR_RING_MASK_2,
227 					WLAN_CFG_RX_ERR_RING_MASK_3};
228 
229 static const int rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
230 					0,
231 					0,
232 					0,
233 					WLAN_CFG_RX_WBM_REL_RING_MASK_0,
234 					WLAN_CFG_RX_WBM_REL_RING_MASK_1,
235 					WLAN_CFG_RX_WBM_REL_RING_MASK_2,
236 					WLAN_CFG_RX_WBM_REL_RING_MASK_3};
237 
238 static const int reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
239 					0,
240 					0,
241 					0,
242 					WLAN_CFG_REO_STATUS_RING_MASK_0,
243 					WLAN_CFG_REO_STATUS_RING_MASK_1,
244 					WLAN_CFG_REO_STATUS_RING_MASK_2,
245 					WLAN_CFG_REO_STATUS_RING_MASK_3};
246 
247 static const int tx_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
248 						WLAN_CFG_TX_RING_MASK_0,
249 						WLAN_CFG_TX_RING_MASK_1,
250 						WLAN_CFG_TX_RING_MASK_2,
251 						WLAN_CFG_TX_RING_MASK_3};
252 
253 static const int rx_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
254 					0,
255 					0,
256 					0,
257 					0,
258 					0,
259 					0,
260 					0,
261 					WLAN_CFG_RX_RING_MASK_0,
262 					WLAN_CFG_RX_RING_MASK_1,
263 					WLAN_CFG_RX_RING_MASK_2,
264 					WLAN_CFG_RX_RING_MASK_3};
265 
266 static const int rx_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
267 					0,
268 					0,
269 					0,
270 					0,
271 					WLAN_CFG_RX_MON_RING_MASK_0,
272 					WLAN_CFG_RX_MON_RING_MASK_1,
273 					WLAN_CFG_RX_MON_RING_MASK_2};
274 
275 static const int host2rxdma_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
276 					WLAN_CFG_HOST2RXDMA_RING_MASK_0,
277 					WLAN_CFG_HOST2RXDMA_RING_MASK_1,
278 					WLAN_CFG_HOST2RXDMA_RING_MASK_2,
279 					WLAN_CFG_HOST2RXDMA_RING_MASK_3};
280 
281 static const int rxdma2host_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
282 					WLAN_CFG_RXDMA2HOST_RING_MASK_0,
283 					WLAN_CFG_RXDMA2HOST_RING_MASK_1,
284 					WLAN_CFG_RXDMA2HOST_RING_MASK_2,
285 					WLAN_CFG_RXDMA2HOST_RING_MASK_3};
286 
287 static const int host2rxdma_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
288 					0,
289 					0,
290 					0,
291 					0,
292 					WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
293 					WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
294 					WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2};
295 
296 static const int rxdma2host_mon_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
297 					0,
298 					0,
299 					0,
300 					0,
301 					WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
302 					WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
303 					WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2};
304 
305 static const int rx_err_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
306 					WLAN_CFG_RX_ERR_RING_MASK_0,
307 					WLAN_CFG_RX_ERR_RING_MASK_1,
308 					WLAN_CFG_RX_ERR_RING_MASK_2,
309 					WLAN_CFG_RX_ERR_RING_MASK_3};
310 
311 static const int rx_wbm_rel_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
312 					WLAN_CFG_RX_WBM_REL_RING_MASK_0,
313 					WLAN_CFG_RX_WBM_REL_RING_MASK_1,
314 					WLAN_CFG_RX_WBM_REL_RING_MASK_2,
315 					WLAN_CFG_RX_WBM_REL_RING_MASK_3};
316 
317 static const int reo_status_ring_mask_integrated[WLAN_CFG_INT_NUM_CONTEXTS] = {
318 					WLAN_CFG_REO_STATUS_RING_MASK_0,
319 					WLAN_CFG_REO_STATUS_RING_MASK_1,
320 					WLAN_CFG_REO_STATUS_RING_MASK_2,
321 					WLAN_CFG_REO_STATUS_RING_MASK_3};
322 #endif /* MAX_PDEV_CNT == 1 */
323 
324 /**
325  * g_wlan_srng_cfg[] - Per ring_type specific configuration
326  *
327  */
328 struct wlan_srng_cfg g_wlan_srng_cfg[MAX_RING_TYPES];
329 
330 /* REO_DST ring configuration */
331 struct wlan_srng_cfg wlan_srng_reo_cfg = {
332 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_REO_RING,
333 	.batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_REO_RING,
334 	.low_threshold = 0,
335 };
336 
337 /* WBM2SW_RELEASE ring configuration */
338 struct wlan_srng_cfg wlan_srng_wbm_release_cfg = {
339 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_WBM_RELEASE_RING,
340 	.batch_count_threshold = 0,
341 	.low_threshold = 0,
342 };
343 
344 /* RXDMA_BUF ring configuration */
345 struct wlan_srng_cfg wlan_srng_rxdma_buf_cfg = {
346 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
347 	.batch_count_threshold = 0,
348 	.low_threshold = WLAN_CFG_RXDMA_REFILL_RING_SIZE >> 3,
349 };
350 
351 /* RXDMA_MONITOR_BUF ring configuration */
352 struct wlan_srng_cfg wlan_srng_rxdma_monitor_buf_cfg = {
353 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
354 	.batch_count_threshold = 0,
355 	.low_threshold = WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE >> 3,
356 };
357 
358 /* RXDMA_MONITOR_STATUS ring configuration */
359 struct wlan_srng_cfg wlan_srng_rxdma_monitor_status_cfg = {
360 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
361 	.batch_count_threshold = 0,
362 	.low_threshold = WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE >> 3,
363 };
364 
365 /* DEFAULT_CONFIG ring configuration */
366 struct wlan_srng_cfg wlan_srng_default_cfg = {
367 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_OTHER,
368 	.batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_OTHER,
369 	.low_threshold = 0,
370 };
371 
372 void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg)
373 {
374 	g_wlan_srng_cfg[REO_DST] = wlan_srng_reo_cfg;
375 	g_wlan_srng_cfg[WBM2SW_RELEASE] = wlan_srng_wbm_release_cfg;
376 	g_wlan_srng_cfg[REO_EXCEPTION] = wlan_srng_default_cfg;
377 	g_wlan_srng_cfg[REO_REINJECT] = wlan_srng_default_cfg;
378 	g_wlan_srng_cfg[REO_CMD] = wlan_srng_default_cfg;
379 	g_wlan_srng_cfg[REO_STATUS] = wlan_srng_default_cfg;
380 	g_wlan_srng_cfg[TCL_DATA] = wlan_srng_default_cfg;
381 	g_wlan_srng_cfg[TCL_CMD_CREDIT] = wlan_srng_default_cfg;
382 	g_wlan_srng_cfg[TCL_STATUS] = wlan_srng_default_cfg;
383 	g_wlan_srng_cfg[WBM_IDLE_LINK] = wlan_srng_default_cfg;
384 	g_wlan_srng_cfg[SW2WBM_RELEASE] = wlan_srng_default_cfg;
385 	g_wlan_srng_cfg[RXDMA_BUF] = wlan_srng_rxdma_buf_cfg;
386 	g_wlan_srng_cfg[RXDMA_DST] = wlan_srng_default_cfg;
387 	g_wlan_srng_cfg[RXDMA_MONITOR_BUF] =
388 			wlan_srng_rxdma_monitor_buf_cfg;
389 	g_wlan_srng_cfg[RXDMA_MONITOR_STATUS] =
390 			wlan_srng_rxdma_monitor_status_cfg;
391 	g_wlan_srng_cfg[RXDMA_MONITOR_DST] = wlan_srng_default_cfg;
392 	g_wlan_srng_cfg[RXDMA_MONITOR_DESC] = wlan_srng_default_cfg;
393 	g_wlan_srng_cfg[DIR_BUF_RX_DMA_SRC] = wlan_srng_default_cfg;
394 #ifdef WLAN_FEATURE_CIF_CFR
395 	g_wlan_srng_cfg[WIFI_POS_SRC] = wlan_srng_default_cfg;
396 #endif
397 	*wlan_cfg = g_wlan_srng_cfg;
398 }
399 
400 static const uint8_t rx_fst_toeplitz_key[WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN] = {
401 	0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
402 	0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
403 	0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
404 	0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
405 	0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
406 };
407 
408 void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
409 				     int interrupt_mode,
410 				     bool is_monitor_mode) {
411 	int i = 0;
412 
413 	if (interrupt_mode == DP_INTR_INTEGRATED) {
414 		for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
415 			wlan_cfg_ctx->int_tx_ring_mask[i] =
416 					tx_ring_mask_integrated[i];
417 			wlan_cfg_ctx->int_rx_ring_mask[i] =
418 					rx_ring_mask_integrated[i];
419 			wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
420 				rx_mon_ring_mask_integrated[i];
421 			wlan_cfg_ctx->int_rx_err_ring_mask[i] =
422 				rx_err_ring_mask_integrated[i];
423 			wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
424 					rx_wbm_rel_ring_mask_integrated[i];
425 			wlan_cfg_ctx->int_reo_status_ring_mask[i] =
426 					reo_status_ring_mask_integrated[i];
427 			wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
428 				rxdma2host_ring_mask_integrated[i];
429 			wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
430 				host2rxdma_ring_mask_integrated[i];
431 			wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
432 				host2rxdma_mon_ring_mask_integrated[i];
433 			wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
434 				rxdma2host_mon_ring_mask_integrated[i];
435 		}
436 	} else if (interrupt_mode == DP_INTR_MSI || interrupt_mode ==
437 		   DP_INTR_POLL) {
438 		for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
439 			wlan_cfg_ctx->int_tx_ring_mask[i] = tx_ring_mask_msi[i];
440 			wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
441 				rx_mon_ring_mask_msi[i];
442 			wlan_cfg_ctx->int_rx_err_ring_mask[i] =
443 				rx_err_ring_mask_msi[i];
444 			wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
445 						rx_wbm_rel_ring_mask_msi[i];
446 			wlan_cfg_ctx->int_reo_status_ring_mask[i] =
447 						reo_status_ring_mask_msi[i];
448 			if (is_monitor_mode) {
449 				wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
450 				wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
451 			} else {
452 				wlan_cfg_ctx->int_rx_ring_mask[i] =
453 					rx_ring_mask_msi[i];
454 				wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
455 					rxdma2host_ring_mask_msi[i];
456 			}
457 			wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
458 				host2rxdma_ring_mask_msi[i];
459 			wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
460 				host2rxdma_mon_ring_mask_msi[i];
461 			wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
462 				rxdma2host_mon_ring_mask_msi[i];
463 		}
464 	} else {
465 		qdf_err("Interrupt mode %d", interrupt_mode);
466 	}
467 }
468 
469 /**
470  * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration
471  * @psoc - Object manager psoc
472  * Return: wlan_cfg_ctx - Handle to Configuration context
473  */
474 struct wlan_cfg_dp_soc_ctxt *
475 wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
476 {
477 	struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx =
478 		qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt));
479 
480 	if (!wlan_cfg_ctx)
481 		return NULL;
482 
483 	wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE;
484 	wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS;
485 	wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS);
486 	wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE);
487 	wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING);
488 	wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS);
489 	wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS);
490 	wlan_cfg_ctx->num_nss_reo_dest_rings =
491 				cfg_get(psoc, CFG_DP_NSS_REO_DEST_RINGS);
492 	wlan_cfg_ctx->num_nss_tcl_data_rings =
493 				cfg_get(psoc, CFG_DP_NSS_TCL_DATA_RINGS);
494 	wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING);
495 	wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING);
496 	wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS;
497 	wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc,
498 						     CFG_DP_TX_EXT_DESC_POOLS);
499 	wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC);
500 	wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN;
501 	wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC);
502 	wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE);
503 	wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID);
504 
505 	wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE);
506 	wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc,
507 						  CFG_DP_TX_COMPL_RING_SIZE);
508 
509 	wlan_cfg_ctx->tx_comp_ring_size_nss =
510 		cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE);
511 
512 	wlan_cfg_ctx->int_batch_threshold_tx =
513 			cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX);
514 	wlan_cfg_ctx->int_timer_threshold_tx =
515 			cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX);
516 	wlan_cfg_ctx->int_batch_threshold_rx =
517 			cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX);
518 	wlan_cfg_ctx->int_timer_threshold_rx =
519 			cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX);
520 	wlan_cfg_ctx->int_batch_threshold_other =
521 		cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER);
522 	wlan_cfg_ctx->int_timer_threshold_other =
523 		cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER);
524 	wlan_cfg_ctx->pktlog_buffer_size =
525 		cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE);
526 
527 	/* This is default mapping and can be overridden by HW config
528 	 * received from FW */
529 	wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0);
530 	if (MAX_PDEV_CNT > 1)
531 		wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2);
532 	if (MAX_PDEV_CNT > 2)
533 		wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1);
534 
535 	wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
536 
537 	wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH);
538 	wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO);
539 	wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO);
540 	wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG);
541 	wlan_cfg_ctx->gro_enabled = cfg_get(psoc, CFG_DP_GRO);
542 	wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM);
543 	wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM);
544 	wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE);
545 	wlan_cfg_ctx->peer_flow_ctrl_enabled =
546 			cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL);
547 	wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI);
548 	wlan_cfg_ctx->p2p_tcp_udp_checksumoffload =
549 			cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
550 	wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
551 			cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
552 	wlan_cfg_ctx->tcp_udp_checksumoffload =
553 			cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
554 	wlan_cfg_ctx->legacy_mode_checksumoffload_disable =
555 			cfg_get(psoc, CFG_DP_LEGACY_MODE_CSUM_DISABLE);
556 	wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING);
557 	wlan_cfg_ctx->defrag_timeout_check =
558 			cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK);
559 	wlan_cfg_ctx->rx_defrag_min_timeout =
560 			cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT);
561 
562 	wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc,
563 						 CFG_DP_WBM_RELEASE_RING);
564 	wlan_cfg_ctx->tcl_cmd_credit_ring = cfg_get(psoc,
565 					     CFG_DP_TCL_CMD_CREDIT_RING);
566 	wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc,
567 						CFG_DP_TCL_STATUS_RING);
568 	wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc,
569 						  CFG_DP_REO_REINJECT_RING);
570 	wlan_cfg_ctx->rx_release_ring = cfg_get(psoc,
571 						CFG_DP_RX_RELEASE_RING);
572 	wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc,
573 						   CFG_DP_REO_EXCEPTION_RING);
574 	wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc,
575 					     CFG_DP_REO_CMD_RING);
576 	wlan_cfg_ctx->reo_status_ring = cfg_get(psoc,
577 						CFG_DP_REO_STATUS_RING);
578 	wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc,
579 						  CFG_DP_RXDMA_REFILL_RING);
580 	wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc,
581 						CFG_DP_TX_DESC_LIMIT_0);
582 	wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc,
583 						CFG_DP_TX_DESC_LIMIT_1);
584 	wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc,
585 						CFG_DP_TX_DESC_LIMIT_2);
586 	wlan_cfg_ctx->tx_device_limit = cfg_get(psoc,
587 						CFG_DP_TX_DEVICE_LIMIT);
588 	wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc,
589 						CFG_DP_TX_SW_INTERNODE_QUEUE);
590 	wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc,
591 						   CFG_DP_RXDMA_ERR_DST_RING);
592 	wlan_cfg_ctx->enable_data_stall_detection =
593 		cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION);
594 	wlan_cfg_ctx->enable_force_rx_64_ba =
595 		cfg_get(psoc, CFG_FORCE_RX_64_BA);
596 	wlan_cfg_ctx->tx_flow_start_queue_offset =
597 		cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET);
598 	wlan_cfg_ctx->tx_flow_stop_queue_threshold =
599 		cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH);
600 	wlan_cfg_ctx->disable_intra_bss_fwd =
601 		cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION);
602 	wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc,
603 						   CFG_DP_RX_SW_DESC_WEIGHT);
604 	wlan_cfg_ctx->rx_sw_desc_num = cfg_get(psoc,
605 						   CFG_DP_RX_SW_DESC_NUM);
606 	wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key;
607 	wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH;
608 	wlan_cfg_ctx->is_rx_flow_tag_enabled =
609 			cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE);
610 	wlan_cfg_ctx->is_rx_flow_search_table_per_pdev =
611 			cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV);
612 	wlan_cfg_ctx->rx_flow_search_table_size =
613 			cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE);
614 	wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled =
615 			cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE);
616 	wlan_cfg_ctx->mon_drop_thresh =
617 		cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD);
618 	wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
619 	wlan_cfg_ctx->reo_rings_mapping = cfg_get(psoc, CFG_DP_REO_RINGS_MAP);
620 	wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS);
621 	wlan_cfg_ctx->is_rx_buff_pool_enabled =
622 			cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE);
623 	wlan_cfg_ctx->rx_pending_high_threshold =
624 			cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
625 	wlan_cfg_ctx->rx_pending_low_threshold =
626 			cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
627 	wlan_cfg_ctx->is_poll_mode_enabled =
628 			cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE);
629 	wlan_cfg_ctx->is_swlm_enabled = cfg_get(psoc, CFG_DP_SWLM_ENABLE);
630 	wlan_cfg_ctx->fst_in_cmem = cfg_get(psoc, CFG_DP_RX_FST_IN_CMEM);
631 	wlan_cfg_ctx->tx_per_pkt_vdev_id_check =
632 			cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK);
633 	wlan_cfg_ctx->radio0_rx_default_reo =
634 			cfg_get(psoc, CFG_DP_RX_RADIO_0_DEFAULT_REO);
635 	wlan_cfg_ctx->radio1_rx_default_reo =
636 			cfg_get(psoc, CFG_DP_RX_RADIO_1_DEFAULT_REO);
637 	wlan_cfg_ctx->radio2_rx_default_reo =
638 			cfg_get(psoc, CFG_DP_RX_RADIO_2_DEFAULT_REO);
639 	wlan_cfg_ctx->wow_check_rx_pending_enable =
640 			cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING);
641 
642 	return wlan_cfg_ctx;
643 }
644 
645 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
646 {
647 	qdf_mem_free(wlan_cfg_ctx);
648 }
649 
650 struct wlan_cfg_dp_pdev_ctxt *
651 wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc)
652 {
653 	struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx =
654 		qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt));
655 
656 	if (!wlan_cfg_ctx)
657 		return NULL;
658 
659 	wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc,
660 					CFG_DP_RXDMA_BUF_RING);
661 	wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc,
662 					CFG_DP_RXDMA_MONITOR_BUF_RING);
663 	wlan_cfg_ctx->dma_mon_dest_ring_size = cfg_get(psoc,
664 					CFG_DP_RXDMA_MONITOR_DST_RING);
665 	wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc,
666 					CFG_DP_RXDMA_MONITOR_STATUS_RING);
667 	wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc,
668 					CFG_DP_RXDMA_MONITOR_DESC_RING);
669 	wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV;
670 
671 	return wlan_cfg_ctx;
672 }
673 
674 void wlan_cfg_set_mon_delayed_replenish_entries(
675 					struct wlan_cfg_dp_soc_ctxt *cfg,
676 					uint32_t val)
677 {
678 	cfg->delayed_replenish_entries = val;
679 }
680 
681 int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg)
682 {
683 	return cfg->delayed_replenish_entries;
684 }
685 
686 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx)
687 {
688 	if (wlan_cfg_ctx)
689 		qdf_mem_free(wlan_cfg_ctx);
690 }
691 
692 int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg)
693 {
694 	return cfg->mon_drop_thresh;
695 }
696 
697 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num)
698 {
699 	cfg->num_int_ctxts = num;
700 }
701 
702 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
703 {
704 	cfg->max_peer_id = val;
705 }
706 
707 void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
708 {
709 	cfg->max_ast_idx = val;
710 }
711 
712 int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg)
713 {
714 	return cfg->max_ast_idx;
715 }
716 
717 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
718 		int context, int mask)
719 {
720 	cfg->int_tx_ring_mask[context] = mask;
721 }
722 
723 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
724 			       int context, int mask)
725 {
726 	cfg->int_rx_ring_mask[context] = mask;
727 }
728 
729 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
730 		int context, int mask)
731 {
732 	cfg->int_rx_mon_ring_mask[context] = mask;
733 }
734 
735 int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
736 					  int context)
737 {
738 	return cfg->int_host2rxdma_mon_ring_mask[context];
739 }
740 
741 void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
742 					   int context, int mask)
743 {
744 	cfg->int_host2rxdma_mon_ring_mask[context] = mask;
745 }
746 
747 int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
748 					  int context)
749 {
750 	return cfg->int_rxdma2host_mon_ring_mask[context];
751 }
752 
753 void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
754 					   int context, int mask)
755 {
756 	cfg->int_rxdma2host_mon_ring_mask[context] = mask;
757 }
758 
759 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
760 	int context, int mask)
761 {
762 	cfg->int_rxdma2host_ring_mask[context] = mask;
763 }
764 
765 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
766 	int context)
767 {
768 	return cfg->int_rxdma2host_ring_mask[context];
769 }
770 
771 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
772 	int context, int mask)
773 {
774 	cfg->int_host2rxdma_ring_mask[context] = mask;
775 }
776 
777 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
778 	int context)
779 {
780 	return cfg->int_host2rxdma_ring_mask[context];
781 }
782 
783 void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
784 			     int hw_macid)
785 {
786 	qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
787 	cfg->hw_macid[pdev_idx] = hw_macid;
788 }
789 
790 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
791 {
792 	qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
793 	return cfg->hw_macid[pdev_idx];
794 }
795 
796 int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
797 				int hw_macid)
798 {
799 	int idx;
800 
801 	for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
802 		if (cfg->hw_macid[idx] == hw_macid)
803 			return (idx + 1);
804 	}
805 	qdf_assert_always(idx < MAX_PDEV_CNT);
806 	return WLAN_INVALID_PDEV_ID;
807 }
808 
809 void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
810 			   int hw_macid)
811 {
812 	qdf_assert_always((pdev_idx < MAX_PDEV_CNT) ||
813 			  (pdev_idx == INVALID_PDEV_ID));
814 	qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
815 	cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
816 }
817 
818 int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
819 {
820 	qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
821 	return cfg->hw_macid_pdev_id_map[hw_macid];
822 }
823 
824 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
825 		int context, int mask)
826 {
827 	cfg->int_ce_ring_mask[context] = mask;
828 }
829 
830 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
831 		int mask)
832 {
833 	cfg->int_rx_ring_mask[context] = mask;
834 }
835 
836 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
837 		int context, int mask)
838 {
839 	return cfg->int_rx_err_ring_mask[context] = mask;
840 }
841 
842 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
843 		int context, int mask)
844 {
845 	return cfg->int_rx_wbm_rel_ring_mask[context] = mask;
846 }
847 
848 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
849 		int context, int mask)
850 {
851 	return cfg->int_reo_status_ring_mask[context] = mask;
852 }
853 
854 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg)
855 {
856 	return cfg->num_int_ctxts;
857 }
858 
859 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
860 {
861 	return cfg->int_tx_ring_mask[context];
862 }
863 
864 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
865 {
866 	return cfg->int_rx_ring_mask[context];
867 }
868 
869 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
870 						int context)
871 {
872 	return cfg->int_rx_err_ring_mask[context];
873 }
874 
875 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
876 					int context)
877 {
878 	return cfg->int_rx_wbm_rel_ring_mask[context];
879 }
880 
881 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
882 					int context)
883 {
884 	return cfg->int_reo_status_ring_mask[context];
885 }
886 
887 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
888 {
889 	return cfg->int_rx_mon_ring_mask[context];
890 }
891 
892 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
893 {
894 	return cfg->int_ce_ring_mask[context];
895 }
896 
897 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg)
898 {
899 	return cfg->max_clients;
900 }
901 
902 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg)
903 {
904 	return cfg->max_alloc_size;
905 }
906 
907 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
908 {
909 	return cfg->per_pdev_tx_ring;
910 }
911 
912 uint32_t
913 wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
914 {
915 	return cfg->rx_pending_high_threshold;
916 }
917 
918 uint32_t
919 wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
920 {
921 	return cfg->rx_pending_low_threshold;
922 }
923 
924 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
925 {
926 	return cfg->per_pdev_lmac_ring;
927 }
928 
929 #ifdef DP_MEMORY_OPT
930 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
931 {
932 	return 1;
933 }
934 
935 int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
936 {
937 	return 1;
938 }
939 
940 #else
941 
942 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
943 {
944 	return cfg->num_tcl_data_rings;
945 }
946 
947 int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
948 {
949 	return cfg->num_nss_tcl_data_rings;
950 }
951 
952 #endif
953 
954 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
955 {
956 	return cfg->tx_ring_size;
957 }
958 
959 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
960 {
961 	return cfg->tx_comp_ring_size;
962 }
963 
964 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
965 {
966 	return cfg->per_pdev_rx_ring;
967 }
968 
969 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
970 {
971 	return cfg->num_reo_dest_rings;
972 }
973 
974 int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
975 {
976 	return cfg->num_nss_reo_dest_rings;
977 }
978 
979 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg)
980 {
981 	return cfg->htt_packet_type;            /*htt_pkt_type_ethernet*/
982 }
983 
984 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
985 {
986 	return cfg->num_tx_desc_pool;
987 }
988 
989 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
990 {
991 	cfg->num_tx_desc_pool = num_pool;
992 }
993 
994 int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
995 {
996 	return cfg->num_tx_ext_desc_pool;
997 }
998 
999 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
1000 {
1001 	cfg->num_tx_ext_desc_pool = num_pool;
1002 }
1003 
1004 int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1005 {
1006 	return cfg->reo_dst_ring_size;
1007 }
1008 
1009 void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
1010 				    int reo_dst_ring_size)
1011 {
1012 	cfg->reo_dst_ring_size = reo_dst_ring_size;
1013 }
1014 
1015 void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
1016 			       bool raw_mode_war)
1017 {
1018 	cfg->raw_mode_war = raw_mode_war;
1019 }
1020 
1021 bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg)
1022 {
1023 	return cfg->raw_mode_war;
1024 }
1025 
1026 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
1027 {
1028 	return cfg->num_tx_desc;
1029 }
1030 
1031 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc)
1032 {
1033 	cfg->num_tx_desc = num_desc;
1034 }
1035 
1036 int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
1037 {
1038 	return cfg->min_tx_desc;
1039 }
1040 
1041 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
1042 {
1043 	return cfg->num_tx_ext_desc;
1044 }
1045 
1046 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc)
1047 {
1048 	cfg->num_tx_ext_desc = num_ext_desc;
1049 }
1050 
1051 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg)
1052 {
1053 	/* TODO: This should be calculated based on target capabilities */
1054 	return cfg->max_peer_id;
1055 }
1056 
1057 int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
1058 {
1059 	return  cfg->dma_mon_buf_ring_size;
1060 }
1061 
1062 int wlan_cfg_get_dma_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
1063 {
1064 	return  cfg->dma_mon_dest_ring_size;
1065 }
1066 
1067 int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
1068 {
1069 	return  cfg->dma_mon_status_ring_size;
1070 }
1071 
1072 int
1073 wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
1074 {
1075 	return cfg->rxdma_monitor_desc_ring;
1076 }
1077 
1078 int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
1079 {
1080 	return  cfg->rx_dma_buf_ring_size;
1081 }
1082 
1083 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg)
1084 {
1085 	return  cfg->num_mac_rings;
1086 }
1087 
1088 bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1089 {
1090 	return  cfg->gro_enabled;
1091 }
1092 
1093 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1094 {
1095 	return  cfg->lro_enabled;
1096 }
1097 
1098 bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1099 {
1100 	return  cfg->ipa_enabled;
1101 }
1102 
1103 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
1104 {
1105 	cfg->rx_hash = val;
1106 }
1107 
1108 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1109 {
1110 	return  cfg->rx_hash;
1111 }
1112 
1113 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg)
1114 {
1115 	return  cfg->nss_enabled;
1116 }
1117 
1118 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled)
1119 {
1120 	cfg->nss_enabled = nss_enabled;
1121 }
1122 
1123 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg)
1124 {
1125 	return  cfg->nss_cfg;
1126 }
1127 
1128 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg)
1129 {
1130 	cfg->nss_cfg = nss_cfg;
1131 	if (cfg->nss_cfg)
1132 		cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss;
1133 }
1134 
1135 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
1136 {
1137 	return cfg->int_batch_threshold_tx;
1138 }
1139 
1140 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
1141 {
1142 	return cfg->int_timer_threshold_tx;
1143 }
1144 
1145 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
1146 {
1147 	return cfg->int_batch_threshold_rx;
1148 }
1149 
1150 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
1151 {
1152 	return cfg->int_timer_threshold_rx;
1153 }
1154 
1155 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
1156 {
1157 	return cfg->int_batch_threshold_other;
1158 }
1159 
1160 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
1161 {
1162 	return cfg->int_timer_threshold_other;
1163 }
1164 
1165 int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
1166 {
1167 	return cfg->int_timer_threshold_mon;
1168 }
1169 
1170 int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
1171 {
1172 	return cfg->p2p_tcp_udp_checksumoffload;
1173 }
1174 
1175 int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
1176 {
1177 	return cfg->nan_tcp_udp_checksumoffload;
1178 }
1179 
1180 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
1181 {
1182 	return cfg->tcp_udp_checksumoffload;
1183 }
1184 
1185 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg)
1186 {
1187 	return cfg->rx_defrag_min_timeout;
1188 }
1189 
1190 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg)
1191 {
1192 	return cfg->defrag_timeout_check;
1193 }
1194 
1195 int
1196 wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1197 {
1198 	return cfg->wbm_release_ring;
1199 }
1200 
1201 int
1202 wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1203 {
1204 	return cfg->tcl_cmd_credit_ring;
1205 }
1206 
1207 int
1208 wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1209 {
1210 	return cfg->tcl_status_ring;
1211 }
1212 
1213 int
1214 wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1215 {
1216 	return cfg->reo_reinject_ring;
1217 }
1218 
1219 int
1220 wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1221 {
1222 	return cfg->rx_release_ring;
1223 }
1224 
1225 int
1226 wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1227 {
1228 	return cfg->reo_exception_ring;
1229 }
1230 
1231 int
1232 wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1233 {
1234 	return cfg->reo_cmd_ring;
1235 }
1236 
1237 int
1238 wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1239 {
1240 	return cfg->reo_status_ring;
1241 }
1242 
1243 int
1244 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1245 {
1246 	return cfg->rxdma_refill_ring;
1247 }
1248 
1249 int
1250 wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
1251 {
1252 	return cfg->tx_desc_limit_0;
1253 }
1254 
1255 int
1256 wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg)
1257 {
1258 	return cfg->tx_desc_limit_1;
1259 }
1260 
1261 int
1262 wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
1263 {
1264 	return cfg->tx_desc_limit_2;
1265 }
1266 
1267 int
1268 wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
1269 {
1270 	return cfg->tx_device_limit;
1271 }
1272 
1273 int
1274 wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg)
1275 {
1276 	return cfg->tx_sw_internode_queue;
1277 }
1278 
1279 int
1280 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1281 {
1282 	return cfg->rxdma_err_dst_ring;
1283 }
1284 
1285 int
1286 wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg)
1287 {
1288 	return cfg->rx_sw_desc_weight;
1289 }
1290 
1291 int
1292 wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg)
1293 {
1294 	return cfg->rx_sw_desc_num;
1295 }
1296 
1297 uint32_t
1298 wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg)
1299 {
1300 	return cfg->reo_rings_mapping;
1301 }
1302 
1303 bool
1304 wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
1305 		     enum cdp_capabilities dp_caps)
1306 {
1307 	switch (dp_caps) {
1308 	case CDP_CFG_DP_TSO:
1309 		return cfg->tso_enabled;
1310 	case CDP_CFG_DP_LRO:
1311 		return cfg->lro_enabled;
1312 	case CDP_CFG_DP_SG:
1313 		return cfg->sg_enabled;
1314 	case CDP_CFG_DP_GRO:
1315 		return cfg->gro_enabled;
1316 	case CDP_CFG_DP_OL_TX_CSUM:
1317 		return cfg->ol_tx_csum_enabled;
1318 	case CDP_CFG_DP_OL_RX_CSUM:
1319 		return cfg->ol_rx_csum_enabled;
1320 	case CDP_CFG_DP_RAWMODE:
1321 		return cfg->rawmode_enabled;
1322 	case CDP_CFG_DP_PEER_FLOW_CTRL:
1323 		return cfg->peer_flow_ctrl_enabled;
1324 	default:
1325 		return false;
1326 	}
1327 }
1328 
1329 void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
1330 					bool val)
1331 {
1332 	cfg->is_tso_desc_attach_defer = val;
1333 }
1334 
1335 bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg)
1336 {
1337 	return cfg->is_tso_desc_attach_defer;
1338 }
1339 
1340 #ifdef QCA_LL_TX_FLOW_CONTROL_V2
1341 /**
1342  * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold
1343  * @cfg: config context
1344  *
1345  * Return: stop threshold
1346  */
1347 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
1348 {
1349 	return cfg->tx_flow_stop_queue_threshold;
1350 }
1351 
1352 /**
1353  * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset
1354  *					for TX to resume
1355  * @cfg: config context
1356  *
1357  * Return: stop threshold
1358  */
1359 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
1360 {
1361 	return cfg->tx_flow_start_queue_offset;
1362 }
1363 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
1364 
1365 void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
1366 				      bool val)
1367 {
1368 	cfg->is_rx_flow_tag_enabled = val;
1369 }
1370 
1371 uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg)
1372 {
1373 	return cfg->rx_toeplitz_hash_key;
1374 }
1375 
1376 uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg)
1377 {
1378 	return cfg->rx_flow_max_search;
1379 }
1380 
1381 bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1382 {
1383 	return cfg->is_rx_flow_tag_enabled;
1384 }
1385 
1386 #ifdef WLAN_SUPPORT_RX_FISA
1387 bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1388 {
1389 	return (bool)(cfg->is_rx_fisa_enabled);
1390 }
1391 #else
1392 bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1393 {
1394 	return false;
1395 }
1396 #endif
1397 
1398 bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1399 {
1400 	return (bool)(cfg->is_poll_mode_enabled);
1401 }
1402 
1403 void
1404 wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
1405 					   bool val)
1406 {
1407 	cfg->is_rx_flow_search_table_per_pdev = val;
1408 }
1409 
1410 bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg)
1411 {
1412 	return cfg->is_rx_flow_search_table_per_pdev;
1413 }
1414 
1415 void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
1416 					    uint16_t val)
1417 {
1418 	cfg->rx_flow_search_table_size = val;
1419 }
1420 
1421 uint16_t
1422 wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg)
1423 {
1424 	return  cfg->rx_flow_search_table_size;
1425 }
1426 
1427 void
1428 wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
1429 					      bool val)
1430 {
1431 	cfg->is_rx_mon_protocol_flow_tag_enabled = val;
1432 }
1433 
1434 bool
1435 wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1436 {
1437 	return cfg->is_rx_mon_protocol_flow_tag_enabled;
1438 }
1439 
1440 void
1441 wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
1442 				      bool val)
1443 {
1444 	cfg->tx_per_pkt_vdev_id_check = val;
1445 }
1446 
1447 bool
1448 wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1449 {
1450 	return cfg->tx_per_pkt_vdev_id_check;
1451 }
1452 
1453 void
1454 wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
1455 			    bool val)
1456 {
1457 	cfg->pext_stats_enabled = val;
1458 }
1459 
1460 bool
1461 wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1462 {
1463 	return cfg->pext_stats_enabled;
1464 }
1465 
1466 bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1467 {
1468 	return cfg->fst_in_cmem;
1469 }
1470 
1471 #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
1472 bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1473 {
1474 	return cfg->is_rx_buff_pool_enabled;
1475 }
1476 #else
1477 bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1478 {
1479 	return false;
1480 }
1481 #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */
1482 
1483 #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
1484 bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1485 {
1486 	return (bool)(cfg->is_swlm_enabled);
1487 }
1488 #else
1489 bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
1490 {
1491 	return false;
1492 }
1493 #endif
1494 uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
1495 {
1496 	return cfg->radio0_rx_default_reo;
1497 }
1498 
1499 uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
1500 {
1501 	return cfg->radio1_rx_default_reo;
1502 }
1503 
1504 uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
1505 {
1506 	return cfg->radio2_rx_default_reo;
1507 }
1508 
1509 #ifdef QCA_LOWMEM_CONFIG
1510 void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *cfg)
1511 {
1512 	cfg->rxdma1_enable = false;
1513 }
1514 #else
1515 void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *cfg)
1516 {
1517 	cfg->rxdma1_enable = true;
1518 }
1519 #endif
1520 
1521 bool wlan_cfg_is_dp_force_rx_64_ba(struct wlan_cfg_dp_soc_ctxt *cfg)
1522 {
1523 	return cfg->enable_force_rx_64_ba;
1524 }
1525