xref: /wlan-dirver/qca-wifi-host-cmn/wlan_cfg/wlan_cfg.c (revision d94f0fb619d3da5ae22f9943f88d4634e2d28581)
1 /*
2  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #if defined(CONFIG_HL_SUPPORT)
21 #include "wlan_tgt_def_config_hl.h"
22 #else
23 #include "wlan_tgt_def_config.h"
24 #endif
25 
26 #include "qdf_trace.h"
27 #include "qdf_mem.h"
28 #include <cdp_txrx_ops.h>
29 #include "wlan_cfg.h"
30 #include "cfg_ucfg_api.h"
31 #include "hal_api.h"
32 #include "dp_types.h"
33 #include <qdf_module.h>
34 
35 /*
36  * The max allowed size for tx comp ring is 8191.
37  * This is limited by h/w ring max size.
38  * As this is not a power of 2 it does not work with nss offload so the
39  * nearest available size which is power of 2 is 4096 chosen for nss
40  */
41 
42 #define WLAN_CFG_TX_RING_MASK_0 BIT(0)
43 #define WLAN_CFG_TX_RING_MASK_1 BIT(1)
44 #define WLAN_CFG_TX_RING_MASK_2 BIT(2)
45 #define WLAN_CFG_TX_RING_MASK_3 BIT(3)
46 #define WLAN_CFG_TX_RING_MASK_4 BIT(4)
47 #define WLAN_CFG_TX_RING_MASK_5 BIT(5)
48 #define WLAN_CFG_TX_RING_MASK_6 BIT(6)
49 #define WLAN_CFG_TX_RING_MASK_7 BIT(7)
50 
51 
52 #define WLAN_CFG_RX_MON_RING_MASK_0 0x1
53 #define WLAN_CFG_RX_MON_RING_MASK_1 0x2
54 #define WLAN_CFG_RX_MON_RING_MASK_2 0x4
55 #define WLAN_CFG_RX_MON_RING_MASK_3 0x0
56 
57 #define WLAN_CFG_TX_MON_RING_MASK_0 BIT(0)
58 #define WLAN_CFG_TX_MON_RING_MASK_1 BIT(1)
59 
60 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 0x1
61 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 0x2
62 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2 0x4
63 
64 #define WLAN_CFG_HOST2TXMON_RING_MASK_0 0x1
65 
66 #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 0x1
67 #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 0x2
68 #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2 0x4
69 
70 #define WLAN_CFG_RX_ERR_RING_MASK_0 0x1
71 #define WLAN_CFG_RX_ERR_RING_MASK_1 0x0
72 #define WLAN_CFG_RX_ERR_RING_MASK_2 0x0
73 #define WLAN_CFG_RX_ERR_RING_MASK_3 0x0
74 
75 #define WLAN_CFG_RX_WBM_REL_RING_MASK_0 0x1
76 #define WLAN_CFG_RX_WBM_REL_RING_MASK_1 0x0
77 #define WLAN_CFG_RX_WBM_REL_RING_MASK_2 0x0
78 #define WLAN_CFG_RX_WBM_REL_RING_MASK_3 0x0
79 
80 #define WLAN_CFG_REO_STATUS_RING_MASK_0 0x1
81 #define WLAN_CFG_REO_STATUS_RING_MASK_1 0x0
82 #define WLAN_CFG_REO_STATUS_RING_MASK_2 0x0
83 #define WLAN_CFG_REO_STATUS_RING_MASK_3 0x0
84 
85 #define WLAN_CFG_RXDMA2HOST_RING_MASK_0 0x1
86 #define WLAN_CFG_RXDMA2HOST_RING_MASK_1 0x2
87 #define WLAN_CFG_RXDMA2HOST_RING_MASK_2 0x4
88 #define WLAN_CFG_RXDMA2HOST_RING_MASK_3 0x0
89 
90 #define WLAN_CFG_HOST2RXDMA_RING_MASK_0 0x1
91 #define WLAN_CFG_HOST2RXDMA_RING_MASK_1 0x2
92 #define WLAN_CFG_HOST2RXDMA_RING_MASK_2 0x4
93 #define WLAN_CFG_HOST2RXDMA_RING_MASK_3 0x0
94 
95 struct dp_int_mask_assignment {
96 	uint8_t tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
97 	uint8_t rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
98 	uint8_t rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
99 	uint8_t host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
100 	uint8_t rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
101 	uint8_t host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
102 	uint8_t rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
103 	uint8_t rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
104 	uint8_t rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
105 	uint8_t reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
106 	uint8_t rx_ring_near_full_irq_1_mask[WLAN_CFG_INT_NUM_CONTEXTS];
107 	uint8_t rx_ring_near_full_irq_2_mask[WLAN_CFG_INT_NUM_CONTEXTS];
108 	uint8_t tx_ring_near_full_irq_mask[WLAN_CFG_INT_NUM_CONTEXTS];
109 	uint8_t host2txmon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
110 	uint8_t tx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
111 };
112 
113 #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
114 /*
115  * For BE, there are 18 available MSI interrupts, assigned in the manner
116  * below.
117  * TX(5) + RX(8) + (REO ERR + WBM ERR)(1) +
118  * (REO status + RXDMA[0] + RXDMA[1])(1) + NEAR_Full_RX(2) +  NEAR_Full_TX(1)
119  * For IPA_OFFLOAD enabled case, 2 TX/RX rings would be assigned to IPA.
120  */
121 
122 #ifdef CONFIG_BERYLLIUM
123 #ifdef IPA_OFFLOAD
124 /*
125  * NEAR-FULL IRQ mask should be updated, if any change is made to
126  * the below TX mask.
127  */
128 static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
129 	[0] = WLAN_CFG_TX_RING_MASK_0, [1] = WLAN_CFG_TX_RING_MASK_6,
130 	[2] = WLAN_CFG_TX_RING_MASK_7};
131 #else
132 static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
133 	[0] = WLAN_CFG_TX_RING_MASK_0, [1] = WLAN_CFG_TX_RING_MASK_4,
134 	[2] = WLAN_CFG_TX_RING_MASK_2, [3] = WLAN_CFG_TX_RING_MASK_6,
135 	[4] = WLAN_CFG_TX_RING_MASK_7};
136 #endif /* IPA_OFFLOAD */
137 
138 static inline const
139 uint8_t *wlan_cfg_get_tx_ring_int_mask(struct wlan_cfg_dp_soc_ctxt *cfg_ctx)
140 {
141 	return &tx_ring_mask_msi[0];
142 }
143 #else
144 static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
145 	[0] = WLAN_CFG_TX_RING_MASK_0};
146 
147 #ifdef TX_MULTI_TCL
148 static const uint8_t multi_tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
149 	[0] = WLAN_CFG_TX_RING_MASK_0, [4] = WLAN_CFG_TX_RING_MASK_2};
150 
151 #ifdef IPA_OFFLOAD
152 static inline const
153 uint8_t *wlan_cfg_get_tx_ring_int_mask(struct wlan_cfg_dp_soc_ctxt *cfg_ctx)
154 {
155 	if (cfg_ctx->ipa_enabled)
156 		return &tx_ring_mask_msi[0];
157 
158 	return &multi_tx_ring_mask_msi[0];
159 }
160 #else
161 static inline const
162 uint8_t *wlan_cfg_get_tx_ring_int_mask(struct wlan_cfg_dp_soc_ctxt *cfg_ctx)
163 {
164 	return &multi_tx_ring_mask_msi[0];
165 }
166 #endif /* IPA_OFFLOAD */
167 #else
168 static inline const
169 uint8_t *wlan_cfg_get_tx_ring_int_mask(struct wlan_cfg_dp_soc_ctxt *cfg_ctx)
170 {
171 	return &tx_ring_mask_msi[0];
172 }
173 #endif /* TX_MULTI_TCL */
174 #endif /* CONFIG_BERYLLIUM */
175 
176 #ifdef CONFIG_BERYLLIUM
177 #ifdef IPA_OFFLOAD
178 static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
179 	[5] = WLAN_CFG_RX_RING_MASK_0, [6] = WLAN_CFG_RX_RING_MASK_1,
180 	[7] = WLAN_CFG_RX_RING_MASK_2, [9] = WLAN_CFG_RX_RING_MASK_4,
181 	[10] = WLAN_CFG_RX_RING_MASK_5, [11] = WLAN_CFG_RX_RING_MASK_6};
182 #else
183 static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
184 	[5] = WLAN_CFG_RX_RING_MASK_0, [6] = WLAN_CFG_RX_RING_MASK_1,
185 	[7] = WLAN_CFG_RX_RING_MASK_2, [8] = WLAN_CFG_RX_RING_MASK_3,
186 	[9] = WLAN_CFG_RX_RING_MASK_4, [10] = WLAN_CFG_RX_RING_MASK_5,
187 	[11] = WLAN_CFG_RX_RING_MASK_6, [12] = WLAN_CFG_RX_RING_MASK_7};
188 #endif /* IPA_OFFLOAD */
189 #else /* !defined(CONFIG_BERYLLIUM) */
190 #ifdef IPA_OFFLOAD
191 static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
192 	[1] = WLAN_CFG_RX_RING_MASK_0, [2] = WLAN_CFG_RX_RING_MASK_1,
193 	[3] = WLAN_CFG_RX_RING_MASK_2};
194 #else
195 static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
196 	[1] = WLAN_CFG_RX_RING_MASK_0, [2] = WLAN_CFG_RX_RING_MASK_1,
197 	[3] = WLAN_CFG_RX_RING_MASK_2 | WLAN_CFG_RX_RING_MASK_3};
198 #endif
199 #endif /* CONFIG_BERYLLIUM */
200 
201 #ifdef CONFIG_BERYLLIUM
202 static const  uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
203 	[13] = WLAN_CFG_RXDMA2HOST_RING_MASK_0};
204 #else
205 static const  uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
206 	[6] = WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
207 	      WLAN_CFG_RXDMA2HOST_RING_MASK_1};
208 #endif /* CONFIG_BERYLLIUM */
209 
210 #ifdef CONFIG_BERYLLIUM
211 static const  uint8_t rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
212 	[5] = WLAN_CFG_RX_MON_RING_MASK_0};
213 #else
214 static const  uint8_t rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
215 	[1] = WLAN_CFG_RX_MON_RING_MASK_0, [2] = WLAN_CFG_RX_MON_RING_MASK_1};
216 #endif
217 
218 static const  uint8_t host2rxdma_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
219 
220 static const  uint8_t host2rxdma_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
221 
222 static const  uint8_t rxdma2host_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0};
223 
224 #ifdef CONFIG_BERYLLIUM
225 static const  uint8_t rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
226 	[14] = WLAN_CFG_RX_ERR_RING_MASK_0};
227 
228 static const  uint8_t rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
229 	[14] = WLAN_CFG_RX_WBM_REL_RING_MASK_0};
230 
231 static const  uint8_t reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
232 	[13] = WLAN_CFG_REO_STATUS_RING_MASK_0};
233 #else
234 static const  uint8_t rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
235 	[6] = WLAN_CFG_RX_ERR_RING_MASK_0};
236 static const  uint8_t rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
237 	[6] = WLAN_CFG_RX_WBM_REL_RING_MASK_0};
238 static const  uint8_t reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
239 	[6] = WLAN_CFG_REO_STATUS_RING_MASK_0};
240 #endif
241 
242 #ifdef CONFIG_BERYLLIUM
243 #ifdef WLAN_FEATURE_NEAR_FULL_IRQ
244 static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
245 	[15] = WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1};
246 static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
247 	[16] = WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1};
248 static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
249 	[17] = WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK};
250 #else
251 static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
252 	0 };
253 static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
254 	0 };
255 static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
256 	0 };
257 #endif
258 #else
259 static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
260 	0 };
261 static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
262 	0 };
263 static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {
264 	0 };
265 #endif
266 
267 #else
268 /* Integrated configuration + 8 possible MSI configurations */
269 #define NUM_INTERRUPT_COMBINATIONS 9
270 /*
271  * This structure contains the best possible mask assignment for a given
272  * number of MSIs available in the system.
273  */
274 #ifdef IPA_OFFLOAD
275 static struct dp_int_mask_assignment dp_mask_assignment[NUM_INTERRUPT_COMBINATIONS] = {
276 	/* Interrupt assignment for integrated configuration */
277 	{
278 		/* tx ring masks */
279 		{ WLAN_CFG_TX_RING_MASK_0,
280 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
281 		/* rx ring masks */
282 		{ 0, 0, 0, 0, 0, 0, 0,
283 		  WLAN_CFG_RX_RING_MASK_0,
284 		  WLAN_CFG_RX_RING_MASK_1,
285 		  WLAN_CFG_RX_RING_MASK_2,
286 		  0},
287 		/* rx mon ring masks */
288 		{ 0, 0, 0, 0,
289 		  WLAN_CFG_RX_MON_RING_MASK_0,
290 		  WLAN_CFG_RX_MON_RING_MASK_1,
291 		  WLAN_CFG_RX_MON_RING_MASK_2,
292 		  0, 0, 0, 0},
293 		/* host2rxdma ring masks */
294 		{ WLAN_CFG_HOST2RXDMA_RING_MASK_0,
295 		  WLAN_CFG_HOST2RXDMA_RING_MASK_1,
296 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2,
297 		  WLAN_CFG_HOST2RXDMA_RING_MASK_3,
298 		  0, 0, 0, 0, 0, 0, 0},
299 		/* rxdma2host ring masks */
300 		{ WLAN_CFG_RXDMA2HOST_RING_MASK_0,
301 		  WLAN_CFG_RXDMA2HOST_RING_MASK_1,
302 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2,
303 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
304 		  0, 0, 0, 0, 0, 0, 0},
305 		/* host2rxdma mon ring masks */
306 		{ 0, 0, 0, 0,
307 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
308 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
309 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
310 		  0, 0, 0, 0},
311 		/* rxdma2host mon ring masks */
312 		{ 0, 0,	0, 0,
313 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
314 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
315 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
316 		  0, 0, 0, 0},
317 		/* rx err ring masks */
318 		{ WLAN_CFG_RX_ERR_RING_MASK_0,
319 		  WLAN_CFG_RX_ERR_RING_MASK_1,
320 		  WLAN_CFG_RX_ERR_RING_MASK_2,
321 		  WLAN_CFG_RX_ERR_RING_MASK_3,
322 		  0, 0, 0, 0, 0, 0, 0},
323 		/* rx wbm rel ring masks */
324 		{ WLAN_CFG_RX_WBM_REL_RING_MASK_0,
325 		  WLAN_CFG_RX_WBM_REL_RING_MASK_1,
326 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2,
327 		  WLAN_CFG_RX_WBM_REL_RING_MASK_3,
328 		  0, 0, 0, 0, 0, 0, 0},
329 		/* reo status ring masks */
330 		{ WLAN_CFG_REO_STATUS_RING_MASK_0,
331 		  WLAN_CFG_REO_STATUS_RING_MASK_1,
332 		  WLAN_CFG_REO_STATUS_RING_MASK_2,
333 		  WLAN_CFG_REO_STATUS_RING_MASK_3,
334 		  0, 0, 0, 0, 0, 0, 0},
335 	},
336 	/* Interrupt assignment for 1 MSI combination */
337 	{
338 		/* tx ring masks */
339 		{ WLAN_CFG_TX_RING_MASK_0,
340 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
341 		/* rx ring masks */
342 		{ WLAN_CFG_RX_RING_MASK_0 |
343 		    WLAN_CFG_RX_RING_MASK_1 |
344 		    WLAN_CFG_RX_RING_MASK_2,
345 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
346 		/* rx mon ring masks */
347 		{ WLAN_CFG_RX_MON_RING_MASK_0 |
348 		    WLAN_CFG_RX_MON_RING_MASK_1 |
349 		    WLAN_CFG_RX_MON_RING_MASK_2,
350 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
351 		/* host2rxdma ring masks */
352 		{ WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
353 		    WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
354 		    WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
355 		    WLAN_CFG_HOST2RXDMA_RING_MASK_3,
356 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
357 		/* rxdma2host ring masks */
358 		{ WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
359 		    WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
360 		    WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
361 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
362 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
363 		/* host2rxdma mon ring masks */
364 		{ WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
365 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
366 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
367 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
368 		/* rxdma2host mon ring masks */
369 		{ WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
370 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
371 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
372 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
373 		/* rx err ring masks */
374 		{ WLAN_CFG_RX_ERR_RING_MASK_0 |
375 		    WLAN_CFG_RX_ERR_RING_MASK_1 |
376 		    WLAN_CFG_RX_ERR_RING_MASK_2 |
377 		    WLAN_CFG_RX_ERR_RING_MASK_3,
378 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
379 		/* rx wbm rel ring masks */
380 		{ WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
381 		    WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
382 		    WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
383 		    WLAN_CFG_RX_WBM_REL_RING_MASK_3,
384 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
385 		/* reo status ring masks */
386 		{ WLAN_CFG_REO_STATUS_RING_MASK_0 |
387 		    WLAN_CFG_REO_STATUS_RING_MASK_1 |
388 		    WLAN_CFG_REO_STATUS_RING_MASK_2 |
389 		    WLAN_CFG_REO_STATUS_RING_MASK_3,
390 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
391 	},
392 	/* Interrupt assignment for 2 MSI combination */
393 	{
394 		/* tx ring masks */
395 		{ WLAN_CFG_TX_RING_MASK_0,
396 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
397 		/* rx ring masks */
398 		{ WLAN_CFG_RX_RING_MASK_0 |
399 		    WLAN_CFG_RX_RING_MASK_1,
400 		  WLAN_CFG_RX_RING_MASK_2,
401 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
402 		/* rx mon ring masks */
403 		{ WLAN_CFG_RX_MON_RING_MASK_0 |
404 		    WLAN_CFG_RX_MON_RING_MASK_1,
405 		  WLAN_CFG_RX_MON_RING_MASK_2,
406 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
407 		/* host2rxdma ring masks */
408 		{ WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
409 		    WLAN_CFG_HOST2RXDMA_RING_MASK_1,
410 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
411 		    WLAN_CFG_HOST2RXDMA_RING_MASK_3,
412 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
413 		/* rxdma2host ring masks */
414 		{ WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
415 		    WLAN_CFG_RXDMA2HOST_RING_MASK_1,
416 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
417 		    WLAN_CFG_RXDMA2HOST_RING_MASK_3,
418 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
419 		/* host2rxdma mon ring masks */
420 		{ WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
421 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
422 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
423 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
424 		/* rxdma2host mon ring masks */
425 		{ WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
426 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
427 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
428 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
429 		/* rx err ring masks */
430 		{ WLAN_CFG_RX_ERR_RING_MASK_0 |
431 		    WLAN_CFG_RX_ERR_RING_MASK_1,
432 		  WLAN_CFG_RX_ERR_RING_MASK_2 |
433 		    WLAN_CFG_RX_ERR_RING_MASK_3,
434 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
435 		/* rx wbm rel ring masks */
436 		{ WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
437 		    WLAN_CFG_RX_WBM_REL_RING_MASK_1,
438 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
439 		    WLAN_CFG_RX_WBM_REL_RING_MASK_3,
440 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
441 		/* reo status ring masks */
442 		{ WLAN_CFG_REO_STATUS_RING_MASK_0 |
443 		    WLAN_CFG_REO_STATUS_RING_MASK_1,
444 		  WLAN_CFG_REO_STATUS_RING_MASK_2 |
445 		    WLAN_CFG_REO_STATUS_RING_MASK_3,
446 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
447 	},
448 	/* Interrupt assignment for 3 MSI combination */
449 	{
450 		/* tx ring masks */
451 		{ WLAN_CFG_TX_RING_MASK_0,
452 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
453 		/* rx ring masks */
454 		{ WLAN_CFG_RX_RING_MASK_0,
455 		    WLAN_CFG_RX_RING_MASK_1,
456 		  WLAN_CFG_RX_RING_MASK_2,
457 		  0, 0, 0, 0, 0, 0, 0, 0},
458 		/* rx mon ring masks */
459 		{ 0, 0,
460 		  WLAN_CFG_RX_MON_RING_MASK_0 |
461 		    WLAN_CFG_RX_MON_RING_MASK_1 |
462 		    WLAN_CFG_RX_MON_RING_MASK_2,
463 		  0, 0, 0, 0, 0, 0, 0, 0},
464 		/* host2rxdma ring masks */
465 		{ 0, 0,
466 		  WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
467 		    WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
468 		    WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
469 		    WLAN_CFG_HOST2RXDMA_RING_MASK_3,
470 		  0, 0, 0, 0, 0, 0, 0, 0},
471 		/* rxdma2host ring masks */
472 		{ 0, 0,
473 		  WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
474 		    WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
475 		    WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
476 		    WLAN_CFG_RXDMA2HOST_RING_MASK_3,
477 		  0, 0, 0, 0, 0, 0, 0, 0},
478 		/* host2rxdma mon ring masks */
479 		{ 0, 0,
480 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
481 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
482 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
483 		  0, 0, 0, 0, 0, 0, 0, 0},
484 		/* rxdma2host mon ring masks */
485 		{ 0, 0,
486 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
487 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
488 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
489 		  0, 0, 0, 0, 0, 0, 0, 0},
490 		/* rx err ring masks */
491 		{ 0, 0,
492 		  WLAN_CFG_RX_ERR_RING_MASK_0 |
493 		    WLAN_CFG_RX_ERR_RING_MASK_1 |
494 		    WLAN_CFG_RX_ERR_RING_MASK_2 |
495 		    WLAN_CFG_RX_ERR_RING_MASK_3,
496 		  0, 0, 0, 0, 0, 0, 0, 0},
497 		/* rx wbm rel ring masks */
498 		{ 0, 0,
499 		  WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
500 		    WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
501 		    WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
502 		    WLAN_CFG_RX_WBM_REL_RING_MASK_3,
503 		  0, 0, 0, 0, 0, 0, 0, 0},
504 		/* reo status ring masks */
505 		{ 0, 0,
506 		  WLAN_CFG_REO_STATUS_RING_MASK_0 |
507 		    WLAN_CFG_REO_STATUS_RING_MASK_1 |
508 		    WLAN_CFG_REO_STATUS_RING_MASK_2 |
509 		    WLAN_CFG_REO_STATUS_RING_MASK_3,
510 		  0, 0, 0, 0, 0, 0, 0, 0},
511 	},
512 	/* Interrupt assignment for 4 MSI combination */
513 	{
514 		/* tx ring masks */
515 		{ WLAN_CFG_TX_RING_MASK_0,
516 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
517 		/* rx ring masks */
518 		{ WLAN_CFG_RX_RING_MASK_0,
519 		  WLAN_CFG_RX_RING_MASK_1,
520 		  WLAN_CFG_RX_RING_MASK_2,
521 		  0, 0, 0, 0, 0, 0, 0, 0},
522 		/* rx mon ring masks */
523 		{ WLAN_CFG_RX_MON_RING_MASK_0,
524 		  WLAN_CFG_RX_MON_RING_MASK_1,
525 		  WLAN_CFG_RX_MON_RING_MASK_2,
526 		  0, 0, 0, 0, 0, 0, 0, 0},
527 		/* host2rxdma ring masks */
528 		{ WLAN_CFG_HOST2RXDMA_RING_MASK_0,
529 		  WLAN_CFG_HOST2RXDMA_RING_MASK_1,
530 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2,
531 		  WLAN_CFG_HOST2RXDMA_RING_MASK_3,
532 		  0, 0, 0, 0, 0, 0, 0},
533 		/* rxdma2host ring masks */
534 		{ WLAN_CFG_RXDMA2HOST_RING_MASK_0,
535 		  WLAN_CFG_RXDMA2HOST_RING_MASK_1,
536 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2,
537 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
538 		  0, 0, 0, 0, 0, 0, 0},
539 		/* host2rxdma mon ring masks */
540 		{ WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
541 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
542 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
543 		  0, 0, 0, 0, 0, 0, 0, 0},
544 		/* rxdma2host mon ring masks */
545 		{ WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
546 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
547 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
548 		  0, 0, 0, 0, 0, 0, 0, 0},
549 		/* rx err ring masks */
550 		{ WLAN_CFG_RX_ERR_RING_MASK_0,
551 		  WLAN_CFG_RX_ERR_RING_MASK_1,
552 		  WLAN_CFG_RX_ERR_RING_MASK_2,
553 		  WLAN_CFG_RX_ERR_RING_MASK_3,
554 		  0, 0, 0, 0, 0, 0, 0},
555 		/* rx wbm rel ring masks */
556 		{ WLAN_CFG_RX_WBM_REL_RING_MASK_0,
557 		  WLAN_CFG_RX_WBM_REL_RING_MASK_1,
558 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2,
559 		  WLAN_CFG_RX_WBM_REL_RING_MASK_3,
560 		  0, 0, 0, 0, 0, 0, 0},
561 		/* reo status ring masks */
562 		{ WLAN_CFG_REO_STATUS_RING_MASK_0,
563 		  WLAN_CFG_REO_STATUS_RING_MASK_1,
564 		  WLAN_CFG_REO_STATUS_RING_MASK_2,
565 		  WLAN_CFG_REO_STATUS_RING_MASK_3,
566 		  0, 0, 0, 0, 0, 0, 0},
567 	},
568 	/* Interrupt assignment for 5 MSI combination */
569 	{
570 		/* tx ring masks */
571 		{ WLAN_CFG_TX_RING_MASK_0,
572 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
573 		/* rx ring masks */
574 		{ WLAN_CFG_RX_RING_MASK_0,
575 		  WLAN_CFG_RX_RING_MASK_1,
576 		  WLAN_CFG_RX_RING_MASK_2,
577 		  0, 0, 0, 0, 0, 0, 0, 0},
578 		/* rx mon ring masks */
579 		{ 0, 0, 0, 0,
580 		  WLAN_CFG_RX_MON_RING_MASK_0 |
581 		    WLAN_CFG_RX_MON_RING_MASK_1 |
582 		    WLAN_CFG_RX_MON_RING_MASK_2,
583 		  0, 0, 0, 0, 0, 0},
584 		/* host2rxdma ring masks */
585 		{ 0, 0, 0, 0,
586 		  WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
587 		    WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
588 		    WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
589 		    WLAN_CFG_HOST2RXDMA_RING_MASK_3,
590 		  0, 0, 0, 0, 0, 0},
591 		/* rxdma2host ring masks */
592 		{ 0, 0, 0, 0,
593 		  WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
594 		    WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
595 		    WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
596 		    WLAN_CFG_RXDMA2HOST_RING_MASK_3,
597 		  0, 0, 0, 0, 0, 0},
598 		/* host2rxdma mon ring masks */
599 		{ 0, 0, 0, 0,
600 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
601 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
602 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
603 		  0, 0, 0, 0, 0, 0},
604 		/* rxdma2host mon ring masks */
605 		{ 0, 0, 0, 0,
606 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
607 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
608 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
609 		  0, 0, 0, 0, 0, 0},
610 		/* rx err ring masks */
611 		{ 0, 0, 0, 0,
612 		  WLAN_CFG_RX_ERR_RING_MASK_0 |
613 		    WLAN_CFG_RX_ERR_RING_MASK_1 |
614 		    WLAN_CFG_RX_ERR_RING_MASK_2 |
615 		    WLAN_CFG_RX_ERR_RING_MASK_3,
616 		  0, 0, 0, 0, 0, 0},
617 		/* rx wbm rel ring masks */
618 		{ 0, 0, 0, 0,
619 		  WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
620 		    WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
621 		    WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
622 		    WLAN_CFG_RX_WBM_REL_RING_MASK_3,
623 		  0, 0, 0, 0, 0, 0},
624 		/* reo status ring masks */
625 		{ 0, 0, 0, 0,
626 		  WLAN_CFG_REO_STATUS_RING_MASK_0 |
627 		    WLAN_CFG_REO_STATUS_RING_MASK_1 |
628 		    WLAN_CFG_REO_STATUS_RING_MASK_2 |
629 		    WLAN_CFG_REO_STATUS_RING_MASK_3,
630 		  0, 0, 0, 0, 0, 0},
631 	},
632 	/* Interrupt assignment for 6 MSI combination */
633 	{
634 		/* tx ring masks */
635 		{ WLAN_CFG_TX_RING_MASK_0,
636 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
637 		/* rx ring masks */
638 		{ 0, 0,
639 		  WLAN_CFG_RX_RING_MASK_0,
640 		  WLAN_CFG_RX_RING_MASK_1,
641 		  WLAN_CFG_RX_RING_MASK_2,
642 		  0, 0, 0, 0, 0, 0},
643 		/* rx mon ring masks */
644 		{ WLAN_CFG_RX_MON_RING_MASK_0,
645 		  WLAN_CFG_RX_MON_RING_MASK_1,
646 		  WLAN_CFG_RX_MON_RING_MASK_2,
647 		  0, 0, 0, 0, 0, 0, 0, 0},
648 		/* host2rxdma ring masks */
649 		{ WLAN_CFG_HOST2RXDMA_RING_MASK_0,
650 		  WLAN_CFG_HOST2RXDMA_RING_MASK_1,
651 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2,
652 		  WLAN_CFG_HOST2RXDMA_RING_MASK_3,
653 		  0, 0, 0, 0, 0, 0, 0},
654 		/* rxdma2host ring masks */
655 		{ WLAN_CFG_RXDMA2HOST_RING_MASK_0,
656 		  WLAN_CFG_RXDMA2HOST_RING_MASK_1,
657 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2,
658 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
659 		  0, 0, 0, 0, 0, 0, 0},
660 		/* host2rxdma mon ring masks */
661 		{ WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
662 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
663 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
664 		  0, 0, 0, 0, 0, 0, 0, 0},
665 		/* rxdma2host mon ring masks */
666 		{ WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
667 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
668 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
669 		  0, 0, 0, 0, 0, 0, 0, 0},
670 		/* rx err ring masks */
671 		{ WLAN_CFG_RX_ERR_RING_MASK_0,
672 		  WLAN_CFG_RX_ERR_RING_MASK_1,
673 		  WLAN_CFG_RX_ERR_RING_MASK_2,
674 		  WLAN_CFG_RX_ERR_RING_MASK_3,
675 		  0, 0, 0, 0, 0, 0, 0},
676 		/* rx wbm rel ring masks */
677 		{ WLAN_CFG_RX_WBM_REL_RING_MASK_0,
678 		  WLAN_CFG_RX_WBM_REL_RING_MASK_1,
679 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2,
680 		  WLAN_CFG_RX_WBM_REL_RING_MASK_3,
681 		  0, 0, 0, 0, 0, 0, 0},
682 		/* reo status ring masks */
683 		{ WLAN_CFG_REO_STATUS_RING_MASK_0,
684 		  WLAN_CFG_REO_STATUS_RING_MASK_1,
685 		  WLAN_CFG_REO_STATUS_RING_MASK_2,
686 		  WLAN_CFG_REO_STATUS_RING_MASK_3,
687 		  0, 0, 0, 0, 0, 0, 0},
688 	},
689 	/* Interrupt assignment for 7 MSI combination */
690 	{
691 		/* tx ring masks */
692 		{ WLAN_CFG_TX_RING_MASK_0,
693 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
694 		/* rx ring masks */
695 		{ 0, 0, 0,
696 		  WLAN_CFG_RX_RING_MASK_0,
697 		  WLAN_CFG_RX_RING_MASK_1,
698 		  WLAN_CFG_RX_RING_MASK_2,
699 		  0, 0, 0, 0},
700 		/* rx mon ring masks */
701 		{ 0, 0, 0,
702 		  WLAN_CFG_RX_MON_RING_MASK_0,
703 		  WLAN_CFG_RX_MON_RING_MASK_1,
704 		  WLAN_CFG_RX_MON_RING_MASK_2,
705 		  0, 0, 0, 0, 0},
706 		/* host2rxdma ring masks */
707 		{ 0, 0, 0,
708 		  WLAN_CFG_HOST2RXDMA_RING_MASK_0,
709 		  WLAN_CFG_HOST2RXDMA_RING_MASK_1,
710 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2,
711 		  WLAN_CFG_HOST2RXDMA_RING_MASK_3,
712 		  0, 0, 0, 0},
713 		/* rxdma2host ring masks */
714 		{ 0, 0, 0,
715 		  WLAN_CFG_RXDMA2HOST_RING_MASK_0,
716 		  WLAN_CFG_RXDMA2HOST_RING_MASK_1,
717 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2,
718 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
719 		  0, 0, 0, 0},
720 		/* host2rxdma mon ring masks */
721 		{ 0, 0, 0,
722 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
723 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
724 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
725 		  0, 0, 0, 0, 0},
726 		/* rxdma2host mon ring masks */
727 		{ 0, 0,	0,
728 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
729 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
730 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
731 		  0, 0, 0, 0, 0},
732 		/* rx err ring masks */
733 		{ 0, 0, 0,
734 		  WLAN_CFG_RX_ERR_RING_MASK_0,
735 		  WLAN_CFG_RX_ERR_RING_MASK_1,
736 		  WLAN_CFG_RX_ERR_RING_MASK_2,
737 		  WLAN_CFG_RX_ERR_RING_MASK_3,
738 		  0, 0, 0, 0},
739 		/* rx wbm rel ring masks */
740 		{ 0, 0, 0,
741 		  WLAN_CFG_RX_WBM_REL_RING_MASK_0,
742 		  WLAN_CFG_RX_WBM_REL_RING_MASK_1,
743 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2,
744 		  WLAN_CFG_RX_WBM_REL_RING_MASK_3,
745 		  0, 0, 0, 0},
746 		/* reo status ring masks */
747 		{ 0, 0, 0,
748 		  WLAN_CFG_REO_STATUS_RING_MASK_0,
749 		  WLAN_CFG_REO_STATUS_RING_MASK_1,
750 		  WLAN_CFG_REO_STATUS_RING_MASK_2,
751 		  WLAN_CFG_REO_STATUS_RING_MASK_3,
752 		  0, 0, 0, 0},
753 	},
754 	/* Interrupt assignment for 8 MSI combination */
755 	{
756 		/* tx ring masks */
757 		{ WLAN_CFG_TX_RING_MASK_0,
758 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
759 		/* rx ring masks */
760 		{ 0, 0, 0, 0,
761 		  WLAN_CFG_RX_RING_MASK_0,
762 		  WLAN_CFG_RX_RING_MASK_1,
763 		  WLAN_CFG_RX_RING_MASK_2,
764 		  0, 0, 0, 0},
765 		/* rx mon ring masks */
766 		{ 0, 0, 0,
767 		  WLAN_CFG_RX_MON_RING_MASK_0,
768 		  WLAN_CFG_RX_MON_RING_MASK_1,
769 		  WLAN_CFG_RX_MON_RING_MASK_2,
770 		  0, 0, 0, 0, 0},
771 		/* host2rxdma ring masks */
772 		{ 0, 0, 0,
773 		  WLAN_CFG_HOST2RXDMA_RING_MASK_0,
774 		  WLAN_CFG_HOST2RXDMA_RING_MASK_1,
775 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2,
776 		  WLAN_CFG_HOST2RXDMA_RING_MASK_3,
777 		  0, 0, 0, 0},
778 		/* rxdma2host ring masks */
779 		{ 0, 0, 0,
780 		  WLAN_CFG_RXDMA2HOST_RING_MASK_0,
781 		  WLAN_CFG_RXDMA2HOST_RING_MASK_1,
782 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2,
783 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
784 		  0, 0, 0, 0},
785 		/* host2rxdma mon ring masks */
786 		{ 0, 0, 0,
787 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
788 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
789 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
790 		  0, 0, 0, 0, 0},
791 		/* rxdma2host mon ring masks */
792 		{ 0, 0, 0,
793 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
794 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
795 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
796 		  0, 0, 0, 0, 0},
797 		/* rx err ring masks */
798 		{ 0, 0, 0,
799 		  WLAN_CFG_RX_ERR_RING_MASK_0,
800 		  WLAN_CFG_RX_ERR_RING_MASK_1,
801 		  WLAN_CFG_RX_ERR_RING_MASK_2,
802 		  WLAN_CFG_RX_ERR_RING_MASK_3,
803 		  0, 0, 0, 0},
804 		/* rx wbm rel ring masks */
805 		{ 0, 0, 0,
806 		  WLAN_CFG_RX_WBM_REL_RING_MASK_0,
807 		  WLAN_CFG_RX_WBM_REL_RING_MASK_1,
808 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2,
809 		  WLAN_CFG_RX_WBM_REL_RING_MASK_3,
810 		  0, 0, 0, 0},
811 		/* reo status ring masks */
812 		{ 0, 0, 0,
813 		  WLAN_CFG_REO_STATUS_RING_MASK_0,
814 		  WLAN_CFG_REO_STATUS_RING_MASK_1,
815 		  WLAN_CFG_REO_STATUS_RING_MASK_2,
816 		  WLAN_CFG_REO_STATUS_RING_MASK_3,
817 		  0, 0, 0, 0},
818 	},
819 };
820 #else
821 static struct dp_int_mask_assignment dp_mask_assignment[NUM_INTERRUPT_COMBINATIONS] = {
822 	/* Interrupt assignment for integrated configuration */
823 	{
824 		/* tx ring masks */
825 		{ WLAN_CFG_TX_RING_MASK_0,
826 		  WLAN_CFG_TX_RING_MASK_1,
827 		  WLAN_CFG_TX_RING_MASK_2,
828 		  WLAN_CFG_TX_RING_MASK_3,
829 		  0, 0, 0, 0, 0, 0, 0},
830 		/* rx ring masks */
831 		{ 0, 0, 0, 0, 0, 0, 0,
832 		  WLAN_CFG_RX_RING_MASK_0,
833 		  WLAN_CFG_RX_RING_MASK_1,
834 		  WLAN_CFG_RX_RING_MASK_2,
835 		  WLAN_CFG_RX_RING_MASK_3},
836 		/* rx mon ring masks */
837 		{ 0, 0, 0, 0,
838 		  WLAN_CFG_RX_MON_RING_MASK_0,
839 		  WLAN_CFG_RX_MON_RING_MASK_1,
840 		  WLAN_CFG_RX_MON_RING_MASK_2,
841 		  0, 0, 0, 0},
842 		/* host2rxdma ring masks */
843 		{ WLAN_CFG_HOST2RXDMA_RING_MASK_0,
844 		  WLAN_CFG_HOST2RXDMA_RING_MASK_1,
845 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2,
846 		  WLAN_CFG_HOST2RXDMA_RING_MASK_3,
847 		  0, 0, 0, 0, 0, 0, 0},
848 		/* rxdma2host ring masks */
849 		{ WLAN_CFG_RXDMA2HOST_RING_MASK_0,
850 		  WLAN_CFG_RXDMA2HOST_RING_MASK_1,
851 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2,
852 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
853 		  0, 0, 0, 0, 0, 0, 0},
854 		/* host2rxdma mon ring masks */
855 		{ 0, 0, 0, 0,
856 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
857 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
858 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
859 		  0, 0, 0, 0},
860 		/* rxdma2host mon ring masks */
861 		{ 0, 0,	0, 0,
862 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
863 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
864 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
865 		  0, 0, 0, 0},
866 		/* rx err ring masks */
867 		{ WLAN_CFG_RX_ERR_RING_MASK_0,
868 		  WLAN_CFG_RX_ERR_RING_MASK_1,
869 		  WLAN_CFG_RX_ERR_RING_MASK_2,
870 		  WLAN_CFG_RX_ERR_RING_MASK_3,
871 		  0, 0, 0, 0, 0, 0, 0},
872 		/* rx wbm rel ring masks */
873 		{ WLAN_CFG_RX_WBM_REL_RING_MASK_0,
874 		  WLAN_CFG_RX_WBM_REL_RING_MASK_1,
875 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2,
876 		  WLAN_CFG_RX_WBM_REL_RING_MASK_3,
877 		  0, 0, 0, 0, 0, 0, 0},
878 		/* reo status ring masks */
879 		{ WLAN_CFG_REO_STATUS_RING_MASK_0,
880 		  WLAN_CFG_REO_STATUS_RING_MASK_1,
881 		  WLAN_CFG_REO_STATUS_RING_MASK_2,
882 		  WLAN_CFG_REO_STATUS_RING_MASK_3,
883 		  0, 0, 0, 0, 0, 0, 0},
884 		/* rx_ring_near_full_irq mask */
885 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
886 		/* rx_ring_near_full_irq_2 mask */
887 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
888 		/* tx_ring_near_full_irq mask */
889 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
890 		/* host2txmon ring masks */
891 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
892 		/* tx mon ring masks */
893 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
894 	},
895 	/* Interrupt assignment for 1 MSI combination */
896 	{
897 		/* tx ring masks */
898 		{ WLAN_CFG_TX_RING_MASK_0 |
899 		    WLAN_CFG_TX_RING_MASK_1 |
900 		    WLAN_CFG_TX_RING_MASK_2 |
901 		    WLAN_CFG_TX_RING_MASK_3,
902 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
903 		/* rx ring masks */
904 		{ WLAN_CFG_RX_RING_MASK_0 |
905 		    WLAN_CFG_RX_RING_MASK_1 |
906 		    WLAN_CFG_RX_RING_MASK_2 |
907 		    WLAN_CFG_RX_RING_MASK_3,
908 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
909 		/* rx mon ring masks */
910 		{ WLAN_CFG_RX_MON_RING_MASK_0 |
911 		    WLAN_CFG_RX_MON_RING_MASK_1 |
912 		    WLAN_CFG_RX_MON_RING_MASK_2,
913 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
914 		/* host2rxdma ring masks */
915 		{ WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
916 		    WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
917 		    WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
918 		    WLAN_CFG_HOST2RXDMA_RING_MASK_3,
919 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
920 		/* rxdma2host ring masks */
921 		{ WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
922 		    WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
923 		    WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
924 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
925 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
926 		/* host2rxdma mon ring masks */
927 		{ WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
928 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
929 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
930 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
931 		/* rxdma2host mon ring masks */
932 		{ WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
933 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
934 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
935 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
936 		/* rx err ring masks */
937 		{ WLAN_CFG_RX_ERR_RING_MASK_0 |
938 		    WLAN_CFG_RX_ERR_RING_MASK_1 |
939 		    WLAN_CFG_RX_ERR_RING_MASK_2 |
940 		    WLAN_CFG_RX_ERR_RING_MASK_3,
941 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
942 		/* rx wbm rel ring masks */
943 		{ WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
944 		    WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
945 		    WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
946 		    WLAN_CFG_RX_WBM_REL_RING_MASK_3,
947 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
948 		/* reo status ring masks */
949 		{ WLAN_CFG_REO_STATUS_RING_MASK_0 |
950 		    WLAN_CFG_REO_STATUS_RING_MASK_1 |
951 		    WLAN_CFG_REO_STATUS_RING_MASK_2 |
952 		    WLAN_CFG_REO_STATUS_RING_MASK_3,
953 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
954 		/* rx_ring_near_full_irq mask */
955 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
956 		/* rx_ring_near_full_irq_2 mask */
957 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
958 		/* tx_ring_near_full_irq mask */
959 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
960 		/* host2txmon ring masks */
961 		{ WLAN_CFG_HOST2TXMON_RING_MASK_0,
962 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
963 		/* tx mon ring masks */
964 		{ WLAN_CFG_TX_MON_RING_MASK_0 |
965 		  WLAN_CFG_TX_MON_RING_MASK_1,
966 		  0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
967 	},
968 	/* Interrupt assignment for 2 MSI combination */
969 	{
970 		/* tx ring masks */
971 		{ WLAN_CFG_TX_RING_MASK_0 |
972 		    WLAN_CFG_TX_RING_MASK_1,
973 		  WLAN_CFG_TX_RING_MASK_2 |
974 		    WLAN_CFG_TX_RING_MASK_3,
975 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
976 		/* rx ring masks */
977 		{ WLAN_CFG_RX_RING_MASK_0 |
978 		    WLAN_CFG_RX_RING_MASK_1,
979 		  WLAN_CFG_RX_RING_MASK_2 |
980 		    WLAN_CFG_RX_RING_MASK_3,
981 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
982 		/* rx mon ring masks */
983 		{ WLAN_CFG_RX_MON_RING_MASK_0 |
984 		    WLAN_CFG_RX_MON_RING_MASK_1,
985 		  WLAN_CFG_RX_MON_RING_MASK_2,
986 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
987 		/* host2rxdma ring masks */
988 		{ WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
989 		    WLAN_CFG_HOST2RXDMA_RING_MASK_1,
990 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
991 		    WLAN_CFG_HOST2RXDMA_RING_MASK_3,
992 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
993 		/* rxdma2host ring masks */
994 		{ WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
995 		    WLAN_CFG_RXDMA2HOST_RING_MASK_1,
996 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
997 		    WLAN_CFG_RXDMA2HOST_RING_MASK_3,
998 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
999 		/* host2rxdma mon ring masks */
1000 		{ WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
1001 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
1002 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
1003 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1004 		/* rxdma2host mon ring masks */
1005 		{ WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
1006 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
1007 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
1008 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1009 		/* rx err ring masks */
1010 		{ WLAN_CFG_RX_ERR_RING_MASK_0 |
1011 		    WLAN_CFG_RX_ERR_RING_MASK_1,
1012 		  WLAN_CFG_RX_ERR_RING_MASK_2 |
1013 		    WLAN_CFG_RX_ERR_RING_MASK_3,
1014 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1015 		/* rx wbm rel ring masks */
1016 		{ WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
1017 		    WLAN_CFG_RX_WBM_REL_RING_MASK_1,
1018 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
1019 		    WLAN_CFG_RX_WBM_REL_RING_MASK_3,
1020 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1021 		/* reo status ring masks */
1022 		{ WLAN_CFG_REO_STATUS_RING_MASK_0 |
1023 		    WLAN_CFG_REO_STATUS_RING_MASK_1,
1024 		  WLAN_CFG_REO_STATUS_RING_MASK_2 |
1025 		    WLAN_CFG_REO_STATUS_RING_MASK_3,
1026 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1027 		/* rx_ring_near_full_irq mask */
1028 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1029 		/* rx_ring_near_full_irq_2 mask */
1030 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1031 		/* tx_ring_near_full_irq mask */
1032 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1033 		/* host2txmon ring masks */
1034 		{ WLAN_CFG_HOST2TXMON_RING_MASK_0,
1035 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1036 		/* tx mon ring masks */
1037 		{ WLAN_CFG_TX_MON_RING_MASK_0,
1038 		  WLAN_CFG_TX_MON_RING_MASK_1,
1039 		  0, 0, 0, 0, 0, 0},
1040 	},
1041 	/* Interrupt assignment for 3 MSI combination */
1042 	{
1043 		/* tx ring masks */
1044 		{ WLAN_CFG_TX_RING_MASK_0 |
1045 		    WLAN_CFG_TX_RING_MASK_1,
1046 		  WLAN_CFG_TX_RING_MASK_2 |
1047 		    WLAN_CFG_TX_RING_MASK_3,
1048 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1049 		/* rx ring masks */
1050 		{ WLAN_CFG_RX_RING_MASK_0 |
1051 		    WLAN_CFG_RX_RING_MASK_1,
1052 		  WLAN_CFG_RX_RING_MASK_2 |
1053 		    WLAN_CFG_RX_RING_MASK_3,
1054 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1055 		/* rx mon ring masks */
1056 		{ 0, 0,
1057 		  WLAN_CFG_RX_MON_RING_MASK_0 |
1058 		    WLAN_CFG_RX_MON_RING_MASK_1 |
1059 		    WLAN_CFG_RX_MON_RING_MASK_2,
1060 		  0, 0, 0, 0, 0, 0, 0, 0},
1061 		/* host2rxdma ring masks */
1062 		{ 0, 0,
1063 		  WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
1064 		    WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
1065 		    WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
1066 		    WLAN_CFG_HOST2RXDMA_RING_MASK_3,
1067 		  0, 0, 0, 0, 0, 0, 0, 0},
1068 		/* rxdma2host ring masks */
1069 		{ 0, 0,
1070 		  WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
1071 		    WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
1072 		    WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
1073 		    WLAN_CFG_RXDMA2HOST_RING_MASK_3,
1074 		  0, 0, 0, 0, 0, 0, 0, 0},
1075 		/* host2rxdma mon ring masks */
1076 		{ 0, 0,
1077 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
1078 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
1079 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
1080 		  0, 0, 0, 0, 0, 0, 0, 0},
1081 		/* rxdma2host mon ring masks */
1082 		{ 0, 0,
1083 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
1084 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
1085 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
1086 		  0, 0, 0, 0, 0, 0, 0, 0},
1087 		/* rx err ring masks */
1088 		{ 0, 0,
1089 		  WLAN_CFG_RX_ERR_RING_MASK_0 |
1090 		    WLAN_CFG_RX_ERR_RING_MASK_1 |
1091 		    WLAN_CFG_RX_ERR_RING_MASK_2 |
1092 		    WLAN_CFG_RX_ERR_RING_MASK_3,
1093 		  0, 0, 0, 0, 0, 0, 0, 0},
1094 		/* rx wbm rel ring masks */
1095 		{ 0, 0,
1096 		  WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
1097 		    WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
1098 		    WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
1099 		    WLAN_CFG_RX_WBM_REL_RING_MASK_3,
1100 		  0, 0, 0, 0, 0, 0, 0, 0},
1101 		/* reo status ring masks */
1102 		{ 0, 0,
1103 		  WLAN_CFG_REO_STATUS_RING_MASK_0 |
1104 		    WLAN_CFG_REO_STATUS_RING_MASK_1 |
1105 		    WLAN_CFG_REO_STATUS_RING_MASK_2 |
1106 		    WLAN_CFG_REO_STATUS_RING_MASK_3,
1107 		  0, 0, 0, 0, 0, 0, 0, 0},
1108 		/* rx_ring_near_full_irq mask */
1109 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1110 		/* rx_ring_near_full_irq_2 mask */
1111 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1112 		/* tx_ring_near_full_irq mask */
1113 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1114 		/* host2txmon ring masks */
1115 		{ WLAN_CFG_HOST2TXMON_RING_MASK_0,
1116 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1117 		/* tx mon ring masks */
1118 		{ WLAN_CFG_TX_MON_RING_MASK_0,
1119 		  WLAN_CFG_TX_MON_RING_MASK_1,
1120 		  0, 0, 0, 0, 0, 0},
1121 	},
1122 	/* Interrupt assignment for 4 MSI combination */
1123 	{
1124 		/* tx ring masks */
1125 		{ WLAN_CFG_TX_RING_MASK_0,
1126 		  WLAN_CFG_TX_RING_MASK_1,
1127 		  WLAN_CFG_TX_RING_MASK_2,
1128 		  WLAN_CFG_TX_RING_MASK_3,
1129 		  0, 0, 0, 0, 0, 0, 0},
1130 		/* rx ring masks */
1131 		{ WLAN_CFG_RX_RING_MASK_0,
1132 		  WLAN_CFG_RX_RING_MASK_1,
1133 		  WLAN_CFG_RX_RING_MASK_2,
1134 		  WLAN_CFG_RX_RING_MASK_3,
1135 		  0, 0, 0, 0, 0, 0, 0},
1136 		/* rx mon ring masks */
1137 		{ WLAN_CFG_RX_MON_RING_MASK_0,
1138 		  WLAN_CFG_RX_MON_RING_MASK_1,
1139 		  WLAN_CFG_RX_MON_RING_MASK_2,
1140 		  0, 0, 0, 0, 0, 0, 0, 0},
1141 		/* host2rxdma ring masks */
1142 		{ WLAN_CFG_HOST2RXDMA_RING_MASK_0,
1143 		  WLAN_CFG_HOST2RXDMA_RING_MASK_1,
1144 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2,
1145 		  WLAN_CFG_HOST2RXDMA_RING_MASK_3,
1146 		  0, 0, 0, 0, 0, 0, 0},
1147 		/* rxdma2host ring masks */
1148 		{ WLAN_CFG_RXDMA2HOST_RING_MASK_0,
1149 		  WLAN_CFG_RXDMA2HOST_RING_MASK_1,
1150 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2,
1151 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
1152 		  0, 0, 0, 0, 0, 0, 0},
1153 		/* host2rxdma mon ring masks */
1154 		{ WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
1155 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
1156 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
1157 		  0, 0, 0, 0, 0, 0, 0, 0},
1158 		/* rxdma2host mon ring masks */
1159 		{ WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
1160 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
1161 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
1162 		  0, 0, 0, 0, 0, 0, 0, 0},
1163 		/* rx err ring masks */
1164 		{ WLAN_CFG_RX_ERR_RING_MASK_0,
1165 		  WLAN_CFG_RX_ERR_RING_MASK_1,
1166 		  WLAN_CFG_RX_ERR_RING_MASK_2,
1167 		  WLAN_CFG_RX_ERR_RING_MASK_3,
1168 		  0, 0, 0, 0, 0, 0, 0},
1169 		/* rx wbm rel ring masks */
1170 		{ WLAN_CFG_RX_WBM_REL_RING_MASK_0,
1171 		  WLAN_CFG_RX_WBM_REL_RING_MASK_1,
1172 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2,
1173 		  WLAN_CFG_RX_WBM_REL_RING_MASK_3,
1174 		  0, 0, 0, 0, 0, 0, 0},
1175 		/* reo status ring masks */
1176 		{ WLAN_CFG_REO_STATUS_RING_MASK_0,
1177 		  WLAN_CFG_REO_STATUS_RING_MASK_1,
1178 		  WLAN_CFG_REO_STATUS_RING_MASK_2,
1179 		  WLAN_CFG_REO_STATUS_RING_MASK_3,
1180 		  0, 0, 0, 0, 0, 0, 0},
1181 		/* rx_ring_near_full_irq mask */
1182 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1183 		/* rx_ring_near_full_irq_2 mask */
1184 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1185 		/* tx_ring_near_full_irq mask */
1186 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1187 		/* host2txmon ring masks */
1188 		{ WLAN_CFG_HOST2TXMON_RING_MASK_0,
1189 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1190 		/* tx mon ring masks */
1191 		{ WLAN_CFG_TX_MON_RING_MASK_0,
1192 		  WLAN_CFG_TX_MON_RING_MASK_1,
1193 		  0, 0, 0, 0, 0, 0},
1194 	},
1195 	/* Interrupt assignment for 5 MSI combination */
1196 	{
1197 		/* tx ring masks */
1198 		{ WLAN_CFG_TX_RING_MASK_0,
1199 		  WLAN_CFG_TX_RING_MASK_1,
1200 		  WLAN_CFG_TX_RING_MASK_2,
1201 		  WLAN_CFG_TX_RING_MASK_3,
1202 		  0, 0, 0, 0, 0, 0, 0},
1203 		/* rx ring masks */
1204 		{ WLAN_CFG_RX_RING_MASK_0,
1205 		  WLAN_CFG_RX_RING_MASK_1,
1206 		  WLAN_CFG_RX_RING_MASK_2,
1207 		  WLAN_CFG_RX_RING_MASK_3,
1208 		  0, 0, 0, 0, 0, 0, 0},
1209 		/* rx mon ring masks */
1210 		{ 0, 0, 0, 0,
1211 		  WLAN_CFG_RX_MON_RING_MASK_0 |
1212 		    WLAN_CFG_RX_MON_RING_MASK_1 |
1213 		    WLAN_CFG_RX_MON_RING_MASK_2,
1214 		  0, 0, 0, 0, 0, 0},
1215 		/* host2rxdma ring masks */
1216 		{ 0, 0, 0, 0,
1217 		  WLAN_CFG_HOST2RXDMA_RING_MASK_0 |
1218 		    WLAN_CFG_HOST2RXDMA_RING_MASK_1 |
1219 		    WLAN_CFG_HOST2RXDMA_RING_MASK_2 |
1220 		    WLAN_CFG_HOST2RXDMA_RING_MASK_3,
1221 		  0, 0, 0, 0, 0, 0},
1222 		/* rxdma2host ring masks */
1223 		{ 0, 0, 0, 0,
1224 		  WLAN_CFG_RXDMA2HOST_RING_MASK_0 |
1225 		    WLAN_CFG_RXDMA2HOST_RING_MASK_1 |
1226 		    WLAN_CFG_RXDMA2HOST_RING_MASK_2 |
1227 		    WLAN_CFG_RXDMA2HOST_RING_MASK_3,
1228 		  0, 0, 0, 0, 0, 0},
1229 		/* host2rxdma mon ring masks */
1230 		{ 0, 0, 0, 0,
1231 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 |
1232 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 |
1233 		    WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
1234 		  0, 0, 0, 0, 0, 0},
1235 		/* rxdma2host mon ring masks */
1236 		{ 0, 0, 0, 0,
1237 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 |
1238 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 |
1239 		    WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
1240 		  0, 0, 0, 0, 0, 0},
1241 		/* rx err ring masks */
1242 		{ 0, 0, 0, 0,
1243 		  WLAN_CFG_RX_ERR_RING_MASK_0 |
1244 		    WLAN_CFG_RX_ERR_RING_MASK_1 |
1245 		    WLAN_CFG_RX_ERR_RING_MASK_2 |
1246 		    WLAN_CFG_RX_ERR_RING_MASK_3,
1247 		  0, 0, 0, 0, 0, 0},
1248 		/* rx wbm rel ring masks */
1249 		{ 0, 0, 0, 0,
1250 		  WLAN_CFG_RX_WBM_REL_RING_MASK_0 |
1251 		    WLAN_CFG_RX_WBM_REL_RING_MASK_1 |
1252 		    WLAN_CFG_RX_WBM_REL_RING_MASK_2 |
1253 		    WLAN_CFG_RX_WBM_REL_RING_MASK_3,
1254 		  0, 0, 0, 0, 0, 0},
1255 		/* reo status ring masks */
1256 		{ 0, 0, 0, 0,
1257 		  WLAN_CFG_REO_STATUS_RING_MASK_0 |
1258 		    WLAN_CFG_REO_STATUS_RING_MASK_1 |
1259 		    WLAN_CFG_REO_STATUS_RING_MASK_2 |
1260 		    WLAN_CFG_REO_STATUS_RING_MASK_3,
1261 		  0, 0, 0, 0, 0, 0},
1262 		/* rx_ring_near_full_irq mask */
1263 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1264 		/* rx_ring_near_full_irq_2 mask */
1265 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1266 		/* tx_ring_near_full_irq mask */
1267 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1268 		/* host2txmon ring masks */
1269 		{ WLAN_CFG_HOST2TXMON_RING_MASK_0,
1270 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1271 		/* tx mon ring masks */
1272 		{ WLAN_CFG_TX_MON_RING_MASK_0,
1273 		  WLAN_CFG_TX_MON_RING_MASK_1,
1274 		  0, 0, 0, 0, 0, 0},
1275 	},
1276 	/* Interrupt assignment for 6 MSI combination */
1277 	{
1278 		/* tx ring masks */
1279 		{ WLAN_CFG_TX_RING_MASK_0,
1280 		  WLAN_CFG_TX_RING_MASK_1,
1281 		  WLAN_CFG_TX_RING_MASK_2,
1282 		  WLAN_CFG_TX_RING_MASK_3,
1283 		  0, 0, 0, 0, 0, 0, 0},
1284 		/* rx ring masks */
1285 		{ 0, 0,
1286 		  WLAN_CFG_RX_RING_MASK_0,
1287 		  WLAN_CFG_RX_RING_MASK_1,
1288 		  WLAN_CFG_RX_RING_MASK_2,
1289 		  WLAN_CFG_RX_RING_MASK_3,
1290 		  0, 0, 0, 0, 0},
1291 		/* rx mon ring masks */
1292 		{ WLAN_CFG_RX_MON_RING_MASK_0,
1293 		  WLAN_CFG_RX_MON_RING_MASK_1,
1294 		  WLAN_CFG_RX_MON_RING_MASK_2,
1295 		  0, 0, 0, 0, 0, 0, 0, 0},
1296 		/* host2rxdma ring masks */
1297 		{ WLAN_CFG_HOST2RXDMA_RING_MASK_0,
1298 		  WLAN_CFG_HOST2RXDMA_RING_MASK_1,
1299 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2,
1300 		  WLAN_CFG_HOST2RXDMA_RING_MASK_3,
1301 		  0, 0, 0, 0, 0, 0, 0},
1302 		/* rxdma2host ring masks */
1303 		{ WLAN_CFG_RXDMA2HOST_RING_MASK_0,
1304 		  WLAN_CFG_RXDMA2HOST_RING_MASK_1,
1305 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2,
1306 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
1307 		  0, 0, 0, 0, 0, 0, 0},
1308 		/* host2rxdma mon ring masks */
1309 		{ WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
1310 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
1311 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
1312 		  0, 0, 0, 0, 0, 0, 0, 0},
1313 		/* rxdma2host mon ring masks */
1314 		{ WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
1315 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
1316 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
1317 		  0, 0, 0, 0, 0, 0, 0, 0},
1318 		/* rx err ring masks */
1319 		{ WLAN_CFG_RX_ERR_RING_MASK_0,
1320 		  WLAN_CFG_RX_ERR_RING_MASK_1,
1321 		  WLAN_CFG_RX_ERR_RING_MASK_2,
1322 		  WLAN_CFG_RX_ERR_RING_MASK_3,
1323 		  0, 0, 0, 0, 0, 0, 0},
1324 		/* rx wbm rel ring masks */
1325 		{ WLAN_CFG_RX_WBM_REL_RING_MASK_0,
1326 		  WLAN_CFG_RX_WBM_REL_RING_MASK_1,
1327 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2,
1328 		  WLAN_CFG_RX_WBM_REL_RING_MASK_3,
1329 		  0, 0, 0, 0, 0, 0, 0},
1330 		/* reo status ring masks */
1331 		{ WLAN_CFG_REO_STATUS_RING_MASK_0,
1332 		  WLAN_CFG_REO_STATUS_RING_MASK_1,
1333 		  WLAN_CFG_REO_STATUS_RING_MASK_2,
1334 		  WLAN_CFG_REO_STATUS_RING_MASK_3,
1335 		  0, 0, 0, 0, 0, 0, 0},
1336 		/* rx_ring_near_full_irq mask */
1337 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1338 		/* rx_ring_near_full_irq_2 mask */
1339 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1340 		/* tx_ring_near_full_irq mask */
1341 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1342 		/* host2txmon ring masks */
1343 		{ WLAN_CFG_HOST2TXMON_RING_MASK_0,
1344 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1345 		/* tx mon ring masks */
1346 		{ WLAN_CFG_TX_MON_RING_MASK_0,
1347 		  WLAN_CFG_TX_MON_RING_MASK_1,
1348 		  0, 0, 0, 0, 0, 0},
1349 	},
1350 	/* Interrupt assignment for 7 MSI combination */
1351 	{
1352 		/* tx ring masks */
1353 		{ WLAN_CFG_TX_RING_MASK_0,
1354 		  WLAN_CFG_TX_RING_MASK_1,
1355 		  WLAN_CFG_TX_RING_MASK_2,
1356 		  WLAN_CFG_TX_RING_MASK_3,
1357 		  0, 0, 0, 0, 0, 0, 0},
1358 		/* rx ring masks */
1359 		{ 0, 0, 0,
1360 		  WLAN_CFG_RX_RING_MASK_0,
1361 		  WLAN_CFG_RX_RING_MASK_1,
1362 		  WLAN_CFG_RX_RING_MASK_2,
1363 		  WLAN_CFG_RX_RING_MASK_3,
1364 		  0, 0, 0},
1365 		/* rx mon ring masks */
1366 		{ 0, 0, 0,
1367 		  WLAN_CFG_RX_MON_RING_MASK_0,
1368 		  WLAN_CFG_RX_MON_RING_MASK_1,
1369 		  WLAN_CFG_RX_MON_RING_MASK_2,
1370 		  0, 0, 0, 0, 0},
1371 		/* host2rxdma ring masks */
1372 		{ 0, 0, 0,
1373 		  WLAN_CFG_HOST2RXDMA_RING_MASK_0,
1374 		  WLAN_CFG_HOST2RXDMA_RING_MASK_1,
1375 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2,
1376 		  WLAN_CFG_HOST2RXDMA_RING_MASK_3,
1377 		  0, 0, 0, 0},
1378 		/* rxdma2host ring masks */
1379 		{ 0, 0, 0,
1380 		  WLAN_CFG_RXDMA2HOST_RING_MASK_0,
1381 		  WLAN_CFG_RXDMA2HOST_RING_MASK_1,
1382 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2,
1383 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
1384 		  0, 0, 0, 0},
1385 		/* host2rxdma mon ring masks */
1386 		{ 0, 0, 0,
1387 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
1388 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
1389 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
1390 		  0, 0, 0, 0, 0},
1391 		/* rxdma2host mon ring masks */
1392 		{ 0, 0,	0,
1393 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
1394 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
1395 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
1396 		  0, 0, 0, 0, 0},
1397 		/* rx err ring masks */
1398 		{ 0, 0, 0,
1399 		  WLAN_CFG_RX_ERR_RING_MASK_0,
1400 		  WLAN_CFG_RX_ERR_RING_MASK_1,
1401 		  WLAN_CFG_RX_ERR_RING_MASK_2,
1402 		  WLAN_CFG_RX_ERR_RING_MASK_3,
1403 		  0, 0, 0, 0},
1404 		/* rx wbm rel ring masks */
1405 		{ 0, 0, 0,
1406 		  WLAN_CFG_RX_WBM_REL_RING_MASK_0,
1407 		  WLAN_CFG_RX_WBM_REL_RING_MASK_1,
1408 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2,
1409 		  WLAN_CFG_RX_WBM_REL_RING_MASK_3,
1410 		  0, 0, 0, 0},
1411 		/* reo status ring masks */
1412 		{ 0, 0, 0,
1413 		  WLAN_CFG_REO_STATUS_RING_MASK_0,
1414 		  WLAN_CFG_REO_STATUS_RING_MASK_1,
1415 		  WLAN_CFG_REO_STATUS_RING_MASK_2,
1416 		  WLAN_CFG_REO_STATUS_RING_MASK_3,
1417 		  0, 0, 0, 0},
1418 		/* rx_ring_near_full_irq mask */
1419 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1420 		/* rx_ring_near_full_irq_2 mask */
1421 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1422 		/* tx_ring_near_full_irq mask */
1423 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1424 		/* host2txmon ring masks */
1425 		{ WLAN_CFG_HOST2TXMON_RING_MASK_0,
1426 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1427 		/* tx mon ring masks */
1428 		{ WLAN_CFG_TX_MON_RING_MASK_0,
1429 		  WLAN_CFG_TX_MON_RING_MASK_1,
1430 		  0, 0, 0, 0, 0, 0},
1431 	},
1432 	/* Interrupt assignment for 8 MSI combination */
1433 	{
1434 		/* tx ring masks */
1435 		{ WLAN_CFG_TX_RING_MASK_0,
1436 		  WLAN_CFG_TX_RING_MASK_1,
1437 		  WLAN_CFG_TX_RING_MASK_2,
1438 		  WLAN_CFG_TX_RING_MASK_3,
1439 		  0, 0, 0, 0, 0, 0, 0},
1440 		/* rx ring masks */
1441 		{ 0, 0, 0, 0,
1442 		  WLAN_CFG_RX_RING_MASK_0,
1443 		  WLAN_CFG_RX_RING_MASK_1,
1444 		  WLAN_CFG_RX_RING_MASK_2,
1445 		  WLAN_CFG_RX_RING_MASK_3,
1446 		  0, 0, 0},
1447 		/* rx mon ring masks */
1448 		{ 0, 0, 0,
1449 		  WLAN_CFG_RX_MON_RING_MASK_0,
1450 		  WLAN_CFG_RX_MON_RING_MASK_1,
1451 		  WLAN_CFG_RX_MON_RING_MASK_2,
1452 		  0, 0, 0, 0, 0},
1453 		/* host2rxdma ring masks */
1454 		{ 0, 0, 0,
1455 		  WLAN_CFG_HOST2RXDMA_RING_MASK_0,
1456 		  WLAN_CFG_HOST2RXDMA_RING_MASK_1,
1457 		  WLAN_CFG_HOST2RXDMA_RING_MASK_2,
1458 		  WLAN_CFG_HOST2RXDMA_RING_MASK_3,
1459 		  0, 0, 0, 0},
1460 		/* rxdma2host ring masks */
1461 		{ 0, 0, 0,
1462 		  WLAN_CFG_RXDMA2HOST_RING_MASK_0,
1463 		  WLAN_CFG_RXDMA2HOST_RING_MASK_1,
1464 		  WLAN_CFG_RXDMA2HOST_RING_MASK_2,
1465 		  WLAN_CFG_RXDMA2HOST_RING_MASK_3,
1466 		  0, 0, 0, 0},
1467 		/* host2rxdma mon ring masks */
1468 		{ 0, 0, 0,
1469 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0,
1470 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1,
1471 		  WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2,
1472 		  0, 0, 0, 0, 0},
1473 		/* rxdma2host mon ring masks */
1474 		{ 0, 0, 0,
1475 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0,
1476 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1,
1477 		  WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2,
1478 		  0, 0, 0, 0, 0},
1479 		/* rx err ring masks */
1480 		{ 0, 0, 0,
1481 		  WLAN_CFG_RX_ERR_RING_MASK_0,
1482 		  WLAN_CFG_RX_ERR_RING_MASK_1,
1483 		  WLAN_CFG_RX_ERR_RING_MASK_2,
1484 		  WLAN_CFG_RX_ERR_RING_MASK_3,
1485 		  0, 0, 0, 0},
1486 		/* rx wbm rel ring masks */
1487 		{ 0, 0, 0,
1488 		  WLAN_CFG_RX_WBM_REL_RING_MASK_0,
1489 		  WLAN_CFG_RX_WBM_REL_RING_MASK_1,
1490 		  WLAN_CFG_RX_WBM_REL_RING_MASK_2,
1491 		  WLAN_CFG_RX_WBM_REL_RING_MASK_3,
1492 		  0, 0, 0, 0},
1493 		/* reo status ring masks */
1494 		{ 0, 0, 0,
1495 		  WLAN_CFG_REO_STATUS_RING_MASK_0,
1496 		  WLAN_CFG_REO_STATUS_RING_MASK_1,
1497 		  WLAN_CFG_REO_STATUS_RING_MASK_2,
1498 		  WLAN_CFG_REO_STATUS_RING_MASK_3,
1499 		  0, 0, 0, 0},
1500 		/* rx_ring_near_full_irq mask */
1501 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1502 		/* rx_ring_near_full_irq_2 mask */
1503 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1504 		/* tx_ring_near_full_irq mask */
1505 		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1506 		/* host2txmon ring masks */
1507 		{ WLAN_CFG_HOST2TXMON_RING_MASK_0,
1508 		  0, 0, 0, 0, 0, 0, 0, 0, 0},
1509 		/* tx mon ring masks */
1510 		{ WLAN_CFG_TX_MON_RING_MASK_0,
1511 		  WLAN_CFG_TX_MON_RING_MASK_1,
1512 		  0, 0, 0, 0, 0, 0},
1513 	},
1514 };
1515 #endif
1516 #endif
1517 
1518 /**
1519  * g_wlan_srng_cfg[] - Per ring_type specific configuration
1520  *
1521  */
1522 struct wlan_srng_cfg g_wlan_srng_cfg[MAX_RING_TYPES];
1523 
1524 /* REO_DST ring configuration */
1525 struct wlan_srng_cfg wlan_srng_reo_cfg = {
1526 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_REO_RING,
1527 	.batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_REO_RING,
1528 	.low_threshold = 0,
1529 };
1530 
1531 /* WBM2SW_RELEASE ring configuration */
1532 struct wlan_srng_cfg wlan_srng_wbm_release_cfg = {
1533 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_WBM_RELEASE_RING,
1534 	.batch_count_threshold = 0,
1535 	.low_threshold = 0,
1536 };
1537 
1538 /* RXDMA_BUF ring configuration */
1539 struct wlan_srng_cfg wlan_srng_rxdma_buf_cfg = {
1540 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
1541 	.batch_count_threshold = 0,
1542 	.low_threshold = WLAN_CFG_RXDMA_REFILL_RING_SIZE >> 3,
1543 };
1544 
1545 /* RXDMA_MONITOR_BUF ring configuration */
1546 struct wlan_srng_cfg wlan_srng_rxdma_monitor_buf_cfg = {
1547 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
1548 	.batch_count_threshold = 0,
1549 	.low_threshold = WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE >> 3,
1550 };
1551 
1552 /* RXDMA_MONITOR_STATUS ring configuration */
1553 struct wlan_srng_cfg wlan_srng_rxdma_monitor_status_cfg = {
1554 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX,
1555 	.batch_count_threshold = 0,
1556 	.low_threshold = WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE >> 3,
1557 };
1558 
1559 /* TX_MONITOR_BUF ring configuration */
1560 struct wlan_srng_cfg wlan_srng_tx_monitor_buf_cfg = {
1561 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_TX,
1562 	.batch_count_threshold = 0,
1563 	.low_threshold = WLAN_CFG_TX_MONITOR_BUF_RING_SIZE_MAX >> 3,
1564 };
1565 
1566 /* DEFAULT_CONFIG ring configuration */
1567 struct wlan_srng_cfg wlan_srng_default_cfg = {
1568 	.timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_OTHER,
1569 	.batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_OTHER,
1570 	.low_threshold = 0,
1571 };
1572 
1573 void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg)
1574 {
1575 	g_wlan_srng_cfg[REO_DST] = wlan_srng_reo_cfg;
1576 	g_wlan_srng_cfg[WBM2SW_RELEASE] = wlan_srng_wbm_release_cfg;
1577 	g_wlan_srng_cfg[REO_EXCEPTION] = wlan_srng_default_cfg;
1578 	g_wlan_srng_cfg[REO_REINJECT] = wlan_srng_default_cfg;
1579 	g_wlan_srng_cfg[REO_CMD] = wlan_srng_default_cfg;
1580 	g_wlan_srng_cfg[REO_STATUS] = wlan_srng_default_cfg;
1581 	g_wlan_srng_cfg[TCL_DATA] = wlan_srng_default_cfg;
1582 	g_wlan_srng_cfg[TCL_CMD_CREDIT] = wlan_srng_default_cfg;
1583 	g_wlan_srng_cfg[TCL_STATUS] = wlan_srng_default_cfg;
1584 	g_wlan_srng_cfg[WBM_IDLE_LINK] = wlan_srng_default_cfg;
1585 	g_wlan_srng_cfg[SW2WBM_RELEASE] = wlan_srng_default_cfg;
1586 	g_wlan_srng_cfg[RXDMA_BUF] = wlan_srng_rxdma_buf_cfg;
1587 	g_wlan_srng_cfg[RXDMA_DST] = wlan_srng_default_cfg;
1588 	g_wlan_srng_cfg[RXDMA_MONITOR_BUF] =
1589 			wlan_srng_rxdma_monitor_buf_cfg;
1590 	g_wlan_srng_cfg[RXDMA_MONITOR_STATUS] =
1591 			wlan_srng_rxdma_monitor_status_cfg;
1592 	g_wlan_srng_cfg[RXDMA_MONITOR_DST] = wlan_srng_default_cfg;
1593 	g_wlan_srng_cfg[RXDMA_MONITOR_DESC] = wlan_srng_default_cfg;
1594 	g_wlan_srng_cfg[DIR_BUF_RX_DMA_SRC] = wlan_srng_default_cfg;
1595 #ifdef WLAN_FEATURE_CIF_CFR
1596 	g_wlan_srng_cfg[WIFI_POS_SRC] = wlan_srng_default_cfg;
1597 #endif
1598 	g_wlan_srng_cfg[TX_MONITOR_BUF] = wlan_srng_tx_monitor_buf_cfg;
1599 	*wlan_cfg = g_wlan_srng_cfg;
1600 }
1601 
1602 static const uint8_t rx_fst_toeplitz_key[WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN] = {
1603 	0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
1604 	0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
1605 	0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
1606 	0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
1607 	0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
1608 };
1609 
1610 #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
1611 void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
1612 				  int num_dp_msi,
1613 				  int interrupt_mode,
1614 				  bool is_monitor_mode)
1615 {	int i = 0;
1616 	const uint8_t *tx_ring_intr_mask =
1617 				wlan_cfg_get_tx_ring_int_mask(wlan_cfg_ctx);
1618 
1619 	for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
1620 		wlan_cfg_ctx->int_tx_ring_mask[i] = tx_ring_intr_mask[i];
1621 		if (wlan_cfg_ctx->int_tx_ring_mask[i])
1622 			wlan_cfg_ctx->tx_rings_grp_bitmap |= BIT(i);
1623 
1624 		wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
1625 							rx_mon_ring_mask_msi[i];
1626 		wlan_cfg_ctx->int_tx_mon_ring_mask[i] = 0;
1627 		wlan_cfg_ctx->int_rx_err_ring_mask[i] =
1628 							rx_err_ring_mask_msi[i];
1629 		wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
1630 						rx_wbm_rel_ring_mask_msi[i];
1631 		wlan_cfg_ctx->int_reo_status_ring_mask[i] =
1632 							reo_status_ring_mask_msi[i];
1633 		if (is_monitor_mode) {
1634 			wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
1635 			if (interrupt_mode == DP_INTR_POLL)
1636 				wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
1637 			else
1638 				wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
1639 						rxdma2host_ring_mask_msi[i];
1640 		} else {
1641 			wlan_cfg_ctx->int_rx_ring_mask[i] =
1642 							rx_ring_mask_msi[i];
1643 			wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
1644 						rxdma2host_ring_mask_msi[i];
1645 		}
1646 		wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
1647 						host2rxdma_ring_mask_msi[i];
1648 		wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
1649 						host2rxdma_mon_ring_mask_msi[i];
1650 		wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
1651 						rxdma2host_mon_ring_mask_msi[i];
1652 		wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] =
1653 					rx_ring_near_full_irq_1_mask_msi[i];
1654 		wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] =
1655 					rx_ring_near_full_irq_2_mask_msi[i];
1656 		wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] =
1657 					tx_ring_near_full_irq_mask_msi[i];
1658 	}
1659 }
1660 
1661 #else
1662 
1663 void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
1664 				     int num_dp_msi,
1665 				     int interrupt_mode,
1666 				     bool is_monitor_mode)
1667 {
1668 	int i = 0;
1669 	int interrupt_index = 0;
1670 	int int_host2rxdma_mon_ring_mask;
1671 	bool host2rxmon_mask_set = false;
1672 	bool txmon_hw_support = false;
1673 
1674 	if(interrupt_mode == DP_INTR_INTEGRATED) {
1675 		interrupt_index = 0;
1676 	} else if (interrupt_mode == DP_INTR_MSI || interrupt_mode ==
1677 		   DP_INTR_POLL) {
1678 		interrupt_index = num_dp_msi;
1679 	} else {
1680 		qdf_err("Interrupt mode %d", interrupt_mode);
1681 	}
1682 
1683 	for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
1684 		wlan_cfg_ctx->int_tx_ring_mask[i] =
1685 			dp_mask_assignment[interrupt_index].tx_ring_mask[i];
1686 		wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
1687 			dp_mask_assignment[interrupt_index].rx_mon_ring_mask[i];
1688 		wlan_cfg_ctx->int_rx_err_ring_mask[i] =
1689 			dp_mask_assignment[interrupt_index].rx_err_ring_mask[i];
1690 		wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
1691 			dp_mask_assignment[interrupt_index].rx_wbm_rel_ring_mask[i];
1692 		wlan_cfg_ctx->int_reo_status_ring_mask[i] =
1693 			dp_mask_assignment[interrupt_index].reo_status_ring_mask[i];
1694 		if (is_monitor_mode) {
1695 			wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
1696 			wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
1697 		} else {
1698 			wlan_cfg_ctx->int_rx_ring_mask[i] =
1699 				dp_mask_assignment[interrupt_index].rx_ring_mask[i];
1700 			wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
1701 				dp_mask_assignment[interrupt_index].rxdma2host_ring_mask[i];
1702 		}
1703 		wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
1704 			dp_mask_assignment[interrupt_index].host2rxdma_ring_mask[i];
1705 		wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
1706 			dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
1707 		wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
1708 			dp_mask_assignment[interrupt_index].rxdma2host_mon_ring_mask[i];
1709 		wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] =
1710 			dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_1_mask[i];
1711 		wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] =
1712 			dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_2_mask[i];
1713 		wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] =
1714 			dp_mask_assignment[interrupt_index].tx_ring_near_full_irq_mask[i];
1715 
1716 		txmon_hw_support = wlan_cfg_get_txmon_hw_support(wlan_cfg_ctx);
1717 		if (txmon_hw_support) {
1718 			wlan_cfg_ctx->int_tx_mon_ring_mask[i] =
1719 				dp_mask_assignment[interrupt_index].tx_mon_ring_mask[i];
1720 			wlan_cfg_ctx->int_host2txmon_ring_mask[i] =
1721 				dp_mask_assignment[interrupt_index].host2txmon_ring_mask[i];
1722 			int_host2rxdma_mon_ring_mask =
1723 				dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
1724 			if (int_host2rxdma_mon_ring_mask && !host2rxmon_mask_set) {
1725 				wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[interrupt_index] =
1726 					dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
1727 				host2rxmon_mask_set = true;
1728 			}
1729 		} else {
1730 			wlan_cfg_ctx->int_tx_mon_ring_mask[i] = 0;
1731 			wlan_cfg_ctx->int_host2txmon_ring_mask[i] = 0;
1732 			wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
1733 				dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
1734 		}
1735 	}
1736 }
1737 #endif
1738 
1739 #ifdef IPA_OFFLOAD
1740 
1741 #define WLAN_CFG_IPA_ENABLE_MASK BIT(0)
1742 #ifdef IPA_WDI3_TX_TWO_PIPES
1743 /**
1744  * wlan_soc_ipa_cfg_attach() - Update ipa tx and tx alt config
1745  *  in dp soc cfg context
1746  * @psoc: Object manager psoc
1747  * @wlan_cfg_ctx: dp soc cfg ctx
1748  *
1749  * Return: None
1750  */
1751 static void
1752 wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1753 			struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1754 {
1755 	wlan_cfg_ctx->ipa_enabled = (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) &
1756 				     WLAN_CFG_IPA_ENABLE_MASK);
1757 	wlan_cfg_ctx->ipa_tx_ring_size =
1758 			cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
1759 	wlan_cfg_ctx->ipa_tx_comp_ring_size =
1760 			cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
1761 	wlan_cfg_ctx->ipa_tx_alt_ring_size =
1762 			cfg_get(psoc, CFG_DP_IPA_TX_ALT_RING_SIZE);
1763 	wlan_cfg_ctx->ipa_tx_alt_comp_ring_size =
1764 			cfg_get(psoc, CFG_DP_IPA_TX_ALT_COMP_RING_SIZE);
1765 }
1766 #else /* !IPA_WDI3_TX_TWO_PIPES */
1767 /**
1768  * wlan_soc_ipa_cfg_attach() - Update ipa config in dp soc
1769  *  cfg context
1770  * @psoc - Object manager psoc
1771  * @wlan_cfg_ctx - dp soc cfg ctx
1772  *
1773  * Return: None
1774  */
1775 static void
1776 wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1777 			struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1778 {
1779 	wlan_cfg_ctx->ipa_enabled = (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) &
1780 				     WLAN_CFG_IPA_ENABLE_MASK);
1781 	wlan_cfg_ctx->ipa_tx_ring_size =
1782 			cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
1783 	wlan_cfg_ctx->ipa_tx_comp_ring_size =
1784 			cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE);
1785 }
1786 #endif /* IPA_WDI3_TX_TWO_PIPES */
1787 #else /* !IPA_OFFLOAD */
1788 static inline void
1789 wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1790 			struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1791 {
1792 }
1793 #endif
1794 
1795 #ifdef DP_HW_COOKIE_CONVERT_EXCEPTION
1796 static void
1797 wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1798 			  struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1799 {
1800 	wlan_cfg_ctx->hw_cc_enabled =
1801 			cfg_get(psoc, CFG_DP_HW_CC_ENABLE);
1802 }
1803 #else
1804 static void
1805 wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1806 			  struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1807 {
1808 	wlan_cfg_ctx->hw_cc_enabled = true;
1809 }
1810 #endif
1811 
1812 #ifdef WLAN_SUPPORT_PPEDS
1813 /**
1814  * wlan_soc_ppe_cfg_attach() - Update ppe config in dp soc
1815  *  cfg context
1816  * @psoc - Object manager psoc
1817  * @wlan_cfg_ctx - dp soc cfg ctx
1818  *
1819  * Return: None
1820  */
1821 static void
1822 wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1823 			struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1824 {
1825 	wlan_cfg_ctx->ppe_enable = cfg_get(psoc, CFG_DP_PPE_ENABLE);
1826 	wlan_cfg_ctx->reo2ppe_ring = cfg_get(psoc, CFG_DP_REO2PPE_RING);
1827 	wlan_cfg_ctx->ppe2tcl_ring = cfg_get(psoc, CFG_DP_PPE2TCL_RING);
1828 	wlan_cfg_ctx->ppe_release_ring = cfg_get(psoc,
1829 						 CFG_DP_PPE_RELEASE_RING);
1830 }
1831 #else
1832 static inline void
1833 wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1834 			struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1835 {
1836 }
1837 #endif
1838 
1839 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
1840 /**
1841  * wlan_cfg_get_lsb_set_pos() - returns position of LSB which is set
1842  *
1843  * Return: position of LSB which is set
1844  */
1845 static uint8_t wlan_cfg_get_lsb_set_pos(uint8_t val)
1846 {
1847 	uint8_t pos = 0;
1848 
1849 	while (pos < 8) {
1850 		if (val & (1 << pos))
1851 			return pos;
1852 
1853 		pos++;
1854 	}
1855 
1856 	return 0;
1857 }
1858 
1859 /**
1860  * wlan_multi_soc_mlo_cfg_attach() - Update multi soc mlo config in dp soc
1861  *  cfg context
1862  * @psoc - Object manager psoc
1863  * @wlan_cfg_ctx - dp soc cfg ctx
1864  *
1865  * Return: None
1866  */
1867 static void
1868 wlan_multi_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1869 			      struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1870 {
1871 	uint8_t rx_ring_map;
1872 
1873 	rx_ring_map =
1874 		cfg_get(psoc, CFG_DP_MLO_CHIP0_RX_RING_MAP);
1875 	wlan_cfg_ctx->mlo_chip_rx_ring_map[0] = rx_ring_map;
1876 	wlan_cfg_ctx->mlo_chip_default_rx_ring_id[0] =
1877 			wlan_cfg_get_lsb_set_pos(rx_ring_map);
1878 	wlan_cfg_ctx->lmac_peer_id_msb[0] = 1;
1879 
1880 	rx_ring_map =
1881 		cfg_get(psoc, CFG_DP_MLO_CHIP1_RX_RING_MAP);
1882 	wlan_cfg_ctx->mlo_chip_rx_ring_map[1] = rx_ring_map;
1883 	wlan_cfg_ctx->mlo_chip_default_rx_ring_id[1] =
1884 			wlan_cfg_get_lsb_set_pos(rx_ring_map);
1885 	wlan_cfg_ctx->lmac_peer_id_msb[1] = 2;
1886 
1887 	rx_ring_map =
1888 		cfg_get(psoc, CFG_DP_MLO_CHIP2_RX_RING_MAP);
1889 	wlan_cfg_ctx->mlo_chip_rx_ring_map[2] = rx_ring_map;
1890 	wlan_cfg_ctx->mlo_chip_default_rx_ring_id[2] =
1891 			wlan_cfg_get_lsb_set_pos(rx_ring_map);
1892 	wlan_cfg_ctx->lmac_peer_id_msb[2] = 3;
1893 }
1894 #else
1895 static inline void
1896 wlan_multi_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1897 			      struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1898 {
1899 }
1900 #endif
1901 
1902 #ifdef WLAN_FEATURE_11BE_MLO
1903 /**
1904  * wlan_soc_mlo_cfg_attach() - Update mlo config in dp soc
1905  *  cfg context
1906  * @psoc - Object manager psoc
1907  * @wlan_cfg_ctx - dp soc cfg ctx
1908  *
1909  * Return: None
1910  */
1911 static void
1912 wlan_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1913 			struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1914 {
1915 	wlan_multi_soc_mlo_cfg_attach(psoc, wlan_cfg_ctx);
1916 }
1917 #else
1918 static inline void
1919 wlan_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1920 			struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1921 {
1922 }
1923 #endif
1924 
1925 #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
1926 /**
1927  * wlan_soc_vdev_hw_stats_cfg_attach() - Update hw vdev stats config in dp soc
1928  *  cfg context
1929  * @psoc - Object manager psoc
1930  * @wlan_cfg_ctx - dp soc cfg ctx
1931  *
1932  * Return: None
1933  */
1934 static void
1935 wlan_soc_vdev_hw_stats_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1936 				  struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1937 {
1938 	wlan_cfg_ctx->vdev_stats_hw_offload_config = cfg_get(psoc,
1939 					CFG_DP_VDEV_STATS_HW_OFFLOAD_CONFIG);
1940 	wlan_cfg_ctx->vdev_stats_hw_offload_timer = cfg_get(psoc,
1941 					CFG_DP_VDEV_STATS_HW_OFFLOAD_TIMER);
1942 }
1943 #else
1944 static void
1945 wlan_soc_vdev_hw_stats_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1946 				  struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1947 {
1948 }
1949 #endif
1950 
1951 #ifdef WLAN_TX_PKT_CAPTURE_ENH
1952 static void wlan_soc_tx_capt_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1953 				struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1954 {
1955 	wlan_cfg_ctx->tx_capt_max_mem_allowed =
1956 		cfg_get(psoc, CFG_DP_TX_CAPT_MAX_MEM_MB) * 1024 * 1024;
1957 }
1958 #else
1959 static void wlan_soc_tx_capt_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
1960 				struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
1961 {
1962 }
1963 #endif
1964 
1965 /**
1966  * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration
1967  * @psoc - Object manager psoc
1968  * Return: wlan_cfg_ctx - Handle to Configuration context
1969  */
1970 struct wlan_cfg_dp_soc_ctxt *
1971 wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
1972 {
1973 	struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx =
1974 		qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt));
1975 	uint32_t gro_bit_set;
1976 
1977 	if (!wlan_cfg_ctx)
1978 		return NULL;
1979 
1980 	wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE;
1981 	wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS;
1982 	wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS);
1983 	wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE);
1984 	wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING);
1985 	wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS);
1986 	wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS);
1987 	wlan_cfg_ctx->num_tx_comp_rings = cfg_get(psoc, CFG_DP_TX_COMP_RINGS);
1988 	wlan_cfg_ctx->num_nss_reo_dest_rings =
1989 				cfg_get(psoc, CFG_DP_NSS_REO_DEST_RINGS);
1990 	wlan_cfg_ctx->num_nss_tcl_data_rings =
1991 				cfg_get(psoc, CFG_DP_NSS_TCL_DATA_RINGS);
1992 	wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING);
1993 	wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING);
1994 	wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS;
1995 	wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc,
1996 						     CFG_DP_TX_EXT_DESC_POOLS);
1997 	wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC);
1998 	wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN;
1999 	wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC);
2000 	wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE);
2001 	wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID);
2002 
2003 	wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE);
2004 	wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc,
2005 						  CFG_DP_TX_COMPL_RING_SIZE);
2006 
2007 	wlan_cfg_ctx->tx_comp_ring_size_nss =
2008 		cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE);
2009 
2010 	wlan_cfg_ctx->int_batch_threshold_tx =
2011 			cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX);
2012 	wlan_cfg_ctx->int_timer_threshold_tx =
2013 			cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX);
2014 	wlan_cfg_ctx->int_batch_threshold_rx =
2015 			cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX);
2016 	wlan_cfg_ctx->int_timer_threshold_rx =
2017 			cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX);
2018 	wlan_cfg_ctx->int_batch_threshold_other =
2019 		cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER);
2020 	wlan_cfg_ctx->int_timer_threshold_other =
2021 		cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER);
2022 	wlan_cfg_ctx->pktlog_buffer_size =
2023 		cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE);
2024 
2025 	/* This is default mapping and can be overridden by HW config
2026 	 * received from FW */
2027 	wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0);
2028 	if (MAX_PDEV_CNT > 1)
2029 		wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2);
2030 	if (MAX_PDEV_CNT > 2)
2031 		wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1);
2032 
2033 	wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID);
2034 
2035 	wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH);
2036 	wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO);
2037 	wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO);
2038 	wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG);
2039 	gro_bit_set = cfg_get(psoc, CFG_DP_GRO);
2040 	if (gro_bit_set & DP_GRO_ENABLE_BIT_SET) {
2041 		wlan_cfg_ctx->gro_enabled = true;
2042 		if (gro_bit_set & DP_FORCE_USE_GRO_BIT_SET)
2043 			wlan_cfg_ctx->force_gro_enabled = true;
2044 	}
2045 	wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM);
2046 	wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM);
2047 	wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE);
2048 	wlan_cfg_ctx->peer_flow_ctrl_enabled =
2049 			cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL);
2050 	wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI);
2051 	wlan_cfg_ctx->p2p_tcp_udp_checksumoffload =
2052 			cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
2053 	wlan_cfg_ctx->nan_tcp_udp_checksumoffload =
2054 			cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
2055 	wlan_cfg_ctx->tcp_udp_checksumoffload =
2056 			cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
2057 	wlan_cfg_ctx->legacy_mode_checksumoffload_disable =
2058 			cfg_get(psoc, CFG_DP_LEGACY_MODE_CSUM_DISABLE);
2059 	wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING);
2060 	wlan_cfg_ctx->defrag_timeout_check =
2061 			cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK);
2062 	wlan_cfg_ctx->rx_defrag_min_timeout =
2063 			cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT);
2064 
2065 	wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc,
2066 						 CFG_DP_WBM_RELEASE_RING);
2067 	wlan_cfg_ctx->tcl_cmd_credit_ring = cfg_get(psoc,
2068 					     CFG_DP_TCL_CMD_CREDIT_RING);
2069 	wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc,
2070 						CFG_DP_TCL_STATUS_RING);
2071 	wlan_cfg_ctx->reo_dst_ring_size = cfg_get(psoc,
2072 						  CFG_DP_RX_DESTINATION_RING);
2073 	wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc,
2074 						  CFG_DP_REO_REINJECT_RING);
2075 	wlan_cfg_ctx->rx_release_ring = cfg_get(psoc,
2076 						CFG_DP_RX_RELEASE_RING);
2077 	wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc,
2078 						   CFG_DP_REO_EXCEPTION_RING);
2079 	wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc,
2080 					     CFG_DP_REO_CMD_RING);
2081 	wlan_cfg_ctx->reo_status_ring = cfg_get(psoc,
2082 						CFG_DP_REO_STATUS_RING);
2083 	wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc,
2084 						  CFG_DP_RXDMA_REFILL_RING);
2085 	wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc,
2086 						CFG_DP_TX_DESC_LIMIT_0);
2087 	wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc,
2088 						CFG_DP_TX_DESC_LIMIT_1);
2089 	wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc,
2090 						CFG_DP_TX_DESC_LIMIT_2);
2091 	wlan_cfg_ctx->tx_device_limit = cfg_get(psoc,
2092 						CFG_DP_TX_DEVICE_LIMIT);
2093 	wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc,
2094 						CFG_DP_TX_SW_INTERNODE_QUEUE);
2095 	wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc,
2096 						   CFG_DP_RXDMA_ERR_DST_RING);
2097 	wlan_cfg_ctx->enable_data_stall_detection =
2098 		cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION);
2099 	wlan_cfg_ctx->tx_flow_start_queue_offset =
2100 		cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET);
2101 	wlan_cfg_ctx->tx_flow_stop_queue_threshold =
2102 		cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH);
2103 	wlan_cfg_ctx->disable_intra_bss_fwd =
2104 		cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION);
2105 	wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc,
2106 						   CFG_DP_RX_SW_DESC_WEIGHT);
2107 	wlan_cfg_ctx->rx_sw_desc_num = cfg_get(psoc,
2108 						   CFG_DP_RX_SW_DESC_NUM);
2109 	wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key;
2110 	wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH;
2111 	wlan_cfg_ctx->is_rx_flow_tag_enabled =
2112 			cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE);
2113 	wlan_cfg_ctx->is_rx_flow_search_table_per_pdev =
2114 			cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV);
2115 	wlan_cfg_ctx->rx_flow_search_table_size =
2116 			cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE);
2117 	wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled =
2118 			cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE);
2119 	wlan_cfg_ctx->mon_drop_thresh =
2120 		cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD);
2121 	wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE);
2122 	wlan_cfg_ctx->reo_rings_mapping = cfg_get(psoc, CFG_DP_REO_RINGS_MAP);
2123 	wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS);
2124 	wlan_cfg_ctx->is_rx_buff_pool_enabled =
2125 			cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE);
2126 	wlan_cfg_ctx->is_rx_refill_buff_pool_enabled =
2127 			cfg_get(psoc, CFG_DP_RX_REFILL_BUFF_POOL_ENABLE);
2128 	wlan_cfg_ctx->rx_pending_high_threshold =
2129 			cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD);
2130 	wlan_cfg_ctx->rx_pending_low_threshold =
2131 			cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
2132 	wlan_cfg_ctx->is_poll_mode_enabled =
2133 			cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE);
2134 	wlan_cfg_ctx->is_swlm_enabled = cfg_get(psoc, CFG_DP_SWLM_ENABLE);
2135 	wlan_cfg_ctx->fst_in_cmem = cfg_get(psoc, CFG_DP_RX_FST_IN_CMEM);
2136 	wlan_cfg_ctx->tx_per_pkt_vdev_id_check =
2137 			cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK);
2138 	wlan_cfg_ctx->radio0_rx_default_reo =
2139 			cfg_get(psoc, CFG_DP_RX_RADIO_0_DEFAULT_REO);
2140 	wlan_cfg_ctx->radio1_rx_default_reo =
2141 			cfg_get(psoc, CFG_DP_RX_RADIO_1_DEFAULT_REO);
2142 	wlan_cfg_ctx->radio2_rx_default_reo =
2143 			cfg_get(psoc, CFG_DP_RX_RADIO_2_DEFAULT_REO);
2144 	wlan_cfg_ctx->wow_check_rx_pending_enable =
2145 			cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING);
2146 	wlan_cfg_ctx->delay_mon_replenish = cfg_get(psoc,
2147 			CFG_DP_DELAY_MON_REPLENISH);
2148 	wlan_cfg_ctx->rx_mon_buf_ring_size = cfg_get(psoc,
2149 					CFG_DP_RXDMA_MONITOR_BUF_RING);
2150 	wlan_cfg_ctx->tx_mon_buf_ring_size = cfg_get(psoc,
2151 					CFG_DP_TX_MONITOR_BUF_RING);
2152 	wlan_soc_ipa_cfg_attach(psoc, wlan_cfg_ctx);
2153 	wlan_soc_hw_cc_cfg_attach(psoc, wlan_cfg_ctx);
2154 	wlan_soc_ppe_cfg_attach(psoc, wlan_cfg_ctx);
2155 	wlan_soc_mlo_cfg_attach(psoc, wlan_cfg_ctx);
2156 	wlan_soc_vdev_hw_stats_cfg_attach(psoc, wlan_cfg_ctx);
2157 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
2158 	wlan_cfg_ctx->pkt_capture_mode = cfg_get(psoc, CFG_PKT_CAPTURE_MODE) &
2159 						 PKT_CAPTURE_MODE_DATA_ONLY;
2160 #endif
2161 	wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev = NUM_RXDMA_RINGS_PER_PDEV;
2162 	wlan_cfg_ctx->num_rxdma_status_rings_per_pdev =
2163 					NUM_RXDMA_RINGS_PER_PDEV;
2164 	wlan_soc_tx_capt_cfg_attach(psoc, wlan_cfg_ctx);
2165 
2166 	return wlan_cfg_ctx;
2167 }
2168 
2169 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
2170 {
2171 	qdf_mem_free(wlan_cfg_ctx);
2172 }
2173 
2174 struct wlan_cfg_dp_pdev_ctxt *
2175 wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc)
2176 {
2177 	struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx =
2178 		qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt));
2179 
2180 	if (!wlan_cfg_ctx)
2181 		return NULL;
2182 
2183 	wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc,
2184 					CFG_DP_RXDMA_BUF_RING);
2185 	wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc,
2186 					CFG_DP_RXDMA_MONITOR_BUF_RING);
2187 	wlan_cfg_ctx->dma_rx_mon_dest_ring_size = cfg_get(psoc,
2188 					CFG_DP_RXDMA_MONITOR_DST_RING);
2189 	wlan_cfg_ctx->dma_tx_mon_dest_ring_size = cfg_get(psoc,
2190 					CFG_DP_TX_MONITOR_DST_RING);
2191 	wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc,
2192 					CFG_DP_RXDMA_MONITOR_STATUS_RING);
2193 	wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc,
2194 					CFG_DP_RXDMA_MONITOR_DESC_RING);
2195 	wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV;
2196 
2197 	return wlan_cfg_ctx;
2198 }
2199 
2200 void wlan_cfg_set_mon_delayed_replenish_entries(
2201 					struct wlan_cfg_dp_soc_ctxt *cfg,
2202 					uint32_t val)
2203 {
2204 	cfg->delayed_replenish_entries = val;
2205 }
2206 
2207 qdf_export_symbol(wlan_cfg_set_mon_delayed_replenish_entries);
2208 
2209 int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg)
2210 {
2211 	return cfg->delayed_replenish_entries;
2212 }
2213 
2214 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx)
2215 {
2216 	if (wlan_cfg_ctx)
2217 		qdf_mem_free(wlan_cfg_ctx);
2218 }
2219 
2220 int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg)
2221 {
2222 	return cfg->mon_drop_thresh;
2223 }
2224 
2225 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num)
2226 {
2227 	cfg->num_int_ctxts = num;
2228 }
2229 
2230 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
2231 {
2232 	cfg->max_peer_id = val;
2233 }
2234 
2235 void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val)
2236 {
2237 	cfg->max_ast_idx = val;
2238 }
2239 
2240 int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg)
2241 {
2242 	return cfg->max_ast_idx;
2243 }
2244 
2245 qdf_export_symbol(wlan_cfg_get_max_ast_idx);
2246 
2247 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2248 		int context, int mask)
2249 {
2250 	cfg->int_tx_ring_mask[context] = mask;
2251 }
2252 
2253 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2254 			       int context, int mask)
2255 {
2256 	cfg->int_rx_ring_mask[context] = mask;
2257 }
2258 
2259 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2260 		int context, int mask)
2261 {
2262 	cfg->int_rx_mon_ring_mask[context] = mask;
2263 }
2264 
2265 void wlan_cfg_set_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2266 				   int context, int mask)
2267 {
2268 	cfg->int_tx_mon_ring_mask[context] = mask;
2269 }
2270 
2271 int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2272 					  int context)
2273 {
2274 	return cfg->int_host2rxdma_mon_ring_mask[context];
2275 }
2276 
2277 void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2278 					   int context, int mask)
2279 {
2280 	cfg->int_host2rxdma_mon_ring_mask[context] = mask;
2281 }
2282 
2283 int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2284 					  int context)
2285 {
2286 	return cfg->int_rxdma2host_mon_ring_mask[context];
2287 }
2288 
2289 void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2290 					   int context, int mask)
2291 {
2292 	cfg->int_rxdma2host_mon_ring_mask[context] = mask;
2293 }
2294 
2295 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2296 	int context, int mask)
2297 {
2298 	cfg->int_rxdma2host_ring_mask[context] = mask;
2299 }
2300 
2301 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2302 	int context)
2303 {
2304 	return cfg->int_rxdma2host_ring_mask[context];
2305 }
2306 
2307 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2308 	int context, int mask)
2309 {
2310 	cfg->int_host2rxdma_ring_mask[context] = mask;
2311 }
2312 
2313 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2314 	int context)
2315 {
2316 	return cfg->int_host2rxdma_ring_mask[context];
2317 }
2318 
2319 int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2320 					 int context)
2321 {
2322 	return cfg->int_rx_ring_near_full_irq_1_mask[context];
2323 }
2324 
2325 int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2326 					 int context)
2327 {
2328 	return cfg->int_rx_ring_near_full_irq_2_mask[context];
2329 }
2330 
2331 int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2332 					int context)
2333 {
2334 	return cfg->int_tx_ring_near_full_irq_mask[context];
2335 }
2336 
2337 void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
2338 			     int hw_macid)
2339 {
2340 	qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
2341 	cfg->hw_macid[pdev_idx] = hw_macid;
2342 }
2343 
2344 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx)
2345 {
2346 	qdf_assert_always(pdev_idx < MAX_PDEV_CNT);
2347 	return cfg->hw_macid[pdev_idx];
2348 }
2349 
2350 qdf_export_symbol(wlan_cfg_get_hw_mac_idx);
2351 
2352 int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
2353 				int hw_macid)
2354 {
2355 	int idx;
2356 
2357 	for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
2358 		if (cfg->hw_macid[idx] == hw_macid)
2359 			return (idx + 1);
2360 	}
2361 	qdf_assert_always(idx < MAX_PDEV_CNT);
2362 	return WLAN_INVALID_PDEV_ID;
2363 }
2364 
2365 void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
2366 			   int hw_macid)
2367 {
2368 	qdf_assert_always((pdev_idx < MAX_PDEV_CNT) ||
2369 			  (pdev_idx == INVALID_PDEV_ID));
2370 	qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
2371 	cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx;
2372 }
2373 
2374 int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid)
2375 {
2376 	qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW);
2377 	return cfg->hw_macid_pdev_id_map[hw_macid];
2378 }
2379 
2380 qdf_export_symbol(wlan_cfg_get_pdev_idx);
2381 
2382 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2383 		int context, int mask)
2384 {
2385 	cfg->int_ce_ring_mask[context] = mask;
2386 }
2387 
2388 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context,
2389 		int mask)
2390 {
2391 	cfg->int_rx_ring_mask[context] = mask;
2392 }
2393 
2394 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2395 		int context, int mask)
2396 {
2397 	return cfg->int_rx_err_ring_mask[context] = mask;
2398 }
2399 
2400 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2401 		int context, int mask)
2402 {
2403 	return cfg->int_rx_wbm_rel_ring_mask[context] = mask;
2404 }
2405 
2406 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2407 		int context, int mask)
2408 {
2409 	return cfg->int_reo_status_ring_mask[context] = mask;
2410 }
2411 
2412 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg)
2413 {
2414 	return cfg->num_int_ctxts;
2415 }
2416 
2417 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
2418 {
2419 	return cfg->int_tx_ring_mask[context];
2420 }
2421 
2422 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
2423 {
2424 	return cfg->int_rx_ring_mask[context];
2425 }
2426 
2427 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2428 						int context)
2429 {
2430 	return cfg->int_rx_err_ring_mask[context];
2431 }
2432 
2433 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2434 					int context)
2435 {
2436 	return cfg->int_rx_wbm_rel_ring_mask[context];
2437 }
2438 
2439 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
2440 					int context)
2441 {
2442 	return cfg->int_reo_status_ring_mask[context];
2443 }
2444 
2445 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
2446 {
2447 	return cfg->int_rx_mon_ring_mask[context];
2448 }
2449 
2450 #ifdef CONFIG_BERYLLIUM
2451 int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
2452 {
2453 	return cfg->int_tx_mon_ring_mask[context];
2454 }
2455 #else
2456 int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
2457 {
2458 	return 0;
2459 }
2460 #endif
2461 
2462 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context)
2463 {
2464 	return cfg->int_ce_ring_mask[context];
2465 }
2466 
2467 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg)
2468 {
2469 	return cfg->max_clients;
2470 }
2471 
2472 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2473 {
2474 	return cfg->max_alloc_size;
2475 }
2476 
2477 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
2478 {
2479 	return cfg->per_pdev_tx_ring;
2480 }
2481 
2482 uint32_t
2483 wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
2484 {
2485 	return cfg->rx_pending_high_threshold;
2486 }
2487 
2488 uint32_t
2489 wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg)
2490 {
2491 	return cfg->rx_pending_low_threshold;
2492 }
2493 
2494 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
2495 {
2496 	return cfg->per_pdev_lmac_ring;
2497 }
2498 
2499 qdf_export_symbol(wlan_cfg_per_pdev_lmac_ring);
2500 
2501 #if defined(DP_USE_SINGLE_TCL) && !defined(TX_MULTI_TCL)
2502 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
2503 {
2504 	return 1;
2505 }
2506 
2507 int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
2508 {
2509 	return 1;
2510 }
2511 
2512 #else
2513 
2514 #if defined(IPA_OFFLOAD) && defined(TX_MULTI_TCL)
2515 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
2516 {
2517 	if (!cfg->ipa_enabled)
2518 		return cfg->num_tcl_data_rings;
2519 
2520 	return 1;
2521 }
2522 
2523 int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
2524 {
2525 	if (!cfg->ipa_enabled)
2526 		return cfg->num_nss_tcl_data_rings;
2527 
2528 	return 1;
2529 }
2530 #else
2531 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
2532 {
2533 	return cfg->num_tcl_data_rings;
2534 }
2535 
2536 int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
2537 {
2538 	return cfg->num_nss_tcl_data_rings;
2539 }
2540 #endif
2541 #endif
2542 
2543 int wlan_cfg_num_tx_comp_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
2544 {
2545 	return cfg->num_tx_comp_rings;
2546 }
2547 
2548 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2549 {
2550 	return cfg->tx_ring_size;
2551 }
2552 
2553 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2554 {
2555 	return cfg->tx_comp_ring_size;
2556 }
2557 
2558 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg)
2559 {
2560 	return cfg->per_pdev_rx_ring;
2561 }
2562 
2563 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
2564 {
2565 	return cfg->num_reo_dest_rings;
2566 }
2567 
2568 int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg)
2569 {
2570 	return cfg->num_nss_reo_dest_rings;
2571 }
2572 
2573 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg)
2574 {
2575 	return cfg->htt_packet_type;            /*htt_pkt_type_ethernet*/
2576 }
2577 
2578 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
2579 {
2580 	return cfg->num_tx_desc_pool;
2581 }
2582 
2583 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
2584 {
2585 	cfg->num_tx_desc_pool = num_pool;
2586 }
2587 
2588 int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg)
2589 {
2590 	return cfg->num_tx_ext_desc_pool;
2591 }
2592 
2593 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool)
2594 {
2595 	cfg->num_tx_ext_desc_pool = num_pool;
2596 }
2597 
2598 int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2599 {
2600 	return cfg->reo_dst_ring_size;
2601 }
2602 
2603 void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
2604 				    int reo_dst_ring_size)
2605 {
2606 	cfg->reo_dst_ring_size = reo_dst_ring_size;
2607 }
2608 
2609 void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg,
2610 			       bool raw_mode_war)
2611 {
2612 	cfg->raw_mode_war = raw_mode_war;
2613 }
2614 
2615 bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg)
2616 {
2617 	return cfg->raw_mode_war;
2618 }
2619 
2620 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
2621 {
2622 	return cfg->num_tx_desc;
2623 }
2624 
2625 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc)
2626 {
2627 	cfg->num_tx_desc = num_desc;
2628 }
2629 
2630 int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
2631 {
2632 	return cfg->min_tx_desc;
2633 }
2634 
2635 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
2636 {
2637 	return cfg->num_tx_ext_desc;
2638 }
2639 
2640 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc)
2641 {
2642 	cfg->num_tx_ext_desc = num_ext_desc;
2643 }
2644 
2645 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg)
2646 {
2647 	/* TODO: This should be calculated based on target capabilities */
2648 	return cfg->max_peer_id;
2649 }
2650 
2651 int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
2652 {
2653 	return  cfg->dma_mon_buf_ring_size;
2654 }
2655 
2656 qdf_export_symbol(wlan_cfg_get_dma_mon_buf_ring_size);
2657 
2658 int wlan_cfg_get_dma_rx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
2659 {
2660 	return  cfg->dma_rx_mon_dest_ring_size;
2661 }
2662 
2663 qdf_export_symbol(wlan_cfg_get_dma_rx_mon_dest_ring_size);
2664 
2665 int wlan_cfg_get_dma_tx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
2666 {
2667 	return  cfg->dma_tx_mon_dest_ring_size;
2668 }
2669 
2670 qdf_export_symbol(wlan_cfg_get_dma_tx_mon_dest_ring_size);
2671 
2672 int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
2673 {
2674 	return  cfg->dma_mon_status_ring_size;
2675 }
2676 
2677 qdf_export_symbol(wlan_cfg_get_dma_mon_stat_ring_size);
2678 
2679 int
2680 wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
2681 {
2682 	return cfg->rxdma_monitor_desc_ring;
2683 }
2684 
2685 qdf_export_symbol(wlan_cfg_get_dma_mon_desc_ring_size);
2686 
2687 int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg)
2688 {
2689 	return  cfg->rx_dma_buf_ring_size;
2690 }
2691 
2692 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg)
2693 {
2694 	return  cfg->num_mac_rings;
2695 }
2696 
2697 qdf_export_symbol(wlan_cfg_get_num_mac_rings);
2698 
2699 bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
2700 {
2701 	return  cfg->gro_enabled;
2702 }
2703 
2704 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
2705 {
2706 	return  cfg->lro_enabled;
2707 }
2708 
2709 bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
2710 {
2711 	return  cfg->ipa_enabled;
2712 }
2713 
2714 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
2715 {
2716 	cfg->rx_hash = val;
2717 }
2718 
2719 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
2720 {
2721 	return  cfg->rx_hash;
2722 }
2723 
2724 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg)
2725 {
2726 	return  cfg->nss_enabled;
2727 }
2728 
2729 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled)
2730 {
2731 	cfg->nss_enabled = nss_enabled;
2732 }
2733 
2734 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg)
2735 {
2736 	return  cfg->nss_cfg;
2737 }
2738 
2739 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg)
2740 {
2741 	cfg->nss_cfg = nss_cfg;
2742 	if (cfg->nss_cfg)
2743 		cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss;
2744 }
2745 
2746 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
2747 {
2748 	return cfg->int_batch_threshold_tx;
2749 }
2750 
2751 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)
2752 {
2753 	return cfg->int_timer_threshold_tx;
2754 }
2755 
2756 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
2757 {
2758 	return cfg->int_batch_threshold_rx;
2759 }
2760 
2761 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg)
2762 {
2763 	return cfg->int_timer_threshold_rx;
2764 }
2765 
2766 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
2767 {
2768 	return cfg->int_batch_threshold_other;
2769 }
2770 
2771 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg)
2772 {
2773 	return cfg->int_timer_threshold_other;
2774 }
2775 
2776 int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg)
2777 {
2778 	return cfg->int_timer_threshold_mon;
2779 }
2780 
2781 int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
2782 {
2783 	return cfg->p2p_tcp_udp_checksumoffload;
2784 }
2785 
2786 int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
2787 {
2788 	return cfg->nan_tcp_udp_checksumoffload;
2789 }
2790 
2791 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg)
2792 {
2793 	return cfg->tcp_udp_checksumoffload;
2794 }
2795 
2796 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg)
2797 {
2798 	return cfg->rx_defrag_min_timeout;
2799 }
2800 
2801 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg)
2802 {
2803 	return cfg->defrag_timeout_check;
2804 }
2805 
2806 int
2807 wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2808 {
2809 	return cfg->wbm_release_ring;
2810 }
2811 
2812 int
2813 wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2814 {
2815 	return cfg->tcl_cmd_credit_ring;
2816 }
2817 
2818 int
2819 wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2820 {
2821 	return cfg->tcl_status_ring;
2822 }
2823 
2824 int
2825 wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2826 {
2827 	return cfg->reo_reinject_ring;
2828 }
2829 
2830 int
2831 wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2832 {
2833 	return cfg->rx_release_ring;
2834 }
2835 
2836 int
2837 wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2838 {
2839 	return cfg->reo_exception_ring;
2840 }
2841 
2842 int
2843 wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2844 {
2845 	return cfg->reo_cmd_ring;
2846 }
2847 
2848 int
2849 wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2850 {
2851 	return cfg->reo_status_ring;
2852 }
2853 
2854 int
2855 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2856 {
2857 	return cfg->rxdma_refill_ring;
2858 }
2859 
2860 int
2861 wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg)
2862 {
2863 	return cfg->tx_desc_limit_0;
2864 }
2865 
2866 int
2867 wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg)
2868 {
2869 	return cfg->tx_desc_limit_1;
2870 }
2871 
2872 int
2873 wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
2874 {
2875 	return cfg->tx_desc_limit_2;
2876 }
2877 
2878 int
2879 wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
2880 {
2881 	return cfg->tx_device_limit;
2882 }
2883 
2884 int
2885 wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg)
2886 {
2887 	return cfg->tx_sw_internode_queue;
2888 }
2889 
2890 int
2891 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
2892 {
2893 	return cfg->rxdma_err_dst_ring;
2894 }
2895 
2896 int
2897 wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg)
2898 {
2899 	return cfg->rx_sw_desc_weight;
2900 }
2901 
2902 qdf_export_symbol(wlan_cfg_get_dp_soc_rx_sw_desc_weight);
2903 
2904 int
2905 wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg)
2906 {
2907 	return cfg->rx_sw_desc_num;
2908 }
2909 
2910 uint32_t
2911 wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg)
2912 {
2913 	return cfg->reo_rings_mapping;
2914 }
2915 
2916 bool
2917 wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg,
2918 		     enum cdp_capabilities dp_caps)
2919 {
2920 	switch (dp_caps) {
2921 	case CDP_CFG_DP_TSO:
2922 		return cfg->tso_enabled;
2923 	case CDP_CFG_DP_LRO:
2924 		return cfg->lro_enabled;
2925 	case CDP_CFG_DP_SG:
2926 		return cfg->sg_enabled;
2927 	case CDP_CFG_DP_GRO:
2928 		return cfg->gro_enabled;
2929 	case CDP_CFG_DP_OL_TX_CSUM:
2930 		return cfg->ol_tx_csum_enabled;
2931 	case CDP_CFG_DP_OL_RX_CSUM:
2932 		return cfg->ol_rx_csum_enabled;
2933 	case CDP_CFG_DP_RAWMODE:
2934 		return cfg->rawmode_enabled;
2935 	case CDP_CFG_DP_PEER_FLOW_CTRL:
2936 		return cfg->peer_flow_ctrl_enabled;
2937 	default:
2938 		return false;
2939 	}
2940 }
2941 
2942 void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
2943 					bool val)
2944 {
2945 	cfg->is_tso_desc_attach_defer = val;
2946 }
2947 
2948 bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg)
2949 {
2950 	return cfg->is_tso_desc_attach_defer;
2951 }
2952 
2953 #ifdef QCA_LL_TX_FLOW_CONTROL_V2
2954 /**
2955  * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold
2956  * @cfg: config context
2957  *
2958  * Return: stop threshold
2959  */
2960 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg)
2961 {
2962 	return cfg->tx_flow_stop_queue_threshold;
2963 }
2964 
2965 /**
2966  * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset
2967  *					for TX to resume
2968  * @cfg: config context
2969  *
2970  * Return: stop threshold
2971  */
2972 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg)
2973 {
2974 	return cfg->tx_flow_start_queue_offset;
2975 }
2976 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
2977 
2978 void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
2979 				      bool val)
2980 {
2981 	cfg->is_rx_flow_tag_enabled = val;
2982 }
2983 
2984 uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg)
2985 {
2986 	return cfg->rx_toeplitz_hash_key;
2987 }
2988 
2989 uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg)
2990 {
2991 	return cfg->rx_flow_max_search;
2992 }
2993 
2994 bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
2995 {
2996 	return cfg->is_rx_flow_tag_enabled;
2997 }
2998 
2999 qdf_export_symbol(wlan_cfg_is_rx_flow_tag_enabled);
3000 
3001 #ifdef WLAN_SUPPORT_RX_FISA
3002 bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3003 {
3004 	return (bool)(cfg->is_rx_fisa_enabled);
3005 }
3006 #else
3007 bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3008 {
3009 	return false;
3010 }
3011 #endif
3012 
3013 bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3014 {
3015 	return (bool)(cfg->is_poll_mode_enabled);
3016 }
3017 
3018 void
3019 wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg,
3020 					   bool val)
3021 {
3022 	cfg->is_rx_flow_search_table_per_pdev = val;
3023 }
3024 
3025 bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg)
3026 {
3027 	return cfg->is_rx_flow_search_table_per_pdev;
3028 }
3029 
3030 void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg,
3031 					    uint16_t val)
3032 {
3033 	cfg->rx_flow_search_table_size = val;
3034 }
3035 
3036 uint16_t
3037 wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3038 {
3039 	return  cfg->rx_flow_search_table_size;
3040 }
3041 
3042 void
3043 wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg,
3044 					      bool val)
3045 {
3046 	cfg->is_rx_mon_protocol_flow_tag_enabled = val;
3047 }
3048 
3049 bool
3050 wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3051 {
3052 	return cfg->is_rx_mon_protocol_flow_tag_enabled;
3053 }
3054 
3055 qdf_export_symbol(wlan_cfg_is_rx_mon_protocol_flow_tag_enabled);
3056 
3057 void
3058 wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg,
3059 				      bool val)
3060 {
3061 	cfg->tx_per_pkt_vdev_id_check = val;
3062 }
3063 
3064 bool
3065 wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3066 {
3067 	return cfg->tx_per_pkt_vdev_id_check;
3068 }
3069 
3070 void
3071 wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg,
3072 			    bool val)
3073 {
3074 	cfg->pext_stats_enabled = val;
3075 }
3076 
3077 bool
3078 wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3079 {
3080 	return cfg->pext_stats_enabled;
3081 }
3082 
3083 bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3084 {
3085 	return cfg->fst_in_cmem;
3086 }
3087 
3088 #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
3089 bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3090 {
3091 	return cfg->is_rx_buff_pool_enabled;
3092 }
3093 
3094 bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3095 {
3096 	return cfg->is_rx_refill_buff_pool_enabled;
3097 }
3098 #else
3099 bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3100 {
3101 	return false;
3102 }
3103 
3104 bool wlan_cfg_is_rx_refill_buffer_pool_enabled(
3105 					struct wlan_cfg_dp_soc_ctxt *cfg)
3106 {
3107 	return false;
3108 }
3109 #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */
3110 
3111 #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
3112 bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3113 {
3114 	return (bool)(cfg->is_swlm_enabled);
3115 }
3116 #else
3117 bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3118 {
3119 	return false;
3120 }
3121 #endif
3122 uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
3123 {
3124 	return cfg->radio0_rx_default_reo;
3125 }
3126 
3127 uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
3128 {
3129 	return cfg->radio1_rx_default_reo;
3130 }
3131 
3132 uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg)
3133 {
3134 	return cfg->radio2_rx_default_reo;
3135 }
3136 
3137 void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *cfg)
3138 {
3139 	cfg->rxdma1_enable = true;
3140 }
3141 
3142 void
3143 wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg,
3144 				 bool val)
3145 {
3146 	cfg->delay_mon_replenish = val;
3147 }
3148 
3149 bool
3150 wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg)
3151 {
3152 	return cfg->delay_mon_replenish;
3153 }
3154 
3155 qdf_export_symbol(wlan_cfg_is_delay_mon_replenish);
3156 
3157 void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg)
3158 {
3159 	dp_info("DP CFG SoC ctx: delay_mon_replenish = %d,",
3160 		cfg->delay_mon_replenish);
3161 	dp_info("reo_dst_ring_size = %d, delayed_replenish_entries = %d",
3162 		cfg->reo_dst_ring_size, cfg->delayed_replenish_entries);
3163 }
3164 
3165 #ifdef IPA_OFFLOAD
3166 uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3167 {
3168 	return cfg->ipa_tx_ring_size;
3169 }
3170 
3171 uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3172 {
3173 	return cfg->ipa_tx_comp_ring_size;
3174 }
3175 
3176 #ifdef IPA_WDI3_TX_TWO_PIPES
3177 int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3178 {
3179 	return cfg->ipa_tx_alt_ring_size;
3180 }
3181 
3182 int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3183 {
3184 	return cfg->ipa_tx_alt_comp_ring_size;
3185 }
3186 
3187 #else
3188 int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3189 {
3190 	return cfg->ipa_tx_ring_size;
3191 }
3192 
3193 int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3194 {
3195 	return cfg->ipa_tx_comp_ring_size;
3196 }
3197 #endif
3198 #endif
3199 
3200 #ifdef WLAN_SUPPORT_PPEDS
3201 bool
3202 wlan_cfg_get_dp_soc_is_ppe_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
3203 {
3204 	return cfg->ppe_enable;
3205 }
3206 
3207 int
3208 wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3209 {
3210 	return cfg->reo2ppe_ring;
3211 }
3212 
3213 int
3214 wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3215 {
3216 	return cfg->ppe2tcl_ring;
3217 }
3218 
3219 int
3220 wlan_cfg_get_dp_soc_ppe_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3221 {
3222 	return cfg->ppe_release_ring;
3223 }
3224 #endif
3225 
3226 void
3227 wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
3228 			  struct wlan_dp_prealloc_cfg *cfg)
3229 {
3230 	if (!ctrl_psoc || !cfg)
3231 		return;
3232 
3233 	cfg->num_tx_ring_entries = cfg_get(ctrl_psoc, CFG_DP_TX_RING_SIZE);
3234 	cfg->num_tx_comp_ring_entries = cfg_get(ctrl_psoc,
3235 						CFG_DP_TX_COMPL_RING_SIZE);
3236 	cfg->num_wbm_rel_ring_entries = cfg_get(ctrl_psoc,
3237 						CFG_DP_WBM_RELEASE_RING);
3238 	cfg->num_rxdma_err_dst_ring_entries = cfg_get(ctrl_psoc,
3239 						     CFG_DP_RXDMA_ERR_DST_RING);
3240 	cfg->num_reo_exception_ring_entries = cfg_get(ctrl_psoc,
3241 						     CFG_DP_REO_EXCEPTION_RING);
3242 	cfg->num_tx_desc = cfg_get(ctrl_psoc, CFG_DP_TX_DESC);
3243 	cfg->num_tx_ext_desc = cfg_get(ctrl_psoc, CFG_DP_TX_EXT_DESC);
3244 }
3245 
3246 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
3247 uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg)
3248 {
3249 	return cfg->pkt_capture_mode;
3250 }
3251 #endif
3252 
3253 uint32_t
3254 wlan_cfg_get_dp_soc_rx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3255 {
3256 	return cfg->rx_mon_buf_ring_size;
3257 }
3258 
3259 qdf_export_symbol(wlan_cfg_get_dp_soc_rx_mon_buf_ring_size);
3260 
3261 uint32_t
3262 wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
3263 {
3264 	return cfg->tx_mon_buf_ring_size;
3265 }
3266 
3267 qdf_export_symbol(wlan_cfg_get_dp_soc_tx_mon_buf_ring_size);
3268 
3269 uint8_t
3270 wlan_cfg_get_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg)
3271 {
3272 	return cfg->rx_rel_wbm2sw_ring_id;
3273 }
3274 
3275 void
3276 wlan_cfg_set_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg,
3277 			    uint8_t wbm2sw_ring_id)
3278 {
3279 	cfg->rx_rel_wbm2sw_ring_id = wbm2sw_ring_id;
3280 }
3281 
3282 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
3283 uint8_t
3284 wlan_cfg_mlo_rx_ring_map_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
3285 					uint8_t chip_id)
3286 {
3287 	return cfg->mlo_chip_rx_ring_map[chip_id];
3288 }
3289 
3290 uint8_t
3291 wlan_cfg_mlo_default_rx_ring_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
3292 					    uint8_t chip_id)
3293 {
3294 	return cfg->mlo_chip_default_rx_ring_id[chip_id];
3295 }
3296 
3297 uint8_t
3298 wlan_cfg_mlo_lmac_peer_id_msb_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
3299 					     uint8_t chip_id)
3300 {
3301 	return cfg->lmac_peer_id_msb[chip_id];
3302 }
3303 #endif
3304 
3305 #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
3306 bool
3307 wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg)
3308 {
3309 	return cfg->vdev_stats_hw_offload_config;
3310 }
3311 
3312 int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg)
3313 {
3314 	return cfg->vdev_stats_hw_offload_timer;
3315 }
3316 
3317 void
3318 wlan_cfg_set_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg,
3319 					  bool val)
3320 {
3321 	cfg->vdev_stats_hw_offload_config = val;
3322 }
3323 #else
3324 bool
3325 wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg)
3326 {
3327 	return false;
3328 }
3329 
3330 int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg)
3331 {
3332 	return 0;
3333 }
3334 
3335 void
3336 wlan_cfg_set_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg,
3337 					  bool val)
3338 {}
3339 #endif
3340 
3341 #ifdef CONFIG_SAWF
3342 bool wlan_cfg_get_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg)
3343 {
3344 	return cfg->sawf_enabled;
3345 }
3346 
3347 void wlan_cfg_set_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
3348 {
3349 	cfg->sawf_enabled = val;
3350 }
3351 #else
3352 bool wlan_cfg_get_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg)
3353 {
3354 	return false;
3355 }
3356 
3357 void wlan_cfg_set_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg, bool val)
3358 {
3359 }
3360 #endif
3361 
3362 #ifdef CONFIG_BERYLLIUM
3363 int wlan_cfg_get_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
3364 				      int context)
3365 {
3366 	return cfg->int_host2txmon_ring_mask[context];
3367 }
3368 
3369 qdf_export_symbol(wlan_cfg_get_host2txmon_ring_mask);
3370 
3371 void wlan_cfg_set_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
3372 				       int context, int mask)
3373 {
3374 	cfg->int_host2txmon_ring_mask[context] = mask;
3375 }
3376 #else
3377 int wlan_cfg_get_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
3378 				      int context)
3379 {
3380 	return 0;
3381 }
3382 
3383 void wlan_cfg_set_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
3384 				       int context, int mask)
3385 {
3386 }
3387 #endif
3388 
3389 qdf_export_symbol(wlan_cfg_set_host2txmon_ring_mask);
3390 
3391 void wlan_cfg_set_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg,
3392 				   bool txmon_hw_support)
3393 {
3394 	cfg->txmon_hw_support = txmon_hw_support;
3395 }
3396 
3397 bool wlan_cfg_get_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg)
3398 {
3399 	return cfg->txmon_hw_support;
3400 }
3401 
3402 qdf_export_symbol(wlan_cfg_get_txmon_hw_support);
3403