Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 1 | /* |
Tallapragada Kalyan | a702362 | 2018-12-03 19:29:52 +0530 | [diff] [blame] | 2 | * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 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" |
Akshay Kosigi | a4f6e17 | 2018-09-03 21:42:27 +0530 | [diff] [blame] | 27 | #include <cdp_txrx_ops.h> |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 28 | #include "wlan_cfg.h" |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 29 | #include "cfg_ucfg_api.h" |
Venkata Sharath Chandra Manchala | cb6d0c0 | 2019-05-16 17:33:18 -0700 | [diff] [blame] | 30 | #include "hal_api.h" |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 31 | |
| 32 | /* |
| 33 | * FIX THIS - |
| 34 | * For now, all these configuration parameters are hardcoded. |
| 35 | * Many of these should actually be coming from dts file/ini file |
| 36 | */ |
Pamidipati, Vijay | 45b1df2 | 2017-06-21 03:20:25 +0530 | [diff] [blame] | 37 | |
Bharat Kumar M | dd67f45 | 2017-07-17 22:37:56 +0530 | [diff] [blame] | 38 | /* |
| 39 | * The max allowed size for tx comp ring is 8191. |
| 40 | * This is limitted by h/w ring max size. |
| 41 | * As this is not a power of 2 it does not work with nss offload so the |
Jeff Johnson | 23dbde8 | 2018-05-05 23:55:52 -0700 | [diff] [blame] | 42 | * nearest available size which is power of 2 is 4096 chosen for nss |
Bharat Kumar M | dd67f45 | 2017-07-17 22:37:56 +0530 | [diff] [blame] | 43 | */ |
Ravi Joshi | fb39e00 | 2017-02-11 21:18:40 -0800 | [diff] [blame] | 44 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 45 | #define WLAN_CFG_TX_RING_MASK_0 0x1 |
| 46 | #define WLAN_CFG_TX_RING_MASK_1 0x2 |
| 47 | #define WLAN_CFG_TX_RING_MASK_2 0x4 |
| 48 | #define WLAN_CFG_TX_RING_MASK_3 0x0 |
| 49 | |
| 50 | #define WLAN_CFG_RX_RING_MASK_0 0x1 |
| 51 | #define WLAN_CFG_RX_RING_MASK_1 0x2 |
| 52 | #define WLAN_CFG_RX_RING_MASK_2 0x4 |
| 53 | #define WLAN_CFG_RX_RING_MASK_3 0x8 |
| 54 | |
| 55 | #define WLAN_CFG_RX_MON_RING_MASK_0 0x1 |
| 56 | #define WLAN_CFG_RX_MON_RING_MASK_1 0x2 |
| 57 | #define WLAN_CFG_RX_MON_RING_MASK_2 0x4 |
| 58 | #define WLAN_CFG_RX_MON_RING_MASK_3 0x0 |
| 59 | |
Keyur Parekh | 1186521 | 2018-10-12 18:03:12 -0700 | [diff] [blame] | 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_RXDMA2HOST_MON_RING_MASK_0 0x1 |
| 65 | #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 0x2 |
| 66 | #define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2 0x4 |
| 67 | |
Nandha Kishore Easwaran | 82ac62e | 2017-06-20 17:55:07 +0530 | [diff] [blame] | 68 | #define WLAN_CFG_RX_ERR_RING_MASK_0 0x1 |
| 69 | #define WLAN_CFG_RX_ERR_RING_MASK_1 0x0 |
| 70 | #define WLAN_CFG_RX_ERR_RING_MASK_2 0x0 |
| 71 | #define WLAN_CFG_RX_ERR_RING_MASK_3 0x0 |
| 72 | |
| 73 | #define WLAN_CFG_RX_WBM_REL_RING_MASK_0 0x1 |
| 74 | #define WLAN_CFG_RX_WBM_REL_RING_MASK_1 0x0 |
| 75 | #define WLAN_CFG_RX_WBM_REL_RING_MASK_2 0x0 |
| 76 | #define WLAN_CFG_RX_WBM_REL_RING_MASK_3 0x0 |
| 77 | |
| 78 | #define WLAN_CFG_REO_STATUS_RING_MASK_0 0x1 |
| 79 | #define WLAN_CFG_REO_STATUS_RING_MASK_1 0x0 |
| 80 | #define WLAN_CFG_REO_STATUS_RING_MASK_2 0x0 |
| 81 | #define WLAN_CFG_REO_STATUS_RING_MASK_3 0x0 |
| 82 | |
Karunakar Dasineni | 1018547 | 2017-06-19 16:32:06 -0700 | [diff] [blame] | 83 | #define WLAN_CFG_RXDMA2HOST_RING_MASK_0 0x1 |
| 84 | #define WLAN_CFG_RXDMA2HOST_RING_MASK_1 0x2 |
| 85 | #define WLAN_CFG_RXDMA2HOST_RING_MASK_2 0x4 |
| 86 | #define WLAN_CFG_RXDMA2HOST_RING_MASK_3 0x0 |
| 87 | |
Karunakar Dasineni | 87f0c5d | 2017-10-29 21:54:21 -0700 | [diff] [blame] | 88 | #define WLAN_CFG_HOST2RXDMA_RING_MASK_0 0x1 |
| 89 | #define WLAN_CFG_HOST2RXDMA_RING_MASK_1 0x2 |
| 90 | #define WLAN_CFG_HOST2RXDMA_RING_MASK_2 0x4 |
| 91 | #define WLAN_CFG_HOST2RXDMA_RING_MASK_3 0x0 |
| 92 | |
Vevek Venkatesan | 4a6c3e8 | 2019-06-24 14:29:19 +0530 | [diff] [blame] | 93 | #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1) |
Houston Hoffman | 648a918 | 2017-05-21 23:27:50 -0700 | [diff] [blame] | 94 | static const int tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
Venkata Sharath Chandra Manchala | 457bee2 | 2019-04-12 11:38:50 -0700 | [diff] [blame] | 95 | WLAN_CFG_TX_RING_MASK_0, 0, 0, 0, 0, 0, 0}; |
Houston Hoffman | 648a918 | 2017-05-21 23:27:50 -0700 | [diff] [blame] | 96 | |
Pramod Simha | b2ef27b | 2018-09-14 14:43:19 -0700 | [diff] [blame] | 97 | #ifndef IPA_OFFLOAD |
Houston Hoffman | 648a918 | 2017-05-21 23:27:50 -0700 | [diff] [blame] | 98 | static const int rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
Venkata Sharath Chandra Manchala | 457bee2 | 2019-04-12 11:38:50 -0700 | [diff] [blame] | 99 | 0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1, WLAN_CFG_RX_RING_MASK_2, WLAN_CFG_RX_RING_MASK_3, 0, 0}; |
Pramod Simha | b2ef27b | 2018-09-14 14:43:19 -0700 | [diff] [blame] | 100 | #else |
| 101 | static const int rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
Venkata Sharath Chandra Manchala | 457bee2 | 2019-04-12 11:38:50 -0700 | [diff] [blame] | 102 | 0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1, WLAN_CFG_RX_RING_MASK_2, 0, 0, 0}; |
Pramod Simha | b2ef27b | 2018-09-14 14:43:19 -0700 | [diff] [blame] | 103 | #endif |
Houston Hoffman | 648a918 | 2017-05-21 23:27:50 -0700 | [diff] [blame] | 104 | |
| 105 | static const int rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
Venkata Sharath Chandra Manchala | 457bee2 | 2019-04-12 11:38:50 -0700 | [diff] [blame] | 106 | 0, WLAN_CFG_RX_MON_RING_MASK_0, WLAN_CFG_RX_MON_RING_MASK_1, 0, 0, 0, 0}; |
Jinwei Chen | 38c92c6 | 2018-09-17 15:24:43 +0800 | [diff] [blame] | 107 | |
| 108 | static const int host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
Venkata Sharath Chandra Manchala | 457bee2 | 2019-04-12 11:38:50 -0700 | [diff] [blame] | 109 | 0, 0, 0, 0, 0, 0, 0}; |
Venkata Sharath Chandra Manchala | 8747958 | 2018-08-01 12:45:34 -0700 | [diff] [blame] | 110 | |
| 111 | static const int rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
Venkata Sharath Chandra Manchala | 457bee2 | 2019-04-12 11:38:50 -0700 | [diff] [blame] | 112 | 0, 0, 0, 0, 0, WLAN_CFG_RXDMA2HOST_RING_MASK_0, WLAN_CFG_RXDMA2HOST_RING_MASK_1}; |
Keyur Parekh | 1186521 | 2018-10-12 18:03:12 -0700 | [diff] [blame] | 113 | |
| 114 | static const int host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
Venkata Sharath Chandra Manchala | 457bee2 | 2019-04-12 11:38:50 -0700 | [diff] [blame] | 115 | 0, 0, 0, 0, 0, 0, 0}; |
Keyur Parekh | 1186521 | 2018-10-12 18:03:12 -0700 | [diff] [blame] | 116 | |
| 117 | static const int rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
Venkata Sharath Chandra Manchala | 457bee2 | 2019-04-12 11:38:50 -0700 | [diff] [blame] | 118 | 0, 0, 0, 0, 0, 0, 0}; |
| 119 | |
| 120 | static const int rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 121 | 0, 0, 0, 0, 0, 0, WLAN_CFG_RX_ERR_RING_MASK_0}; |
| 122 | |
| 123 | static const int rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 124 | 0, 0, 0, 0, 0, 0, WLAN_CFG_RX_WBM_REL_RING_MASK_0}; |
| 125 | |
| 126 | static const int reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 127 | 0, 0, 0, 0, 0, 0, WLAN_CFG_REO_STATUS_RING_MASK_0}; |
Houston Hoffman | 648a918 | 2017-05-21 23:27:50 -0700 | [diff] [blame] | 128 | #else |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 129 | static const int tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 130 | WLAN_CFG_TX_RING_MASK_0, |
| 131 | WLAN_CFG_TX_RING_MASK_1, |
| 132 | WLAN_CFG_TX_RING_MASK_2, |
| 133 | WLAN_CFG_TX_RING_MASK_3}; |
| 134 | |
| 135 | static const int rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
Pamidipati, Vijay | a59b560 | 2018-11-08 10:09:03 +0530 | [diff] [blame] | 136 | 0, |
| 137 | 0, |
| 138 | 0, |
| 139 | 0, |
| 140 | 0, |
| 141 | 0, |
| 142 | 0, |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 143 | WLAN_CFG_RX_RING_MASK_0, |
| 144 | WLAN_CFG_RX_RING_MASK_1, |
| 145 | WLAN_CFG_RX_RING_MASK_2, |
| 146 | WLAN_CFG_RX_RING_MASK_3}; |
| 147 | |
| 148 | static const int rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
Karunakar Dasineni | 860938e | 2018-03-14 17:28:15 -0700 | [diff] [blame] | 149 | 0, |
| 150 | 0, |
| 151 | 0, |
| 152 | 0, |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 153 | WLAN_CFG_RX_MON_RING_MASK_0, |
| 154 | WLAN_CFG_RX_MON_RING_MASK_1, |
Karunakar Dasineni | 860938e | 2018-03-14 17:28:15 -0700 | [diff] [blame] | 155 | WLAN_CFG_RX_MON_RING_MASK_2}; |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 156 | |
Jinwei Chen | 38c92c6 | 2018-09-17 15:24:43 +0800 | [diff] [blame] | 157 | static const int host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 158 | WLAN_CFG_HOST2RXDMA_RING_MASK_0, |
| 159 | WLAN_CFG_HOST2RXDMA_RING_MASK_1, |
| 160 | WLAN_CFG_HOST2RXDMA_RING_MASK_2, |
| 161 | WLAN_CFG_HOST2RXDMA_RING_MASK_3}; |
Venkata Sharath Chandra Manchala | 8747958 | 2018-08-01 12:45:34 -0700 | [diff] [blame] | 162 | |
| 163 | static const int rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 164 | WLAN_CFG_RXDMA2HOST_RING_MASK_0, |
| 165 | WLAN_CFG_RXDMA2HOST_RING_MASK_1, |
| 166 | WLAN_CFG_RXDMA2HOST_RING_MASK_2, |
| 167 | WLAN_CFG_RXDMA2HOST_RING_MASK_3}; |
Keyur Parekh | 1186521 | 2018-10-12 18:03:12 -0700 | [diff] [blame] | 168 | |
| 169 | static const int host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 170 | 0, |
| 171 | 0, |
| 172 | 0, |
| 173 | 0, |
| 174 | WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0, |
| 175 | WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1, |
| 176 | WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2}; |
| 177 | |
| 178 | static const int rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 179 | 0, |
| 180 | 0, |
| 181 | 0, |
| 182 | 0, |
| 183 | WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0, |
| 184 | WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1, |
| 185 | WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2}; |
Houston Hoffman | 648a918 | 2017-05-21 23:27:50 -0700 | [diff] [blame] | 186 | |
Nandha Kishore Easwaran | 82ac62e | 2017-06-20 17:55:07 +0530 | [diff] [blame] | 187 | static const int rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 188 | WLAN_CFG_RX_ERR_RING_MASK_0, |
| 189 | WLAN_CFG_RX_ERR_RING_MASK_1, |
| 190 | WLAN_CFG_RX_ERR_RING_MASK_2, |
| 191 | WLAN_CFG_RX_ERR_RING_MASK_3}; |
| 192 | |
| 193 | static const int rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 194 | WLAN_CFG_RX_WBM_REL_RING_MASK_0, |
| 195 | WLAN_CFG_RX_WBM_REL_RING_MASK_1, |
| 196 | WLAN_CFG_RX_WBM_REL_RING_MASK_2, |
| 197 | WLAN_CFG_RX_WBM_REL_RING_MASK_3}; |
| 198 | |
| 199 | static const int reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 200 | WLAN_CFG_REO_STATUS_RING_MASK_0, |
| 201 | WLAN_CFG_REO_STATUS_RING_MASK_1, |
| 202 | WLAN_CFG_REO_STATUS_RING_MASK_2, |
| 203 | WLAN_CFG_REO_STATUS_RING_MASK_3}; |
Vevek Venkatesan | 4a6c3e8 | 2019-06-24 14:29:19 +0530 | [diff] [blame] | 204 | #endif /* MAX_PDEV_CNT == 1 */ |
Nandha Kishore Easwaran | 82ac62e | 2017-06-20 17:55:07 +0530 | [diff] [blame] | 205 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 206 | /** |
Venkata Sharath Chandra Manchala | cb6d0c0 | 2019-05-16 17:33:18 -0700 | [diff] [blame] | 207 | * g_wlan_srng_cfg[] - Per ring_type specific configuration |
| 208 | * |
| 209 | */ |
| 210 | struct wlan_srng_cfg g_wlan_srng_cfg[MAX_RING_TYPES]; |
| 211 | |
| 212 | /* REO_DST ring configuration */ |
| 213 | struct wlan_srng_cfg wlan_srng_reo_cfg = { |
| 214 | .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_REO_RING, |
| 215 | .batch_count_threshold = 0, |
| 216 | .low_threshold = 0, |
| 217 | }; |
| 218 | |
| 219 | /* WBM2SW_RELEASE ring configuration */ |
| 220 | struct wlan_srng_cfg wlan_srng_wbm_release_cfg = { |
| 221 | .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_WBM_RELEASE_RING, |
| 222 | .batch_count_threshold = 0, |
| 223 | .low_threshold = 0, |
| 224 | }; |
| 225 | |
| 226 | /* RXDMA_BUF ring configuration */ |
| 227 | struct wlan_srng_cfg wlan_srng_rxdma_buf_cfg = { |
| 228 | .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX, |
| 229 | .batch_count_threshold = 0, |
| 230 | .low_threshold = WLAN_CFG_RXDMA_REFILL_RING_SIZE >> 3, |
| 231 | }; |
| 232 | |
| 233 | /* RXDMA_MONITOR_BUF ring configuration */ |
| 234 | struct wlan_srng_cfg wlan_srng_rxdma_monitor_buf_cfg = { |
| 235 | .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX, |
| 236 | .batch_count_threshold = 0, |
| 237 | .low_threshold = WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE >> 3, |
| 238 | }; |
| 239 | |
| 240 | /* RXDMA_MONITOR_STATUS ring configuration */ |
| 241 | struct wlan_srng_cfg wlan_srng_rxdma_monitor_status_cfg = { |
| 242 | .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_RX, |
| 243 | .batch_count_threshold = 0, |
| 244 | .low_threshold = WLAN_CFG_RXDMA_MONITOR_STATUS_RING_SIZE >> 3, |
| 245 | }; |
| 246 | |
| 247 | /* DEFAULT_CONFIG ring configuration */ |
| 248 | struct wlan_srng_cfg wlan_srng_default_cfg = { |
| 249 | .timer_threshold = WLAN_CFG_INT_TIMER_THRESHOLD_OTHER, |
| 250 | .batch_count_threshold = WLAN_CFG_INT_BATCH_THRESHOLD_OTHER, |
| 251 | .low_threshold = 0, |
| 252 | }; |
| 253 | |
| 254 | void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg) |
| 255 | { |
| 256 | g_wlan_srng_cfg[REO_DST] = wlan_srng_reo_cfg; |
| 257 | g_wlan_srng_cfg[WBM2SW_RELEASE] = wlan_srng_wbm_release_cfg; |
| 258 | g_wlan_srng_cfg[REO_EXCEPTION] = wlan_srng_default_cfg; |
| 259 | g_wlan_srng_cfg[REO_REINJECT] = wlan_srng_default_cfg; |
| 260 | g_wlan_srng_cfg[REO_CMD] = wlan_srng_default_cfg; |
| 261 | g_wlan_srng_cfg[REO_STATUS] = wlan_srng_default_cfg; |
| 262 | g_wlan_srng_cfg[TCL_DATA] = wlan_srng_default_cfg; |
| 263 | g_wlan_srng_cfg[TCL_CMD] = wlan_srng_default_cfg; |
| 264 | g_wlan_srng_cfg[TCL_STATUS] = wlan_srng_default_cfg; |
| 265 | g_wlan_srng_cfg[WBM_IDLE_LINK] = wlan_srng_default_cfg; |
| 266 | g_wlan_srng_cfg[SW2WBM_RELEASE] = wlan_srng_default_cfg; |
| 267 | g_wlan_srng_cfg[RXDMA_BUF] = wlan_srng_rxdma_buf_cfg; |
| 268 | g_wlan_srng_cfg[RXDMA_DST] = wlan_srng_default_cfg; |
| 269 | g_wlan_srng_cfg[RXDMA_MONITOR_BUF] = |
| 270 | wlan_srng_rxdma_monitor_buf_cfg; |
| 271 | g_wlan_srng_cfg[RXDMA_MONITOR_STATUS] = |
| 272 | wlan_srng_rxdma_monitor_status_cfg; |
| 273 | g_wlan_srng_cfg[RXDMA_MONITOR_DST] = wlan_srng_default_cfg; |
| 274 | g_wlan_srng_cfg[RXDMA_MONITOR_DESC] = wlan_srng_default_cfg; |
| 275 | g_wlan_srng_cfg[DIR_BUF_RX_DMA_SRC] = wlan_srng_default_cfg; |
| 276 | #ifdef WLAN_FEATURE_CIF_CFR |
| 277 | g_wlan_srng_cfg[WIFI_POS_SRC] = wlan_srng_default_cfg; |
| 278 | #endif |
| 279 | *wlan_cfg = g_wlan_srng_cfg; |
| 280 | } |
| 281 | |
Sumeet Rao | 76aa8d5 | 2019-06-20 12:23:14 -0700 | [diff] [blame] | 282 | static const uint8_t rx_fst_toeplitz_key[WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN] = { |
| 283 | 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, |
| 284 | 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, |
| 285 | 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, |
| 286 | 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, |
| 287 | 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa |
| 288 | }; |
| 289 | |
Venkata Sharath Chandra Manchala | cb6d0c0 | 2019-05-16 17:33:18 -0700 | [diff] [blame] | 290 | /** |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 291 | * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 292 | * @psoc - Object manager psoc |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 293 | * Return: wlan_cfg_ctx - Handle to Configuration context |
| 294 | */ |
Akshay Kosigi | eec6db9 | 2019-07-02 14:25:54 +0530 | [diff] [blame] | 295 | struct wlan_cfg_dp_soc_ctxt * |
| 296 | wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 297 | { |
| 298 | int i = 0; |
Pamidipati, Vijay | 6b0d2a8 | 2017-06-09 04:46:32 +0530 | [diff] [blame] | 299 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 300 | struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx = |
| 301 | qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt)); |
| 302 | |
Jeff Johnson | 2e42a9e | 2019-03-18 09:53:22 -0700 | [diff] [blame] | 303 | if (!wlan_cfg_ctx) |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 304 | return NULL; |
| 305 | |
Venkata Sharath Chandra Manchala | 8747958 | 2018-08-01 12:45:34 -0700 | [diff] [blame] | 306 | wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE; |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 307 | wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS; |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 308 | wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS); |
| 309 | wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE); |
| 310 | wlan_cfg_ctx->per_pdev_tx_ring = cfg_get(psoc, CFG_DP_PDEV_TX_RING); |
| 311 | wlan_cfg_ctx->num_tcl_data_rings = cfg_get(psoc, CFG_DP_TCL_DATA_RINGS); |
| 312 | wlan_cfg_ctx->per_pdev_rx_ring = cfg_get(psoc, CFG_DP_PDEV_RX_RING); |
| 313 | wlan_cfg_ctx->per_pdev_lmac_ring = cfg_get(psoc, CFG_DP_PDEV_LMAC_RING); |
| 314 | wlan_cfg_ctx->num_reo_dest_rings = cfg_get(psoc, CFG_DP_REO_DEST_RINGS); |
Manjunathappa Prakash | ced7ea6 | 2017-07-02 03:02:15 -0700 | [diff] [blame] | 315 | wlan_cfg_ctx->num_tx_desc_pool = MAX_TXDESC_POOLS; |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 316 | wlan_cfg_ctx->num_tx_ext_desc_pool = cfg_get(psoc, |
| 317 | CFG_DP_TX_EXT_DESC_POOLS); |
| 318 | wlan_cfg_ctx->num_tx_desc = cfg_get(psoc, CFG_DP_TX_DESC); |
Shashikala Prabhu | 550e69c | 2019-03-13 17:41:17 +0530 | [diff] [blame] | 319 | wlan_cfg_ctx->min_tx_desc = WLAN_CFG_NUM_TX_DESC_MIN; |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 320 | wlan_cfg_ctx->num_tx_ext_desc = cfg_get(psoc, CFG_DP_TX_EXT_DESC); |
| 321 | wlan_cfg_ctx->htt_packet_type = cfg_get(psoc, CFG_DP_HTT_PACKET_TYPE); |
| 322 | wlan_cfg_ctx->max_peer_id = cfg_get(psoc, CFG_DP_MAX_PEER_ID); |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 323 | |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 324 | wlan_cfg_ctx->tx_ring_size = cfg_get(psoc, CFG_DP_TX_RING_SIZE); |
| 325 | wlan_cfg_ctx->tx_comp_ring_size = cfg_get(psoc, |
| 326 | CFG_DP_TX_COMPL_RING_SIZE); |
Pamidipati, Vijay | bea353e | 2017-07-05 03:09:20 +0530 | [diff] [blame] | 327 | |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 328 | wlan_cfg_ctx->tx_comp_ring_size_nss = |
| 329 | cfg_get(psoc, CFG_DP_NSS_COMP_RING_SIZE); |
Venkata Sharath Chandra Manchala | cb6d0c0 | 2019-05-16 17:33:18 -0700 | [diff] [blame] | 330 | |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 331 | wlan_cfg_ctx->int_batch_threshold_tx = |
| 332 | cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_TX); |
| 333 | wlan_cfg_ctx->int_timer_threshold_tx = |
| 334 | cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_TX); |
| 335 | wlan_cfg_ctx->int_batch_threshold_rx = |
| 336 | cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_RX); |
| 337 | wlan_cfg_ctx->int_timer_threshold_rx = |
| 338 | cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_RX); |
Pamidipati, Vijay | 45b1df2 | 2017-06-21 03:20:25 +0530 | [diff] [blame] | 339 | wlan_cfg_ctx->int_batch_threshold_other = |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 340 | cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER); |
Pamidipati, Vijay | 45b1df2 | 2017-06-21 03:20:25 +0530 | [diff] [blame] | 341 | wlan_cfg_ctx->int_timer_threshold_other = |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 342 | cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER); |
Pamidipati, Vijay | 45b1df2 | 2017-06-21 03:20:25 +0530 | [diff] [blame] | 343 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 344 | for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) { |
| 345 | wlan_cfg_ctx->int_tx_ring_mask[i] = tx_ring_mask[i]; |
| 346 | wlan_cfg_ctx->int_rx_ring_mask[i] = rx_ring_mask[i]; |
| 347 | wlan_cfg_ctx->int_rx_mon_ring_mask[i] = rx_mon_ring_mask[i]; |
Nandha Kishore Easwaran | 82ac62e | 2017-06-20 17:55:07 +0530 | [diff] [blame] | 348 | wlan_cfg_ctx->int_rx_err_ring_mask[i] = rx_err_ring_mask[i]; |
| 349 | wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] = |
| 350 | rx_wbm_rel_ring_mask[i]; |
| 351 | wlan_cfg_ctx->int_reo_status_ring_mask[i] = |
| 352 | reo_status_ring_mask[i]; |
Karunakar Dasineni | 1018547 | 2017-06-19 16:32:06 -0700 | [diff] [blame] | 353 | wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = |
| 354 | rxdma2host_ring_mask[i]; |
Karunakar Dasineni | 87f0c5d | 2017-10-29 21:54:21 -0700 | [diff] [blame] | 355 | wlan_cfg_ctx->int_host2rxdma_ring_mask[i] = |
| 356 | host2rxdma_ring_mask[i]; |
Keyur Parekh | 1186521 | 2018-10-12 18:03:12 -0700 | [diff] [blame] | 357 | wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] = |
| 358 | host2rxdma_mon_ring_mask[i]; |
| 359 | wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] = |
| 360 | rxdma2host_mon_ring_mask[i]; |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 361 | } |
| 362 | |
Karunakar Dasineni | 1018547 | 2017-06-19 16:32:06 -0700 | [diff] [blame] | 363 | /* This is default mapping and can be overridden by HW config |
| 364 | * received from FW */ |
| 365 | wlan_cfg_set_hw_macid(wlan_cfg_ctx, 0, 1); |
| 366 | if (MAX_PDEV_CNT > 1) |
| 367 | wlan_cfg_set_hw_macid(wlan_cfg_ctx, 1, 3); |
| 368 | if (MAX_PDEV_CNT > 2) |
| 369 | wlan_cfg_set_hw_macid(wlan_cfg_ctx, 2, 2); |
| 370 | |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 371 | wlan_cfg_ctx->base_hw_macid = cfg_get(psoc, CFG_DP_BASE_HW_MAC_ID); |
Karunakar Dasineni | 1018547 | 2017-06-19 16:32:06 -0700 | [diff] [blame] | 372 | |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 373 | wlan_cfg_ctx->rx_hash = cfg_get(psoc, CFG_DP_RX_HASH); |
| 374 | wlan_cfg_ctx->tso_enabled = cfg_get(psoc, CFG_DP_TSO); |
Akshay Kosigi | a4f6e17 | 2018-09-03 21:42:27 +0530 | [diff] [blame] | 375 | wlan_cfg_ctx->lro_enabled = cfg_get(psoc, CFG_DP_LRO); |
| 376 | wlan_cfg_ctx->sg_enabled = cfg_get(psoc, CFG_DP_SG); |
| 377 | wlan_cfg_ctx->gro_enabled = cfg_get(psoc, CFG_DP_GRO); |
| 378 | wlan_cfg_ctx->ol_tx_csum_enabled = cfg_get(psoc, CFG_DP_OL_TX_CSUM); |
| 379 | wlan_cfg_ctx->ol_rx_csum_enabled = cfg_get(psoc, CFG_DP_OL_RX_CSUM); |
| 380 | wlan_cfg_ctx->rawmode_enabled = cfg_get(psoc, CFG_DP_RAWMODE); |
| 381 | wlan_cfg_ctx->peer_flow_ctrl_enabled = |
| 382 | cfg_get(psoc, CFG_DP_PEER_FLOW_CTRL); |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 383 | wlan_cfg_ctx->napi_enabled = cfg_get(psoc, CFG_DP_NAPI); |
| 384 | /*Enable checksum offload by default*/ |
| 385 | wlan_cfg_ctx->tcp_udp_checksumoffload = |
| 386 | cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD); |
Krunal Soni | 03ba0f5 | 2019-02-12 11:44:46 -0800 | [diff] [blame] | 387 | wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING); |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 388 | wlan_cfg_ctx->defrag_timeout_check = |
| 389 | cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK); |
| 390 | wlan_cfg_ctx->rx_defrag_min_timeout = |
| 391 | cfg_get(psoc, CFG_DP_RX_DEFRAG_TIMEOUT); |
| 392 | |
| 393 | wlan_cfg_ctx->wbm_release_ring = cfg_get(psoc, |
| 394 | CFG_DP_WBM_RELEASE_RING); |
| 395 | wlan_cfg_ctx->tcl_cmd_ring = cfg_get(psoc, |
| 396 | CFG_DP_TCL_CMD_RING); |
| 397 | wlan_cfg_ctx->tcl_status_ring = cfg_get(psoc, |
| 398 | CFG_DP_TCL_STATUS_RING); |
| 399 | wlan_cfg_ctx->reo_reinject_ring = cfg_get(psoc, |
| 400 | CFG_DP_REO_REINJECT_RING); |
| 401 | wlan_cfg_ctx->rx_release_ring = cfg_get(psoc, |
| 402 | CFG_DP_RX_RELEASE_RING); |
| 403 | wlan_cfg_ctx->reo_exception_ring = cfg_get(psoc, |
| 404 | CFG_DP_REO_EXCEPTION_RING); |
| 405 | wlan_cfg_ctx->reo_cmd_ring = cfg_get(psoc, |
| 406 | CFG_DP_REO_CMD_RING); |
| 407 | wlan_cfg_ctx->reo_status_ring = cfg_get(psoc, |
| 408 | CFG_DP_REO_STATUS_RING); |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 409 | wlan_cfg_ctx->rxdma_refill_ring = cfg_get(psoc, |
| 410 | CFG_DP_RXDMA_REFILL_RING); |
Prathyusha Guduri | 36ce817 | 2019-07-19 19:43:39 +0530 | [diff] [blame] | 411 | wlan_cfg_ctx->tx_desc_limit_0 = cfg_get(psoc, |
| 412 | CFG_DP_TX_DESC_LIMIT_0); |
| 413 | wlan_cfg_ctx->tx_desc_limit_1 = cfg_get(psoc, |
| 414 | CFG_DP_TX_DESC_LIMIT_1); |
| 415 | wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc, |
| 416 | CFG_DP_TX_DESC_LIMIT_2); |
Prathyusha Guduri | aed67e1 | 2019-07-21 23:55:52 +0530 | [diff] [blame] | 417 | wlan_cfg_ctx->tx_device_limit = cfg_get(psoc, |
| 418 | CFG_DP_TX_DEVICE_LIMIT); |
Prathyusha Guduri | abac9ee | 2019-07-24 23:49:45 +0530 | [diff] [blame] | 419 | wlan_cfg_ctx->tx_sw_internode_queue = cfg_get(psoc, |
| 420 | CFG_DP_TX_SW_INTERNODE_QUEUE); |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 421 | wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc, |
| 422 | CFG_DP_RXDMA_ERR_DST_RING); |
jitiphil | 60ac9aa | 2018-10-05 19:54:04 +0530 | [diff] [blame] | 423 | wlan_cfg_ctx->enable_data_stall_detection = |
| 424 | cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION); |
| 425 | wlan_cfg_ctx->tx_flow_start_queue_offset = |
| 426 | cfg_get(psoc, CFG_DP_TX_FLOW_START_QUEUE_OFFSET); |
| 427 | wlan_cfg_ctx->tx_flow_stop_queue_threshold = |
| 428 | cfg_get(psoc, CFG_DP_TX_FLOW_STOP_QUEUE_TH); |
| 429 | wlan_cfg_ctx->disable_intra_bss_fwd = |
| 430 | cfg_get(psoc, CFG_DP_AP_STA_SECURITY_SEPERATION); |
Mainak Sen | 9550273 | 2019-07-25 00:48:59 +0530 | [diff] [blame] | 431 | wlan_cfg_ctx->rx_sw_desc_weight = cfg_get(psoc, |
| 432 | CFG_DP_RX_SW_DESC_WEIGHT); |
Sumeet Rao | 76aa8d5 | 2019-06-20 12:23:14 -0700 | [diff] [blame] | 433 | wlan_cfg_ctx->rx_toeplitz_hash_key = (uint8_t *)rx_fst_toeplitz_key; |
| 434 | wlan_cfg_ctx->rx_flow_max_search = WLAN_CFG_RX_FST_MAX_SEARCH; |
| 435 | wlan_cfg_ctx->is_rx_flow_tag_enabled = |
| 436 | cfg_get(psoc, CFG_DP_RX_FLOW_TAG_ENABLE); |
| 437 | wlan_cfg_ctx->is_rx_flow_search_table_per_pdev = |
| 438 | cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV); |
| 439 | wlan_cfg_ctx->rx_flow_search_table_size = |
| 440 | cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE); |
| 441 | wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled = |
| 442 | cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE); |
Ruben Columbus | b7a1c57 | 2019-08-12 11:11:29 -0700 | [diff] [blame] | 443 | wlan_cfg_ctx->mon_drop_thresh = |
| 444 | cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD); |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 445 | return wlan_cfg_ctx; |
| 446 | } |
| 447 | |
| 448 | void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) |
| 449 | { |
| 450 | qdf_mem_free(wlan_cfg_ctx); |
| 451 | } |
| 452 | |
Akshay Kosigi | eec6db9 | 2019-07-02 14:25:54 +0530 | [diff] [blame] | 453 | struct wlan_cfg_dp_pdev_ctxt * |
| 454 | wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc) |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 455 | { |
| 456 | struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx = |
| 457 | qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt)); |
| 458 | |
Jeff Johnson | 2e42a9e | 2019-03-18 09:53:22 -0700 | [diff] [blame] | 459 | if (!wlan_cfg_ctx) |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 460 | return NULL; |
| 461 | |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 462 | wlan_cfg_ctx->rx_dma_buf_ring_size = cfg_get(psoc, |
| 463 | CFG_DP_RXDMA_BUF_RING); |
| 464 | wlan_cfg_ctx->dma_mon_buf_ring_size = cfg_get(psoc, |
| 465 | CFG_DP_RXDMA_MONITOR_BUF_RING); |
| 466 | wlan_cfg_ctx->dma_mon_dest_ring_size = cfg_get(psoc, |
| 467 | CFG_DP_RXDMA_MONITOR_DST_RING); |
| 468 | wlan_cfg_ctx->dma_mon_status_ring_size = cfg_get(psoc, |
| 469 | CFG_DP_RXDMA_MONITOR_STATUS_RING); |
| 470 | wlan_cfg_ctx->rxdma_monitor_desc_ring = cfg_get(psoc, |
| 471 | CFG_DP_RXDMA_MONITOR_DESC_RING); |
Dhanashri Atre | d4032ab | 2017-01-17 15:05:41 -0800 | [diff] [blame] | 472 | wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV; |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 473 | |
| 474 | return wlan_cfg_ctx; |
| 475 | } |
| 476 | |
| 477 | void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx) |
| 478 | { |
Varun Reddy Yeturu | 23fbb87 | 2019-05-02 22:37:55 -0700 | [diff] [blame] | 479 | if (wlan_cfg_ctx) |
| 480 | qdf_mem_free(wlan_cfg_ctx); |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 481 | } |
| 482 | |
Ruben Columbus | b7a1c57 | 2019-08-12 11:11:29 -0700 | [diff] [blame] | 483 | int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 484 | { |
| 485 | return cfg->mon_drop_thresh; |
| 486 | } |
| 487 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 488 | void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num) |
| 489 | { |
| 490 | cfg->num_int_ctxts = num; |
| 491 | } |
| 492 | |
Pamidipati, Vijay | 6b0d2a8 | 2017-06-09 04:46:32 +0530 | [diff] [blame] | 493 | void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val) |
| 494 | { |
Tallapragada Kalyan | a702362 | 2018-12-03 19:29:52 +0530 | [diff] [blame] | 495 | cfg->max_peer_id = val; |
| 496 | } |
| 497 | |
| 498 | void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val) |
| 499 | { |
| 500 | cfg->max_ast_idx = val; |
| 501 | } |
| 502 | |
| 503 | int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 504 | { |
| 505 | return cfg->max_ast_idx; |
Pamidipati, Vijay | 6b0d2a8 | 2017-06-09 04:46:32 +0530 | [diff] [blame] | 506 | } |
| 507 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 508 | void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 509 | int context, int mask) |
| 510 | { |
| 511 | cfg->int_tx_ring_mask[context] = mask; |
| 512 | } |
| 513 | |
| 514 | void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
Keyur Parekh | 1186521 | 2018-10-12 18:03:12 -0700 | [diff] [blame] | 515 | int context, int mask) |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 516 | { |
| 517 | cfg->int_rx_ring_mask[context] = mask; |
| 518 | } |
| 519 | |
| 520 | void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 521 | int context, int mask) |
| 522 | { |
| 523 | cfg->int_rx_mon_ring_mask[context] = mask; |
| 524 | } |
| 525 | |
Keyur Parekh | 1186521 | 2018-10-12 18:03:12 -0700 | [diff] [blame] | 526 | int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 527 | int context) |
| 528 | { |
| 529 | return cfg->int_host2rxdma_mon_ring_mask[context]; |
| 530 | } |
| 531 | |
| 532 | void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 533 | int context, int mask) |
| 534 | { |
| 535 | cfg->int_host2rxdma_mon_ring_mask[context] = mask; |
| 536 | } |
| 537 | |
| 538 | int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 539 | int context) |
| 540 | { |
| 541 | return cfg->int_rxdma2host_mon_ring_mask[context]; |
| 542 | } |
| 543 | |
| 544 | void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 545 | int context, int mask) |
| 546 | { |
| 547 | cfg->int_rxdma2host_mon_ring_mask[context] = mask; |
| 548 | } |
| 549 | |
Karunakar Dasineni | 1018547 | 2017-06-19 16:32:06 -0700 | [diff] [blame] | 550 | void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 551 | int context, int mask) |
| 552 | { |
| 553 | cfg->int_rxdma2host_ring_mask[context] = mask; |
| 554 | } |
| 555 | |
| 556 | int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 557 | int context) |
| 558 | { |
| 559 | return cfg->int_rxdma2host_ring_mask[context]; |
| 560 | } |
| 561 | |
Karunakar Dasineni | 87f0c5d | 2017-10-29 21:54:21 -0700 | [diff] [blame] | 562 | void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 563 | int context, int mask) |
| 564 | { |
| 565 | cfg->int_host2rxdma_ring_mask[context] = mask; |
| 566 | } |
| 567 | |
| 568 | int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 569 | int context) |
| 570 | { |
| 571 | return cfg->int_host2rxdma_ring_mask[context]; |
| 572 | } |
| 573 | |
Karunakar Dasineni | 1018547 | 2017-06-19 16:32:06 -0700 | [diff] [blame] | 574 | void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, |
| 575 | int hw_macid) |
| 576 | { |
| 577 | qdf_assert_always(pdev_idx < MAX_PDEV_CNT); |
| 578 | cfg->hw_macid[pdev_idx] = hw_macid; |
| 579 | } |
| 580 | |
| 581 | int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx) |
| 582 | { |
| 583 | qdf_assert_always(pdev_idx < MAX_PDEV_CNT); |
| 584 | return cfg->hw_macid[pdev_idx]; |
| 585 | } |
| 586 | |
| 587 | int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx) |
| 588 | { |
| 589 | qdf_assert_always(pdev_idx < MAX_PDEV_CNT); |
| 590 | return cfg->hw_macid[pdev_idx] - cfg->base_hw_macid; |
| 591 | } |
| 592 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 593 | void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 594 | int context, int mask) |
| 595 | { |
| 596 | cfg->int_ce_ring_mask[context] = mask; |
| 597 | } |
| 598 | |
| 599 | void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, |
| 600 | int mask) |
| 601 | { |
| 602 | cfg->int_rx_ring_mask[context] = mask; |
| 603 | } |
| 604 | |
Nandha Kishore Easwaran | 82ac62e | 2017-06-20 17:55:07 +0530 | [diff] [blame] | 605 | int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 606 | int context, int mask) |
| 607 | { |
| 608 | return cfg->int_rx_err_ring_mask[context] = mask; |
| 609 | } |
| 610 | |
| 611 | int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 612 | int context, int mask) |
| 613 | { |
| 614 | return cfg->int_rx_wbm_rel_ring_mask[context] = mask; |
| 615 | } |
| 616 | |
| 617 | int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 618 | int context, int mask) |
| 619 | { |
| 620 | return cfg->int_reo_status_ring_mask[context] = mask; |
| 621 | } |
| 622 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 623 | int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 624 | { |
| 625 | return cfg->num_int_ctxts; |
| 626 | } |
| 627 | |
| 628 | int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) |
| 629 | { |
| 630 | return cfg->int_tx_ring_mask[context]; |
| 631 | } |
| 632 | |
| 633 | int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) |
| 634 | { |
| 635 | return cfg->int_rx_ring_mask[context]; |
| 636 | } |
| 637 | |
Nandha Kishore Easwaran | 82ac62e | 2017-06-20 17:55:07 +0530 | [diff] [blame] | 638 | int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 639 | int context) |
| 640 | { |
| 641 | return cfg->int_rx_err_ring_mask[context]; |
| 642 | } |
| 643 | |
| 644 | int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 645 | int context) |
| 646 | { |
| 647 | return cfg->int_rx_wbm_rel_ring_mask[context]; |
| 648 | } |
| 649 | |
| 650 | int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 651 | int context) |
| 652 | { |
| 653 | return cfg->int_reo_status_ring_mask[context]; |
| 654 | } |
| 655 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 656 | int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) |
| 657 | { |
| 658 | return cfg->int_rx_mon_ring_mask[context]; |
| 659 | } |
| 660 | |
| 661 | int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) |
| 662 | { |
| 663 | return cfg->int_ce_ring_mask[context]; |
| 664 | } |
| 665 | |
| 666 | uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 667 | { |
| 668 | return cfg->max_clients; |
| 669 | } |
| 670 | |
| 671 | uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 672 | { |
| 673 | return cfg->max_alloc_size; |
| 674 | } |
| 675 | |
| 676 | int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 677 | { |
| 678 | return cfg->per_pdev_tx_ring; |
| 679 | } |
| 680 | |
Manjunathappa Prakash | e23acaf | 2017-11-10 00:17:24 -0800 | [diff] [blame] | 681 | int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 682 | { |
| 683 | return cfg->per_pdev_lmac_ring; |
| 684 | } |
| 685 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 686 | int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 687 | { |
| 688 | return cfg->num_tcl_data_rings; |
| 689 | } |
| 690 | |
Pamidipati, Vijay | bea353e | 2017-07-05 03:09:20 +0530 | [diff] [blame] | 691 | int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 692 | { |
| 693 | return cfg->tx_ring_size; |
| 694 | } |
| 695 | |
| 696 | int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 697 | { |
| 698 | return cfg->tx_comp_ring_size; |
| 699 | } |
| 700 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 701 | int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 702 | { |
| 703 | return cfg->per_pdev_rx_ring; |
| 704 | } |
| 705 | |
| 706 | int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 707 | { |
| 708 | return cfg->num_reo_dest_rings; |
| 709 | } |
| 710 | |
| 711 | int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 712 | { |
| 713 | return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/ |
| 714 | } |
| 715 | |
| 716 | int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 717 | { |
| 718 | return cfg->num_tx_desc_pool; |
| 719 | } |
| 720 | |
Aniruddha Paul | 9d7dc27 | 2018-02-11 19:40:41 +0530 | [diff] [blame] | 721 | void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool) |
| 722 | { |
| 723 | cfg->num_tx_desc_pool = num_pool; |
| 724 | } |
| 725 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 726 | int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 727 | { |
| 728 | return cfg->num_tx_ext_desc_pool; |
| 729 | } |
| 730 | |
Aniruddha Paul | 9d7dc27 | 2018-02-11 19:40:41 +0530 | [diff] [blame] | 731 | void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool) |
| 732 | { |
| 733 | cfg->num_tx_ext_desc_pool = num_pool; |
| 734 | } |
| 735 | |
Balamurugan Mahalingam | 54d16a9 | 2018-06-25 17:08:08 +0530 | [diff] [blame] | 736 | int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 737 | { |
| 738 | return cfg->reo_dst_ring_size; |
| 739 | } |
| 740 | |
| 741 | void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 742 | int reo_dst_ring_size) |
| 743 | { |
| 744 | cfg->reo_dst_ring_size = reo_dst_ring_size; |
| 745 | } |
| 746 | |
Venkateswara Swamy Bandaru | 6ca4112 | 2018-08-03 16:07:06 +0530 | [diff] [blame] | 747 | void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 748 | bool raw_mode_war) |
| 749 | { |
| 750 | cfg->raw_mode_war = raw_mode_war; |
| 751 | } |
| 752 | |
| 753 | bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 754 | { |
| 755 | return cfg->raw_mode_war; |
| 756 | } |
| 757 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 758 | int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 759 | { |
| 760 | return cfg->num_tx_desc; |
| 761 | } |
| 762 | |
Aniruddha Paul | 9d7dc27 | 2018-02-11 19:40:41 +0530 | [diff] [blame] | 763 | void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc) |
| 764 | { |
| 765 | cfg->num_tx_desc = num_desc; |
| 766 | } |
| 767 | |
Shashikala Prabhu | 550e69c | 2019-03-13 17:41:17 +0530 | [diff] [blame] | 768 | int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 769 | { |
| 770 | return cfg->min_tx_desc; |
| 771 | } |
| 772 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 773 | int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 774 | { |
| 775 | return cfg->num_tx_ext_desc; |
| 776 | } |
| 777 | |
Aniruddha Paul | 9d7dc27 | 2018-02-11 19:40:41 +0530 | [diff] [blame] | 778 | void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc) |
| 779 | { |
| 780 | cfg->num_tx_ext_desc = num_ext_desc; |
| 781 | } |
| 782 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 783 | uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 784 | { |
| 785 | /* TODO: This should be calculated based on target capabilities */ |
| 786 | return cfg->max_peer_id; |
| 787 | } |
| 788 | |
| 789 | int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 790 | { |
| 791 | return cfg->dma_mon_buf_ring_size; |
| 792 | } |
| 793 | |
| 794 | int wlan_cfg_get_dma_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 795 | { |
| 796 | return cfg->dma_mon_dest_ring_size; |
| 797 | } |
| 798 | |
| 799 | int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 800 | { |
| 801 | return cfg->dma_mon_status_ring_size; |
| 802 | } |
| 803 | |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 804 | int |
| 805 | wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 806 | { |
| 807 | return cfg->rxdma_monitor_desc_ring; |
| 808 | } |
| 809 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 810 | int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 811 | { |
| 812 | return cfg->rx_dma_buf_ring_size; |
| 813 | } |
Dhanashri Atre | d4032ab | 2017-01-17 15:05:41 -0800 | [diff] [blame] | 814 | |
| 815 | int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 816 | { |
| 817 | return cfg->num_mac_rings; |
| 818 | } |
Dhanashri Atre | 1404917 | 2016-11-11 18:32:36 -0800 | [diff] [blame] | 819 | |
Mohit Khanna | 16816ae | 2018-10-30 14:12:03 -0700 | [diff] [blame] | 820 | bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 821 | { |
| 822 | return cfg->gro_enabled; |
| 823 | } |
| 824 | |
Dhanashri Atre | 1404917 | 2016-11-11 18:32:36 -0800 | [diff] [blame] | 825 | bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 826 | { |
| 827 | return cfg->lro_enabled; |
| 828 | } |
| 829 | |
Mohit Khanna | 81179cb | 2018-08-16 20:50:43 -0700 | [diff] [blame] | 830 | bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 831 | { |
| 832 | return cfg->ipa_enabled; |
| 833 | } |
| 834 | |
Tallapragada Kalyan | 4c183b8 | 2017-09-13 23:48:14 +0530 | [diff] [blame] | 835 | void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool val) |
| 836 | { |
| 837 | cfg->rx_hash = val; |
| 838 | } |
| 839 | |
Dhanashri Atre | 1404917 | 2016-11-11 18:32:36 -0800 | [diff] [blame] | 840 | bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 841 | { |
| 842 | return cfg->rx_hash; |
| 843 | } |
Bharat Kumar M | 9a5d537 | 2017-05-08 17:41:42 +0530 | [diff] [blame] | 844 | |
| 845 | int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 846 | { |
| 847 | return cfg->nss_enabled; |
| 848 | } |
| 849 | |
| 850 | void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled) |
| 851 | { |
| 852 | cfg->nss_enabled = nss_enabled; |
| 853 | } |
| 854 | |
| 855 | int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 856 | { |
| 857 | return cfg->nss_cfg; |
| 858 | } |
| 859 | |
| 860 | void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg) |
| 861 | { |
| 862 | cfg->nss_cfg = nss_cfg; |
Bharat Kumar M | dd67f45 | 2017-07-17 22:37:56 +0530 | [diff] [blame] | 863 | if (cfg->nss_cfg) |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 864 | cfg->tx_comp_ring_size = cfg->tx_comp_ring_size_nss; |
Bharat Kumar M | 9a5d537 | 2017-05-08 17:41:42 +0530 | [diff] [blame] | 865 | } |
Pamidipati, Vijay | 45b1df2 | 2017-06-21 03:20:25 +0530 | [diff] [blame] | 866 | |
| 867 | int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 868 | { |
| 869 | return cfg->int_batch_threshold_tx; |
| 870 | } |
| 871 | |
| 872 | int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 873 | { |
| 874 | return cfg->int_timer_threshold_tx; |
| 875 | } |
| 876 | |
| 877 | int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 878 | { |
| 879 | return cfg->int_batch_threshold_rx; |
| 880 | } |
| 881 | |
| 882 | int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 883 | { |
| 884 | return cfg->int_timer_threshold_rx; |
| 885 | } |
| 886 | |
| 887 | int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 888 | { |
| 889 | return cfg->int_batch_threshold_other; |
| 890 | } |
| 891 | |
| 892 | int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 893 | { |
| 894 | return cfg->int_timer_threshold_other; |
| 895 | } |
chenguo | 8d0c219 | 2017-12-01 19:35:53 +0800 | [diff] [blame] | 896 | |
Keyur Parekh | 1186521 | 2018-10-12 18:03:12 -0700 | [diff] [blame] | 897 | int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 898 | { |
| 899 | return cfg->int_timer_threshold_mon; |
| 900 | } |
| 901 | |
chenguo | 8d0c219 | 2017-12-01 19:35:53 +0800 | [diff] [blame] | 902 | int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 903 | { |
| 904 | return cfg->tcp_udp_checksumoffload; |
| 905 | } |
psimha | fc2f91b | 2018-01-10 15:30:03 -0800 | [diff] [blame] | 906 | |
| 907 | int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 908 | { |
| 909 | return cfg->rx_defrag_min_timeout; |
| 910 | } |
| 911 | |
| 912 | int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 913 | { |
| 914 | return cfg->defrag_timeout_check; |
| 915 | } |
| 916 | |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 917 | int |
| 918 | wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 919 | { |
| 920 | return cfg->wbm_release_ring; |
| 921 | } |
| 922 | |
| 923 | int |
| 924 | wlan_cfg_get_dp_soc_tcl_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 925 | { |
| 926 | return cfg->tcl_cmd_ring; |
| 927 | } |
| 928 | |
| 929 | int |
| 930 | wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 931 | { |
| 932 | return cfg->tcl_status_ring; |
| 933 | } |
| 934 | |
| 935 | int |
| 936 | wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 937 | { |
| 938 | return cfg->reo_reinject_ring; |
| 939 | } |
| 940 | |
| 941 | int |
| 942 | wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 943 | { |
| 944 | return cfg->rx_release_ring; |
| 945 | } |
| 946 | |
| 947 | int |
| 948 | wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 949 | { |
| 950 | return cfg->reo_exception_ring; |
| 951 | } |
| 952 | |
| 953 | int |
| 954 | wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 955 | { |
| 956 | return cfg->reo_cmd_ring; |
| 957 | } |
| 958 | |
| 959 | int |
| 960 | wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 961 | { |
| 962 | return cfg->reo_status_ring; |
| 963 | } |
| 964 | |
| 965 | int |
| 966 | wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 967 | { |
| 968 | return cfg->rxdma_refill_ring; |
| 969 | } |
| 970 | |
| 971 | int |
Prathyusha Guduri | 36ce817 | 2019-07-19 19:43:39 +0530 | [diff] [blame] | 972 | wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 973 | { |
| 974 | return cfg->tx_desc_limit_0; |
| 975 | } |
| 976 | |
| 977 | int |
| 978 | wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 979 | { |
| 980 | return cfg->tx_desc_limit_1; |
| 981 | } |
| 982 | |
| 983 | int |
| 984 | wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 985 | { |
| 986 | return cfg->tx_desc_limit_2; |
| 987 | } |
| 988 | |
| 989 | int |
Prathyusha Guduri | aed67e1 | 2019-07-21 23:55:52 +0530 | [diff] [blame] | 990 | wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 991 | { |
| 992 | return cfg->tx_device_limit; |
| 993 | } |
| 994 | |
| 995 | int |
Prathyusha Guduri | abac9ee | 2019-07-24 23:49:45 +0530 | [diff] [blame] | 996 | wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 997 | { |
| 998 | return cfg->tx_sw_internode_queue; |
| 999 | } |
| 1000 | |
| 1001 | int |
Vivek | 126db5d | 2018-07-25 22:05:04 +0530 | [diff] [blame] | 1002 | wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 1003 | { |
| 1004 | return cfg->rxdma_err_dst_ring; |
| 1005 | } |
| 1006 | |
Mainak Sen | 9550273 | 2019-07-25 00:48:59 +0530 | [diff] [blame] | 1007 | int |
| 1008 | wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 1009 | { |
| 1010 | return cfg->rx_sw_desc_weight; |
| 1011 | } |
| 1012 | |
Akshay Kosigi | a4f6e17 | 2018-09-03 21:42:27 +0530 | [diff] [blame] | 1013 | bool |
| 1014 | wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 1015 | enum cdp_capabilities dp_caps) |
| 1016 | { |
| 1017 | switch (dp_caps) { |
| 1018 | case CDP_CFG_DP_TSO: |
| 1019 | return cfg->tso_enabled; |
| 1020 | case CDP_CFG_DP_LRO: |
| 1021 | return cfg->lro_enabled; |
| 1022 | case CDP_CFG_DP_SG: |
| 1023 | return cfg->sg_enabled; |
| 1024 | case CDP_CFG_DP_GRO: |
| 1025 | return cfg->gro_enabled; |
| 1026 | case CDP_CFG_DP_OL_TX_CSUM: |
| 1027 | return cfg->ol_tx_csum_enabled; |
| 1028 | case CDP_CFG_DP_OL_RX_CSUM: |
| 1029 | return cfg->ol_rx_csum_enabled; |
| 1030 | case CDP_CFG_DP_RAWMODE: |
| 1031 | return cfg->rawmode_enabled; |
| 1032 | case CDP_CFG_DP_PEER_FLOW_CTRL: |
| 1033 | return cfg->peer_flow_ctrl_enabled; |
| 1034 | default: |
| 1035 | return false; |
| 1036 | } |
| 1037 | } |
| 1038 | |
Manjunathappa Prakash | ced7ea6 | 2017-07-02 03:02:15 -0700 | [diff] [blame] | 1039 | #ifdef QCA_LL_TX_FLOW_CONTROL_V2 |
| 1040 | /** |
| 1041 | * wlan_cfg_get_tx_flow_stop_queue_th() - Get flow control stop threshold |
| 1042 | * @cfg: config context |
| 1043 | * |
| 1044 | * Return: stop threshold |
| 1045 | */ |
| 1046 | int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 1047 | { |
Venkata Sharath Chandra Manchala | 3e8add8 | 2017-07-10 11:59:54 -0700 | [diff] [blame] | 1048 | return cfg->tx_flow_stop_queue_threshold; |
Manjunathappa Prakash | ced7ea6 | 2017-07-02 03:02:15 -0700 | [diff] [blame] | 1049 | } |
| 1050 | |
| 1051 | /** |
| 1052 | * wlan_cfg_get_tx_flow_start_queue_offset() - Get flow control start offset |
| 1053 | * for TX to resume |
| 1054 | * @cfg: config context |
| 1055 | * |
| 1056 | * Return: stop threshold |
| 1057 | */ |
| 1058 | int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 1059 | { |
Manjunathappa Prakash | ced7ea6 | 2017-07-02 03:02:15 -0700 | [diff] [blame] | 1060 | return cfg->tx_flow_start_queue_offset; |
Manjunathappa Prakash | ced7ea6 | 2017-07-02 03:02:15 -0700 | [diff] [blame] | 1061 | } |
| 1062 | #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */ |
Sumeet Rao | 76aa8d5 | 2019-06-20 12:23:14 -0700 | [diff] [blame] | 1063 | |
| 1064 | void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 1065 | bool val) |
| 1066 | { |
| 1067 | cfg->is_rx_flow_tag_enabled = val; |
| 1068 | } |
| 1069 | |
| 1070 | uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 1071 | { |
| 1072 | return cfg->rx_toeplitz_hash_key; |
| 1073 | } |
| 1074 | |
| 1075 | uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 1076 | { |
| 1077 | return cfg->rx_flow_max_search; |
| 1078 | } |
| 1079 | |
| 1080 | bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 1081 | { |
| 1082 | return cfg->is_rx_flow_tag_enabled; |
| 1083 | } |
| 1084 | |
| 1085 | void |
| 1086 | wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 1087 | bool val) |
| 1088 | { |
| 1089 | cfg->is_rx_flow_search_table_per_pdev = val; |
| 1090 | } |
| 1091 | |
| 1092 | bool wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 1093 | { |
| 1094 | return cfg->is_rx_flow_search_table_per_pdev; |
| 1095 | } |
| 1096 | |
| 1097 | void wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 1098 | uint16_t val) |
| 1099 | { |
| 1100 | cfg->rx_flow_search_table_size = val; |
| 1101 | } |
| 1102 | |
| 1103 | uint16_t |
| 1104 | wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 1105 | { |
| 1106 | return cfg->rx_flow_search_table_size; |
| 1107 | } |
| 1108 | |
| 1109 | void |
| 1110 | wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 1111 | bool val) |
| 1112 | { |
| 1113 | cfg->is_rx_mon_protocol_flow_tag_enabled = val; |
| 1114 | } |
| 1115 | |
| 1116 | bool |
| 1117 | wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 1118 | { |
| 1119 | return cfg->is_rx_mon_protocol_flow_tag_enabled; |
| 1120 | } |