1 /* 2 * * Copyright (c) 2013-2018 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 #ifndef __WLAN_CFG_H 20 #define __WLAN_CFG_H 21 22 /* 23 * Temporary place holders. These should come either from target config 24 * or platform configuration 25 */ 26 #if defined(CONFIG_MCL) 27 #define MAX_PDEV_CNT 1 28 #define WLAN_CFG_INT_NUM_CONTEXTS 7 29 /* 30 * This mask defines how many transmit frames account for 1 NAPI work unit 31 * 0 means each tx completion is 1 unit 32 */ 33 #define DP_TX_NAPI_BUDGET_DIV_MASK 0 34 35 /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */ 36 #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x1FFF 37 38 #define NUM_RXDMA_RINGS_PER_PDEV 2 39 #else 40 #define MAX_PDEV_CNT 3 41 #define WLAN_CFG_INT_NUM_CONTEXTS 7 42 /* 43 * This mask defines how many transmit frames account for 1 NAPI work unit 44 * 0xFFFF means each 64K tx frame completions account for 1 unit of NAPI budget 45 */ 46 #define DP_TX_NAPI_BUDGET_DIV_MASK 0xFFFF 47 48 /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */ 49 #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0xFFFF 50 51 #define NUM_RXDMA_RINGS_PER_PDEV 1 52 #endif 53 54 /* Tx configuration */ 55 #define MAX_LINK_DESC_BANKS 8 56 #define MAX_TXDESC_POOLS 4 57 #define MAX_TCL_DATA_RINGS 4 58 59 /* Rx configuration */ 60 #define MAX_RXDESC_POOLS 4 61 #define MAX_REO_DEST_RINGS 4 62 #define MAX_RX_MAC_RINGS 2 63 64 /* DP process status */ 65 #ifdef CONFIG_MCL 66 #define CONFIG_PROCESS_RX_STATUS 1 67 #define CONFIG_PROCESS_TX_STATUS 1 68 #else 69 #define CONFIG_PROCESS_RX_STATUS 0 70 #define CONFIG_PROCESS_TX_STATUS 0 71 #endif 72 73 /* Miscellaneous configuration */ 74 #define MAX_IDLE_SCATTER_BUFS 16 75 #define DP_MAX_IRQ_PER_CONTEXT 12 76 #define DP_MAX_INTERRUPT_CONTEXTS 8 77 #define DP_MAX_INTERRUPT_CONTEXTS 8 78 #define MAX_HTT_METADATA_LEN 32 79 #define MAX_NUM_PEER_ID_PER_PEER 8 80 #define DP_MAX_TIDS 17 81 #define DP_NON_QOS_TID 16 82 83 struct wlan_cfg_dp_pdev_ctxt; 84 85 /** 86 * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx) 87 * @num_int_ctxts - Number of NAPI/Interrupt contexts to be registered for DP 88 * @max_clients - Maximum number of peers/stations supported by device 89 * @max_alloc_size - Maximum allocation size for any dynamic memory 90 * allocation request for this device 91 * @per_pdev_tx_ring - 0 - TCL ring is not mapped per radio 92 * 1 - Each TCL ring is mapped to one radio/pdev 93 * @num_tcl_data_rings - Number of TCL Data rings supported by device 94 * @per_pdev_rx_ring - 0 - REO ring is not mapped per radio 95 * 1 - Each REO ring is mapped to one radio/pdev 96 * @num_tx_desc_pool - Number of Tx Descriptor pools 97 * @num_tx_ext_desc_pool - Number of Tx MSDU extension Descriptor pools 98 * @num_tx_desc - Number of Tx Descriptors per pool 99 * @num_tx_ext_desc - Number of Tx MSDU extension Descriptors per pool 100 * @max_peer_id - Maximum value of peer id that FW can assign for a client 101 * @htt_packet_type - Default 802.11 encapsulation type for any VAP created 102 * @int_tx_ring_mask - Bitmap of Tx interrupts mapped to each NAPI/Intr context 103 * @int_rx_ring_mask - Bitmap of Rx interrupts mapped to each NAPI/Intr context 104 * @int_rx_mon_ring_mask - Bitmap of Rx monitor ring interrupts mapped to each 105 * NAPI/Intr context 106 * @int_rx_err_ring_mask - Bitmap of Rx err ring interrupts mapped to each 107 * NAPI/Intr context 108 * @int_wbm_rel_ring_mask - Bitmap of wbm rel ring interrupts mapped to each 109 * NAPI/Intr context 110 * @int_reo_status_ring_mask - Bitmap of reo status ring interrupts mapped to each 111 * NAPI/Intr context 112 * @int_ce_ring_mask - Bitmap of CE interrupts mapped to each NAPI/Intr context 113 * @lro_enabled - enable/disable lro feature 114 * @rx_hash - Enable hash based steering of rx packets 115 * @tso_enabled - enable/disable tso feature 116 * @napi_enabled - enable/disable interrupt mode for reaping tx and rx packets 117 * @tcp_Udp_Checksumoffload - enable/disable checksum offload 118 * @nss_cfg - nss configuration 119 * @rx_defrag_min_timeout - rx defrag minimum timeout 120 * @wbm_release_ring - wbm release ring size 121 * @tcl_cmd_ring - tcl cmd ring size 122 * @tcl_status_ring - tcl status ring size 123 * @reo_reinject_ring - reo reinject ring 124 * @rx_release_ring - rx release ring size 125 * @reo_exception_ring - reo exception ring size 126 * @reo_cmd_ring - reo cmd ring size 127 * @reo_status_ring - reo status ting size 128 * @rxdma_refill_ring - rxdma refill ring size 129 * @rxdma_err_dst_ring - rxdma error detination ring size 130 */ 131 struct wlan_cfg_dp_soc_ctxt { 132 int num_int_ctxts; 133 int max_clients; 134 int max_alloc_size; 135 int per_pdev_tx_ring; 136 int num_tcl_data_rings; 137 int per_pdev_rx_ring; 138 int per_pdev_lmac_ring; 139 int num_reo_dest_rings; 140 int num_tx_desc_pool; 141 int num_tx_ext_desc_pool; 142 int num_tx_desc; 143 int num_tx_ext_desc; 144 int max_peer_id; 145 int htt_packet_type; 146 int int_batch_threshold_tx; 147 int int_timer_threshold_tx; 148 int int_batch_threshold_rx; 149 int int_timer_threshold_rx; 150 int int_batch_threshold_other; 151 int int_timer_threshold_other; 152 int tx_ring_size; 153 int tx_comp_ring_size; 154 int tx_comp_ring_size_nss; 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]; 159 int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 160 int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 161 int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 162 int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 163 int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 164 int hw_macid[MAX_PDEV_CNT]; 165 int base_hw_macid; 166 bool lro_enabled; 167 bool rx_hash; 168 bool tso_enabled; 169 bool napi_enabled; 170 bool tcp_udp_checksumoffload; 171 bool defrag_timeout_check; 172 int nss_cfg; 173 #ifdef QCA_LL_TX_FLOW_CONTROL_V2 174 uint32_t tx_flow_stop_queue_threshold; 175 uint32_t tx_flow_start_queue_offset; 176 #endif 177 int rx_defrag_min_timeout; 178 int reo_dst_ring_size; 179 int wbm_release_ring; 180 int tcl_cmd_ring; 181 int tcl_status_ring; 182 int reo_reinject_ring; 183 int rx_release_ring; 184 int reo_exception_ring; 185 int reo_cmd_ring; 186 int reo_status_ring; 187 188 int rxdma_refill_ring; 189 int rxdma_err_dst_ring; 190 }; 191 192 /** 193 * wlan_cfg_soc_attach() - Attach configuration interface for SoC 194 * @ctrl_obj - PSOC object 195 * 196 * Allocates context for Soc configuration parameters, 197 * Read configuration information from device tree/ini file and 198 * returns back handle 199 * 200 * Return: Handle to configuration context 201 */ 202 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void *ctrl_obj); 203 204 /** 205 * wlan_cfg_soc_detach() - Detach soc configuration handle 206 * @wlan_cfg_ctx: soc configuration handle 207 * 208 * De-allocates memory allocated for SoC configuration 209 * 210 * Return:none 211 */ 212 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 213 214 /** 215 * wlan_cfg_pdev_attach() Attach configuration interface for pdev 216 * @ctrl_obj - PSOC object 217 * 218 * Allocates context for pdev configuration parameters, 219 * Read configuration information from device tree/ini file and 220 * returns back handle 221 * 222 * Return: Handle to configuration context 223 */ 224 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void *ctrl_obj); 225 226 /** 227 * wlan_cfg_pdev_detach() Detach and free pdev configuration handle 228 * @wlan_cfg_pdev_ctx - PDEV Configuration Handle 229 * 230 * Return: void 231 */ 232 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 233 234 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num); 235 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 236 int context, int mask); 237 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 238 int context, int mask); 239 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 240 int context, int mask); 241 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 242 int context, int mask); 243 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, 244 int mask); 245 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val); 246 247 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 248 int context, int mask); 249 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 250 int context, int mask); 251 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 252 int context, int mask); 253 /** 254 * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered 255 * @wlan_cfg_ctx - Configuration Handle 256 * 257 * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores. 258 * Each context (for linux it is a NAPI context) will have a tx_ring_mask, 259 * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings 260 * that are processed by the handler. 261 * 262 * Return: num_contexts 263 */ 264 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 265 266 /** 267 * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an 268 * interrupt context 269 * @wlan_cfg_ctx - Configuration Handle 270 * @context - Numerical ID identifying the Interrupt/NAPI context 271 * 272 * Return: int_tx_ring_mask[context] 273 */ 274 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 275 int context); 276 277 /** 278 * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an 279 * interrupt context 280 * @wlan_cfg_ctx - Configuration Handle 281 * @context - Numerical ID identifying the Interrupt/NAPI context 282 * 283 * Return: int_rx_ring_mask[context] 284 */ 285 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 286 int context); 287 288 /** 289 * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask 290 * mapped to an interrupt context 291 * @wlan_cfg_ctx - Configuration Handle 292 * @context - Numerical ID identifying the Interrupt/NAPI context 293 * 294 * Return: int_rx_mon_ring_mask[context] 295 */ 296 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 297 int context); 298 299 /** 300 * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask 301 * for the given interrupt context 302 * @wlan_cfg_ctx - Configuration Handle 303 * @context - Numerical ID identifying the Interrupt/NAPI context 304 * 305 */ 306 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 307 int context, int mask); 308 309 /** 310 * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask 311 * mapped to an interrupt context 312 * @wlan_cfg_ctx - Configuration Handle 313 * @context - Numerical ID identifying the Interrupt/NAPI context 314 * 315 * Return: int_rxdma2host_ring_mask[context] 316 */ 317 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 318 int context); 319 320 /** 321 * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask 322 * for the given interrupt context 323 * @wlan_cfg_ctx - Configuration Handle 324 * @context - Numerical ID identifying the Interrupt/NAPI context 325 * 326 */ 327 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 328 int context, int mask); 329 330 /** 331 * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask 332 * mapped to an interrupt context 333 * @wlan_cfg_ctx - Configuration Handle 334 * @context - Numerical ID identifying the Interrupt/NAPI context 335 * 336 * Return: int_host2rxdma_ring_mask[context] 337 */ 338 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 339 int context); 340 341 /** 342 * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index 343 * 344 * @wlan_cfg_ctx - Configuration Handle 345 * @pdev_idx - Index of SW PDEV 346 * @hw_macid - HW MAC Id 347 * 348 */ 349 void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, 350 int hw_macid); 351 352 /** 353 * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index 354 * 355 * @wlan_cfg_ctx - Configuration Handle 356 * @pdev_idx - Index of SW PDEV 357 * 358 * Return: HW MAC Id 359 */ 360 int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx); 361 362 /** 363 * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given 364 * PDEV index 365 * 366 * @wlan_cfg_ctx - Configuration Handle 367 * @pdev_idx - Index of SW PDEV 368 * 369 * Return: HW MAC index 370 */ 371 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx); 372 373 /** 374 * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask 375 * mapped to an interrupt context 376 * @wlan_cfg_ctx - Configuration Handle 377 * @context - Numerical ID identifying the Interrupt/NAPI context 378 * 379 * Return: int_rx_err_ring_mask[context] 380 */ 381 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 382 context); 383 384 /** 385 * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask 386 * mapped to an interrupt context 387 * @wlan_cfg_ctx - Configuration Handle 388 * @context - Numerical ID identifying the Interrupt/NAPI context 389 * 390 * Return: int_wbm_rel_ring_mask[context] 391 */ 392 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 393 context); 394 395 /** 396 * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask 397 * mapped to an interrupt context 398 * @wlan_cfg_ctx - Configuration Handle 399 * @context - Numerical ID identifying the Interrupt/NAPI context 400 * 401 * Return: int_reo_status_ring_mask[context] 402 */ 403 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 404 context); 405 406 /** 407 * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask 408 * mapped to an interrupt context 409 * @wlan_cfg_ctx - Configuration Handle 410 * @context - Numerical ID identifying the Interrupt/NAPI context 411 * 412 * Return: int_ce_ring_mask[context] 413 */ 414 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 415 int context); 416 417 /** 418 * wlan_cfg_get_max_clients() - Return maximum number of peers/stations 419 * supported by device 420 * @wlan_cfg_ctx - Configuration Handle 421 * 422 * Return: max_clients 423 */ 424 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 425 426 /** 427 * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic 428 * memory allocation request for this device 429 * @wlan_cfg_ctx - Configuration Handle 430 * 431 * Return: max_alloc_size 432 */ 433 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 434 435 /* 436 * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as 437 * one per radio 438 * @wlan_cfg_ctx - Configuration Handle 439 * 440 * Return: per_pdev_tx_ring 441 */ 442 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 443 444 /* 445 * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device 446 * @wlan_cfg_ctx 447 * 448 * Return: num_tcl_data_rings 449 */ 450 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 451 452 /* 453 * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as 454 * one per radio 455 * @wlan_cfg_ctx 456 * 457 * Return: per_pdev_rx_ring 458 */ 459 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 460 461 /* 462 * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as 463 * one per radio 464 * @wlan_cfg_ctx 465 * 466 * Return: return 1 if per pdev error ring else 0 467 */ 468 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 469 470 /* 471 * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device 472 * @wlan_cfg_ctx - Configuration Handle 473 * 474 * Return: num_reo_dest_rings 475 */ 476 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 477 478 /* 479 * wlan_cfg_pkt_type() - Default 802.11 encapsulation type 480 * @wlan_cfg_ctx - Configuration Handle 481 * 482 * Return: htt_pkt_type_ethernet 483 */ 484 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 485 486 /* 487 * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the 488 * device 489 * @wlan_cfg_ctx - Configuration Handle 490 * 491 * Return: num_tx_desc_pool 492 */ 493 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 494 495 /* 496 * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the 497 * device 498 * @wlan_cfg_ctx - Configuration Handle 499 * @num_pool - Number of pool 500 */ 501 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool); 502 503 /* 504 * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor 505 * pools 506 * @wlan_cfg_ctx - Configuration Handle 507 * 508 * Return: num_tx_ext_desc_pool 509 */ 510 int wlan_cfg_get_num_tx_ext_desc_pool( 511 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 512 513 /* 514 * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size 515 * 516 * @wlan_cfg_ctx - Configuration Handle 517 * 518 * Return: reo_dst_ring_size 519 */ 520 int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 521 522 /* 523 * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size 524 * 525 * @wlan_cfg_ctx - Configuration Handle 526 * @reo_dst_ring_size - REO Destination ring size 527 */ 528 void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, 529 int reo_dst_ring_size); 530 531 /* 532 * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor 533 * pools 534 * @wlan_cfg_ctx - Configuration Handle 535 * @num_pool - Number of pool 536 */ 537 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool); 538 539 /* 540 * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool 541 * @wlan_cfg_ctx - Configuration Handle 542 * 543 * Return: num_tx_desc 544 */ 545 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 546 547 /* 548 * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool 549 * 550 * @wlan_cfg_ctx - Configuration Handle 551 * @num_desc: Number of descriptor 552 */ 553 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc); 554 555 /* 556 * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors 557 * per pool 558 * @wlan_cfg_ctx - Configuration Handle 559 * 560 * Return: num_tx_ext_desc 561 */ 562 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 563 564 /* 565 * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors 566 * per pool 567 * @wlan_cfg_ctx - Configuration Handle 568 * @num_desc: Number of descriptor 569 */ 570 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc); 571 572 /* 573 * wlan_cfg_max_peer_id() - Get maximum peer ID 574 * @cfg: Configuration Handle 575 * 576 * Return: maximum peer ID 577 */ 578 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg); 579 580 /* 581 * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring 582 * @wlan_cfg_pdev_ctx 583 * 584 * Return: dma_mon_buf_ring_size 585 */ 586 int wlan_cfg_get_dma_mon_buf_ring_size( 587 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 588 589 /* 590 * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor 591 * Destination ring 592 * @wlan_cfg_pdev_ctx 593 * 594 * Return: dma_mon_dest_size 595 */ 596 int wlan_cfg_get_dma_mon_dest_ring_size( 597 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 598 599 /* 600 * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring 601 * @wlan_cfg_pdev_ctx 602 * 603 * Return: dma_mon_stat_ring_size 604 */ 605 int wlan_cfg_get_dma_mon_stat_ring_size( 606 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 607 608 /* 609 * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size 610 * @wlan_cfg_soc_ctx 611 * 612 * Return: rxdma monitor desc ring size 613 */ 614 int 615 wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg); 616 617 /* 618 * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring 619 * @wlan_cfg_pdev_ctx 620 * 621 * Return: rx_dma_buf_ring_size 622 */ 623 int wlan_cfg_get_rx_dma_buf_ring_size( 624 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 625 626 /* 627 * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings 628 * per pdev 629 * @wlan_cfg_pdev_ctx 630 * 631 * Return: number of mac DMA rings per pdev 632 */ 633 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg); 634 635 /* 636 * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled 637 * @wlan_cfg_pdev_ctx 638 * 639 * Return: true - LRO enabled false - LRO disabled 640 */ 641 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 642 643 /* 644 * wlan_cfg_is_lro_enabled - Return RX hash enabled/disabled 645 * @wlan_cfg_pdev_ctx 646 * 647 * Return: true - enabled false - disabled 648 */ 649 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 650 651 /* 652 * wlan_cfg_set_rx_hash - set rx hash enabled/disabled 653 * @wlan_cfg_soc_ctx 654 * @rx_hash 655 */ 656 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash); 657 658 /* 659 * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled 660 * @wlan_cfg_pdev_ctx 661 * 662 * Return: 1 - enabled 0 - disabled 663 */ 664 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg); 665 666 /* 667 * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled 668 * @wlan_cfg_pdev_ctx 669 */ 670 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled); 671 672 /* 673 * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config 674 * @wlan_cfg_pdev_ctx 675 * 676 * Return: nss_cfg 677 */ 678 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg); 679 680 /* 681 * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config 682 * @wlan_cfg_pdev_ctx 683 * 684 */ 685 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg); 686 687 /* 688 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx 689 * @wlan_cfg_soc_ctx 690 * 691 * Return: Batch threshold 692 */ 693 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg); 694 695 /* 696 * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx 697 * @wlan_cfg_soc_ctx 698 * 699 * Return: Timer threshold 700 */ 701 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg); 702 703 /* 704 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx 705 * @wlan_cfg_soc_ctx 706 * 707 * Return: Batch threshold 708 */ 709 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg); 710 711 /* 712 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx 713 * @wlan_cfg_soc_ctx 714 * 715 * Return: Timer threshold 716 */ 717 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg); 718 719 /* 720 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs 721 * @wlan_cfg_soc_ctx 722 * 723 * Return: Batch threshold 724 */ 725 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); 726 727 /* 728 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs 729 * @wlan_cfg_soc_ctx 730 * 731 * Return: Timer threshold 732 */ 733 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); 734 735 /* 736 * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status 737 * @wlan_cfg_soc_ctx 738 * 739 * Return: Checksum offload enable or disable 740 */ 741 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg); 742 743 /* 744 * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring) 745 * @wlan_cfg_soc_ctx 746 * 747 * Return: Tx Ring Size 748 */ 749 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 750 751 /* 752 * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring) 753 * @wlan_cfg_soc_ctx 754 * 755 * Return: Tx Completion ring size 756 */ 757 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 758 759 /* 760 * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size 761 * @wlan_cfg_soc_ctx 762 * 763 * Return: wbm_release_ring size 764 */ 765 int 766 wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 767 768 /* 769 * wlan_cfg_get_dp_soc_tcl_cmd_ring_size - Get tcl_cmd_ring size 770 * @wlan_cfg_soc_ctx 771 * 772 * Return: tcl_cmd_ring size 773 */ 774 int 775 wlan_cfg_get_dp_soc_tcl_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 776 777 /* 778 * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size 779 * @wlan_cfg_soc_ctx 780 * 781 * Return: tcl_status_ring size 782 */ 783 int 784 wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 785 786 /* 787 * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size 788 * @wlan_cfg_soc_ctx 789 * 790 * Return: reo_reinject_ring size 791 */ 792 int 793 wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 794 795 /* 796 * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size 797 * @wlan_cfg_soc_ctx 798 * 799 * Return: rx_release_ring size 800 */ 801 int 802 wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 803 804 /* 805 * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size 806 * @wlan_cfg_soc_ctx 807 * 808 * Return: reo_exception_ring size 809 */ 810 int 811 wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 812 813 /* 814 * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size 815 * @wlan_cfg_soc_ctx 816 * 817 * Return: reo_cmd_ring size 818 */ 819 int 820 wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 821 822 /* 823 * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size 824 * @wlan_cfg_soc_ctx 825 * 826 * Return: reo_status_ring size 827 */ 828 int 829 wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 830 831 /* 832 * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size 833 * @wlan_cfg_soc_ctx 834 * 835 * Return: rxdma refill ring size 836 */ 837 int 838 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 839 840 /* 841 * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size 842 * @wlan_cfg_soc_ctx 843 * 844 * Return: rxdma error dst ring size 845 */ 846 int 847 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 848 849 #ifdef QCA_LL_TX_FLOW_CONTROL_V2 850 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg); 851 852 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg); 853 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */ 854 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg); 855 856 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg); 857 #endif 858