1 /* 2 * Copyright (c) 2013-2019 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(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1) 27 #define WLAN_CFG_DST_RING_CACHED_DESC 0 28 #define MAX_PDEV_CNT 1 29 #define WLAN_CFG_INT_NUM_CONTEXTS 7 30 #define WLAN_CFG_RXDMA1_ENABLE 1 31 /* 32 * This mask defines how many transmit frames account for 1 NAPI work unit 33 * 0 means each tx completion is 1 unit 34 */ 35 #define DP_TX_NAPI_BUDGET_DIV_MASK 0 36 37 /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */ 38 #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x3FFF 39 40 #define NUM_RXDMA_RINGS_PER_PDEV 2 41 #else 42 #define WLAN_CFG_DST_RING_CACHED_DESC 1 43 #define MAX_PDEV_CNT 3 44 #define WLAN_CFG_INT_NUM_CONTEXTS 11 45 #define NUM_RXDMA_RINGS_PER_PDEV 1 46 #endif 47 48 #define WLAN_CFG_INT_NUM_CONTEXTS_MAX 11 49 50 /* Tx configuration */ 51 #define MAX_LINK_DESC_BANKS 8 52 #define MAX_TXDESC_POOLS 4 53 #define MAX_TCL_DATA_RINGS 4 54 55 /* Rx configuration */ 56 #define MAX_RXDESC_POOLS 4 57 #define MAX_REO_DEST_RINGS 4 58 #define MAX_RX_MAC_RINGS 2 59 60 /* DP process status */ 61 #if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1) 62 #define CONFIG_PROCESS_RX_STATUS 1 63 #define CONFIG_PROCESS_TX_STATUS 1 64 #else 65 #define CONFIG_PROCESS_RX_STATUS 0 66 #define CONFIG_PROCESS_TX_STATUS 0 67 #endif 68 69 /* Miscellaneous configuration */ 70 #define MAX_IDLE_SCATTER_BUFS 16 71 #define DP_MAX_IRQ_PER_CONTEXT 12 72 #define MAX_HTT_METADATA_LEN 32 73 #define MAX_NUM_PEER_ID_PER_PEER 8 74 #define DP_MAX_TIDS 17 75 #define DP_NON_QOS_TID 16 76 #define DP_NULL_DATA_TID 17 77 78 #define WLAN_CFG_RX_FST_MAX_SEARCH 2 79 #define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40 80 81 struct wlan_cfg_dp_pdev_ctxt; 82 83 /** 84 * struct wlan_srng_cfg - Per ring configuration parameters 85 * @timer_threshold: Config to control interrupts based on timer duration 86 * @batch_count_threshold: Config to control interrupts based on 87 * number of packets in the ring 88 * @low_threshold: Config to control low threshold interrupts for SRC rings 89 */ 90 struct wlan_srng_cfg { 91 uint32_t timer_threshold; 92 uint32_t batch_count_threshold; 93 uint32_t low_threshold; 94 }; 95 96 /** 97 * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx) 98 * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP 99 * @max_clients: Maximum number of peers/stations supported by device 100 * @max_alloc_size: Maximum allocation size for any dynamic memory 101 * allocation request for this device 102 * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio 103 * 1: Each TCL ring is mapped to one radio/pdev 104 * @num_tcl_data_rings: Number of TCL Data rings supported by device 105 * @per_pdev_rx_ring: 0: REO ring is not mapped per radio 106 * 1: Each REO ring is mapped to one radio/pdev 107 * @num_tx_desc_pool: Number of Tx Descriptor pools 108 * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools 109 * @num_tx_desc: Number of Tx Descriptors per pool 110 * @min_tx_desc: Minimum number of Tx Descriptors per pool 111 * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool 112 * @max_peer_id: Maximum value of peer id that FW can assign for a client 113 * @htt_packet_type: Default 802.11 encapsulation type for any VAP created 114 * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context 115 * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context 116 * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each 117 * NAPI/Intr context 118 * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each 119 * NAPI/Intr context 120 * @int_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each 121 * NAPI/Intr context 122 * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to 123 * each NAPI/Intr context 124 * @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context 125 * @lro_enabled: enable/disable lro feature 126 * @rx_hash: Enable hash based steering of rx packets 127 * @tso_enabled: enable/disable tso feature 128 * @lro_enabled: enable/disable LRO feature 129 * @sg_enabled: enable disable scatter gather feature 130 * @gro_enabled: enable disable GRO feature 131 * @ipa_enabled: Flag indicating if IPA is enabled 132 * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled 133 * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled 134 * @rawmode_enabled: Flag indicating if RAW mode is enabled 135 * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled 136 * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets 137 * @tcp_udp_checksumoffload: enable/disable checksum offload 138 * @nss_cfg: nss configuration 139 * @rx_defrag_min_timeout: rx defrag minimum timeout 140 * @wbm_release_ring: wbm release ring size 141 * @tcl_cmd_ring: tcl cmd ring size 142 * @tcl_status_ring: tcl status ring size 143 * @reo_reinject_ring: reo reinject ring 144 * @rx_release_ring: rx release ring size 145 * @reo_exception_ring: reo exception ring size 146 * @reo_cmd_ring: reo cmd ring size 147 * @reo_status_ring: reo status ting size 148 * @rxdma_refill_ring: rxdma refill ring size 149 * @rxdma_err_dst_ring: rxdma error detination ring size 150 * @raw_mode_war: enable/disable raw mode war 151 * @enable_data_stall_detection: flag to enable data stall detection 152 * @disable_intra_bss_fwd: flag to disable intra bss forwarding 153 * @rxdma1_enable: flag to indicate if rxdma1 is enabled 154 * @tx_desc_limit_0: tx_desc limit for 5G H 155 * @tx_desc_limit_1: tx_desc limit for 2G 156 * @tx_desc_limit_2: tx_desc limit for 5G L 157 * @tx_device_limit: tx device limit 158 * @tx_sw_internode_queue: tx sw internode queue 159 * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop 160 * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop 161 * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates 162 * @rx_enable_eol_data_check: flag to enable check for more ring data at end of 163 * dp_rx_process loop 164 * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data 165 * at end of tx_comp_handler loop. 166 * @rx_sw_desc_weight: rx sw descriptor weight configuration 167 * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or 168 * flow tagging in monitor/mon-lite mode 169 * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE 170 * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev 171 * table should be used 172 * @rx_flow_search_table_size: indicates the number of flows in the flow search 173 * table 174 * @rx_flow_max_search: max skid length for each hash entry 175 * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over 176 * 5 tuple flow entry 177 */ 178 struct wlan_cfg_dp_soc_ctxt { 179 int num_int_ctxts; 180 int max_clients; 181 int max_alloc_size; 182 int per_pdev_tx_ring; 183 int num_tcl_data_rings; 184 int per_pdev_rx_ring; 185 int per_pdev_lmac_ring; 186 int num_reo_dest_rings; 187 int num_tx_desc_pool; 188 int num_tx_ext_desc_pool; 189 int num_tx_desc; 190 int min_tx_desc; 191 int num_tx_ext_desc; 192 int max_peer_id; 193 int htt_packet_type; 194 int int_batch_threshold_tx; 195 int int_timer_threshold_tx; 196 int int_batch_threshold_rx; 197 int int_timer_threshold_rx; 198 int int_batch_threshold_other; 199 int int_timer_threshold_other; 200 int int_timer_threshold_mon; 201 int tx_ring_size; 202 int tx_comp_ring_size; 203 int tx_comp_ring_size_nss; 204 int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 205 int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 206 int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 207 int int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 208 int int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 209 int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 210 int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 211 int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 212 int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 213 int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 214 int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 215 int hw_macid[MAX_PDEV_CNT]; 216 int base_hw_macid; 217 bool rx_hash; 218 bool tso_enabled; 219 bool lro_enabled; 220 bool sg_enabled; 221 bool gro_enabled; 222 bool ipa_enabled; 223 bool ol_tx_csum_enabled; 224 bool ol_rx_csum_enabled; 225 bool rawmode_enabled; 226 bool peer_flow_ctrl_enabled; 227 bool napi_enabled; 228 bool tcp_udp_checksumoffload; 229 bool defrag_timeout_check; 230 int nss_cfg; 231 uint32_t tx_flow_stop_queue_threshold; 232 uint32_t tx_flow_start_queue_offset; 233 int rx_defrag_min_timeout; 234 int reo_dst_ring_size; 235 int wbm_release_ring; 236 int tcl_cmd_ring; 237 int tcl_status_ring; 238 int reo_reinject_ring; 239 int rx_release_ring; 240 int reo_exception_ring; 241 int reo_cmd_ring; 242 int reo_status_ring; 243 int rxdma_refill_ring; 244 int rxdma_err_dst_ring; 245 uint32_t per_pkt_trace; 246 bool raw_mode_war; 247 bool enable_data_stall_detection; 248 bool disable_intra_bss_fwd; 249 bool rxdma1_enable; 250 int max_ast_idx; 251 int tx_desc_limit_0; 252 int tx_desc_limit_1; 253 int tx_desc_limit_2; 254 int tx_device_limit; 255 int tx_sw_internode_queue; 256 int mon_drop_thresh; 257 #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT 258 uint32_t tx_comp_loop_pkt_limit; 259 uint32_t rx_reap_loop_pkt_limit; 260 uint32_t rx_hp_oos_update_limit; 261 bool rx_enable_eol_data_check; 262 bool tx_comp_enable_eol_data_check; 263 #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */ 264 int rx_sw_desc_weight; 265 bool is_rx_mon_protocol_flow_tag_enabled; 266 bool is_rx_flow_tag_enabled; 267 bool is_rx_flow_search_table_per_pdev; 268 uint16_t rx_flow_search_table_size; 269 uint16_t rx_flow_max_search; 270 uint8_t *rx_toeplitz_hash_key; 271 }; 272 273 /** 274 * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio) 275 * @rx_dma_buf_ring_size - Size of RxDMA buffer ring 276 * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring 277 * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring 278 * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring 279 * @rxdma_monitor_desc_ring - rxdma monitor desc ring size 280 */ 281 struct wlan_cfg_dp_pdev_ctxt { 282 int rx_dma_buf_ring_size; 283 int dma_mon_buf_ring_size; 284 int dma_mon_dest_ring_size; 285 int dma_mon_status_ring_size; 286 int rxdma_monitor_desc_ring; 287 int num_mac_rings; 288 int nss_enabled; 289 }; 290 291 /** 292 * wlan_cfg_soc_attach() - Attach configuration interface for SoC 293 * @ctrl_obj - PSOC object 294 * 295 * Allocates context for Soc configuration parameters, 296 * Read configuration information from device tree/ini file and 297 * returns back handle 298 * 299 * Return: Handle to configuration context 300 */ 301 struct wlan_cfg_dp_soc_ctxt * 302 wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj); 303 304 /** 305 * wlan_cfg_soc_detach() - Detach soc configuration handle 306 * @wlan_cfg_ctx: soc configuration handle 307 * 308 * De-allocates memory allocated for SoC configuration 309 * 310 * Return:none 311 */ 312 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 313 314 /** 315 * wlan_cfg_pdev_attach() Attach configuration interface for pdev 316 * @ctrl_obj - PSOC object 317 * 318 * Allocates context for pdev configuration parameters, 319 * Read configuration information from device tree/ini file and 320 * returns back handle 321 * 322 * Return: Handle to configuration context 323 */ 324 struct wlan_cfg_dp_pdev_ctxt * 325 wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj); 326 327 /** 328 * wlan_cfg_pdev_detach() Detach and free pdev configuration handle 329 * @wlan_cfg_pdev_ctx - PDEV Configuration Handle 330 * 331 * Return: void 332 */ 333 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 334 335 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num); 336 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 337 int context, int mask); 338 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 339 int context, int mask); 340 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 341 int context, int mask); 342 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 343 int context, int mask); 344 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, 345 int mask); 346 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val); 347 void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val); 348 int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg); 349 int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg); 350 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 351 int context, int mask); 352 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 353 int context, int mask); 354 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 355 int context, int mask); 356 /** 357 * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered 358 * @wlan_cfg_ctx - Configuration Handle 359 * 360 * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores. 361 * Each context (for linux it is a NAPI context) will have a tx_ring_mask, 362 * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings 363 * that are processed by the handler. 364 * 365 * Return: num_contexts 366 */ 367 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 368 369 /** 370 * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an 371 * interrupt context 372 * @wlan_cfg_ctx - Configuration Handle 373 * @context - Numerical ID identifying the Interrupt/NAPI context 374 * 375 * Return: int_tx_ring_mask[context] 376 */ 377 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 378 int context); 379 380 /** 381 * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an 382 * interrupt context 383 * @wlan_cfg_ctx - Configuration Handle 384 * @context - Numerical ID identifying the Interrupt/NAPI context 385 * 386 * Return: int_rx_ring_mask[context] 387 */ 388 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 389 int context); 390 391 /** 392 * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask 393 * mapped to an interrupt context 394 * @wlan_cfg_ctx - Configuration Handle 395 * @context - Numerical ID identifying the Interrupt/NAPI context 396 * 397 * Return: int_rx_mon_ring_mask[context] 398 */ 399 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 400 int context); 401 402 /** 403 * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask 404 * for the given interrupt context 405 * @wlan_cfg_ctx - Configuration Handle 406 * @context - Numerical ID identifying the Interrupt/NAPI context 407 * 408 */ 409 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 410 int context, int mask); 411 412 /** 413 * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask 414 * mapped to an interrupt context 415 * @wlan_cfg_ctx - Configuration Handle 416 * @context - Numerical ID identifying the Interrupt/NAPI context 417 * 418 * Return: int_rxdma2host_ring_mask[context] 419 */ 420 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 421 int context); 422 423 /** 424 * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask 425 * for the given interrupt context 426 * @wlan_cfg_ctx - Configuration Handle 427 * @context - Numerical ID identifying the Interrupt/NAPI context 428 * 429 */ 430 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 431 int context, int mask); 432 433 /** 434 * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask 435 * mapped to an interrupt context 436 * @wlan_cfg_ctx - Configuration Handle 437 * @context - Numerical ID identifying the Interrupt/NAPI context 438 * 439 * Return: int_host2rxdma_ring_mask[context] 440 */ 441 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 442 int context); 443 444 /** 445 * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring 446 * interrupt mask for the given interrupt context 447 * @wlan_cfg_ctx - Configuration Handle 448 * @context - Numerical ID identifying the Interrupt/NAPI context 449 * 450 */ 451 void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 452 int context, int mask); 453 454 /** 455 * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring 456 * interrupt mask mapped to an interrupt context 457 * @wlan_cfg_ctx - Configuration Handle 458 * @context - Numerical ID identifying the Interrupt/NAPI context 459 * 460 * Return: int_host2rxdma_mon_ring_mask[context] 461 */ 462 int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 463 int context); 464 465 /** 466 * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor 467 * destination ring interrupt mask 468 * for the given interrupt context 469 * @wlan_cfg_ctx - Configuration Handle 470 * @context - Numerical ID identifying the Interrupt/NAPI context 471 * 472 */ 473 void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 474 int context, int mask); 475 476 /** 477 * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor 478 * destination ring interrupt mask 479 * mapped to an interrupt context 480 * @wlan_cfg_ctx - Configuration Handle 481 * @context - Numerical ID identifying the Interrupt/NAPI context 482 * 483 * Return: int_rxdma2host_mon_ring_mask[context] 484 */ 485 int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 486 int context); 487 488 /** 489 * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index 490 * 491 * @wlan_cfg_ctx - Configuration Handle 492 * @pdev_idx - Index of SW PDEV 493 * @hw_macid - HW MAC Id 494 * 495 */ 496 void wlan_cfg_set_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, 497 int hw_macid); 498 499 /** 500 * wlan_cfg_get_hw_macid() - Get HW MAC Id for the given PDEV index 501 * 502 * @wlan_cfg_ctx - Configuration Handle 503 * @pdev_idx - Index of SW PDEV 504 * 505 * Return: HW MAC Id 506 */ 507 int wlan_cfg_get_hw_macid(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx); 508 509 /** 510 * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given 511 * PDEV index 512 * 513 * @wlan_cfg_ctx - Configuration Handle 514 * @pdev_idx - Index of SW PDEV 515 * 516 * Return: HW MAC index 517 */ 518 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx); 519 520 /** 521 * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask 522 * mapped to an interrupt context 523 * @wlan_cfg_ctx - Configuration Handle 524 * @context - Numerical ID identifying the Interrupt/NAPI context 525 * 526 * Return: int_rx_err_ring_mask[context] 527 */ 528 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 529 context); 530 531 /** 532 * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask 533 * mapped to an interrupt context 534 * @wlan_cfg_ctx - Configuration Handle 535 * @context - Numerical ID identifying the Interrupt/NAPI context 536 * 537 * Return: int_wbm_rel_ring_mask[context] 538 */ 539 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 540 context); 541 542 /** 543 * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask 544 * mapped to an interrupt context 545 * @wlan_cfg_ctx - Configuration Handle 546 * @context - Numerical ID identifying the Interrupt/NAPI context 547 * 548 * Return: int_reo_status_ring_mask[context] 549 */ 550 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 551 context); 552 553 /** 554 * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask 555 * mapped to an interrupt context 556 * @wlan_cfg_ctx - Configuration Handle 557 * @context - Numerical ID identifying the Interrupt/NAPI context 558 * 559 * Return: int_ce_ring_mask[context] 560 */ 561 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 562 int context); 563 564 /** 565 * wlan_cfg_get_max_clients() - Return maximum number of peers/stations 566 * supported by device 567 * @wlan_cfg_ctx - Configuration Handle 568 * 569 * Return: max_clients 570 */ 571 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 572 573 /** 574 * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic 575 * memory allocation request for this device 576 * @wlan_cfg_ctx - Configuration Handle 577 * 578 * Return: max_alloc_size 579 */ 580 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 581 582 /* 583 * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as 584 * one per radio 585 * @wlan_cfg_ctx - Configuration Handle 586 * 587 * Return: per_pdev_tx_ring 588 */ 589 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 590 591 /* 592 * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings supported by device 593 * @wlan_cfg_ctx 594 * 595 * Return: num_tcl_data_rings 596 */ 597 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 598 599 /* 600 * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as 601 * one per radio 602 * @wlan_cfg_ctx 603 * 604 * Return: per_pdev_rx_ring 605 */ 606 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 607 608 /* 609 * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as 610 * one per radio 611 * @wlan_cfg_ctx 612 * 613 * Return: return 1 if per pdev error ring else 0 614 */ 615 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 616 617 /* 618 * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings supported by device 619 * @wlan_cfg_ctx - Configuration Handle 620 * 621 * Return: num_reo_dest_rings 622 */ 623 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 624 625 /* 626 * wlan_cfg_pkt_type() - Default 802.11 encapsulation type 627 * @wlan_cfg_ctx - Configuration Handle 628 * 629 * Return: htt_pkt_type_ethernet 630 */ 631 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 632 633 /* 634 * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the 635 * device 636 * @wlan_cfg_ctx - Configuration Handle 637 * 638 * Return: num_tx_desc_pool 639 */ 640 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 641 642 /* 643 * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the 644 * device 645 * @wlan_cfg_ctx - Configuration Handle 646 * @num_pool - Number of pool 647 */ 648 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool); 649 650 /* 651 * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor 652 * pools 653 * @wlan_cfg_ctx - Configuration Handle 654 * 655 * Return: num_tx_ext_desc_pool 656 */ 657 int wlan_cfg_get_num_tx_ext_desc_pool( 658 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 659 660 /* 661 * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size 662 * 663 * @wlan_cfg_ctx - Configuration Handle 664 * 665 * Return: reo_dst_ring_size 666 */ 667 int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 668 669 /* 670 * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size 671 * 672 * @wlan_cfg_ctx - Configuration Handle 673 * @reo_dst_ring_size - REO Destination ring size 674 */ 675 void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, 676 int reo_dst_ring_size); 677 678 /* 679 * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration 680 * 681 * @wlan_cfg_ctx - Configuration Handle 682 * @raw_mode_war - raw mode war configuration 683 */ 684 void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg, 685 bool raw_mode_war); 686 687 /* 688 * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration 689 * 690 * @wlan_cfg_ctx - Configuration Handle 691 * 692 * Return: reo_dst_ring_size 693 */ 694 bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg); 695 696 /* 697 * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor 698 * pools 699 * @wlan_cfg_ctx - Configuration Handle 700 * @num_pool - Number of pool 701 */ 702 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool); 703 704 /* 705 * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool 706 * @wlan_cfg_ctx - Configuration Handle 707 * 708 * Return: num_tx_desc 709 */ 710 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 711 712 /* 713 * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool 714 * @wlan_cfg_ctx - Configuration Handle 715 * 716 * Return: num_tx_desc 717 */ 718 int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 719 720 /* 721 * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool 722 * 723 * @wlan_cfg_ctx - Configuration Handle 724 * @num_desc: Number of descriptor 725 */ 726 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc); 727 728 /* 729 * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors 730 * per pool 731 * @wlan_cfg_ctx - Configuration Handle 732 * 733 * Return: num_tx_ext_desc 734 */ 735 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 736 737 /* 738 * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors 739 * per pool 740 * @wlan_cfg_ctx - Configuration Handle 741 * @num_desc: Number of descriptor 742 */ 743 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc); 744 745 /* 746 * wlan_cfg_max_peer_id() - Get maximum peer ID 747 * @cfg: Configuration Handle 748 * 749 * Return: maximum peer ID 750 */ 751 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg); 752 753 /* 754 * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring 755 * @wlan_cfg_pdev_ctx 756 * 757 * Return: dma_mon_buf_ring_size 758 */ 759 int wlan_cfg_get_dma_mon_buf_ring_size( 760 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 761 762 /* 763 * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor 764 * Destination ring 765 * @wlan_cfg_pdev_ctx 766 * 767 * Return: dma_mon_dest_size 768 */ 769 int wlan_cfg_get_dma_mon_dest_ring_size( 770 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 771 772 /* 773 * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring 774 * @wlan_cfg_pdev_ctx 775 * 776 * Return: dma_mon_stat_ring_size 777 */ 778 int wlan_cfg_get_dma_mon_stat_ring_size( 779 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 780 781 /* 782 * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size 783 * @wlan_cfg_soc_ctx 784 * 785 * Return: rxdma monitor desc ring size 786 */ 787 int 788 wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg); 789 790 /* 791 * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring 792 * @wlan_cfg_pdev_ctx 793 * 794 * Return: rx_dma_buf_ring_size 795 */ 796 int wlan_cfg_get_rx_dma_buf_ring_size( 797 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 798 799 /* 800 * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings 801 * per pdev 802 * @wlan_cfg_pdev_ctx 803 * 804 * Return: number of mac DMA rings per pdev 805 */ 806 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg); 807 808 /* 809 * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled 810 * @wlan_cfg_dp_soc_ctxt 811 * 812 * Return: true - LRO enabled false - LRO disabled 813 */ 814 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 815 816 /* 817 * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled 818 * @wlan_cfg_dp_soc_ctxt 819 * 820 * Return: true - GRO enabled false - GRO disabled 821 */ 822 bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 823 824 /* 825 * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled 826 * @wlan_cfg_dp_soc_ctxt 827 * 828 * Return: true - enabled false - disabled 829 */ 830 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 831 832 /* 833 * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled 834 * @wlan_cfg_dp_soc_ctxt 835 * 836 * Return: true - enabled false - disabled 837 */ 838 bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 839 840 /* 841 * wlan_cfg_set_rx_hash - set rx hash enabled/disabled 842 * @wlan_cfg_soc_ctx 843 * @rx_hash 844 */ 845 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash); 846 847 /* 848 * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled 849 * @wlan_cfg_pdev_ctx 850 * 851 * Return: 1 - enabled 0 - disabled 852 */ 853 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg); 854 855 /* 856 * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled 857 * @wlan_cfg_pdev_ctx 858 */ 859 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled); 860 861 /* 862 * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config 863 * @wlan_cfg_pdev_ctx 864 * 865 * Return: nss_cfg 866 */ 867 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg); 868 869 /* 870 * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config 871 * @wlan_cfg_pdev_ctx 872 * 873 */ 874 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg); 875 876 /* 877 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx 878 * @wlan_cfg_soc_ctx 879 * 880 * Return: Batch threshold 881 */ 882 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg); 883 884 /* 885 * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx 886 * @wlan_cfg_soc_ctx 887 * 888 * Return: Timer threshold 889 */ 890 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg); 891 892 /* 893 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx 894 * @wlan_cfg_soc_ctx 895 * 896 * Return: Batch threshold 897 */ 898 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg); 899 900 /* 901 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx 902 * @wlan_cfg_soc_ctx 903 * 904 * Return: Timer threshold 905 */ 906 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg); 907 908 /* 909 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs 910 * @wlan_cfg_soc_ctx 911 * 912 * Return: Batch threshold 913 */ 914 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); 915 916 /* 917 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs 918 * @wlan_cfg_soc_ctx 919 * 920 * Return: Timer threshold 921 */ 922 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); 923 924 /* 925 * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs 926 * @wlan_cfg_soc_ctx 927 * 928 * Return: Timer threshold 929 */ 930 int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg); 931 932 /* 933 * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status 934 * @wlan_cfg_soc_ctx 935 * 936 * Return: Checksum offload enable or disable 937 */ 938 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg); 939 940 /* 941 * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring) 942 * @wlan_cfg_soc_ctx 943 * 944 * Return: Tx Ring Size 945 */ 946 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 947 948 /* 949 * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring) 950 * @wlan_cfg_soc_ctx 951 * 952 * Return: Tx Completion ring size 953 */ 954 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 955 956 /* 957 * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size 958 * @wlan_cfg_soc_ctx 959 * 960 * Return: wbm_release_ring size 961 */ 962 int 963 wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 964 965 /* 966 * wlan_cfg_get_dp_soc_tcl_cmd_ring_size - Get tcl_cmd_ring size 967 * @wlan_cfg_soc_ctx 968 * 969 * Return: tcl_cmd_ring size 970 */ 971 int 972 wlan_cfg_get_dp_soc_tcl_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 973 974 /* 975 * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size 976 * @wlan_cfg_soc_ctx 977 * 978 * Return: tcl_status_ring size 979 */ 980 int 981 wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 982 983 /* 984 * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size 985 * @wlan_cfg_soc_ctx 986 * 987 * Return: reo_reinject_ring size 988 */ 989 int 990 wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 991 992 /* 993 * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size 994 * @wlan_cfg_soc_ctx 995 * 996 * Return: rx_release_ring size 997 */ 998 int 999 wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1000 1001 /* 1002 * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size 1003 * @wlan_cfg_soc_ctx 1004 * 1005 * Return: reo_exception_ring size 1006 */ 1007 int 1008 wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1009 1010 /* 1011 * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size 1012 * @wlan_cfg_soc_ctx 1013 * 1014 * Return: reo_cmd_ring size 1015 */ 1016 int 1017 wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1018 1019 /* 1020 * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size 1021 * @wlan_cfg_soc_ctx 1022 * 1023 * Return: reo_status_ring size 1024 */ 1025 int 1026 wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1027 1028 /* 1029 * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H 1030 * @wlan_cfg_soc_ctx 1031 * 1032 * Return: tx desc limit for 5G H 1033 */ 1034 int 1035 wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg); 1036 1037 /* 1038 * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G 1039 * @wlan_cfg_soc_ctx 1040 * 1041 * Return: tx desc limit for 2G 1042 */ 1043 int 1044 wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg); 1045 1046 /* 1047 * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L 1048 * @wlan_cfg_soc_ctx 1049 * 1050 * Return: tx desc limit for 5G L 1051 */ 1052 int 1053 wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg); 1054 1055 /* 1056 * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit 1057 * @wlan_cfg_soc_ctx 1058 * 1059 * Return: tx device limit 1060 */ 1061 int 1062 wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg); 1063 1064 /* 1065 * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue 1066 * @wlan_cfg_soc_ctx 1067 * 1068 * Return: tx sw internode queue 1069 */ 1070 int 1071 wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg); 1072 1073 /* 1074 * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size 1075 * @wlan_cfg_soc_ctx 1076 * 1077 * Return: rxdma refill ring size 1078 */ 1079 int 1080 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1081 1082 /* 1083 * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size 1084 * @wlan_cfg_soc_ctx 1085 * 1086 * Return: rxdma error dst ring size 1087 */ 1088 int 1089 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1090 1091 /* 1092 * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight 1093 * @wlan_cfg_soc_ctx 1094 * 1095 * Return: rx_sw_desc_weight 1096 */ 1097 int 1098 wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg); 1099 1100 /* 1101 * wlan_cfg_get_dp_caps - Get dp capablities 1102 * @wlan_cfg_soc_ctx 1103 * @dp_caps: enum for dp capablities 1104 * 1105 * Return: bool if a dp capabilities is enabled 1106 */ 1107 bool 1108 wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg, 1109 enum cdp_capabilities dp_caps); 1110 1111 /** 1112 * wlan_set_srng_cfg() - Fill per ring specific 1113 * configuration parameters 1114 * @wlan_cfg: global srng configuration table 1115 * 1116 * Return: None 1117 */ 1118 void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg); 1119 1120 #ifdef QCA_LL_TX_FLOW_CONTROL_V2 1121 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg); 1122 1123 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg); 1124 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */ 1125 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg); 1126 1127 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg); 1128 1129 /** 1130 * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST 1131 * in number of entries 1132 * 1133 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1134 * 1135 * Return: rx_fst_size 1136 */ 1137 uint16_t 1138 wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1139 1140 /** 1141 * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search 1142 * 1143 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1144 * 1145 * Return: max_search 1146 */ 1147 uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg); 1148 1149 /** 1150 * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST 1151 * search 1152 * 1153 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1154 * 1155 * Return: 320-bit Hash Key 1156 */ 1157 uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg); 1158 1159 /** 1160 * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in 1161 * DP soc context 1162 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1163 * @val: Rx flow tag feature flag value 1164 * 1165 * Return: None 1166 */ 1167 void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg, 1168 bool val); 1169 1170 /** 1171 * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from 1172 * DP soc context 1173 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1174 * 1175 * Return: true if feature is enabled, else false 1176 */ 1177 bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1178 1179 /** 1180 * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that 1181 * Rx FST is per pdev 1182 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1183 * @val: boolean flag indicating Rx FST per pdev or per SOC 1184 * 1185 * Return: None 1186 */ 1187 void 1188 wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg, 1189 bool val); 1190 1191 /** 1192 * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev 1193 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1194 * 1195 * Return: true if Rx FST is per pdev, else false 1196 */ 1197 bool 1198 wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg); 1199 1200 /** 1201 * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context 1202 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1203 * @val: Rx FST size in number of entries 1204 * 1205 * Return: None 1206 */ 1207 void 1208 wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg, 1209 uint16_t val); 1210 1211 /** 1212 * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag 1213 * in DP soc context 1214 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1215 * @val: Rx protocol or flow tag feature flag value in monitor mode from INI 1216 * 1217 * Return: None 1218 */ 1219 void 1220 wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg, 1221 bool val); 1222 1223 /** 1224 * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag 1225 * from DP soc context 1226 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1227 * 1228 * Return: true if feature is enabled in monitor mode for protocol or flow 1229 * tagging in INI, false otherwise 1230 */ 1231 bool 1232 wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1233 #endif 1234