Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 1 | /* |
Dhanashri Atre | d4032ab | 2017-01-17 15:05:41 -0800 | [diff] [blame] | 2 | * Copyright (c) 2016-2017 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" |
| 27 | #include "wlan_cfg.h" |
| 28 | |
| 29 | /* |
| 30 | * FIX THIS - |
| 31 | * For now, all these configuration parameters are hardcoded. |
| 32 | * Many of these should actually be coming from dts file/ini file |
| 33 | */ |
| 34 | #define WLAN_CFG_INT_NUM_CONTEXTS 4 |
Vijay Pamidipati | c84501a | 2016-11-17 21:51:35 +0530 | [diff] [blame] | 35 | |
| 36 | #define RXDMA_BUF_RING_SIZE 2048 |
| 37 | #define RXDMA_MONITOR_BUF_RING_SIZE 2048 |
| 38 | #define RXDMA_MONITOR_DEST_RING_SIZE 2048 |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 39 | #define RXDMA_MONITOR_STATUS_RING_SIZE 2048 |
| 40 | |
Vijay Pamidipati | c84501a | 2016-11-17 21:51:35 +0530 | [diff] [blame] | 41 | #define WLAN_CFG_NUM_TX_DESC 1024 |
| 42 | #define WLAN_CFG_NUM_TX_EXT_DESC 1024 |
Ravi Joshi | fb39e00 | 2017-02-11 21:18:40 -0800 | [diff] [blame] | 43 | |
| 44 | #ifdef TX_PER_PDEV_DESC_POOL |
| 45 | #define WLAN_CFG_NUM_TX_DESC_POOL MAX_PDEV_CNT |
| 46 | #define WLAN_CFG_NUM_TXEXT_DESC_POOL MAX_PDEV_CNT |
| 47 | #else |
Vijay Pamidipati | c84501a | 2016-11-17 21:51:35 +0530 | [diff] [blame] | 48 | #define WLAN_CFG_NUM_TX_DESC_POOL 3 |
| 49 | #define WLAN_CFG_NUM_TXEXT_DESC_POOL 3 |
Ravi Joshi | fb39e00 | 2017-02-11 21:18:40 -0800 | [diff] [blame] | 50 | #endif /* TX_PER_PDEV_DESC_POOL */ |
| 51 | |
Vijay Pamidipati | c84501a | 2016-11-17 21:51:35 +0530 | [diff] [blame] | 52 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 53 | #define WLAN_CFG_TX_RING_MASK_0 0x1 |
| 54 | #define WLAN_CFG_TX_RING_MASK_1 0x2 |
| 55 | #define WLAN_CFG_TX_RING_MASK_2 0x4 |
| 56 | #define WLAN_CFG_TX_RING_MASK_3 0x0 |
| 57 | |
| 58 | #define WLAN_CFG_RX_RING_MASK_0 0x1 |
| 59 | #define WLAN_CFG_RX_RING_MASK_1 0x2 |
| 60 | #define WLAN_CFG_RX_RING_MASK_2 0x4 |
| 61 | #define WLAN_CFG_RX_RING_MASK_3 0x8 |
| 62 | |
| 63 | #define WLAN_CFG_RX_MON_RING_MASK_0 0x1 |
| 64 | #define WLAN_CFG_RX_MON_RING_MASK_1 0x2 |
| 65 | #define WLAN_CFG_RX_MON_RING_MASK_2 0x4 |
| 66 | #define WLAN_CFG_RX_MON_RING_MASK_3 0x0 |
| 67 | |
| 68 | #define WLAN_CFG_DP_TX_NUM_POOLS 3 |
| 69 | /* Change this to a lower value to enforce scattered idle list mode */ |
Karunakar Dasineni | 67c7877 | 2017-02-27 22:03:25 -0800 | [diff] [blame] | 70 | #define WLAN_CFG_MAX_ALLOC_SIZE (2 << 20) |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 71 | |
Karunakar Dasineni | d0ea21f | 2017-01-31 22:58:15 -0800 | [diff] [blame] | 72 | #define WLAN_CFG_MAX_CLIENTS 64 |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 73 | |
Vijay Pamidipati | c84501a | 2016-11-17 21:51:35 +0530 | [diff] [blame] | 74 | #define WLAN_CFG_PER_PDEV_TX_RING 1 |
| 75 | #define WLAN_CFG_NUM_TCL_DATA_RINGS 3 |
Vijay Pamidipati | c84501a | 2016-11-17 21:51:35 +0530 | [diff] [blame] | 76 | #define WLAN_CFG_NUM_REO_DEST_RING 4 |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 77 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 78 | #define WLAN_CFG_HTT_PKT_TYPE 2 |
Kiran Venkatappa | 8dac1db | 2017-05-16 12:40:38 +0530 | [diff] [blame] | 79 | #define WLAN_CFG_MAX_PEER_ID 64 |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 80 | |
Dhanashri Atre | d4032ab | 2017-01-17 15:05:41 -0800 | [diff] [blame] | 81 | #ifdef CONFIG_MCL |
Dhanashri Atre | cdfde22 | 2017-04-13 22:41:19 -0700 | [diff] [blame] | 82 | #define WLAN_CFG_PER_PDEV_RX_RING 0 |
Dhanashri Atre | d4032ab | 2017-01-17 15:05:41 -0800 | [diff] [blame] | 83 | #define NUM_RXDMA_RINGS_PER_PDEV 2 |
Manjunathappa Prakash | 9737bd7 | 2017-05-26 20:59:19 -0700 | [diff] [blame] | 84 | #define WLAN_LRO_ENABLE 1 |
Dhanashri Atre | d4032ab | 2017-01-17 15:05:41 -0800 | [diff] [blame] | 85 | #else |
Dhanashri Atre | cdfde22 | 2017-04-13 22:41:19 -0700 | [diff] [blame] | 86 | #define WLAN_CFG_PER_PDEV_RX_RING 1 |
Dhanashri Atre | d4032ab | 2017-01-17 15:05:41 -0800 | [diff] [blame] | 87 | #define NUM_RXDMA_RINGS_PER_PDEV 1 |
Manjunathappa Prakash | 9737bd7 | 2017-05-26 20:59:19 -0700 | [diff] [blame] | 88 | #define WLAN_LRO_ENABLE 0 |
Dhanashri Atre | d4032ab | 2017-01-17 15:05:41 -0800 | [diff] [blame] | 89 | #endif |
| 90 | |
Dhanashri Atre | b178eb4 | 2017-03-21 12:32:33 -0700 | [diff] [blame] | 91 | #ifdef WLAN_RX_HASH |
| 92 | #define WLAN_RX_HASH_ENABLE 1 |
| 93 | #else |
Dhanashri Atre | 1404917 | 2016-11-11 18:32:36 -0800 | [diff] [blame] | 94 | #define WLAN_RX_HASH_ENABLE 0 |
Dhanashri Atre | b178eb4 | 2017-03-21 12:32:33 -0700 | [diff] [blame] | 95 | #endif |
Dhanashri Atre | 1404917 | 2016-11-11 18:32:36 -0800 | [diff] [blame] | 96 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 97 | static const int tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 98 | WLAN_CFG_TX_RING_MASK_0, |
| 99 | WLAN_CFG_TX_RING_MASK_1, |
| 100 | WLAN_CFG_TX_RING_MASK_2, |
| 101 | WLAN_CFG_TX_RING_MASK_3}; |
| 102 | |
| 103 | static const int rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 104 | WLAN_CFG_RX_RING_MASK_0, |
| 105 | WLAN_CFG_RX_RING_MASK_1, |
| 106 | WLAN_CFG_RX_RING_MASK_2, |
| 107 | WLAN_CFG_RX_RING_MASK_3}; |
| 108 | |
| 109 | static const int rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { |
| 110 | WLAN_CFG_RX_MON_RING_MASK_0, |
| 111 | WLAN_CFG_RX_MON_RING_MASK_1, |
| 112 | WLAN_CFG_RX_MON_RING_MASK_2, |
| 113 | WLAN_CFG_RX_MON_RING_MASK_3}; |
| 114 | |
| 115 | /** |
| 116 | * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx) |
| 117 | * @num_int_ctxts - Number of NAPI/Interrupt contexts to be registered for DP |
| 118 | * @max_clients - Maximum number of peers/stations supported by device |
| 119 | * @max_alloc_size - Maximum allocation size for any dynamic memory |
| 120 | * allocation request for this device |
| 121 | * @per_pdev_tx_ring - 0 - TCL ring is not mapped per radio |
| 122 | * 1 - Each TCL ring is mapped to one radio/pdev |
| 123 | * @num_tcl_data_rings - Number of TCL Data rings supported by device |
| 124 | * @per_pdev_rx_ring - 0 - REO ring is not mapped per radio |
| 125 | * 1 - Each REO ring is mapped to one radio/pdev |
| 126 | * @num_tx_desc_pool - Number of Tx Descriptor pools |
| 127 | * @num_tx_ext_desc_pool - Number of Tx MSDU extension Descriptor pools |
| 128 | * @num_tx_desc - Number of Tx Descriptors per pool |
| 129 | * @num_tx_ext_desc - Number of Tx MSDU extension Descriptors per pool |
| 130 | * @max_peer_id - Maximum value of peer id that FW can assign for a client |
| 131 | * @htt_packet_type - Default 802.11 encapsulation type for any VAP created |
| 132 | * @int_tx_ring_mask - Bitmap of Tx interrupts mapped to each NAPI/Intr context |
| 133 | * @int_rx_ring_mask - Bitmap of Rx interrupts mapped to each NAPI/Intr context |
| 134 | * @int_rx_mon_ring_mask - Bitmap of Rx monitor ring interrupts mapped to each |
| 135 | * NAPI/Intr context |
| 136 | * @int_ce_ring_mask - Bitmap of CE interrupts mapped to each NAPI/Intr context |
Dhanashri Atre | 1404917 | 2016-11-11 18:32:36 -0800 | [diff] [blame] | 137 | * @lro_enabled - is LRO enabled |
| 138 | * @rx_hash - Enable hash based steering of rx packets |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 139 | * |
| 140 | */ |
| 141 | struct wlan_cfg_dp_soc_ctxt { |
| 142 | int num_int_ctxts; |
| 143 | int max_clients; |
| 144 | int max_alloc_size; |
| 145 | int per_pdev_tx_ring; |
| 146 | int num_tcl_data_rings; |
| 147 | int per_pdev_rx_ring; |
| 148 | int num_reo_dest_rings; |
| 149 | int num_tx_desc_pool; |
| 150 | int num_tx_ext_desc_pool; |
| 151 | int num_tx_desc; |
| 152 | int num_tx_ext_desc; |
| 153 | int max_peer_id; |
| 154 | int htt_packet_type; |
| 155 | int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; |
| 156 | int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; |
| 157 | int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; |
| 158 | int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; |
Dhanashri Atre | 1404917 | 2016-11-11 18:32:36 -0800 | [diff] [blame] | 159 | bool lro_enabled; |
| 160 | bool rx_hash; |
Bharat Kumar M | 9a5d537 | 2017-05-08 17:41:42 +0530 | [diff] [blame] | 161 | int nss_cfg; |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 162 | }; |
| 163 | |
| 164 | /** |
| 165 | * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio) |
| 166 | * @rx_dma_buf_ring_size - Size of RxDMA buffer ring |
| 167 | * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring |
| 168 | * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring |
| 169 | * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring |
| 170 | */ |
| 171 | struct wlan_cfg_dp_pdev_ctxt { |
| 172 | int rx_dma_buf_ring_size; |
| 173 | int dma_mon_buf_ring_size; |
| 174 | int dma_mon_dest_ring_size; |
| 175 | int dma_mon_status_ring_size; |
Dhanashri Atre | d4032ab | 2017-01-17 15:05:41 -0800 | [diff] [blame] | 176 | int num_mac_rings; |
Bharat Kumar M | 9a5d537 | 2017-05-08 17:41:42 +0530 | [diff] [blame] | 177 | int nss_enabled; |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 178 | }; |
| 179 | |
| 180 | /** |
| 181 | * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration |
| 182 | * |
| 183 | * Return: wlan_cfg_ctx - Handle to Configuration context |
| 184 | */ |
| 185 | struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void) |
| 186 | { |
| 187 | int i = 0; |
| 188 | struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx = |
| 189 | qdf_mem_malloc(sizeof(struct wlan_cfg_dp_soc_ctxt)); |
| 190 | |
| 191 | if (wlan_cfg_ctx == NULL) |
| 192 | return NULL; |
| 193 | |
| 194 | wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS; |
| 195 | wlan_cfg_ctx->max_clients = WLAN_CFG_MAX_CLIENTS; |
| 196 | wlan_cfg_ctx->max_alloc_size = WLAN_CFG_MAX_ALLOC_SIZE; |
| 197 | wlan_cfg_ctx->per_pdev_tx_ring = WLAN_CFG_PER_PDEV_TX_RING; |
| 198 | wlan_cfg_ctx->num_tcl_data_rings = WLAN_CFG_NUM_TCL_DATA_RINGS; |
| 199 | wlan_cfg_ctx->per_pdev_rx_ring = WLAN_CFG_PER_PDEV_RX_RING; |
| 200 | wlan_cfg_ctx->num_reo_dest_rings = WLAN_CFG_NUM_REO_DEST_RING; |
| 201 | wlan_cfg_ctx->num_tx_desc_pool = WLAN_CFG_NUM_TX_DESC_POOL; |
| 202 | wlan_cfg_ctx->num_tx_ext_desc_pool = WLAN_CFG_NUM_TXEXT_DESC_POOL; |
| 203 | wlan_cfg_ctx->num_tx_desc = WLAN_CFG_NUM_TX_DESC; |
| 204 | wlan_cfg_ctx->num_tx_ext_desc = WLAN_CFG_NUM_TX_EXT_DESC; |
| 205 | wlan_cfg_ctx->max_peer_id = WLAN_CFG_MAX_PEER_ID; |
| 206 | wlan_cfg_ctx->htt_packet_type = WLAN_CFG_HTT_PKT_TYPE; |
| 207 | |
| 208 | for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) { |
| 209 | wlan_cfg_ctx->int_tx_ring_mask[i] = tx_ring_mask[i]; |
| 210 | wlan_cfg_ctx->int_rx_ring_mask[i] = rx_ring_mask[i]; |
| 211 | wlan_cfg_ctx->int_rx_mon_ring_mask[i] = rx_mon_ring_mask[i]; |
| 212 | } |
| 213 | |
Dhanashri Atre | 1404917 | 2016-11-11 18:32:36 -0800 | [diff] [blame] | 214 | wlan_cfg_ctx->rx_hash = WLAN_RX_HASH_ENABLE; |
| 215 | wlan_cfg_ctx->lro_enabled = WLAN_LRO_ENABLE; |
| 216 | |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 217 | return wlan_cfg_ctx; |
| 218 | } |
| 219 | |
| 220 | void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) |
| 221 | { |
| 222 | qdf_mem_free(wlan_cfg_ctx); |
| 223 | } |
| 224 | |
| 225 | struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void) |
| 226 | { |
| 227 | struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx = |
| 228 | qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt)); |
| 229 | |
| 230 | if (wlan_cfg_ctx == NULL) |
| 231 | return NULL; |
| 232 | |
| 233 | wlan_cfg_ctx->rx_dma_buf_ring_size = RXDMA_BUF_RING_SIZE; |
| 234 | wlan_cfg_ctx->dma_mon_buf_ring_size = RXDMA_MONITOR_BUF_RING_SIZE; |
| 235 | wlan_cfg_ctx->dma_mon_dest_ring_size = RXDMA_MONITOR_DEST_RING_SIZE; |
| 236 | wlan_cfg_ctx->dma_mon_status_ring_size = RXDMA_MONITOR_STATUS_RING_SIZE; |
Dhanashri Atre | d4032ab | 2017-01-17 15:05:41 -0800 | [diff] [blame] | 237 | wlan_cfg_ctx->num_mac_rings = NUM_RXDMA_RINGS_PER_PDEV; |
Vijay Pamidipati | d41d6d6 | 2016-10-19 21:19:00 +0530 | [diff] [blame] | 238 | |
| 239 | return wlan_cfg_ctx; |
| 240 | } |
| 241 | |
| 242 | void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx) |
| 243 | { |
| 244 | qdf_mem_free(wlan_cfg_ctx); |
| 245 | } |
| 246 | |
| 247 | void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num) |
| 248 | { |
| 249 | cfg->num_int_ctxts = num; |
| 250 | } |
| 251 | |
| 252 | void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 253 | int context, int mask) |
| 254 | { |
| 255 | cfg->int_tx_ring_mask[context] = mask; |
| 256 | } |
| 257 | |
| 258 | void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 259 | int context, int mask) |
| 260 | { |
| 261 | cfg->int_rx_ring_mask[context] = mask; |
| 262 | } |
| 263 | |
| 264 | void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 265 | int context, int mask) |
| 266 | { |
| 267 | cfg->int_rx_mon_ring_mask[context] = mask; |
| 268 | } |
| 269 | |
| 270 | void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, |
| 271 | int context, int mask) |
| 272 | { |
| 273 | cfg->int_ce_ring_mask[context] = mask; |
| 274 | } |
| 275 | |
| 276 | void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, |
| 277 | int mask) |
| 278 | { |
| 279 | cfg->int_rx_ring_mask[context] = mask; |
| 280 | } |
| 281 | |
| 282 | int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 283 | { |
| 284 | return cfg->num_int_ctxts; |
| 285 | } |
| 286 | |
| 287 | int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) |
| 288 | { |
| 289 | return cfg->int_tx_ring_mask[context]; |
| 290 | } |
| 291 | |
| 292 | int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) |
| 293 | { |
| 294 | return cfg->int_rx_ring_mask[context]; |
| 295 | } |
| 296 | |
| 297 | int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) |
| 298 | { |
| 299 | return cfg->int_rx_mon_ring_mask[context]; |
| 300 | } |
| 301 | |
| 302 | int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context) |
| 303 | { |
| 304 | return cfg->int_ce_ring_mask[context]; |
| 305 | } |
| 306 | |
| 307 | uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 308 | { |
| 309 | return cfg->max_clients; |
| 310 | } |
| 311 | |
| 312 | uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 313 | { |
| 314 | return cfg->max_alloc_size; |
| 315 | } |
| 316 | |
| 317 | int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 318 | { |
| 319 | return cfg->per_pdev_tx_ring; |
| 320 | } |
| 321 | |
| 322 | int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 323 | { |
| 324 | return cfg->num_tcl_data_rings; |
| 325 | } |
| 326 | |
| 327 | int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 328 | { |
| 329 | return cfg->per_pdev_rx_ring; |
| 330 | } |
| 331 | |
| 332 | int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 333 | { |
| 334 | return cfg->num_reo_dest_rings; |
| 335 | } |
| 336 | |
| 337 | int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 338 | { |
| 339 | return cfg->htt_packet_type; /*htt_pkt_type_ethernet*/ |
| 340 | } |
| 341 | |
| 342 | int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 343 | { |
| 344 | return cfg->num_tx_desc_pool; |
| 345 | } |
| 346 | |
| 347 | int wlan_cfg_get_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 348 | { |
| 349 | return cfg->num_tx_ext_desc_pool; |
| 350 | } |
| 351 | |
| 352 | int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 353 | { |
| 354 | return cfg->num_tx_desc; |
| 355 | } |
| 356 | |
| 357 | int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 358 | { |
| 359 | return cfg->num_tx_ext_desc; |
| 360 | } |
| 361 | |
| 362 | uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 363 | { |
| 364 | /* TODO: This should be calculated based on target capabilities */ |
| 365 | return cfg->max_peer_id; |
| 366 | } |
| 367 | |
| 368 | int wlan_cfg_get_dma_mon_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 369 | { |
| 370 | return cfg->dma_mon_buf_ring_size; |
| 371 | } |
| 372 | |
| 373 | int wlan_cfg_get_dma_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 374 | { |
| 375 | return cfg->dma_mon_dest_ring_size; |
| 376 | } |
| 377 | |
| 378 | int wlan_cfg_get_dma_mon_stat_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 379 | { |
| 380 | return cfg->dma_mon_status_ring_size; |
| 381 | } |
| 382 | |
| 383 | int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 384 | { |
| 385 | return cfg->rx_dma_buf_ring_size; |
| 386 | } |
Dhanashri Atre | d4032ab | 2017-01-17 15:05:41 -0800 | [diff] [blame] | 387 | |
| 388 | int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 389 | { |
| 390 | return cfg->num_mac_rings; |
| 391 | } |
Dhanashri Atre | 1404917 | 2016-11-11 18:32:36 -0800 | [diff] [blame] | 392 | |
| 393 | bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 394 | { |
| 395 | return cfg->lro_enabled; |
| 396 | } |
| 397 | |
| 398 | bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 399 | { |
| 400 | return cfg->rx_hash; |
| 401 | } |
Bharat Kumar M | 9a5d537 | 2017-05-08 17:41:42 +0530 | [diff] [blame] | 402 | |
| 403 | int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg) |
| 404 | { |
| 405 | return cfg->nss_enabled; |
| 406 | } |
| 407 | |
| 408 | void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled) |
| 409 | { |
| 410 | cfg->nss_enabled = nss_enabled; |
| 411 | } |
| 412 | |
| 413 | int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg) |
| 414 | { |
| 415 | return cfg->nss_cfg; |
| 416 | } |
| 417 | |
| 418 | void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg) |
| 419 | { |
| 420 | cfg->nss_cfg = nss_cfg; |
| 421 | } |