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