1 /* 2 * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 #if defined(CONFIG_HL_SUPPORT) 20 #include "wlan_tgt_def_config_hl.h" 21 #else 22 #include "wlan_tgt_def_config.h" 23 #endif 24 25 #include "qdf_trace.h" 26 #include "qdf_mem.h" 27 #include <cdp_txrx_ops.h> 28 #include "wlan_cfg.h" 29 #include "cfg_ucfg_api.h" 30 #include "hal_api.h" 31 #include "dp_types.h" 32 #include <qdf_module.h> 33 34 /* 35 * The max allowed size for tx comp ring is 8191. 36 * This is limited by h/w ring max size. 37 * As this is not a power of 2 it does not work with nss offload so the 38 * nearest available size which is power of 2 is 4096 chosen for nss 39 */ 40 41 #define WLAN_CFG_TX_RING_MASK_0 BIT(0) 42 #define WLAN_CFG_TX_RING_MASK_1 BIT(1) 43 #define WLAN_CFG_TX_RING_MASK_2 BIT(2) 44 #define WLAN_CFG_TX_RING_MASK_3 0 45 #define WLAN_CFG_TX_RING_MASK_4 BIT(4) 46 #define WLAN_CFG_TX_RING_MASK_5 BIT(5) 47 #define WLAN_CFG_TX_RING_MASK_6 BIT(6) 48 #define WLAN_CFG_TX_RING_MASK_7 BIT(7) 49 50 51 #define WLAN_CFG_RX_MON_RING_MASK_0 0x1 52 #define WLAN_CFG_RX_MON_RING_MASK_1 0x2 53 #define WLAN_CFG_RX_MON_RING_MASK_2 0x4 54 #define WLAN_CFG_RX_MON_RING_MASK_3 0x0 55 56 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 0x1 57 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 0x2 58 #define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2 0x4 59 60 #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 0x1 61 #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 0x2 62 #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2 0x4 63 64 #define WLAN_CFG_RX_ERR_RING_MASK_0 0x1 65 #define WLAN_CFG_RX_ERR_RING_MASK_1 0x0 66 #define WLAN_CFG_RX_ERR_RING_MASK_2 0x0 67 #define WLAN_CFG_RX_ERR_RING_MASK_3 0x0 68 69 #define WLAN_CFG_RX_WBM_REL_RING_MASK_0 0x1 70 #define WLAN_CFG_RX_WBM_REL_RING_MASK_1 0x0 71 #define WLAN_CFG_RX_WBM_REL_RING_MASK_2 0x0 72 #define WLAN_CFG_RX_WBM_REL_RING_MASK_3 0x0 73 74 #define WLAN_CFG_REO_STATUS_RING_MASK_0 0x1 75 #define WLAN_CFG_REO_STATUS_RING_MASK_1 0x0 76 #define WLAN_CFG_REO_STATUS_RING_MASK_2 0x0 77 #define WLAN_CFG_REO_STATUS_RING_MASK_3 0x0 78 79 #define WLAN_CFG_RXDMA2HOST_RING_MASK_0 0x1 80 #define WLAN_CFG_RXDMA2HOST_RING_MASK_1 0x2 81 #define WLAN_CFG_RXDMA2HOST_RING_MASK_2 0x4 82 #define WLAN_CFG_RXDMA2HOST_RING_MASK_3 0x0 83 84 #define WLAN_CFG_HOST2RXDMA_RING_MASK_0 0x1 85 #define WLAN_CFG_HOST2RXDMA_RING_MASK_1 0x2 86 #define WLAN_CFG_HOST2RXDMA_RING_MASK_2 0x4 87 #define WLAN_CFG_HOST2RXDMA_RING_MASK_3 0x0 88 89 struct dp_int_mask_assignment { 90 uint8_t tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 91 uint8_t rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 92 uint8_t rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 93 uint8_t host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 94 uint8_t rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 95 uint8_t host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 96 uint8_t rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 97 uint8_t rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 98 uint8_t rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 99 uint8_t reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 100 uint8_t rx_ring_near_full_irq_1_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 101 uint8_t rx_ring_near_full_irq_2_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 102 uint8_t tx_ring_near_full_irq_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 103 }; 104 105 #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1) 106 /* 107 * For BE, there are 18 available MSI interrupts, assigned in the manner 108 * below. 109 * TX(5) + RX(8) + (REO ERR + WBM ERR)(1) + 110 * (REO status + RXDMA[0] + RXDMA[1])(1) + NEAR_Full_RX(2) + NEAR_Full_TX(1) 111 * For IPA_OFFLOAD enabled case, 2 TX/RX rings would be assigned to IPA. 112 */ 113 114 #ifdef CONFIG_BERYLLIUM 115 #ifdef IPA_OFFLOAD 116 static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 117 [0] = WLAN_CFG_TX_RING_MASK_0, [1] = WLAN_CFG_TX_RING_MASK_6, 118 [2] = WLAN_CFG_TX_RING_MASK_7}; 119 #else 120 static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 121 [0] = WLAN_CFG_TX_RING_MASK_0, [1] = WLAN_CFG_TX_RING_MASK_4, 122 [2] = WLAN_CFG_TX_RING_MASK_2, [3] = WLAN_CFG_TX_RING_MASK_6, 123 [4] = WLAN_CFG_TX_RING_MASK_7}; 124 #endif 125 #else 126 static const uint8_t tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 127 WLAN_CFG_TX_RING_MASK_0, 0, 0, 0, 0, 0, 0}; 128 #endif /* CONFIG_BERYLLIUM */ 129 130 #ifdef CONFIG_BERYLLIUM 131 #ifdef IPA_OFFLOAD 132 static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 133 [5] = WLAN_CFG_RX_RING_MASK_0, [6] = WLAN_CFG_RX_RING_MASK_1, 134 [7] = WLAN_CFG_RX_RING_MASK_2, [9] = WLAN_CFG_RX_RING_MASK_4, 135 [10] = WLAN_CFG_RX_RING_MASK_5, [11] = WLAN_CFG_RX_RING_MASK_6}; 136 #else 137 static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 138 [5] = WLAN_CFG_RX_RING_MASK_0, [6] = WLAN_CFG_RX_RING_MASK_1, 139 [7] = WLAN_CFG_RX_RING_MASK_2, [8] = WLAN_CFG_RX_RING_MASK_3, 140 [9] = WLAN_CFG_RX_RING_MASK_4, [10] = WLAN_CFG_RX_RING_MASK_5, 141 [11] = WLAN_CFG_RX_RING_MASK_6, [12] = WLAN_CFG_RX_RING_MASK_7}; 142 #endif /* IPA_OFFLOAD */ 143 #else /* !defined(CONFIG_BERYLLIUM) */ 144 #ifdef IPA_OFFLOAD 145 static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 146 0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1, 147 WLAN_CFG_RX_RING_MASK_2, 0, 0, 0}; 148 #else 149 static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 150 0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1, 151 WLAN_CFG_RX_RING_MASK_2, WLAN_CFG_RX_RING_MASK_3, 0, 0}; 152 #endif 153 #endif /* CONFIG_BERYLLIUM */ 154 155 #ifdef CONFIG_BERYLLIUM 156 static const uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 157 [13] = WLAN_CFG_RXDMA2HOST_RING_MASK_0 | 158 WLAN_CFG_RXDMA2HOST_RING_MASK_1}; 159 #else 160 static const uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 161 0, 0, 0, 0, 0, WLAN_CFG_RXDMA2HOST_RING_MASK_0, 162 WLAN_CFG_RXDMA2HOST_RING_MASK_1}; 163 #endif /* CONFIG_BERYLLIUM */ 164 165 static const uint8_t rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 166 [1] = WLAN_CFG_RX_MON_RING_MASK_0, 167 [2] = WLAN_CFG_RX_MON_RING_MASK_1}; 168 169 static const uint8_t host2rxdma_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0}; 170 171 static const uint8_t host2rxdma_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0}; 172 173 static const uint8_t rxdma2host_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0}; 174 175 #ifdef CONFIG_BERYLLIUM 176 static const uint8_t rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 177 [14] = WLAN_CFG_RX_ERR_RING_MASK_0}; 178 179 static const uint8_t rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 180 [14] = WLAN_CFG_RX_WBM_REL_RING_MASK_0}; 181 182 static const uint8_t reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 183 [13] = WLAN_CFG_REO_STATUS_RING_MASK_0}; 184 #else 185 static const uint8_t rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 186 0, 0, 0, 0, 0, 0, WLAN_CFG_RX_ERR_RING_MASK_0}; 187 static const uint8_t rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 188 0, 0, 0, 0, 0, 0, WLAN_CFG_RX_WBM_REL_RING_MASK_0}; 189 static const uint8_t reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 190 0, 0, 0, 0, 0, 0, WLAN_CFG_REO_STATUS_RING_MASK_0}; 191 #endif 192 193 #ifdef CONFIG_BERYLLIUM 194 #ifdef WLAN_FEATURE_NEAR_FULL_IRQ 195 static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 196 [15] = WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1}; 197 static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 198 [16] = WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1}; 199 static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 200 [17] = WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK}; 201 #else 202 static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 203 0 }; 204 static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 205 0 }; 206 static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 207 0 }; 208 #endif 209 #else 210 static const uint8_t rx_ring_near_full_irq_1_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 211 0 }; 212 static const uint8_t rx_ring_near_full_irq_2_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 213 0 }; 214 static const uint8_t tx_ring_near_full_irq_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { 215 0 }; 216 #endif 217 218 #else 219 /* Integrated configuration + 8 possible MSI configurations */ 220 #define NUM_INTERRUPT_COMBINATIONS 9 221 /* 222 * This structure contains the best possible mask assignment for a given 223 * number of MSIs available in the system. 224 */ 225 static struct dp_int_mask_assignment dp_mask_assignment[NUM_INTERRUPT_COMBINATIONS] = { 226 /* Interrupt assignment for integrated configuration */ 227 { 228 /* tx ring masks */ 229 { WLAN_CFG_TX_RING_MASK_0, 230 WLAN_CFG_TX_RING_MASK_1, 231 WLAN_CFG_TX_RING_MASK_2, 232 WLAN_CFG_TX_RING_MASK_3, 233 0, 0, 0, 0, 0, 0, 0}, 234 /* rx ring masks */ 235 { 0, 0, 0, 0, 0, 0, 0, 236 WLAN_CFG_RX_RING_MASK_0, 237 WLAN_CFG_RX_RING_MASK_1, 238 WLAN_CFG_RX_RING_MASK_2, 239 WLAN_CFG_RX_RING_MASK_3}, 240 /* rx mon ring masks */ 241 { 0, 0, 0, 0, 242 WLAN_CFG_RX_MON_RING_MASK_0, 243 WLAN_CFG_RX_MON_RING_MASK_1, 244 WLAN_CFG_RX_MON_RING_MASK_2, 245 0, 0, 0, 0}, 246 /* host2rxdma ring masks */ 247 { WLAN_CFG_HOST2RXDMA_RING_MASK_0, 248 WLAN_CFG_HOST2RXDMA_RING_MASK_1, 249 WLAN_CFG_HOST2RXDMA_RING_MASK_2, 250 WLAN_CFG_HOST2RXDMA_RING_MASK_3, 251 0, 0, 0, 0, 0, 0, 0}, 252 /* rxdma2host ring masks */ 253 { WLAN_CFG_RXDMA2HOST_RING_MASK_0, 254 WLAN_CFG_RXDMA2HOST_RING_MASK_1, 255 WLAN_CFG_RXDMA2HOST_RING_MASK_2, 256 WLAN_CFG_RXDMA2HOST_RING_MASK_3, 257 0, 0, 0, 0, 0, 0, 0}, 258 /* host2rxdma mon ring masks */ 259 { 0, 0, 0, 0, 260 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0, 261 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1, 262 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2, 263 0, 0, 0, 0}, 264 /* rxdma2host mon ring masks */ 265 { 0, 0, 0, 0, 266 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0, 267 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1, 268 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2, 269 0, 0, 0, 0}, 270 /* rx err ring masks */ 271 { WLAN_CFG_RX_ERR_RING_MASK_0, 272 WLAN_CFG_RX_ERR_RING_MASK_1, 273 WLAN_CFG_RX_ERR_RING_MASK_2, 274 WLAN_CFG_RX_ERR_RING_MASK_3, 275 0, 0, 0, 0, 0, 0, 0}, 276 /* rx wbm rel ring masks */ 277 { WLAN_CFG_RX_WBM_REL_RING_MASK_0, 278 WLAN_CFG_RX_WBM_REL_RING_MASK_1, 279 WLAN_CFG_RX_WBM_REL_RING_MASK_2, 280 WLAN_CFG_RX_WBM_REL_RING_MASK_3, 281 0, 0, 0, 0, 0, 0, 0}, 282 /* reo status ring masks */ 283 { WLAN_CFG_REO_STATUS_RING_MASK_0, 284 WLAN_CFG_REO_STATUS_RING_MASK_1, 285 WLAN_CFG_REO_STATUS_RING_MASK_2, 286 WLAN_CFG_REO_STATUS_RING_MASK_3, 287 0, 0, 0, 0, 0, 0, 0}, 288 }, 289 /* Interrupt assignment for 1 MSI combination */ 290 { 291 /* tx ring masks */ 292 { WLAN_CFG_TX_RING_MASK_0 | 293 WLAN_CFG_TX_RING_MASK_1 | 294 WLAN_CFG_TX_RING_MASK_2 | 295 WLAN_CFG_TX_RING_MASK_3, 296 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 297 /* rx ring masks */ 298 { WLAN_CFG_RX_RING_MASK_0 | 299 WLAN_CFG_RX_RING_MASK_1 | 300 WLAN_CFG_RX_RING_MASK_2 | 301 WLAN_CFG_RX_RING_MASK_3, 302 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 303 /* rx mon ring masks */ 304 { WLAN_CFG_RX_MON_RING_MASK_0 | 305 WLAN_CFG_RX_MON_RING_MASK_1 | 306 WLAN_CFG_RX_MON_RING_MASK_2, 307 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 308 /* host2rxdma ring masks */ 309 { WLAN_CFG_HOST2RXDMA_RING_MASK_0 | 310 WLAN_CFG_HOST2RXDMA_RING_MASK_1 | 311 WLAN_CFG_HOST2RXDMA_RING_MASK_2 | 312 WLAN_CFG_HOST2RXDMA_RING_MASK_3, 313 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 314 /* rxdma2host ring masks */ 315 { WLAN_CFG_RXDMA2HOST_RING_MASK_0 | 316 WLAN_CFG_RXDMA2HOST_RING_MASK_1 | 317 WLAN_CFG_RXDMA2HOST_RING_MASK_2 | 318 WLAN_CFG_RXDMA2HOST_RING_MASK_3, 319 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 320 /* host2rxdma mon ring masks */ 321 { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 | 322 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 | 323 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2, 324 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 325 /* rxdma2host mon ring masks */ 326 { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 | 327 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 | 328 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2, 329 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 330 /* rx err ring masks */ 331 { WLAN_CFG_RX_ERR_RING_MASK_0 | 332 WLAN_CFG_RX_ERR_RING_MASK_1 | 333 WLAN_CFG_RX_ERR_RING_MASK_2 | 334 WLAN_CFG_RX_ERR_RING_MASK_3, 335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 336 /* rx wbm rel ring masks */ 337 { WLAN_CFG_RX_WBM_REL_RING_MASK_0 | 338 WLAN_CFG_RX_WBM_REL_RING_MASK_1 | 339 WLAN_CFG_RX_WBM_REL_RING_MASK_2 | 340 WLAN_CFG_RX_WBM_REL_RING_MASK_3, 341 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 342 /* reo status ring masks */ 343 { WLAN_CFG_REO_STATUS_RING_MASK_0 | 344 WLAN_CFG_REO_STATUS_RING_MASK_1 | 345 WLAN_CFG_REO_STATUS_RING_MASK_2 | 346 WLAN_CFG_REO_STATUS_RING_MASK_3, 347 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 348 }, 349 /* Interrupt assignment for 2 MSI combination */ 350 { 351 /* tx ring masks */ 352 { WLAN_CFG_TX_RING_MASK_0 | 353 WLAN_CFG_TX_RING_MASK_1, 354 WLAN_CFG_TX_RING_MASK_2 | 355 WLAN_CFG_TX_RING_MASK_3, 356 0, 0, 0, 0, 0, 0, 0, 0, 0}, 357 /* rx ring masks */ 358 { WLAN_CFG_RX_RING_MASK_0 | 359 WLAN_CFG_RX_RING_MASK_1, 360 WLAN_CFG_RX_RING_MASK_2 | 361 WLAN_CFG_RX_RING_MASK_3, 362 0, 0, 0, 0, 0, 0, 0, 0, 0}, 363 /* rx mon ring masks */ 364 { WLAN_CFG_RX_MON_RING_MASK_0 | 365 WLAN_CFG_RX_MON_RING_MASK_1, 366 WLAN_CFG_RX_MON_RING_MASK_2, 367 0, 0, 0, 0, 0, 0, 0, 0, 0}, 368 /* host2rxdma ring masks */ 369 { WLAN_CFG_HOST2RXDMA_RING_MASK_0 | 370 WLAN_CFG_HOST2RXDMA_RING_MASK_1, 371 WLAN_CFG_HOST2RXDMA_RING_MASK_2 | 372 WLAN_CFG_HOST2RXDMA_RING_MASK_3, 373 0, 0, 0, 0, 0, 0, 0, 0, 0}, 374 /* rxdma2host ring masks */ 375 { WLAN_CFG_RXDMA2HOST_RING_MASK_0 | 376 WLAN_CFG_RXDMA2HOST_RING_MASK_1, 377 WLAN_CFG_RXDMA2HOST_RING_MASK_2 | 378 WLAN_CFG_RXDMA2HOST_RING_MASK_3, 379 0, 0, 0, 0, 0, 0, 0, 0, 0}, 380 /* host2rxdma mon ring masks */ 381 { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 | 382 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1, 383 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2, 384 0, 0, 0, 0, 0, 0, 0, 0, 0}, 385 /* rxdma2host mon ring masks */ 386 { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 | 387 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1, 388 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2, 389 0, 0, 0, 0, 0, 0, 0, 0, 0}, 390 /* rx err ring masks */ 391 { WLAN_CFG_RX_ERR_RING_MASK_0 | 392 WLAN_CFG_RX_ERR_RING_MASK_1, 393 WLAN_CFG_RX_ERR_RING_MASK_2 | 394 WLAN_CFG_RX_ERR_RING_MASK_3, 395 0, 0, 0, 0, 0, 0, 0, 0, 0}, 396 /* rx wbm rel ring masks */ 397 { WLAN_CFG_RX_WBM_REL_RING_MASK_0 | 398 WLAN_CFG_RX_WBM_REL_RING_MASK_1, 399 WLAN_CFG_RX_WBM_REL_RING_MASK_2 | 400 WLAN_CFG_RX_WBM_REL_RING_MASK_3, 401 0, 0, 0, 0, 0, 0, 0, 0, 0}, 402 /* reo status ring masks */ 403 { WLAN_CFG_REO_STATUS_RING_MASK_0 | 404 WLAN_CFG_REO_STATUS_RING_MASK_1, 405 WLAN_CFG_REO_STATUS_RING_MASK_2 | 406 WLAN_CFG_REO_STATUS_RING_MASK_3, 407 0, 0, 0, 0, 0, 0, 0, 0, 0}, 408 }, 409 /* Interrupt assignment for 3 MSI combination */ 410 { 411 /* tx ring masks */ 412 { WLAN_CFG_TX_RING_MASK_0 | 413 WLAN_CFG_TX_RING_MASK_1, 414 WLAN_CFG_TX_RING_MASK_2 | 415 WLAN_CFG_TX_RING_MASK_3, 416 0, 0, 0, 0, 0, 0, 0, 0, 0}, 417 /* rx ring masks */ 418 { WLAN_CFG_RX_RING_MASK_0 | 419 WLAN_CFG_RX_RING_MASK_1, 420 WLAN_CFG_RX_RING_MASK_2 | 421 WLAN_CFG_RX_RING_MASK_3, 422 0, 0, 0, 0, 0, 0, 0, 0, 0}, 423 /* rx mon ring masks */ 424 { 0, 0, 425 WLAN_CFG_RX_MON_RING_MASK_0 | 426 WLAN_CFG_RX_MON_RING_MASK_1 | 427 WLAN_CFG_RX_MON_RING_MASK_2, 428 0, 0, 0, 0, 0, 0, 0, 0}, 429 /* host2rxdma ring masks */ 430 { 0, 0, 431 WLAN_CFG_HOST2RXDMA_RING_MASK_0 | 432 WLAN_CFG_HOST2RXDMA_RING_MASK_1 | 433 WLAN_CFG_HOST2RXDMA_RING_MASK_2 | 434 WLAN_CFG_HOST2RXDMA_RING_MASK_3, 435 0, 0, 0, 0, 0, 0, 0, 0}, 436 /* rxdma2host ring masks */ 437 { 0, 0, 438 WLAN_CFG_RXDMA2HOST_RING_MASK_0 | 439 WLAN_CFG_RXDMA2HOST_RING_MASK_1 | 440 WLAN_CFG_RXDMA2HOST_RING_MASK_2 | 441 WLAN_CFG_RXDMA2HOST_RING_MASK_3, 442 0, 0, 0, 0, 0, 0, 0, 0}, 443 /* host2rxdma mon ring masks */ 444 { 0, 0, 445 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 | 446 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 | 447 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2, 448 0, 0, 0, 0, 0, 0, 0, 0}, 449 /* rxdma2host mon ring masks */ 450 { 0, 0, 451 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 | 452 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 | 453 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2, 454 0, 0, 0, 0, 0, 0, 0, 0}, 455 /* rx err ring masks */ 456 { 0, 0, 457 WLAN_CFG_RX_ERR_RING_MASK_0 | 458 WLAN_CFG_RX_ERR_RING_MASK_1 | 459 WLAN_CFG_RX_ERR_RING_MASK_2 | 460 WLAN_CFG_RX_ERR_RING_MASK_3, 461 0, 0, 0, 0, 0, 0, 0, 0}, 462 /* rx wbm rel ring masks */ 463 { 0, 0, 464 WLAN_CFG_RX_WBM_REL_RING_MASK_0 | 465 WLAN_CFG_RX_WBM_REL_RING_MASK_1 | 466 WLAN_CFG_RX_WBM_REL_RING_MASK_2 | 467 WLAN_CFG_RX_WBM_REL_RING_MASK_3, 468 0, 0, 0, 0, 0, 0, 0, 0}, 469 /* reo status ring masks */ 470 { 0, 0, 471 WLAN_CFG_REO_STATUS_RING_MASK_0 | 472 WLAN_CFG_REO_STATUS_RING_MASK_1 | 473 WLAN_CFG_REO_STATUS_RING_MASK_2 | 474 WLAN_CFG_REO_STATUS_RING_MASK_3, 475 0, 0, 0, 0, 0, 0, 0, 0}, 476 }, 477 /* Interrupt assignment for 4 MSI combination */ 478 { 479 /* tx ring masks */ 480 { WLAN_CFG_TX_RING_MASK_0, 481 WLAN_CFG_TX_RING_MASK_1, 482 WLAN_CFG_TX_RING_MASK_2, 483 WLAN_CFG_TX_RING_MASK_3, 484 0, 0, 0, 0, 0, 0, 0}, 485 /* rx ring masks */ 486 { WLAN_CFG_RX_RING_MASK_0, 487 WLAN_CFG_RX_RING_MASK_1, 488 WLAN_CFG_RX_RING_MASK_2, 489 WLAN_CFG_RX_RING_MASK_3, 490 0, 0, 0, 0, 0, 0, 0}, 491 /* rx mon ring masks */ 492 { WLAN_CFG_RX_MON_RING_MASK_0, 493 WLAN_CFG_RX_MON_RING_MASK_1, 494 WLAN_CFG_RX_MON_RING_MASK_2, 495 0, 0, 0, 0, 0, 0, 0, 0}, 496 /* host2rxdma ring masks */ 497 { WLAN_CFG_HOST2RXDMA_RING_MASK_0, 498 WLAN_CFG_HOST2RXDMA_RING_MASK_1, 499 WLAN_CFG_HOST2RXDMA_RING_MASK_2, 500 WLAN_CFG_HOST2RXDMA_RING_MASK_3, 501 0, 0, 0, 0, 0, 0, 0}, 502 /* rxdma2host ring masks */ 503 { WLAN_CFG_RXDMA2HOST_RING_MASK_0, 504 WLAN_CFG_RXDMA2HOST_RING_MASK_1, 505 WLAN_CFG_RXDMA2HOST_RING_MASK_2, 506 WLAN_CFG_RXDMA2HOST_RING_MASK_3, 507 0, 0, 0, 0, 0, 0, 0}, 508 /* host2rxdma mon ring masks */ 509 { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0, 510 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1, 511 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2, 512 0, 0, 0, 0, 0, 0, 0, 0}, 513 /* rxdma2host mon ring masks */ 514 { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0, 515 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1, 516 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2, 517 0, 0, 0, 0, 0, 0, 0, 0}, 518 /* rx err ring masks */ 519 { WLAN_CFG_RX_ERR_RING_MASK_0, 520 WLAN_CFG_RX_ERR_RING_MASK_1, 521 WLAN_CFG_RX_ERR_RING_MASK_2, 522 WLAN_CFG_RX_ERR_RING_MASK_3, 523 0, 0, 0, 0, 0, 0, 0}, 524 /* rx wbm rel ring masks */ 525 { WLAN_CFG_RX_WBM_REL_RING_MASK_0, 526 WLAN_CFG_RX_WBM_REL_RING_MASK_1, 527 WLAN_CFG_RX_WBM_REL_RING_MASK_2, 528 WLAN_CFG_RX_WBM_REL_RING_MASK_3, 529 0, 0, 0, 0, 0, 0, 0}, 530 /* reo status ring masks */ 531 { WLAN_CFG_REO_STATUS_RING_MASK_0, 532 WLAN_CFG_REO_STATUS_RING_MASK_1, 533 WLAN_CFG_REO_STATUS_RING_MASK_2, 534 WLAN_CFG_REO_STATUS_RING_MASK_3, 535 0, 0, 0, 0, 0, 0, 0}, 536 }, 537 /* Interrupt assignment for 5 MSI combination */ 538 { 539 /* tx ring masks */ 540 { WLAN_CFG_TX_RING_MASK_0, 541 WLAN_CFG_TX_RING_MASK_1, 542 WLAN_CFG_TX_RING_MASK_2, 543 WLAN_CFG_TX_RING_MASK_3, 544 0, 0, 0, 0, 0, 0, 0}, 545 /* rx ring masks */ 546 { WLAN_CFG_RX_RING_MASK_0, 547 WLAN_CFG_RX_RING_MASK_1, 548 WLAN_CFG_RX_RING_MASK_2, 549 WLAN_CFG_RX_RING_MASK_3, 550 0, 0, 0, 0, 0, 0, 0}, 551 /* rx mon ring masks */ 552 { 0, 0, 0, 0, 553 WLAN_CFG_RX_MON_RING_MASK_0 | 554 WLAN_CFG_RX_MON_RING_MASK_1 | 555 WLAN_CFG_RX_MON_RING_MASK_2, 556 0, 0, 0, 0, 0, 0}, 557 /* host2rxdma ring masks */ 558 { 0, 0, 0, 0, 559 WLAN_CFG_HOST2RXDMA_RING_MASK_0 | 560 WLAN_CFG_HOST2RXDMA_RING_MASK_1 | 561 WLAN_CFG_HOST2RXDMA_RING_MASK_2 | 562 WLAN_CFG_HOST2RXDMA_RING_MASK_3, 563 0, 0, 0, 0, 0, 0}, 564 /* rxdma2host ring masks */ 565 { 0, 0, 0, 0, 566 WLAN_CFG_RXDMA2HOST_RING_MASK_0 | 567 WLAN_CFG_RXDMA2HOST_RING_MASK_1 | 568 WLAN_CFG_RXDMA2HOST_RING_MASK_2 | 569 WLAN_CFG_RXDMA2HOST_RING_MASK_3, 570 0, 0, 0, 0, 0, 0}, 571 /* host2rxdma mon ring masks */ 572 { 0, 0, 0, 0, 573 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 | 574 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 | 575 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2, 576 0, 0, 0, 0, 0, 0}, 577 /* rxdma2host mon ring masks */ 578 { 0, 0, 0, 0, 579 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 | 580 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 | 581 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2, 582 0, 0, 0, 0, 0, 0}, 583 /* rx err ring masks */ 584 { 0, 0, 0, 0, 585 WLAN_CFG_RX_ERR_RING_MASK_0 | 586 WLAN_CFG_RX_ERR_RING_MASK_1 | 587 WLAN_CFG_RX_ERR_RING_MASK_2 | 588 WLAN_CFG_RX_ERR_RING_MASK_3, 589 0, 0, 0, 0, 0, 0}, 590 /* rx wbm rel ring masks */ 591 { 0, 0, 0, 0, 592 WLAN_CFG_RX_WBM_REL_RING_MASK_0 | 593 WLAN_CFG_RX_WBM_REL_RING_MASK_1 | 594 WLAN_CFG_RX_WBM_REL_RING_MASK_2 | 595 WLAN_CFG_RX_WBM_REL_RING_MASK_3, 596 0, 0, 0, 0, 0, 0}, 597 /* reo status ring masks */ 598 { 0, 0, 0, 0, 599 WLAN_CFG_REO_STATUS_RING_MASK_0 | 600 WLAN_CFG_REO_STATUS_RING_MASK_1 | 601 WLAN_CFG_REO_STATUS_RING_MASK_2 | 602 WLAN_CFG_REO_STATUS_RING_MASK_3, 603 0, 0, 0, 0, 0, 0}, 604 }, 605 /* Interrupt assignment for 6 MSI combination */ 606 { 607 /* tx ring masks */ 608 { WLAN_CFG_TX_RING_MASK_0, 609 WLAN_CFG_TX_RING_MASK_1, 610 WLAN_CFG_TX_RING_MASK_2, 611 WLAN_CFG_TX_RING_MASK_3, 612 0, 0, 0, 0, 0, 0, 0}, 613 /* rx ring masks */ 614 { 0, 0, 615 WLAN_CFG_RX_RING_MASK_0, 616 WLAN_CFG_RX_RING_MASK_1, 617 WLAN_CFG_RX_RING_MASK_2, 618 WLAN_CFG_RX_RING_MASK_3, 619 0, 0, 0, 0, 0}, 620 /* rx mon ring masks */ 621 { WLAN_CFG_RX_MON_RING_MASK_0, 622 WLAN_CFG_RX_MON_RING_MASK_1, 623 WLAN_CFG_RX_MON_RING_MASK_2, 624 0, 0, 0, 0, 0, 0, 0, 0}, 625 /* host2rxdma ring masks */ 626 { WLAN_CFG_HOST2RXDMA_RING_MASK_0, 627 WLAN_CFG_HOST2RXDMA_RING_MASK_1, 628 WLAN_CFG_HOST2RXDMA_RING_MASK_2, 629 WLAN_CFG_HOST2RXDMA_RING_MASK_3, 630 0, 0, 0, 0, 0, 0, 0}, 631 /* rxdma2host ring masks */ 632 { WLAN_CFG_RXDMA2HOST_RING_MASK_0, 633 WLAN_CFG_RXDMA2HOST_RING_MASK_1, 634 WLAN_CFG_RXDMA2HOST_RING_MASK_2, 635 WLAN_CFG_RXDMA2HOST_RING_MASK_3, 636 0, 0, 0, 0, 0, 0, 0}, 637 /* host2rxdma mon ring masks */ 638 { WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0, 639 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1, 640 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2, 641 0, 0, 0, 0, 0, 0, 0, 0}, 642 /* rxdma2host mon ring masks */ 643 { WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0, 644 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1, 645 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2, 646 0, 0, 0, 0, 0, 0, 0, 0}, 647 /* rx err ring masks */ 648 { WLAN_CFG_RX_ERR_RING_MASK_0, 649 WLAN_CFG_RX_ERR_RING_MASK_1, 650 WLAN_CFG_RX_ERR_RING_MASK_2, 651 WLAN_CFG_RX_ERR_RING_MASK_3, 652 0, 0, 0, 0, 0, 0, 0}, 653 /* rx wbm rel ring masks */ 654 { WLAN_CFG_RX_WBM_REL_RING_MASK_0, 655 WLAN_CFG_RX_WBM_REL_RING_MASK_1, 656 WLAN_CFG_RX_WBM_REL_RING_MASK_2, 657 WLAN_CFG_RX_WBM_REL_RING_MASK_3, 658 0, 0, 0, 0, 0, 0, 0}, 659 /* reo status ring masks */ 660 { WLAN_CFG_REO_STATUS_RING_MASK_0, 661 WLAN_CFG_REO_STATUS_RING_MASK_1, 662 WLAN_CFG_REO_STATUS_RING_MASK_2, 663 WLAN_CFG_REO_STATUS_RING_MASK_3, 664 0, 0, 0, 0, 0, 0, 0}, 665 }, 666 /* Interrupt assignment for 7 MSI combination */ 667 { 668 /* tx ring masks */ 669 { WLAN_CFG_TX_RING_MASK_0, 670 WLAN_CFG_TX_RING_MASK_1, 671 WLAN_CFG_TX_RING_MASK_2, 672 WLAN_CFG_TX_RING_MASK_3, 673 0, 0, 0, 0, 0, 0, 0}, 674 /* rx ring masks */ 675 { 0, 0, 0, 676 WLAN_CFG_RX_RING_MASK_0, 677 WLAN_CFG_RX_RING_MASK_1, 678 WLAN_CFG_RX_RING_MASK_2, 679 WLAN_CFG_RX_RING_MASK_3, 680 0, 0, 0}, 681 /* rx mon ring masks */ 682 { 0, 0, 0, 683 WLAN_CFG_RX_MON_RING_MASK_0, 684 WLAN_CFG_RX_MON_RING_MASK_1, 685 WLAN_CFG_RX_MON_RING_MASK_2, 686 0, 0, 0, 0, 0}, 687 /* host2rxdma ring masks */ 688 { 0, 0, 0, 689 WLAN_CFG_HOST2RXDMA_RING_MASK_0, 690 WLAN_CFG_HOST2RXDMA_RING_MASK_1, 691 WLAN_CFG_HOST2RXDMA_RING_MASK_2, 692 WLAN_CFG_HOST2RXDMA_RING_MASK_3, 693 0, 0, 0, 0}, 694 /* rxdma2host ring masks */ 695 { 0, 0, 0, 696 WLAN_CFG_RXDMA2HOST_RING_MASK_0, 697 WLAN_CFG_RXDMA2HOST_RING_MASK_1, 698 WLAN_CFG_RXDMA2HOST_RING_MASK_2, 699 WLAN_CFG_RXDMA2HOST_RING_MASK_3, 700 0, 0, 0, 0}, 701 /* host2rxdma mon ring masks */ 702 { 0, 0, 0, 703 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0, 704 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1, 705 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2, 706 0, 0, 0, 0, 0}, 707 /* rxdma2host mon ring masks */ 708 { 0, 0, 0, 709 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0, 710 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1, 711 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2, 712 0, 0, 0, 0, 0}, 713 /* rx err ring masks */ 714 { 0, 0, 0, 715 WLAN_CFG_RX_ERR_RING_MASK_0, 716 WLAN_CFG_RX_ERR_RING_MASK_1, 717 WLAN_CFG_RX_ERR_RING_MASK_2, 718 WLAN_CFG_RX_ERR_RING_MASK_3, 719 0, 0, 0, 0}, 720 /* rx wbm rel ring masks */ 721 { 0, 0, 0, 722 WLAN_CFG_RX_WBM_REL_RING_MASK_0, 723 WLAN_CFG_RX_WBM_REL_RING_MASK_1, 724 WLAN_CFG_RX_WBM_REL_RING_MASK_2, 725 WLAN_CFG_RX_WBM_REL_RING_MASK_3, 726 0, 0, 0, 0}, 727 /* reo status ring masks */ 728 { 0, 0, 0, 729 WLAN_CFG_REO_STATUS_RING_MASK_0, 730 WLAN_CFG_REO_STATUS_RING_MASK_1, 731 WLAN_CFG_REO_STATUS_RING_MASK_2, 732 WLAN_CFG_REO_STATUS_RING_MASK_3, 733 0, 0, 0, 0}, 734 }, 735 /* Interrupt assignment for 8 MSI combination */ 736 { 737 /* tx ring masks */ 738 { WLAN_CFG_TX_RING_MASK_0, 739 WLAN_CFG_TX_RING_MASK_1, 740 WLAN_CFG_TX_RING_MASK_2, 741 WLAN_CFG_TX_RING_MASK_3, 742 0, 0, 0, 0, 0, 0, 0}, 743 /* rx ring masks */ 744 { 0, 0, 0, 0, 745 WLAN_CFG_RX_RING_MASK_0, 746 WLAN_CFG_RX_RING_MASK_1, 747 WLAN_CFG_RX_RING_MASK_2, 748 WLAN_CFG_RX_RING_MASK_3, 749 0, 0, 0}, 750 /* rx mon ring masks */ 751 { 0, 0, 0, 752 WLAN_CFG_RX_MON_RING_MASK_0, 753 WLAN_CFG_RX_MON_RING_MASK_1, 754 WLAN_CFG_RX_MON_RING_MASK_2, 755 0, 0, 0, 0, 0}, 756 /* host2rxdma ring masks */ 757 { 0, 0, 0, 758 WLAN_CFG_HOST2RXDMA_RING_MASK_0, 759 WLAN_CFG_HOST2RXDMA_RING_MASK_1, 760 WLAN_CFG_HOST2RXDMA_RING_MASK_2, 761 WLAN_CFG_HOST2RXDMA_RING_MASK_3, 762 0, 0, 0, 0}, 763 /* rxdma2host ring masks */ 764 { 0, 0, 0, 765 WLAN_CFG_RXDMA2HOST_RING_MASK_0, 766 WLAN_CFG_RXDMA2HOST_RING_MASK_1, 767 WLAN_CFG_RXDMA2HOST_RING_MASK_2, 768 WLAN_CFG_RXDMA2HOST_RING_MASK_3, 769 0, 0, 0, 0}, 770 /* host2rxdma mon ring masks */ 771 { 0, 0, 0, 772 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0, 773 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1, 774 WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2, 775 0, 0, 0, 0, 0}, 776 /* rxdma2host mon ring masks */ 777 { 0, 0, 0, 778 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0, 779 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1, 780 WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2, 781 0, 0, 0, 0, 0}, 782 /* rx err ring masks */ 783 { 0, 0, 0, 784 WLAN_CFG_RX_ERR_RING_MASK_0, 785 WLAN_CFG_RX_ERR_RING_MASK_1, 786 WLAN_CFG_RX_ERR_RING_MASK_2, 787 WLAN_CFG_RX_ERR_RING_MASK_3, 788 0, 0, 0, 0}, 789 /* rx wbm rel ring masks */ 790 { 0, 0, 0, 791 WLAN_CFG_RX_WBM_REL_RING_MASK_0, 792 WLAN_CFG_RX_WBM_REL_RING_MASK_1, 793 WLAN_CFG_RX_WBM_REL_RING_MASK_2, 794 WLAN_CFG_RX_WBM_REL_RING_MASK_3, 795 0, 0, 0, 0}, 796 /* reo status ring masks */ 797 { 0, 0, 0, 798 WLAN_CFG_REO_STATUS_RING_MASK_0, 799 WLAN_CFG_REO_STATUS_RING_MASK_1, 800 WLAN_CFG_REO_STATUS_RING_MASK_2, 801 WLAN_CFG_REO_STATUS_RING_MASK_3, 802 0, 0, 0, 0}, 803 }, 804 }; 805 #endif 806 807 /** 808 * g_wlan_srng_cfg[] - Per ring_type specific configuration 809 * 810 */ 811 struct wlan_srng_cfg g_wlan_srng_cfg[MAX_RING_TYPES]; 812 813 /* REO_DST ring configuration */ 814 struct wlan_srng_cfg wlan_srng_reo_cfg = { 815 .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_REO_RING, 816 .batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_REO_RING, 817 .low_threshold = 0, 818 }; 819 820 /* WBM2SW_RELEASE ring configuration */ 821 struct wlan_srng_cfg wlan_srng_wbm_release_cfg = { 822 .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_WBM_RELEASE_RING, 823 .batch_count_threshold = 0, 824 .low_threshold = 0, 825 }; 826 827 /* RXDMA_BUF ring configuration */ 828 struct wlan_srng_cfg wlan_srng_rxdma_buf_cfg = { 829 .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX, 830 .batch_count_threshold = 0, 831 .low_threshold = WLAN_CFG_RXDMA_REFILL_RING_SIZE >> 3, 832 }; 833 834 /* RXDMA_MONITOR_BUF ring configuration */ 835 struct wlan_srng_cfg wlan_srng_rxdma_monitor_buf_cfg = { 836 .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX, 837 .batch_count_threshold = 0, 838 .low_threshold = WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE >> 3, 839 }; 840 841 /* RXDMA_MONITOR_STATUS ring configuration */ 842 struct wlan_srng_cfg wlan_srng_rxdma_monitor_status_cfg = { 843 .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX, 844 .batch_count_threshold = 0, 845 .low_threshold = WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE >> 3, 846 }; 847 848 /* DEFAULT_CONFIG ring configuration */ 849 struct wlan_srng_cfg wlan_srng_default_cfg = { 850 .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_OTHER, 851 .batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_OTHER, 852 .low_threshold = 0, 853 }; 854 855 void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg) 856 { 857 g_wlan_srng_cfg[REO_DST] = wlan_srng_reo_cfg; 858 g_wlan_srng_cfg[WBM2SW_RELEASE] = wlan_srng_wbm_release_cfg; 859 g_wlan_srng_cfg[REO_EXCEPTION] = wlan_srng_default_cfg; 860 g_wlan_srng_cfg[REO_REINJECT] = wlan_srng_default_cfg; 861 g_wlan_srng_cfg[REO_CMD] = wlan_srng_default_cfg; 862 g_wlan_srng_cfg[REO_STATUS] = wlan_srng_default_cfg; 863 g_wlan_srng_cfg[TCL_DATA] = wlan_srng_default_cfg; 864 g_wlan_srng_cfg[TCL_CMD_CREDIT] = wlan_srng_default_cfg; 865 g_wlan_srng_cfg[TCL_STATUS] = wlan_srng_default_cfg; 866 g_wlan_srng_cfg[WBM_IDLE_LINK] = wlan_srng_default_cfg; 867 g_wlan_srng_cfg[SW2WBM_RELEASE] = wlan_srng_default_cfg; 868 g_wlan_srng_cfg[RXDMA_BUF] = wlan_srng_rxdma_buf_cfg; 869 g_wlan_srng_cfg[RXDMA_DST] = wlan_srng_default_cfg; 870 g_wlan_srng_cfg[RXDMA_MONITOR_BUF] = 871 wlan_srng_rxdma_monitor_buf_cfg; 872 g_wlan_srng_cfg[RXDMA_MONITOR_STATUS] = 873 wlan_srng_rxdma_monitor_status_cfg; 874 g_wlan_srng_cfg[RXDMA_MONITOR_DST] = wlan_srng_default_cfg; 875 g_wlan_srng_cfg[RXDMA_MONITOR_DESC] = wlan_srng_default_cfg; 876 g_wlan_srng_cfg[DIR_BUF_RX_DMA_SRC] = wlan_srng_default_cfg; 877 #ifdef WLAN_FEATURE_CIF_CFR 878 g_wlan_srng_cfg[WIFI_POS_SRC] = wlan_srng_default_cfg; 879 #endif 880 *wlan_cfg = g_wlan_srng_cfg; 881 } 882 883 static const uint8_t rx_fst_toeplitz_key[WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN] = { 884 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, 885 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, 886 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, 887 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, 888 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa 889 }; 890 891 #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1) 892 void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 893 int num_dp_msi, 894 int interrupt_mode, 895 bool is_monitor_mode) 896 { int i = 0; 897 898 for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) { 899 wlan_cfg_ctx->int_tx_ring_mask[i] = tx_ring_mask_msi[i]; 900 wlan_cfg_ctx->int_rx_mon_ring_mask[i] = 901 rx_mon_ring_mask_msi[i]; 902 wlan_cfg_ctx->int_rx_err_ring_mask[i] = 903 rx_err_ring_mask_msi[i]; 904 wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] = 905 rx_wbm_rel_ring_mask_msi[i]; 906 wlan_cfg_ctx->int_reo_status_ring_mask[i] = 907 reo_status_ring_mask_msi[i]; 908 if (is_monitor_mode) { 909 wlan_cfg_ctx->int_rx_ring_mask[i] = 0; 910 wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0; 911 } else { 912 wlan_cfg_ctx->int_rx_ring_mask[i] = 913 rx_ring_mask_msi[i]; 914 wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 915 rxdma2host_ring_mask_msi[i]; 916 } 917 wlan_cfg_ctx->int_host2rxdma_ring_mask[i] = 918 host2rxdma_ring_mask_msi[i]; 919 wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] = 920 host2rxdma_mon_ring_mask_msi[i]; 921 wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] = 922 rxdma2host_mon_ring_mask_msi[i]; 923 wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] = 924 rx_ring_near_full_irq_1_mask_msi[i]; 925 wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] = 926 rx_ring_near_full_irq_2_mask_msi[i]; 927 wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] = 928 tx_ring_near_full_irq_mask_msi[i]; 929 } 930 } 931 932 #else 933 934 void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 935 int num_dp_msi, 936 int interrupt_mode, 937 bool is_monitor_mode) 938 { 939 int i = 0; 940 int interrupt_index = 0; 941 942 if(interrupt_mode == DP_INTR_INTEGRATED) { 943 interrupt_index = 0; 944 } else if (interrupt_mode == DP_INTR_MSI || interrupt_mode == 945 DP_INTR_POLL) { 946 interrupt_index = num_dp_msi; 947 } else { 948 qdf_err("Interrupt mode %d", interrupt_mode); 949 } 950 951 for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) { 952 wlan_cfg_ctx->int_tx_ring_mask[i] = 953 dp_mask_assignment[interrupt_index].tx_ring_mask[i]; 954 wlan_cfg_ctx->int_rx_mon_ring_mask[i] = 955 dp_mask_assignment[interrupt_index].rx_mon_ring_mask[i]; 956 wlan_cfg_ctx->int_rx_err_ring_mask[i] = 957 dp_mask_assignment[interrupt_index].rx_err_ring_mask[i]; 958 wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] = 959 dp_mask_assignment[interrupt_index].rx_wbm_rel_ring_mask[i]; 960 wlan_cfg_ctx->int_reo_status_ring_mask[i] = 961 dp_mask_assignment[interrupt_index].reo_status_ring_mask[i]; 962 if (is_monitor_mode) { 963 wlan_cfg_ctx->int_rx_ring_mask[i] = 0; 964 wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0; 965 } else { 966 wlan_cfg_ctx->int_rx_ring_mask[i] = 967 dp_mask_assignment[interrupt_index].rx_ring_mask[i]; 968 wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 969 dp_mask_assignment[interrupt_index].rxdma2host_ring_mask[i]; 970 } 971 wlan_cfg_ctx->int_host2rxdma_ring_mask[i] = 972 dp_mask_assignment[interrupt_index].host2rxdma_ring_mask[i]; 973 wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] = 974 dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i]; 975 wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] = 976 dp_mask_assignment[interrupt_index].rxdma2host_mon_ring_mask[i]; 977 wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] = 978 dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_1_mask[i]; 979 wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] = 980 dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_2_mask[i]; 981 wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] = 982 dp_mask_assignment[interrupt_index].tx_ring_near_full_irq_mask[i]; 983 } 984 } 985 #endif 986 987 #ifdef IPA_OFFLOAD 988 #ifdef IPA_WDI3_TX_TWO_PIPES 989 /** 990 * wlan_soc_ipa_cfg_attach() - Update ipa tx and tx alt config 991 * in dp soc cfg context 992 * @psoc: Object manager psoc 993 * @wlan_cfg_ctx: dp soc cfg ctx 994 * 995 * Return: None 996 */ 997 static void 998 wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, 999 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) 1000 { 1001 wlan_cfg_ctx->ipa_tx_ring_size = 1002 cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE); 1003 wlan_cfg_ctx->ipa_tx_comp_ring_size = 1004 cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE); 1005 wlan_cfg_ctx->ipa_tx_alt_ring_size = 1006 cfg_get(psoc, CFG_DP_IPA_TX_ALT_RING_SIZE); 1007 wlan_cfg_ctx->ipa_tx_alt_comp_ring_size = 1008 cfg_get(psoc, CFG_DP_IPA_TX_ALT_COMP_RING_SIZE); 1009 } 1010 #else /* !IPA_WDI3_TX_TWO_PIPES */ 1011 /** 1012 * wlan_soc_ipa_cfg_attach() - Update ipa config in dp soc 1013 * cfg context 1014 * @psoc - Object manager psoc 1015 * @wlan_cfg_ctx - dp soc cfg ctx 1016 * 1017 * Return: None 1018 */ 1019 static void 1020 wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, 1021 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) 1022 { 1023 wlan_cfg_ctx->ipa_tx_ring_size = 1024 cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE); 1025 wlan_cfg_ctx->ipa_tx_comp_ring_size = 1026 cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE); 1027 } 1028 #endif /* IPA_WDI3_TX_TWO_PIPES */ 1029 #else /* !IPA_OFFLOAD */ 1030 static inline void 1031 wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, 1032 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) 1033 { 1034 } 1035 #endif 1036 1037 #ifdef DP_HW_COOKIE_CONVERT_EXCEPTION 1038 static void 1039 wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, 1040 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) 1041 { 1042 wlan_cfg_ctx->hw_cc_enabled = 1043 cfg_get(psoc, CFG_DP_HW_CC_ENABLE); 1044 } 1045 #else 1046 static void 1047 wlan_soc_hw_cc_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, 1048 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) 1049 { 1050 wlan_cfg_ctx->hw_cc_enabled = true; 1051 } 1052 #endif 1053 1054 #ifdef WLAN_SUPPORT_PPEDS 1055 /** 1056 * wlan_soc_ppe_cfg_attach() - Update ppe config in dp soc 1057 * cfg context 1058 * @psoc - Object manager psoc 1059 * @wlan_cfg_ctx - dp soc cfg ctx 1060 * 1061 * Return: None 1062 */ 1063 static void 1064 wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, 1065 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) 1066 { 1067 wlan_cfg_ctx->ppe_enable = cfg_get(psoc, CFG_DP_PPE_ENABLE); 1068 wlan_cfg_ctx->reo2ppe_ring = cfg_get(psoc, CFG_DP_REO2PPE_RING); 1069 wlan_cfg_ctx->ppe2tcl_ring = cfg_get(psoc, CFG_DP_PPE2TCL_RING); 1070 wlan_cfg_ctx->ppe_release_ring = cfg_get(psoc, 1071 CFG_DP_PPE_RELEASE_RING); 1072 } 1073 #else 1074 static inline void 1075 wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, 1076 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) 1077 { 1078 } 1079 #endif 1080 1081 /** 1082 * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration 1083 * @psoc - Object manager psoc 1084 * Return: wlan_cfg_ctx - Handle to Configuration context 1085 */ 1086 struct wlan_cfg_dp_soc_ctxt * 1087 wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) 1088 { 1089 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx = 1090 qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt)); 1091 1092 if (!wlan_cfg_ctx) 1093 return NULL; 1094 1095 wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE; 1096 wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS; 1097 wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS); 1098 wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE); 1099 wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING); 1100 wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS); 1101 wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS); 1102 wlan_cfg_ctx->num_nss_reo_dest_rings = 1103 cfg_get(psoc, CFG_DP_NSS_REO_DEST_RINGS); 1104 wlan_cfg_ctx->num_nss_tcl_data_rings = 1105 cfg_get(psoc, CFG_DP_NSS_TCL_DATA_RINGS); 1106 wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING); 1107 wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING); 1108 wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS; 1109 wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc, 1110 CFG_DP_TX_EXT_DESC_POOLS); 1111 wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC); 1112 wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN; 1113 wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC); 1114 wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE); 1115 wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID); 1116 1117 wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE); 1118 wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc, 1119 CFG_DP_TX_COMPL_RING_SIZE); 1120 1121 wlan_cfg_ctx->tx_comp_ring_size_nss = 1122 cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE); 1123 1124 wlan_cfg_ctx->int_batch_threshold_tx = 1125 cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX); 1126 wlan_cfg_ctx->int_timer_threshold_tx = 1127 cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX); 1128 wlan_cfg_ctx->int_batch_threshold_rx = 1129 cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX); 1130 wlan_cfg_ctx->int_timer_threshold_rx = 1131 cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX); 1132 wlan_cfg_ctx->int_batch_threshold_other = 1133 cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER); 1134 wlan_cfg_ctx->int_timer_threshold_other = 1135 cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER); 1136 wlan_cfg_ctx->pktlog_buffer_size = 1137 cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE); 1138 1139 /* This is default mapping and can be overridden by HW config 1140 * received from FW */ 1141 wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 0, 0); 1142 if (MAX_PDEV_CNT > 1) 1143 wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 1, 2); 1144 if (MAX_PDEV_CNT > 2) 1145 wlan_cfg_set_hw_mac_idx(wlan_cfg_ctx, 2, 1); 1146 1147 wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID); 1148 1149 wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH); 1150 wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO); 1151 wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO); 1152 wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG); 1153 wlan_cfg_ctx->gro_enabled = cfg_get(psoc, CFG_DP_GRO); 1154 wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM); 1155 wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM); 1156 wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE); 1157 wlan_cfg_ctx->peer_flow_ctrl_enabled = 1158 cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL); 1159 wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI); 1160 wlan_cfg_ctx->p2p_tcp_udp_checksumoffload = 1161 cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD); 1162 wlan_cfg_ctx->nan_tcp_udp_checksumoffload = 1163 cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD); 1164 wlan_cfg_ctx->tcp_udp_checksumoffload = 1165 cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD); 1166 wlan_cfg_ctx->legacy_mode_checksumoffload_disable = 1167 cfg_get(psoc, CFG_DP_LEGACY_MODE_CSUM_DISABLE); 1168 wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING); 1169 wlan_cfg_ctx->defrag_timeout_check = 1170 cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK); 1171 wlan_cfg_ctx->rx_defrag_min_timeout = 1172 cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT); 1173 1174 wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc, 1175 CFG_DP_WBM_RELEASE_RING); 1176 wlan_cfg_ctx->tcl_cmd_credit_ring = cfg_get(psoc, 1177 CFG_DP_TCL_CMD_CREDIT_RING); 1178 wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc, 1179 CFG_DP_TCL_STATUS_RING); 1180 wlan_cfg_ctx->reo_dst_ring_size = cfg_get(psoc, 1181 CFG_DP_RX_DESTINATION_RING); 1182 wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc, 1183 CFG_DP_REO_REINJECT_RING); 1184 wlan_cfg_ctx->rx_release_ring = cfg_get(psoc, 1185 CFG_DP_RX_RELEASE_RING); 1186 wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc, 1187 CFG_DP_REO_EXCEPTION_RING); 1188 wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc, 1189 CFG_DP_REO_CMD_RING); 1190 wlan_cfg_ctx->reo_status_ring = cfg_get(psoc, 1191 CFG_DP_REO_STATUS_RING); 1192 wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc, 1193 CFG_DP_RXDMA_REFILL_RING); 1194 wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc, 1195 CFG_DP_TX_DESC_LIMIT_0); 1196 wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc, 1197 CFG_DP_TX_DESC_LIMIT_1); 1198 wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc, 1199 CFG_DP_TX_DESC_LIMIT_2); 1200 wlan_cfg_ctx->tx_device_limit = cfg_get(psoc, 1201 CFG_DP_TX_DEVICE_LIMIT); 1202 wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc, 1203 CFG_DP_TX_SW_INTERNODE_QUEUE); 1204 wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc, 1205 CFG_DP_RXDMA_ERR_DST_RING); 1206 wlan_cfg_ctx->enable_data_stall_detection = 1207 cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION); 1208 wlan_cfg_ctx->enable_force_rx_64_ba = 1209 cfg_get(psoc, CFG_FORCE_RX_64_BA); 1210 wlan_cfg_ctx->tx_flow_start_queue_offset = 1211 cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET); 1212 wlan_cfg_ctx->tx_flow_stop_queue_threshold = 1213 cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH); 1214 wlan_cfg_ctx->disable_intra_bss_fwd = 1215 cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION); 1216 wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc, 1217 CFG_DP_RX_SW_DESC_WEIGHT); 1218 wlan_cfg_ctx->rx_sw_desc_num = cfg_get(psoc, 1219 CFG_DP_RX_SW_DESC_NUM); 1220 wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key; 1221 wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH; 1222 wlan_cfg_ctx->is_rx_flow_tag_enabled = 1223 cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE); 1224 wlan_cfg_ctx->is_rx_flow_search_table_per_pdev = 1225 cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV); 1226 wlan_cfg_ctx->rx_flow_search_table_size = 1227 cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE); 1228 wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled = 1229 cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE); 1230 wlan_cfg_ctx->mon_drop_thresh = 1231 cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD); 1232 wlan_cfg_ctx->is_rx_fisa_enabled = cfg_get(psoc, CFG_DP_RX_FISA_ENABLE); 1233 wlan_cfg_ctx->reo_rings_mapping = cfg_get(psoc, CFG_DP_REO_RINGS_MAP); 1234 wlan_cfg_ctx->pext_stats_enabled = cfg_get(psoc, CFG_DP_PEER_EXT_STATS); 1235 wlan_cfg_ctx->is_rx_buff_pool_enabled = 1236 cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE); 1237 wlan_cfg_ctx->is_rx_refill_buff_pool_enabled = 1238 cfg_get(psoc, CFG_DP_RX_REFILL_BUFF_POOL_ENABLE); 1239 wlan_cfg_ctx->rx_pending_high_threshold = 1240 cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD); 1241 wlan_cfg_ctx->rx_pending_low_threshold = 1242 cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD); 1243 wlan_cfg_ctx->is_poll_mode_enabled = 1244 cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE); 1245 wlan_cfg_ctx->is_swlm_enabled = cfg_get(psoc, CFG_DP_SWLM_ENABLE); 1246 wlan_cfg_ctx->fst_in_cmem = cfg_get(psoc, CFG_DP_RX_FST_IN_CMEM); 1247 wlan_cfg_ctx->tx_per_pkt_vdev_id_check = 1248 cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK); 1249 wlan_cfg_ctx->radio0_rx_default_reo = 1250 cfg_get(psoc, CFG_DP_RX_RADIO_0_DEFAULT_REO); 1251 wlan_cfg_ctx->radio1_rx_default_reo = 1252 cfg_get(psoc, CFG_DP_RX_RADIO_1_DEFAULT_REO); 1253 wlan_cfg_ctx->radio2_rx_default_reo = 1254 cfg_get(psoc, CFG_DP_RX_RADIO_2_DEFAULT_REO); 1255 wlan_cfg_ctx->wow_check_rx_pending_enable = 1256 cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING); 1257 wlan_cfg_ctx->delay_mon_replenish = cfg_get(psoc, 1258 CFG_DP_DELAY_MON_REPLENISH); 1259 wlan_soc_ipa_cfg_attach(psoc, wlan_cfg_ctx); 1260 wlan_soc_hw_cc_cfg_attach(psoc, wlan_cfg_ctx); 1261 wlan_soc_ppe_cfg_attach(psoc, wlan_cfg_ctx); 1262 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2 1263 wlan_cfg_ctx->pkt_capture_mode = cfg_get(psoc, CFG_PKT_CAPTURE_MODE) & 1264 PKT_CAPTURE_MODE_DATA_ONLY; 1265 #endif 1266 1267 return wlan_cfg_ctx; 1268 } 1269 1270 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) 1271 { 1272 qdf_mem_free(wlan_cfg_ctx); 1273 } 1274 1275 struct wlan_cfg_dp_pdev_ctxt * 1276 wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc) 1277 { 1278 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx = 1279 qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt)); 1280 1281 if (!wlan_cfg_ctx) 1282 return NULL; 1283 1284 wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc, 1285 CFG_DP_RXDMA_BUF_RING); 1286 wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc, 1287 CFG_DP_RXDMA_MONITOR_BUF_RING); 1288 wlan_cfg_ctx->dma_mon_dest_ring_size = cfg_get(psoc, 1289 CFG_DP_RXDMA_MONITOR_DST_RING); 1290 wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc, 1291 CFG_DP_RXDMA_MONITOR_STATUS_RING); 1292 wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc, 1293 CFG_DP_RXDMA_MONITOR_DESC_RING); 1294 wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV; 1295 1296 return wlan_cfg_ctx; 1297 } 1298 1299 void wlan_cfg_set_mon_delayed_replenish_entries( 1300 struct wlan_cfg_dp_soc_ctxt *cfg, 1301 uint32_t val) 1302 { 1303 cfg->delayed_replenish_entries = val; 1304 } 1305 1306 qdf_export_symbol(wlan_cfg_set_mon_delayed_replenish_entries); 1307 1308 int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt *cfg) 1309 { 1310 return cfg->delayed_replenish_entries; 1311 } 1312 1313 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx) 1314 { 1315 if (wlan_cfg_ctx) 1316 qdf_mem_free(wlan_cfg_ctx); 1317 } 1318 1319 int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg) 1320 { 1321 return cfg->mon_drop_thresh; 1322 } 1323 1324 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num) 1325 { 1326 cfg->num_int_ctxts = num; 1327 } 1328 1329 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val) 1330 { 1331 cfg->max_peer_id = val; 1332 } 1333 1334 void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val) 1335 { 1336 cfg->max_ast_idx = val; 1337 } 1338 1339 int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg) 1340 { 1341 return cfg->max_ast_idx; 1342 } 1343 1344 qdf_export_symbol(wlan_cfg_get_max_ast_idx); 1345 1346 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1347 int context, int mask) 1348 { 1349 cfg->int_tx_ring_mask[context] = mask; 1350 } 1351 1352 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1353 int context, int mask) 1354 { 1355 cfg->int_rx_ring_mask[context] = mask; 1356 } 1357 1358 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1359 int context, int mask) 1360 { 1361 cfg->int_rx_mon_ring_mask[context] = mask; 1362 } 1363 1364 int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1365 int context) 1366 { 1367 return cfg->int_host2rxdma_mon_ring_mask[context]; 1368 } 1369 1370 void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1371 int context, int mask) 1372 { 1373 cfg->int_host2rxdma_mon_ring_mask[context] = mask; 1374 } 1375 1376 int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1377 int context) 1378 { 1379 return cfg->int_rxdma2host_mon_ring_mask[context]; 1380 } 1381 1382 void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1383 int context, int mask) 1384 { 1385 cfg->int_rxdma2host_mon_ring_mask[context] = mask; 1386 } 1387 1388 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1389 int context, int mask) 1390 { 1391 cfg->int_rxdma2host_ring_mask[context] = mask; 1392 } 1393 1394 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1395 int context) 1396 { 1397 return cfg->int_rxdma2host_ring_mask[context]; 1398 } 1399 1400 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1401 int context, int mask) 1402 { 1403 cfg->int_host2rxdma_ring_mask[context] = mask; 1404 } 1405 1406 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1407 int context) 1408 { 1409 return cfg->int_host2rxdma_ring_mask[context]; 1410 } 1411 1412 int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1413 int context) 1414 { 1415 return cfg->int_rx_ring_near_full_irq_1_mask[context]; 1416 } 1417 1418 int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1419 int context) 1420 { 1421 return cfg->int_rx_ring_near_full_irq_2_mask[context]; 1422 } 1423 1424 int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1425 int context) 1426 { 1427 return cfg->int_tx_ring_near_full_irq_mask[context]; 1428 } 1429 1430 void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, 1431 int hw_macid) 1432 { 1433 qdf_assert_always(pdev_idx < MAX_PDEV_CNT); 1434 cfg->hw_macid[pdev_idx] = hw_macid; 1435 } 1436 1437 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx) 1438 { 1439 qdf_assert_always(pdev_idx < MAX_PDEV_CNT); 1440 return cfg->hw_macid[pdev_idx]; 1441 } 1442 1443 qdf_export_symbol(wlan_cfg_get_hw_mac_idx); 1444 1445 int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg, 1446 int hw_macid) 1447 { 1448 int idx; 1449 1450 for (idx = 0; idx < MAX_PDEV_CNT; idx++) { 1451 if (cfg->hw_macid[idx] == hw_macid) 1452 return (idx + 1); 1453 } 1454 qdf_assert_always(idx < MAX_PDEV_CNT); 1455 return WLAN_INVALID_PDEV_ID; 1456 } 1457 1458 void wlan_cfg_set_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, 1459 int hw_macid) 1460 { 1461 qdf_assert_always((pdev_idx < MAX_PDEV_CNT) || 1462 (pdev_idx == INVALID_PDEV_ID)); 1463 qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW); 1464 cfg->hw_macid_pdev_id_map[hw_macid] = pdev_idx; 1465 } 1466 1467 int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid) 1468 { 1469 qdf_assert_always(hw_macid < MAX_NUM_LMAC_HW); 1470 return cfg->hw_macid_pdev_id_map[hw_macid]; 1471 } 1472 1473 qdf_export_symbol(wlan_cfg_get_pdev_idx); 1474 1475 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1476 int context, int mask) 1477 { 1478 cfg->int_ce_ring_mask[context] = mask; 1479 } 1480 1481 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, 1482 int mask) 1483 { 1484 cfg->int_rx_ring_mask[context] = mask; 1485 } 1486 1487 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1488 int context, int mask) 1489 { 1490 return cfg->int_rx_err_ring_mask[context] = mask; 1491 } 1492 1493 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1494 int context, int mask) 1495 { 1496 return cfg->int_rx_wbm_rel_ring_mask[context] = mask; 1497 } 1498 1499 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1500 int context, int mask) 1501 { 1502 return cfg->int_reo_status_ring_mask[context] = mask; 1503 } 1504 1505 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg) 1506 { 1507 return cfg->num_int_ctxts; 1508 } 1509 1510 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) 1511 { 1512 return cfg->int_tx_ring_mask[context]; 1513 } 1514 1515 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) 1516 { 1517 return cfg->int_rx_ring_mask[context]; 1518 } 1519 1520 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1521 int context) 1522 { 1523 return cfg->int_rx_err_ring_mask[context]; 1524 } 1525 1526 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1527 int context) 1528 { 1529 return cfg->int_rx_wbm_rel_ring_mask[context]; 1530 } 1531 1532 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 1533 int context) 1534 { 1535 return cfg->int_reo_status_ring_mask[context]; 1536 } 1537 1538 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) 1539 { 1540 return cfg->int_rx_mon_ring_mask[context]; 1541 } 1542 1543 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) 1544 { 1545 return cfg->int_ce_ring_mask[context]; 1546 } 1547 1548 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg) 1549 { 1550 return cfg->max_clients; 1551 } 1552 1553 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1554 { 1555 return cfg->max_alloc_size; 1556 } 1557 1558 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg) 1559 { 1560 return cfg->per_pdev_tx_ring; 1561 } 1562 1563 uint32_t 1564 wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg) 1565 { 1566 return cfg->rx_pending_high_threshold; 1567 } 1568 1569 uint32_t 1570 wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg) 1571 { 1572 return cfg->rx_pending_low_threshold; 1573 } 1574 1575 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg) 1576 { 1577 return cfg->per_pdev_lmac_ring; 1578 } 1579 1580 qdf_export_symbol(wlan_cfg_per_pdev_lmac_ring); 1581 1582 #if defined(DP_USE_SINGLE_TCL) 1583 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg) 1584 { 1585 return 1; 1586 } 1587 1588 int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg) 1589 { 1590 return 1; 1591 } 1592 1593 #else 1594 1595 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg) 1596 { 1597 return cfg->num_tcl_data_rings; 1598 } 1599 1600 int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg) 1601 { 1602 return cfg->num_nss_tcl_data_rings; 1603 } 1604 1605 #endif 1606 1607 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1608 { 1609 return cfg->tx_ring_size; 1610 } 1611 1612 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1613 { 1614 return cfg->tx_comp_ring_size; 1615 } 1616 1617 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg) 1618 { 1619 return cfg->per_pdev_rx_ring; 1620 } 1621 1622 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg) 1623 { 1624 return cfg->num_reo_dest_rings; 1625 } 1626 1627 int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg) 1628 { 1629 return cfg->num_nss_reo_dest_rings; 1630 } 1631 1632 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg) 1633 { 1634 return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/ 1635 } 1636 1637 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg) 1638 { 1639 return cfg->num_tx_desc_pool; 1640 } 1641 1642 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool) 1643 { 1644 cfg->num_tx_desc_pool = num_pool; 1645 } 1646 1647 int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg) 1648 { 1649 return cfg->num_tx_ext_desc_pool; 1650 } 1651 1652 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool) 1653 { 1654 cfg->num_tx_ext_desc_pool = num_pool; 1655 } 1656 1657 int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1658 { 1659 return cfg->reo_dst_ring_size; 1660 } 1661 1662 void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, 1663 int reo_dst_ring_size) 1664 { 1665 cfg->reo_dst_ring_size = reo_dst_ring_size; 1666 } 1667 1668 void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg, 1669 bool raw_mode_war) 1670 { 1671 cfg->raw_mode_war = raw_mode_war; 1672 } 1673 1674 bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg) 1675 { 1676 return cfg->raw_mode_war; 1677 } 1678 1679 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg) 1680 { 1681 return cfg->num_tx_desc; 1682 } 1683 1684 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc) 1685 { 1686 cfg->num_tx_desc = num_desc; 1687 } 1688 1689 int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg) 1690 { 1691 return cfg->min_tx_desc; 1692 } 1693 1694 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg) 1695 { 1696 return cfg->num_tx_ext_desc; 1697 } 1698 1699 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc) 1700 { 1701 cfg->num_tx_ext_desc = num_ext_desc; 1702 } 1703 1704 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg) 1705 { 1706 /* TODO: This should be calculated based on target capabilities */ 1707 return cfg->max_peer_id; 1708 } 1709 1710 int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) 1711 { 1712 return cfg->dma_mon_buf_ring_size; 1713 } 1714 1715 qdf_export_symbol(wlan_cfg_get_dma_mon_buf_ring_size); 1716 1717 int wlan_cfg_get_dma_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) 1718 { 1719 return cfg->dma_mon_dest_ring_size; 1720 } 1721 1722 qdf_export_symbol(wlan_cfg_get_dma_mon_dest_ring_size); 1723 1724 int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) 1725 { 1726 return cfg->dma_mon_status_ring_size; 1727 } 1728 1729 qdf_export_symbol(wlan_cfg_get_dma_mon_stat_ring_size); 1730 1731 int 1732 wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) 1733 { 1734 return cfg->rxdma_monitor_desc_ring; 1735 } 1736 1737 qdf_export_symbol(wlan_cfg_get_dma_mon_desc_ring_size); 1738 1739 int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) 1740 { 1741 return cfg->rx_dma_buf_ring_size; 1742 } 1743 1744 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg) 1745 { 1746 return cfg->num_mac_rings; 1747 } 1748 1749 qdf_export_symbol(wlan_cfg_get_num_mac_rings); 1750 1751 bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 1752 { 1753 return cfg->gro_enabled; 1754 } 1755 1756 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 1757 { 1758 return cfg->lro_enabled; 1759 } 1760 1761 bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 1762 { 1763 return cfg->ipa_enabled; 1764 } 1765 1766 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val) 1767 { 1768 cfg->rx_hash = val; 1769 } 1770 1771 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 1772 { 1773 return cfg->rx_hash; 1774 } 1775 1776 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg) 1777 { 1778 return cfg->nss_enabled; 1779 } 1780 1781 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled) 1782 { 1783 cfg->nss_enabled = nss_enabled; 1784 } 1785 1786 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg) 1787 { 1788 return cfg->nss_cfg; 1789 } 1790 1791 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg) 1792 { 1793 cfg->nss_cfg = nss_cfg; 1794 if (cfg->nss_cfg) 1795 cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss; 1796 } 1797 1798 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg) 1799 { 1800 return cfg->int_batch_threshold_tx; 1801 } 1802 1803 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg) 1804 { 1805 return cfg->int_timer_threshold_tx; 1806 } 1807 1808 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg) 1809 { 1810 return cfg->int_batch_threshold_rx; 1811 } 1812 1813 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg) 1814 { 1815 return cfg->int_timer_threshold_rx; 1816 } 1817 1818 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg) 1819 { 1820 return cfg->int_batch_threshold_other; 1821 } 1822 1823 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg) 1824 { 1825 return cfg->int_timer_threshold_other; 1826 } 1827 1828 int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg) 1829 { 1830 return cfg->int_timer_threshold_mon; 1831 } 1832 1833 int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg) 1834 { 1835 return cfg->p2p_tcp_udp_checksumoffload; 1836 } 1837 1838 int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg) 1839 { 1840 return cfg->nan_tcp_udp_checksumoffload; 1841 } 1842 1843 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg) 1844 { 1845 return cfg->tcp_udp_checksumoffload; 1846 } 1847 1848 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg) 1849 { 1850 return cfg->rx_defrag_min_timeout; 1851 } 1852 1853 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg) 1854 { 1855 return cfg->defrag_timeout_check; 1856 } 1857 1858 int 1859 wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1860 { 1861 return cfg->wbm_release_ring; 1862 } 1863 1864 int 1865 wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1866 { 1867 return cfg->tcl_cmd_credit_ring; 1868 } 1869 1870 int 1871 wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1872 { 1873 return cfg->tcl_status_ring; 1874 } 1875 1876 int 1877 wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1878 { 1879 return cfg->reo_reinject_ring; 1880 } 1881 1882 int 1883 wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1884 { 1885 return cfg->rx_release_ring; 1886 } 1887 1888 int 1889 wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1890 { 1891 return cfg->reo_exception_ring; 1892 } 1893 1894 int 1895 wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1896 { 1897 return cfg->reo_cmd_ring; 1898 } 1899 1900 int 1901 wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1902 { 1903 return cfg->reo_status_ring; 1904 } 1905 1906 int 1907 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1908 { 1909 return cfg->rxdma_refill_ring; 1910 } 1911 1912 int 1913 wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg) 1914 { 1915 return cfg->tx_desc_limit_0; 1916 } 1917 1918 int 1919 wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg) 1920 { 1921 return cfg->tx_desc_limit_1; 1922 } 1923 1924 int 1925 wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg) 1926 { 1927 return cfg->tx_desc_limit_2; 1928 } 1929 1930 int 1931 wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg) 1932 { 1933 return cfg->tx_device_limit; 1934 } 1935 1936 int 1937 wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg) 1938 { 1939 return cfg->tx_sw_internode_queue; 1940 } 1941 1942 int 1943 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1944 { 1945 return cfg->rxdma_err_dst_ring; 1946 } 1947 1948 int 1949 wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg) 1950 { 1951 return cfg->rx_sw_desc_weight; 1952 } 1953 1954 qdf_export_symbol(wlan_cfg_get_dp_soc_rx_sw_desc_weight); 1955 1956 int 1957 wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg) 1958 { 1959 return cfg->rx_sw_desc_num; 1960 } 1961 1962 uint32_t 1963 wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg) 1964 { 1965 return cfg->reo_rings_mapping; 1966 } 1967 1968 bool 1969 wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg, 1970 enum cdp_capabilities dp_caps) 1971 { 1972 switch (dp_caps) { 1973 case CDP_CFG_DP_TSO: 1974 return cfg->tso_enabled; 1975 case CDP_CFG_DP_LRO: 1976 return cfg->lro_enabled; 1977 case CDP_CFG_DP_SG: 1978 return cfg->sg_enabled; 1979 case CDP_CFG_DP_GRO: 1980 return cfg->gro_enabled; 1981 case CDP_CFG_DP_OL_TX_CSUM: 1982 return cfg->ol_tx_csum_enabled; 1983 case CDP_CFG_DP_OL_RX_CSUM: 1984 return cfg->ol_rx_csum_enabled; 1985 case CDP_CFG_DP_RAWMODE: 1986 return cfg->rawmode_enabled; 1987 case CDP_CFG_DP_PEER_FLOW_CTRL: 1988 return cfg->peer_flow_ctrl_enabled; 1989 default: 1990 return false; 1991 } 1992 } 1993 1994 void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg, 1995 bool val) 1996 { 1997 cfg->is_tso_desc_attach_defer = val; 1998 } 1999 2000 bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg) 2001 { 2002 return cfg->is_tso_desc_attach_defer; 2003 } 2004 2005 #ifdef QCA_LL_TX_FLOW_CONTROL_V2 2006 /** 2007 * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold 2008 * @cfg: config context 2009 * 2010 * Return: stop threshold 2011 */ 2012 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg) 2013 { 2014 return cfg->tx_flow_stop_queue_threshold; 2015 } 2016 2017 /** 2018 * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset 2019 * for TX to resume 2020 * @cfg: config context 2021 * 2022 * Return: stop threshold 2023 */ 2024 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg) 2025 { 2026 return cfg->tx_flow_start_queue_offset; 2027 } 2028 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */ 2029 2030 void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg, 2031 bool val) 2032 { 2033 cfg->is_rx_flow_tag_enabled = val; 2034 } 2035 2036 uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg) 2037 { 2038 return cfg->rx_toeplitz_hash_key; 2039 } 2040 2041 uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg) 2042 { 2043 return cfg->rx_flow_max_search; 2044 } 2045 2046 bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2047 { 2048 return cfg->is_rx_flow_tag_enabled; 2049 } 2050 2051 qdf_export_symbol(wlan_cfg_is_rx_flow_tag_enabled); 2052 2053 #ifdef WLAN_SUPPORT_RX_FISA 2054 bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2055 { 2056 return (bool)(cfg->is_rx_fisa_enabled); 2057 } 2058 #else 2059 bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2060 { 2061 return false; 2062 } 2063 #endif 2064 2065 bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2066 { 2067 return (bool)(cfg->is_poll_mode_enabled); 2068 } 2069 2070 void 2071 wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg, 2072 bool val) 2073 { 2074 cfg->is_rx_flow_search_table_per_pdev = val; 2075 } 2076 2077 bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg) 2078 { 2079 return cfg->is_rx_flow_search_table_per_pdev; 2080 } 2081 2082 void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg, 2083 uint16_t val) 2084 { 2085 cfg->rx_flow_search_table_size = val; 2086 } 2087 2088 uint16_t 2089 wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2090 { 2091 return cfg->rx_flow_search_table_size; 2092 } 2093 2094 void 2095 wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg, 2096 bool val) 2097 { 2098 cfg->is_rx_mon_protocol_flow_tag_enabled = val; 2099 } 2100 2101 bool 2102 wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2103 { 2104 return cfg->is_rx_mon_protocol_flow_tag_enabled; 2105 } 2106 2107 qdf_export_symbol(wlan_cfg_is_rx_mon_protocol_flow_tag_enabled); 2108 2109 void 2110 wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg, 2111 bool val) 2112 { 2113 cfg->tx_per_pkt_vdev_id_check = val; 2114 } 2115 2116 bool 2117 wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2118 { 2119 return cfg->tx_per_pkt_vdev_id_check; 2120 } 2121 2122 void 2123 wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg, 2124 bool val) 2125 { 2126 cfg->pext_stats_enabled = val; 2127 } 2128 2129 bool 2130 wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2131 { 2132 return cfg->pext_stats_enabled; 2133 } 2134 2135 bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2136 { 2137 return cfg->fst_in_cmem; 2138 } 2139 2140 #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL 2141 bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2142 { 2143 return cfg->is_rx_buff_pool_enabled; 2144 } 2145 2146 bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2147 { 2148 return cfg->is_rx_refill_buff_pool_enabled; 2149 } 2150 #else 2151 bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2152 { 2153 return false; 2154 } 2155 2156 bool wlan_cfg_is_rx_refill_buffer_pool_enabled( 2157 struct wlan_cfg_dp_soc_ctxt *cfg) 2158 { 2159 return false; 2160 } 2161 #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */ 2162 2163 #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR 2164 bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2165 { 2166 return (bool)(cfg->is_swlm_enabled); 2167 } 2168 #else 2169 bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2170 { 2171 return false; 2172 } 2173 #endif 2174 uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg) 2175 { 2176 return cfg->radio0_rx_default_reo; 2177 } 2178 2179 uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg) 2180 { 2181 return cfg->radio1_rx_default_reo; 2182 } 2183 2184 uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg) 2185 { 2186 return cfg->radio2_rx_default_reo; 2187 } 2188 2189 void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *cfg) 2190 { 2191 cfg->rxdma1_enable = true; 2192 } 2193 2194 bool wlan_cfg_is_dp_force_rx_64_ba(struct wlan_cfg_dp_soc_ctxt *cfg) 2195 { 2196 return cfg->enable_force_rx_64_ba; 2197 } 2198 2199 void 2200 wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg, 2201 bool val) 2202 { 2203 cfg->delay_mon_replenish = val; 2204 } 2205 2206 bool 2207 wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg) 2208 { 2209 return cfg->delay_mon_replenish; 2210 } 2211 2212 qdf_export_symbol(wlan_cfg_is_delay_mon_replenish); 2213 2214 void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg) 2215 { 2216 dp_info("DP CFG SoC ctx: delay_mon_replenish = %d,", 2217 cfg->delay_mon_replenish); 2218 dp_info("reo_dst_ring_size = %d, delayed_replenish_entries = %d", 2219 cfg->reo_dst_ring_size, cfg->delayed_replenish_entries); 2220 } 2221 2222 #ifdef IPA_OFFLOAD 2223 uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2224 { 2225 return cfg->ipa_tx_ring_size; 2226 } 2227 2228 uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2229 { 2230 return cfg->ipa_tx_comp_ring_size; 2231 } 2232 2233 #ifdef IPA_WDI3_TX_TWO_PIPES 2234 int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2235 { 2236 return cfg->ipa_tx_alt_ring_size; 2237 } 2238 2239 int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2240 { 2241 return cfg->ipa_tx_alt_comp_ring_size; 2242 } 2243 2244 #else 2245 int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2246 { 2247 return cfg->ipa_tx_ring_size; 2248 } 2249 2250 int wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2251 { 2252 return cfg->ipa_tx_comp_ring_size; 2253 } 2254 #endif 2255 #endif 2256 2257 #ifdef WLAN_SUPPORT_PPEDS 2258 bool 2259 wlan_cfg_get_dp_soc_is_ppe_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2260 { 2261 return cfg->ppe_enable; 2262 } 2263 2264 int 2265 wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2266 { 2267 return cfg->reo2ppe_ring; 2268 } 2269 2270 int 2271 wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2272 { 2273 return cfg->ppe2tcl_ring; 2274 } 2275 2276 int 2277 wlan_cfg_get_dp_soc_ppe_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2278 { 2279 return cfg->ppe_release_ring; 2280 } 2281 #endif 2282 2283 void 2284 wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 2285 struct wlan_dp_prealloc_cfg *cfg) 2286 { 2287 if (!ctrl_psoc || !cfg) 2288 return; 2289 2290 cfg->num_tx_ring_entries = cfg_get(ctrl_psoc, CFG_DP_TX_RING_SIZE); 2291 cfg->num_tx_comp_ring_entries = cfg_get(ctrl_psoc, 2292 CFG_DP_TX_COMPL_RING_SIZE); 2293 cfg->num_wbm_rel_ring_entries = cfg_get(ctrl_psoc, 2294 CFG_DP_WBM_RELEASE_RING); 2295 cfg->num_rxdma_err_dst_ring_entries = cfg_get(ctrl_psoc, 2296 CFG_DP_RXDMA_ERR_DST_RING); 2297 cfg->num_reo_exception_ring_entries = cfg_get(ctrl_psoc, 2298 CFG_DP_REO_EXCEPTION_RING); 2299 cfg->num_tx_desc = cfg_get(ctrl_psoc, CFG_DP_TX_DESC); 2300 cfg->num_tx_ext_desc = cfg_get(ctrl_psoc, CFG_DP_TX_EXT_DESC); 2301 } 2302 2303 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2 2304 uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg) 2305 { 2306 return cfg->pkt_capture_mode; 2307 } 2308 #endif 2309