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