1 /* 2 * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 #ifndef __WLAN_CFG_H 21 #define __WLAN_CFG_H 22 23 #include <wlan_init_cfg.h> 24 25 /* DP process status */ 26 #if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1) 27 #define CONFIG_PROCESS_RX_STATUS 1 28 #define CONFIG_PROCESS_TX_STATUS 1 29 #else 30 #define CONFIG_PROCESS_RX_STATUS 0 31 #define CONFIG_PROCESS_TX_STATUS 0 32 #endif 33 34 /* Miscellaneous configuration */ 35 #define MAX_IDLE_SCATTER_BUFS 16 36 #define DP_MAX_IRQ_PER_CONTEXT 12 37 #define MAX_HTT_METADATA_LEN 32 38 #define DP_MAX_TIDS 17 39 #define DP_NON_QOS_TID 16 40 #define DP_NULL_DATA_TID 17 41 42 #ifdef CONFIG_BERYLLIUM 43 #define WLAN_CFG_RX_FST_MAX_SEARCH 16 44 #else 45 #define WLAN_CFG_RX_FST_MAX_SEARCH 2 46 #endif 47 #define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40 48 49 #define INVALID_PDEV_ID 0xFF 50 51 #define WLAN_CFG_RX_RING_MASK_0 0x1 52 #define WLAN_CFG_RX_RING_MASK_1 0x2 53 #define WLAN_CFG_RX_RING_MASK_2 0x4 54 #define WLAN_CFG_RX_RING_MASK_3 0x8 55 #define WLAN_CFG_RX_RING_MASK_4 0x10 56 #define WLAN_CFG_RX_RING_MASK_5 0x20 57 #define WLAN_CFG_RX_RING_MASK_6 0x40 58 #define WLAN_CFG_RX_RING_MASK_7 0x80 59 60 #ifdef WLAN_FEATURE_NEAR_FULL_IRQ 61 #ifdef IPA_OFFLOAD 62 #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1 (WLAN_CFG_RX_RING_MASK_0 | \ 63 WLAN_CFG_RX_RING_MASK_1 | \ 64 WLAN_CFG_RX_RING_MASK_2) 65 66 #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_2 (WLAN_CFG_RX_RING_MASK_4 | \ 67 WLAN_CFG_RX_RING_MASK_5 | \ 68 WLAN_CFG_RX_RING_MASK_6) 69 70 #define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0 | \ 71 WLAN_CFG_TX_RING_MASK_4 | \ 72 WLAN_CFG_TX_RING_MASK_2) 73 74 #else 75 #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1 (WLAN_CFG_RX_RING_MASK_0 | \ 76 WLAN_CFG_RX_RING_MASK_1 | \ 77 WLAN_CFG_RX_RING_MASK_2 | \ 78 WLAN_CFG_RX_RING_MASK_3) 79 80 #define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_2 (WLAN_CFG_RX_RING_MASK_4 | \ 81 WLAN_CFG_RX_RING_MASK_5 | \ 82 WLAN_CFG_RX_RING_MASK_6 | \ 83 WLAN_CFG_RX_RING_MASK_7) 84 85 #ifdef QCA_WIFI_KIWI_V2 86 #define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0 | \ 87 WLAN_CFG_TX_RING_MASK_4 | \ 88 WLAN_CFG_TX_RING_MASK_2 | \ 89 WLAN_CFG_TX_RING_MASK_5 | \ 90 WLAN_CFG_TX_RING_MASK_6) 91 #else /* !QCA_WIFI_KIWI_V2 */ 92 #define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0 | \ 93 WLAN_CFG_TX_RING_MASK_4 | \ 94 WLAN_CFG_TX_RING_MASK_2 | \ 95 WLAN_CFG_TX_RING_MASK_6 | \ 96 WLAN_CFG_TX_RING_MASK_7) 97 #endif /* QCA_WIFI_KIWI_V2 */ 98 #endif 99 #endif 100 101 /* Max number of chips that can participate in MLO */ 102 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) 103 #define WLAN_MAX_MLO_CHIPS 3 104 #define WLAN_MAX_MLO_LINKS_PER_SOC 2 105 #else 106 #define WLAN_MAX_MLO_CHIPS 1 107 #endif 108 109 struct wlan_cfg_dp_pdev_ctxt; 110 111 /** 112 * struct wlan_cfg_tcl_wbm_ring_num_map - TCL WBM Ring number mapping 113 * @tcl_ring_num - TCL Ring number 114 * @wbm_ring_num - WBM Ring number 115 * @wbm_ring_num - WBM RBM ID to be used when enqueuing to TCL 116 * @for_ipa - whether this TCL/WBM for IPA use or not 117 */ 118 struct wlan_cfg_tcl_wbm_ring_num_map { 119 uint8_t tcl_ring_num; 120 uint8_t wbm_ring_num; 121 uint8_t wbm_rbm_id; 122 uint8_t for_ipa; 123 }; 124 125 /** 126 * struct wlan_srng_cfg - Per ring configuration parameters 127 * @timer_threshold: Config to control interrupts based on timer duration 128 * @batch_count_threshold: Config to control interrupts based on 129 * number of packets in the ring 130 * @low_threshold: Config to control low threshold interrupts for SRC rings 131 */ 132 struct wlan_srng_cfg { 133 uint32_t timer_threshold; 134 uint32_t batch_count_threshold; 135 uint32_t low_threshold; 136 }; 137 138 /** 139 * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx) 140 * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP 141 * @max_clients: Maximum number of peers/stations supported by device 142 * @max_alloc_size: Maximum allocation size for any dynamic memory 143 * allocation request for this device 144 * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio 145 * 1: Each TCL ring is mapped to one radio/pdev 146 * @num_tx_comp_rings: Number of Tx comp rings supported by device 147 * @num_tcl_data_rings: Number of TCL Data rings supported by device 148 * @per_pdev_rx_ring: 0: REO ring is not mapped per radio 149 * 1: Each REO ring is mapped to one radio/pdev 150 * @num_tx_desc_pool: Number of Tx Descriptor pools 151 * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools 152 * @num_tx_desc: Number of Tx Descriptors per pool 153 * @min_tx_desc: Minimum number of Tx Descriptors per pool 154 * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool 155 * @max_peer_id: Maximum value of peer id that FW can assign for a client 156 * @htt_packet_type: Default 802.11 encapsulation type for any VAP created 157 * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context 158 * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context 159 * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each 160 * NAPI/Intr context 161 * @int_tx_mon_ring_mask: Bitmap of Tx monitor ring interrupts mapped to each 162 * NAPI/Intr context 163 * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each 164 * NAPI/Intr context 165 * @int_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each 166 * NAPI/Intr context 167 * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to 168 * each NAPI/Intr context 169 * @int_rxdma2host_ring_mask: 170 * @int_host2rxdma_ring_mask: 171 * @int_rx_ring_near_full_irq_1_mask: Bitmap of REO DST ring near full interrupt 172 * mapped to each NAPI/INTR context 173 * @int_rx_ring_near_full_irq_2_mask: Bitmap of REO DST ring near full interrupt 174 * mapped to each NAPI/INTR context 175 * @int_tx_ring_near_full_irq_mask: Bitmap of Tx completion ring near full 176 * interrupt mapped to each NAPI/INTR context 177 * @int_host2txmon_ring_mask: Bitmap of Tx monitor source ring interrupt 178 * mapped to each NAPI/INTR context 179 * @int_umac_reset_intr_mask: Bitmap of UMAC reset interrupt mapped to each 180 * NAPI/INTR context 181 * @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context 182 * @lro_enabled: enable/disable lro feature 183 * @rx_hash: Enable hash based steering of rx packets 184 * @tso_enabled: enable/disable tso feature 185 * @lro_enabled: enable/disable LRO feature 186 * @sg_enabled: enable disable scatter gather feature 187 * @gro_enabled: enable disable GRO feature 188 * @tc_based_dynamic_gro: enable/disable tc based dynamic gro 189 * @tc_ingress_prio: ingress prio to be checked for dynamic gro 190 * @ipa_enabled: Flag indicating if IPA is enabled 191 * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled 192 * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled 193 * @rawmode_enabled: Flag indicating if RAW mode is enabled 194 * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled 195 * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets 196 * @p2p_tcp_udp_checksumoffload: enable/disable checksum offload for P2P mode 197 * @nan_tcp_udp_checksumoffload: enable/disable checksum offload for NAN mode 198 * @tcp_udp_checksumoffload: enable/disable checksum offload 199 * @nss_cfg: nss configuration 200 * @rx_defrag_min_timeout: rx defrag minimum timeout 201 * @wbm_release_ring: wbm release ring size 202 * @tcl_cmd_credit_ring: tcl command/credit ring size 203 * @tcl_status_ring: tcl status ring size 204 * @reo_reinject_ring: reo reinject ring 205 * @rx_release_ring: rx release ring size 206 * @reo_exception_ring: reo exception ring size 207 * @reo_cmd_ring: reo cmd ring size 208 * @reo_status_ring: reo status ting size 209 * @rxdma_refill_ring: rxdma refill ring size 210 * @rxdma_refill_lt_disable: rxdma refill low threshold disable 211 * @rxdma_err_dst_ring: rxdma error destination ring size 212 * @raw_mode_war: enable/disable raw mode war 213 * @enable_data_stall_detection: enable/disable specific data stall detection 214 * @disable_intra_bss_fwd: flag to disable intra bss forwarding 215 * @rxdma1_enable: flag to indicate if rxdma1 is enabled 216 * @delay_mon_replenish: delay monitor buffer replenish 217 * @tx_desc_limit_0: tx_desc limit for 5G H 218 * @tx_desc_limit_1: tx_desc limit for 2G 219 * @tx_desc_limit_2: tx_desc limit for 5G L 220 * @tx_device_limit: tx device limit 221 * @tx_sw_internode_queue: tx sw internode queue 222 * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop 223 * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop 224 * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates 225 * @rx_enable_eol_data_check: flag to enable check for more ring data at end of 226 * dp_rx_process loop 227 * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data 228 * at end of tx_comp_handler loop. 229 * @rx_sw_desc_weight: rx sw descriptor weight configuration 230 * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or 231 * flow tagging in monitor/mon-lite mode 232 * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE 233 * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev 234 * table should be used 235 * @rx_flow_search_table_size: indicates the number of flows in the flow search 236 * table 237 * @rx_flow_max_search: max skid length for each hash entry 238 * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over 239 * 5 tuple flow entry 240 * @pktlog_buffer_size: packet log buffer size 241 * @is_rx_fisa_enabled: flag to enable/disable FISA Rx 242 * @pext_stats_enabled: Flag to enable and disabled peer extended stats 243 * @is_rx_buff_pool_enabled: flag to enable/disable emergency RX buffer 244 * pool support 245 * @is_rx_refill_buff_pool_enabled: flag to enable/disable RX refill buffer 246 * pool support 247 * @rx_pending_high_threshold: threshold of starting pkt drop 248 * @rx_pending_low_threshold: threshold of stopping pkt drop 249 * @is_swlm_enabled: flag to enable/disable SWLM 250 * @tx_per_pkt_vdev_id_check: Enable tx perpkt vdev id check 251 * @wow_check_rx_pending_enable: Enable RX frame pending check in WoW 252 * @ipa_tx_ring_size: IPA tx ring size 253 * @ipa_tx_comp_ring_size: IPA tx completion ring size 254 * @ipa_tx_alt_ring_size: IPA tx alt ring size 255 * @ipa_tx_alt_comp_ring_size: IPA tx alt completion ring size 256 * @hw_cc_conv_enabled: cookie conversion enabled 257 * @tcl_wbm_map_array: TCL-WBM map array 258 * @pkt_capture_mode: Packet capture mode config 259 * @rx_mon_buf_ring_size: Rx monitor buf ring size 260 * @tx_mon_buf_ring_size: Tx monitor buf ring size 261 * @tx_rings_grp_bitmap: bitmap of group intr contexts which have 262 * non-zero tx ring mask 263 * @mlo_chip_rx_ring_map: map of chip_id to rx ring map 264 * @vdev_stats_hw_offload_config: HW vdev stats config 265 * @vdev_stats_hw_offload_timer: HW vdev stats timer duration 266 * @txmon_hw_support: TxMON HW support 267 * @num_rxdma_status_rings_per_pdev: Num RXDMA status rings 268 * @mpdu_retry_threshold_1: MPDU retry threshold 1 to increment tx bad count 269 * @mpdu_retry_threshold_2: MPDU retry threshold 2 to increment tx bad count 270 * napi_scale_factor: scaling factor to be used for napi polls 271 * @notify_frame_support: flag indicating capability to mark notify frames 272 * @is_handle_invalid_decap_type_disabled: flag to indicate if invalid decap type 273 * handling is disabled 274 */ 275 struct wlan_cfg_dp_soc_ctxt { 276 int num_int_ctxts; 277 int max_clients; 278 int max_alloc_size; 279 int per_pdev_tx_ring; 280 int num_tx_comp_rings; 281 int num_tcl_data_rings; 282 int num_nss_tcl_data_rings; 283 int per_pdev_rx_ring; 284 int per_pdev_lmac_ring; 285 int num_reo_dest_rings; 286 int num_nss_reo_dest_rings; 287 int num_tx_desc_pool; 288 int num_tx_ext_desc_pool; 289 int num_tx_desc; 290 int min_tx_desc; 291 int num_tx_ext_desc; 292 int max_peer_id; 293 int htt_packet_type; 294 int int_batch_threshold_tx; 295 int int_timer_threshold_tx; 296 int int_batch_threshold_rx; 297 int int_timer_threshold_rx; 298 int int_batch_threshold_other; 299 int int_timer_threshold_other; 300 int int_timer_threshold_mon; 301 int tx_ring_size; 302 int time_control_bp; 303 int tx_comp_ring_size; 304 int tx_comp_ring_size_nss; 305 uint8_t int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 306 uint8_t int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 307 uint8_t int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 308 uint8_t int_tx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 309 uint8_t int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 310 uint8_t int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 311 uint8_t int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 312 uint8_t int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 313 uint8_t int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 314 uint8_t int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 315 uint8_t int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 316 uint8_t int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 317 uint8_t int_rx_ring_near_full_irq_1_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 318 uint8_t int_rx_ring_near_full_irq_2_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 319 uint8_t int_tx_ring_near_full_irq_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 320 uint8_t int_host2txmon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 321 uint8_t int_umac_reset_intr_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 322 int hw_macid[MAX_PDEV_CNT]; 323 int hw_macid_pdev_id_map[MAX_NUM_LMAC_HW]; 324 int base_hw_macid; 325 bool rx_hash; 326 bool tso_enabled; 327 bool lro_enabled; 328 bool sg_enabled; 329 bool gro_enabled; 330 bool tc_based_dynamic_gro; 331 uint32_t tc_ingress_prio; 332 bool ipa_enabled; 333 bool ol_tx_csum_enabled; 334 bool ol_rx_csum_enabled; 335 bool rawmode_enabled; 336 bool peer_flow_ctrl_enabled; 337 bool napi_enabled; 338 bool p2p_tcp_udp_checksumoffload; 339 bool nan_tcp_udp_checksumoffload; 340 bool tcp_udp_checksumoffload; 341 bool legacy_mode_checksumoffload_disable; 342 bool defrag_timeout_check; 343 int nss_cfg; 344 uint32_t tx_flow_stop_queue_threshold; 345 uint32_t tx_flow_start_queue_offset; 346 int rx_defrag_min_timeout; 347 int reo_dst_ring_size; 348 int wbm_release_ring; 349 int tcl_cmd_credit_ring; 350 int tcl_status_ring; 351 int reo_reinject_ring; 352 int rx_release_ring; 353 int reo_exception_ring; 354 int reo_cmd_ring; 355 int reo_status_ring; 356 int rxdma_refill_ring; 357 bool rxdma_refill_lt_disable; 358 int rxdma_err_dst_ring; 359 uint32_t per_pkt_trace; 360 bool raw_mode_war; 361 uint32_t enable_data_stall_detection; 362 bool disable_intra_bss_fwd; 363 bool rxdma1_enable; 364 bool delay_mon_replenish; 365 int max_ast_idx; 366 int tx_desc_limit_0; 367 int tx_desc_limit_1; 368 int tx_desc_limit_2; 369 int tx_device_limit; 370 int tx_sw_internode_queue; 371 int mon_drop_thresh; 372 #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT 373 uint32_t tx_comp_loop_pkt_limit; 374 uint32_t rx_reap_loop_pkt_limit; 375 uint32_t rx_hp_oos_update_limit; 376 bool rx_enable_eol_data_check; 377 bool tx_comp_enable_eol_data_check; 378 #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */ 379 int rx_sw_desc_weight; 380 int rx_sw_desc_num; 381 bool is_rx_mon_protocol_flow_tag_enabled; 382 bool is_rx_flow_tag_enabled; 383 bool is_rx_flow_search_table_per_pdev; 384 uint16_t rx_flow_search_table_size; 385 uint16_t rx_flow_max_search; 386 uint8_t *rx_toeplitz_hash_key; 387 uint8_t pktlog_buffer_size; 388 uint8_t is_rx_fisa_enabled; 389 bool is_rx_fisa_lru_del_enabled; 390 bool is_tso_desc_attach_defer; 391 uint32_t delayed_replenish_entries; 392 uint32_t reo_rings_mapping; 393 bool pext_stats_enabled; 394 bool is_rx_buff_pool_enabled; 395 bool is_rx_refill_buff_pool_enabled; 396 uint32_t rx_pending_high_threshold; 397 uint32_t rx_pending_low_threshold; 398 bool is_poll_mode_enabled; 399 uint8_t is_swlm_enabled; 400 bool fst_in_cmem; 401 bool tx_per_pkt_vdev_id_check; 402 uint8_t radio0_rx_default_reo; 403 uint8_t radio1_rx_default_reo; 404 uint8_t radio2_rx_default_reo; 405 bool wow_check_rx_pending_enable; 406 bool jitter_stats_enabled; 407 #ifdef IPA_OFFLOAD 408 uint32_t ipa_tx_ring_size; 409 uint32_t ipa_tx_comp_ring_size; 410 #ifdef IPA_WDI3_TX_TWO_PIPES 411 int ipa_tx_alt_ring_size; 412 int ipa_tx_alt_comp_ring_size; 413 #endif /* IPA_WDI3_TX_TWO_PIPES */ 414 #endif /* IPA_OFFLOAD */ 415 bool hw_cc_enabled; 416 struct wlan_cfg_tcl_wbm_ring_num_map *tcl_wbm_map_array; 417 #ifdef WLAN_SUPPORT_PPEDS 418 bool ppe_enable; 419 int reo2ppe_ring; 420 int ppe2tcl_ring; 421 int ppe_release_ring; 422 int ppe_num_tx_desc; 423 #endif 424 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2 425 uint32_t pkt_capture_mode; 426 #endif 427 uint32_t rx_mon_buf_ring_size; 428 uint32_t tx_mon_buf_ring_size; 429 uint8_t rx_rel_wbm2sw_ring_id; 430 uint32_t tx_rings_grp_bitmap; 431 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) 432 uint8_t mlo_chip_rx_ring_map; 433 #endif 434 #ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT 435 bool vdev_stats_hw_offload_config; 436 int vdev_stats_hw_offload_timer; 437 #endif 438 uint8_t num_rxdma_dst_rings_per_pdev; 439 bool txmon_hw_support; 440 uint8_t num_rxdma_status_rings_per_pdev; 441 #ifdef WLAN_TX_PKT_CAPTURE_ENH 442 uint32_t tx_capt_max_mem_allowed; 443 #endif 444 #ifdef CONFIG_SAWF 445 bool sawf_enabled; 446 #endif 447 #ifdef CONFIG_SAWF_STATS 448 uint8_t sawf_stats; 449 #endif 450 uint8_t mpdu_retry_threshold_1; 451 uint8_t mpdu_retry_threshold_2; 452 uint8_t napi_scale_factor; 453 uint8_t notify_frame_support; 454 bool is_handle_invalid_decap_type_disabled; 455 }; 456 457 /** 458 * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio) 459 * @rx_dma_buf_ring_size - Size of RxDMA buffer ring 460 * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring 461 * @dma_rx_mon_dest_ring_size - Size of RxDMA Monitor Destination ring 462 * @dma_tx_mon_dest_ring_size - Size of Tx Monitor Destination ring 463 * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring 464 * @rxdma_monitor_desc_ring - rxdma monitor desc ring size 465 * @dma_tx_mon_buf_ring_size - Tx monitor BUF Ring size 466 */ 467 struct wlan_cfg_dp_pdev_ctxt { 468 int rx_dma_buf_ring_size; 469 int dma_mon_buf_ring_size; 470 int dma_rx_mon_dest_ring_size; 471 int dma_tx_mon_dest_ring_size; 472 int dma_mon_status_ring_size; 473 int rxdma_monitor_desc_ring; 474 int num_mac_rings; 475 int nss_enabled; 476 int dma_tx_mon_buf_ring_size; 477 }; 478 479 /** 480 * struct wlan_dp_prealloc_cfg - DP prealloc related config 481 * @num_tx_ring_entries: num of tcl data ring entries 482 * @num_tx_comp_ring_entries: num of tx comp ring entries 483 * @num_wbm_rel_ring_entries: num of wbm err ring entries 484 * @num_rxdma_err_dst_ring_entries: num of rxdma err ring entries 485 * @num_reo_exception_ring_entries: num of rx exception ring entries 486 * @num_tx_desc: num of tx descriptors 487 * @num_tx_ext_desc: num of tx ext descriptors 488 * @num_reo_dst_ring_entries: Number of entries in REO destination ring 489 * @num_rxdma_buf_ring_entries: Number of entries in rxdma buf ring 490 * @num_rxdma_refill_ring_entries: Number of entries in rxdma refill ring 491 * @num_reo_status_ring_entries: Number of entries in REO status ring 492 * @num_mon_status_ring_entries: Number of entries in monitor status ring 493 */ 494 struct wlan_dp_prealloc_cfg { 495 int num_tx_ring_entries; 496 int num_tx_comp_ring_entries; 497 int num_wbm_rel_ring_entries; 498 int num_rxdma_err_dst_ring_entries; 499 int num_reo_exception_ring_entries; 500 int num_tx_desc; 501 int num_tx_ext_desc; 502 int num_reo_dst_ring_entries; 503 int num_rxdma_buf_ring_entries; 504 int num_rxdma_refill_ring_entries; 505 int num_reo_status_ring_entries; 506 int num_mon_status_ring_entries; 507 }; 508 509 /** 510 * wlan_cfg_soc_attach() - Attach configuration interface for SoC 511 * @ctrl_obj - PSOC object 512 * 513 * Allocates context for Soc configuration parameters, 514 * Read configuration information from device tree/ini file and 515 * returns back handle 516 * 517 * Return: Handle to configuration context 518 */ 519 struct wlan_cfg_dp_soc_ctxt * 520 wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj); 521 522 /** 523 * wlan_cfg_soc_detach() - Detach soc configuration handle 524 * @wlan_cfg_ctx: soc configuration handle 525 * 526 * De-allocates memory allocated for SoC configuration 527 * 528 * Return:none 529 */ 530 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 531 532 /** 533 * wlan_cfg_pdev_attach() Attach configuration interface for pdev 534 * @ctrl_obj - PSOC object 535 * 536 * Allocates context for pdev configuration parameters, 537 * Read configuration information from device tree/ini file and 538 * returns back handle 539 * 540 * Return: Handle to configuration context 541 */ 542 struct wlan_cfg_dp_pdev_ctxt * 543 wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj); 544 545 /** 546 * wlan_cfg_pdev_detach() Detach and free pdev configuration handle 547 * @wlan_cfg_pdev_ctx - PDEV Configuration Handle 548 * 549 * Return: void 550 */ 551 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 552 553 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num); 554 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 555 int context, int mask); 556 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 557 int context, int mask); 558 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 559 int context, int mask); 560 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 561 int context, int mask); 562 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, 563 int mask); 564 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val); 565 void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val); 566 int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg); 567 int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg); 568 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 569 int context, int mask); 570 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 571 int context, int mask); 572 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 573 int context, int mask); 574 575 /** 576 * wlan_cfg_set_mon_delayed_replenish_entries() - number of buffers to replenish 577 * for monitor buffer ring at initialization 578 * @wlan_cfg_ctx - Configuration Handle 579 * @replenish_entries - number of entries to replenish at initialization 580 * 581 */ 582 void wlan_cfg_set_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt 583 *wlan_cfg_ctx, 584 uint32_t replenish_entries); 585 586 /** 587 * wlan_cfg_get_mon_delayed_replenish_entries() - get num of buffer to replenish 588 * for monitor buffer ring at initialization 589 * @wlan_cfg_ctx - Configuration Handle 590 * @replenish_entries - number of entries to replenish at initialization 591 * 592 * Return: delayed_replenish_entries; 593 */ 594 int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt 595 *wlan_cfg_ctx); 596 /** 597 * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered 598 * @wlan_cfg_ctx - Configuration Handle 599 * 600 * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores. 601 * Each context (for linux it is a NAPI context) will have a tx_ring_mask, 602 * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings 603 * that are processed by the handler. 604 * 605 * Return: num_contexts 606 */ 607 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 608 609 /** 610 * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an 611 * interrupt context 612 * @wlan_cfg_ctx - Configuration Handle 613 * @context - Numerical ID identifying the Interrupt/NAPI context 614 * 615 * Return: int_tx_ring_mask[context] 616 */ 617 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 618 int context); 619 620 /** 621 * wlan_cfg_get_tcl_wbm_ring_num_for_index() - Get TCL/WBM ring number for index 622 * @wlan_cfg_ctx - Configuration Handle 623 * @index: index for which TCL/WBM ring numbers are needed 624 * @tcl: pointer to TCL ring number, to be filled 625 * @wbm: pointer to WBM ring number to be filled 626 * 627 * The function fills in tcl/wbm input pointers with TCL/WBM ring numbers for a 628 * given index corresponding to soc->tcl_data_ring or soc->tx_comp_ring. This 629 * is needed since WBM/TCL rings may not be sequentially available for HOST 630 * to use. The function returns values as stored in tcl_wbm_map_array global 631 * array. 632 * 633 * Return: None 634 */ 635 static inline 636 void wlan_cfg_get_tcl_wbm_ring_num_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 637 int index, int *tcl, int *wbm) 638 { 639 *tcl = wlan_cfg_ctx->tcl_wbm_map_array[index].tcl_ring_num; 640 *wbm = wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_ring_num; 641 } 642 643 /** 644 * wlan_cfg_get_wbm_ring_num_for_index() - Get WBM ring number for index 645 * @wlan_cfg_ctx - Configuration Handle 646 * @index: index for which WBM ring numbers is needed 647 * 648 * Return: WBM Ring number for the index 649 */ 650 static inline 651 int wlan_cfg_get_wbm_ring_num_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 652 int index) 653 { 654 return wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_ring_num; 655 } 656 657 /** 658 * wlan_cfg_get_rbm_id_for_index() - Get WBM RBM ID for TX ring index 659 * @wlan_cfg_ctx - Configuration Handle 660 * @index: TCL index for which WBM rbm value is needed 661 * 662 * The function fills in wbm rbm value corresponding to a TX ring index in 663 * soc->tcl_data_ring. This is needed since WBM ring numbers donot map 664 * sequentially to wbm rbm values. 665 * The function returns rbm id values as stored in tcl_wbm_map_array global 666 * array. 667 * 668 * Return: WBM rbm value corresnponding to TX ring index 669 */ 670 static inline 671 int wlan_cfg_get_rbm_id_for_index(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, int index) 672 { 673 return wlan_cfg_ctx->tcl_wbm_map_array[index].wbm_rbm_id; 674 } 675 676 /** 677 * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an 678 * interrupt context 679 * @wlan_cfg_ctx - Configuration Handle 680 * @context - Numerical ID identifying the Interrupt/NAPI context 681 * 682 * Return: int_rx_ring_mask[context] 683 */ 684 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 685 int context); 686 687 /** 688 * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask 689 * mapped to an interrupt context 690 * @wlan_cfg_ctx - Configuration Handle 691 * @context - Numerical ID identifying the Interrupt/NAPI context 692 * 693 * Return: int_rx_mon_ring_mask[context] 694 */ 695 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 696 int context); 697 698 /** 699 * wlan_cfg_set_tx_mon_ring_mask() - Set Tx monitor ring interrupt mask 700 * mapped to an interrupt context 701 * @wlan_cfg_ctx - Configuration Handle 702 * @context - Numerical ID identifying the Interrupt/NAPI context 703 * @mask: Interrupt mask 704 * 705 * Return: None 706 */ 707 void wlan_cfg_set_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 708 int context, int mask); 709 710 /** 711 * wlan_cfg_get_tx_mon_ring_mask() - Return Tx monitor ring interrupt mask 712 * mapped to an interrupt context 713 * @wlan_cfg_ctx - Configuration Handle 714 * @context - Numerical ID identifying the Interrupt/NAPI context 715 * 716 * Return: int_tx_mon_ring_mask[context] 717 */ 718 int wlan_cfg_get_tx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 719 int context); 720 721 /** 722 * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask 723 * for the given interrupt context 724 * @wlan_cfg_ctx - Configuration Handle 725 * @context - Numerical ID identifying the Interrupt/NAPI context 726 * 727 */ 728 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 729 int context, int mask); 730 731 /** 732 * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask 733 * mapped to an interrupt context 734 * @wlan_cfg_ctx - Configuration Handle 735 * @context - Numerical ID identifying the Interrupt/NAPI context 736 * 737 * Return: int_rxdma2host_ring_mask[context] 738 */ 739 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 740 int context); 741 742 /** 743 * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask 744 * for the given interrupt context 745 * @wlan_cfg_ctx - Configuration Handle 746 * @context - Numerical ID identifying the Interrupt/NAPI context 747 * 748 */ 749 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 750 int context, int mask); 751 752 /** 753 * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask 754 * mapped to an interrupt context 755 * @wlan_cfg_ctx - Configuration Handle 756 * @context - Numerical ID identifying the Interrupt/NAPI context 757 * 758 * Return: int_host2rxdma_ring_mask[context] 759 */ 760 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 761 int context); 762 763 /** 764 * wlan_cfg_get_rx_near_full_grp_1_mask() - Return REO near full interrupt mask 765 * mapped to an interrupt context 766 * @cfg: Configuration Handle 767 * @context - Numerical ID identifying the Interrupt/NAPI context 768 * 769 * Return: REO near full interrupt mask[context] 770 */ 771 int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 772 int context); 773 774 /** 775 * wlan_cfg_get_rx_near_full_grp_2_mask() - Return REO near full interrupt mask 776 * mapped to an interrupt context 777 * @cfg: Configuration Handle 778 * @context - Numerical ID identifying the Interrupt/NAPI context 779 * 780 * Return: REO near full interrupt mask[context] 781 */ 782 int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 783 int context); 784 785 /** 786 * wlan_cfg_get_tx_ring_near_full_mask() - Return tx completion ring near full 787 * interrupt mask mapped to an interrupt context 788 * @cfg: Configuration Handle 789 * @context - Numerical ID identifying the Interrupt/NAPI context 790 * 791 * Return: tx completion near full interrupt mask[context] 792 */ 793 int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 794 int context); 795 /** 796 * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring 797 * interrupt mask for the given interrupt context 798 * @wlan_cfg_ctx - Configuration Handle 799 * @context - Numerical ID identifying the Interrupt/NAPI context 800 * 801 */ 802 void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 803 int context, int mask); 804 805 /** 806 * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring 807 * interrupt mask mapped to an interrupt context 808 * @wlan_cfg_ctx - Configuration Handle 809 * @context - Numerical ID identifying the Interrupt/NAPI context 810 * 811 * Return: int_host2rxdma_mon_ring_mask[context] 812 */ 813 int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 814 int context); 815 816 /** 817 * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor 818 * destination ring interrupt mask 819 * for the given interrupt context 820 * @wlan_cfg_ctx - Configuration Handle 821 * @context - Numerical ID identifying the Interrupt/NAPI context 822 * 823 */ 824 void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 825 int context, int mask); 826 827 /** 828 * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor 829 * destination ring interrupt mask 830 * mapped to an interrupt context 831 * @wlan_cfg_ctx - Configuration Handle 832 * @context - Numerical ID identifying the Interrupt/NAPI context 833 * 834 * Return: int_rxdma2host_mon_ring_mask[context] 835 */ 836 int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 837 int context); 838 839 /** 840 * wlan_cfg_set_hw_macidx() - Set HW MAC Idx for the given PDEV index 841 * 842 * @wlan_cfg_ctx - Configuration Handle 843 * @pdev_idx - Index of SW PDEV 844 * @hw_macid - HW MAC Id 845 * 846 */ 847 void wlan_cfg_set_hw_mac_idx 848 (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid); 849 850 /** 851 * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given 852 * PDEV index 853 * 854 * @wlan_cfg_ctx - Configuration Handle 855 * @pdev_idx - Index of SW PDEV 856 * 857 * Return: HW MAC index 858 */ 859 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx); 860 861 /** 862 * wlan_cfg_get_target_pdev_id() - Get target PDEV ID for HW MAC ID 863 * 864 * @wlan_cfg_ctx - Configuration Handle 865 * @hw_macid - Index of hw mac 866 * 867 * Return: PDEV ID 868 */ 869 int 870 wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid); 871 872 /** 873 * wlan_cfg_set_pdev_idx() - Set 0 based host PDEV index for the given 874 * hw mac index 875 * 876 * @wlan_cfg_ctx - Configuration Handle 877 * @pdev_idx - Index of SW PDEV 878 * @hw_macid - Index of hw mac 879 * 880 * Return: PDEV index 881 */ 882 void wlan_cfg_set_pdev_idx 883 (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid); 884 885 /** 886 * wlan_cfg_get_pdev_idx() - Get 0 based PDEV index for the given 887 * hw mac index 888 * 889 * @wlan_cfg_ctx - Configuration Handle 890 * @hw_macid - Index of hw mac 891 * 892 * Return: PDEV index 893 */ 894 int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid); 895 896 /** 897 * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask 898 * mapped to an interrupt context 899 * @wlan_cfg_ctx - Configuration Handle 900 * @context - Numerical ID identifying the Interrupt/NAPI context 901 * 902 * Return: int_rx_err_ring_mask[context] 903 */ 904 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 905 context); 906 907 /** 908 * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask 909 * mapped to an interrupt context 910 * @wlan_cfg_ctx - Configuration Handle 911 * @context - Numerical ID identifying the Interrupt/NAPI context 912 * 913 * Return: int_wbm_rel_ring_mask[context] 914 */ 915 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 916 context); 917 918 /** 919 * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask 920 * mapped to an interrupt context 921 * @wlan_cfg_ctx - Configuration Handle 922 * @context - Numerical ID identifying the Interrupt/NAPI context 923 * 924 * Return: int_reo_status_ring_mask[context] 925 */ 926 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 927 context); 928 929 /** 930 * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask 931 * mapped to an interrupt context 932 * @wlan_cfg_ctx - Configuration Handle 933 * @context - Numerical ID identifying the Interrupt/NAPI context 934 * 935 * Return: int_ce_ring_mask[context] 936 */ 937 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 938 int context); 939 940 /** 941 * wlan_cfg_get_umac_reset_intr_mask() - Get UMAC reset interrupt mask 942 * mapped to an interrupt context 943 * @wlan_cfg_ctx - Configuration Handle 944 * @context - Numerical ID identifying the Interrupt/NAPI context 945 * 946 * Return: int_umac_reset_intr_mask[context] 947 */ 948 int wlan_cfg_get_umac_reset_intr_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 949 int context); 950 /** 951 * wlan_cfg_get_max_clients() - Return maximum number of peers/stations 952 * supported by device 953 * @wlan_cfg_ctx - Configuration Handle 954 * 955 * Return: max_clients 956 */ 957 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 958 959 /** 960 * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic 961 * memory allocation request for this device 962 * @wlan_cfg_ctx - Configuration Handle 963 * 964 * Return: max_alloc_size 965 */ 966 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 967 968 /* 969 * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as 970 * one per radio 971 * @wlan_cfg_ctx - Configuration Handle 972 * 973 * Return: per_pdev_tx_ring 974 */ 975 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 976 977 /* 978 * wlan_cfg_num_tx_comp_rings() - Number of Tx comp rings (HOST mode) 979 * @wlan_cfg_ctx 980 * 981 * Return: num_tx_comp_rings 982 */ 983 int wlan_cfg_num_tx_comp_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 984 985 /* 986 * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings (HOST mode) 987 * @wlan_cfg_ctx 988 * 989 * Return: num_tcl_data_rings 990 */ 991 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 992 993 /* 994 * wlan_cfg_num_nss_tcl_data_rings() - Number of TCL Data rings (NSS offload) 995 * @wlan_cfg_ctx 996 * 997 * Return: num_tcl_data_rings 998 */ 999 int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1000 1001 /* 1002 * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as 1003 * one per radio 1004 * @wlan_cfg_ctx 1005 * 1006 * Return: per_pdev_rx_ring 1007 */ 1008 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1009 1010 /* 1011 * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as 1012 * one per radio 1013 * @wlan_cfg_ctx 1014 * 1015 * Return: return 1 if per pdev error ring else 0 1016 */ 1017 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1018 1019 /* 1020 * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings (HOST mode) 1021 * @wlan_cfg_ctx - Configuration Handle 1022 * 1023 * Return: num_reo_dest_rings 1024 */ 1025 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1026 1027 /* 1028 * wlan_cfg_num_nss_reo_dest_rings() - Number of REO Data rings (NSS offload) 1029 * @wlan_cfg_ctx - Configuration Handle 1030 * 1031 * Return: num_reo_dest_rings 1032 */ 1033 int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1034 1035 /* 1036 * wlan_cfg_pkt_type() - Default 802.11 encapsulation type 1037 * @wlan_cfg_ctx - Configuration Handle 1038 * 1039 * Return: htt_pkt_type_ethernet 1040 */ 1041 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1042 1043 /* 1044 * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the 1045 * device 1046 * @wlan_cfg_ctx - Configuration Handle 1047 * 1048 * Return: num_tx_desc_pool 1049 */ 1050 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1051 1052 /* 1053 * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the 1054 * device 1055 * @wlan_cfg_ctx - Configuration Handle 1056 * @num_pool - Number of pool 1057 */ 1058 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool); 1059 1060 /* 1061 * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor 1062 * pools 1063 * @wlan_cfg_ctx - Configuration Handle 1064 * 1065 * Return: num_tx_ext_desc_pool 1066 */ 1067 int wlan_cfg_get_num_tx_ext_desc_pool( 1068 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1069 1070 /* 1071 * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size 1072 * 1073 * @wlan_cfg_ctx - Configuration Handle 1074 * 1075 * Return: reo_dst_ring_size 1076 */ 1077 int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1078 1079 /* 1080 * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size 1081 * 1082 * @wlan_cfg_ctx - Configuration Handle 1083 * @reo_dst_ring_size - REO Destination ring size 1084 */ 1085 void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, 1086 int reo_dst_ring_size); 1087 1088 /* 1089 * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration 1090 * 1091 * @wlan_cfg_ctx - Configuration Handle 1092 * @raw_mode_war - raw mode war configuration 1093 */ 1094 void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg, 1095 bool raw_mode_war); 1096 1097 /* 1098 * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration 1099 * 1100 * @wlan_cfg_ctx - Configuration Handle 1101 * 1102 * Return: reo_dst_ring_size 1103 */ 1104 bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg); 1105 1106 /* 1107 * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor 1108 * pools 1109 * @wlan_cfg_ctx - Configuration Handle 1110 * @num_pool - Number of pool 1111 */ 1112 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool); 1113 1114 /* 1115 * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool 1116 * @wlan_cfg_ctx - Configuration Handle 1117 * 1118 * Return: num_tx_desc 1119 */ 1120 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1121 1122 /* 1123 * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool 1124 * @wlan_cfg_ctx - Configuration Handle 1125 * 1126 * Return: num_tx_desc 1127 */ 1128 int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1129 1130 /* 1131 * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool 1132 * 1133 * @wlan_cfg_ctx - Configuration Handle 1134 * @num_desc: Number of descriptor 1135 */ 1136 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc); 1137 1138 /* 1139 * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors 1140 * per pool 1141 * @wlan_cfg_ctx - Configuration Handle 1142 * 1143 * Return: num_tx_ext_desc 1144 */ 1145 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1146 1147 /* 1148 * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors 1149 * per pool 1150 * @wlan_cfg_ctx - Configuration Handle 1151 * @num_desc: Number of descriptor 1152 */ 1153 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc); 1154 1155 /* 1156 * wlan_cfg_max_peer_id() - Get maximum peer ID 1157 * @cfg: Configuration Handle 1158 * 1159 * Return: maximum peer ID 1160 */ 1161 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg); 1162 1163 /* 1164 * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring 1165 * @wlan_cfg_pdev_ctx 1166 * 1167 * Return: dma_mon_buf_ring_size 1168 */ 1169 int wlan_cfg_get_dma_mon_buf_ring_size( 1170 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 1171 1172 /* 1173 * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring 1174 * @wlan_cfg_pdev_ctx 1175 * 1176 * Return: dma_mon_stat_ring_size 1177 */ 1178 int wlan_cfg_get_dma_mon_stat_ring_size( 1179 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 1180 1181 /* 1182 * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size 1183 * @wlan_cfg_soc_ctx 1184 * 1185 * Return: rxdma monitor desc ring size 1186 */ 1187 int 1188 wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg); 1189 1190 /* 1191 * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring 1192 * @wlan_cfg_pdev_ctx 1193 * 1194 * Return: rx_dma_buf_ring_size 1195 */ 1196 int wlan_cfg_get_rx_dma_buf_ring_size( 1197 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 1198 1199 /* 1200 * wlan_cfg_rx_pending_hl_threshold() - Return high threshold of rx pending 1201 * @wlan_cfg_pdev_ctx 1202 * 1203 * Return: rx_pending_high_threshold 1204 */ 1205 uint32_t 1206 wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg); 1207 1208 /* 1209 * wlan_cfg_rx_pending_lo_threshold() - Return low threshold of rx pending 1210 * @wlan_cfg_pdev_ctx 1211 * 1212 * Return: rx_pending_low_threshold 1213 */ 1214 uint32_t 1215 wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg); 1216 1217 /* 1218 * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings 1219 * per pdev 1220 * @wlan_cfg_pdev_ctx 1221 * 1222 * Return: number of mac DMA rings per pdev 1223 */ 1224 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg); 1225 1226 /* 1227 * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled 1228 * @wlan_cfg_dp_soc_ctxt 1229 * 1230 * Return: true - LRO enabled false - LRO disabled 1231 */ 1232 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1233 1234 /* 1235 * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled 1236 * @wlan_cfg_dp_soc_ctxt 1237 * 1238 * Return: true - GRO enabled false - GRO disabled 1239 */ 1240 bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1241 1242 /* 1243 * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled 1244 * @wlan_cfg_dp_soc_ctxt 1245 * 1246 * Return: true - enabled false - disabled 1247 */ 1248 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1249 1250 /* 1251 * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled 1252 * @wlan_cfg_dp_soc_ctxt 1253 * 1254 * Return: true - enabled false - disabled 1255 */ 1256 bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1257 1258 /* 1259 * wlan_cfg_set_rx_hash - set rx hash enabled/disabled 1260 * @wlan_cfg_soc_ctx 1261 * @rx_hash 1262 */ 1263 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash); 1264 1265 /* 1266 * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled 1267 * @wlan_cfg_pdev_ctx 1268 * 1269 * Return: 1 - enabled 0 - disabled 1270 */ 1271 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg); 1272 1273 /* 1274 * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled 1275 * @wlan_cfg_pdev_ctx 1276 */ 1277 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled); 1278 1279 /* 1280 * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config 1281 * @wlan_cfg_pdev_ctx 1282 * 1283 * Return: nss_cfg 1284 */ 1285 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg); 1286 1287 /* 1288 * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config 1289 * @wlan_cfg_pdev_ctx 1290 * 1291 */ 1292 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg); 1293 1294 /* 1295 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx 1296 * @wlan_cfg_soc_ctx 1297 * 1298 * Return: Batch threshold 1299 */ 1300 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg); 1301 1302 /* 1303 * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx 1304 * @wlan_cfg_soc_ctx 1305 * 1306 * Return: Timer threshold 1307 */ 1308 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg); 1309 1310 /* 1311 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx 1312 * @wlan_cfg_soc_ctx 1313 * 1314 * Return: Batch threshold 1315 */ 1316 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg); 1317 1318 /* 1319 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx 1320 * @wlan_cfg_soc_ctx 1321 * 1322 * Return: Timer threshold 1323 */ 1324 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg); 1325 1326 /* 1327 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs 1328 * @wlan_cfg_soc_ctx 1329 * 1330 * Return: Batch threshold 1331 */ 1332 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); 1333 1334 /* 1335 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs 1336 * @wlan_cfg_soc_ctx 1337 * 1338 * Return: Timer threshold 1339 */ 1340 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); 1341 1342 /* 1343 * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs 1344 * @wlan_cfg_soc_ctx 1345 * 1346 * Return: Timer threshold 1347 */ 1348 int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg); 1349 1350 /* 1351 * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status 1352 * @wlan_cfg_soc_ctx 1353 * 1354 * Return: Checksum offload enable or disable 1355 */ 1356 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg); 1357 1358 /* 1359 * wlan_cfg_get_nan_checksum_offload - Get checksum offload enable/disable val 1360 * @wlan_cfg_soc_ctx 1361 * 1362 * Return: Checksum offload enable or disable value for NAN mode 1363 */ 1364 int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg); 1365 1366 /* 1367 * wlan_cfg_get_p2p_checksum_offload - Get checksum offload enable/disable val 1368 * @wlan_cfg_soc_ctx 1369 * 1370 * Return: Checksum offload enable or disable value for P2P mode 1371 */ 1372 int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg); 1373 1374 /* 1375 * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring) 1376 * @wlan_cfg_soc_ctx 1377 * 1378 * Return: Tx Ring Size 1379 */ 1380 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1381 1382 /* 1383 * wlan_cfg_time_control_bp - Get time for interval in bp prints 1384 * @wlan_cfg_soc_ctx 1385 * 1386 * Return: interval time 1387 */ 1388 int wlan_cfg_time_control_bp(struct wlan_cfg_dp_soc_ctxt *cfg); 1389 1390 /* 1391 * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring) 1392 * @wlan_cfg_soc_ctx 1393 * 1394 * Return: Tx Completion ring size 1395 */ 1396 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1397 1398 /* 1399 * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size 1400 * @wlan_cfg_soc_ctx 1401 * 1402 * Return: wbm_release_ring size 1403 */ 1404 int 1405 wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1406 1407 /* 1408 * wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size - Get command/credit ring size 1409 * @wlan_cfg_soc_ctx 1410 * 1411 * Return: tcl_cmd_credit_ring size 1412 */ 1413 int 1414 wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1415 1416 /* 1417 * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size 1418 * @wlan_cfg_soc_ctx 1419 * 1420 * Return: tcl_status_ring size 1421 */ 1422 int 1423 wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1424 1425 /* 1426 * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size 1427 * @wlan_cfg_soc_ctx 1428 * 1429 * Return: reo_reinject_ring size 1430 */ 1431 int 1432 wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1433 1434 /* 1435 * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size 1436 * @wlan_cfg_soc_ctx 1437 * 1438 * Return: rx_release_ring size 1439 */ 1440 int 1441 wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1442 1443 /* 1444 * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size 1445 * @wlan_cfg_soc_ctx 1446 * 1447 * Return: reo_exception_ring size 1448 */ 1449 int 1450 wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1451 1452 /* 1453 * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size 1454 * @wlan_cfg_soc_ctx 1455 * 1456 * Return: reo_cmd_ring size 1457 */ 1458 int 1459 wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1460 1461 /* 1462 * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size 1463 * @wlan_cfg_soc_ctx 1464 * 1465 * Return: reo_status_ring size 1466 */ 1467 int 1468 wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1469 1470 /* 1471 * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H 1472 * @wlan_cfg_soc_ctx 1473 * 1474 * Return: tx desc limit for 5G H 1475 */ 1476 int 1477 wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg); 1478 1479 /* 1480 * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G 1481 * @wlan_cfg_soc_ctx 1482 * 1483 * Return: tx desc limit for 2G 1484 */ 1485 int 1486 wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg); 1487 1488 /* 1489 * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L 1490 * @wlan_cfg_soc_ctx 1491 * 1492 * Return: tx desc limit for 5G L 1493 */ 1494 int 1495 wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg); 1496 1497 /* 1498 * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit 1499 * @wlan_cfg_soc_ctx 1500 * 1501 * Return: tx device limit 1502 */ 1503 int 1504 wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg); 1505 1506 /* 1507 * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue 1508 * @wlan_cfg_soc_ctx 1509 * 1510 * Return: tx sw internode queue 1511 */ 1512 int 1513 wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg); 1514 1515 /* 1516 * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size 1517 * @wlan_cfg_soc_ctx 1518 * 1519 * Return: rxdma refill ring size 1520 */ 1521 int 1522 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1523 1524 /* 1525 * wlan_cfg_get_dp_soc_rxdma_refill_lt_disable - Get RxDMA refill LT status 1526 * @wlan_cfg_soc_ctx 1527 * 1528 * Return: true if Low threshold disable else false 1529 */ 1530 bool 1531 wlan_cfg_get_dp_soc_rxdma_refill_lt_disable(struct wlan_cfg_dp_soc_ctxt *cfg); 1532 1533 /* 1534 * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size 1535 * @wlan_cfg_soc_ctx 1536 * 1537 * Return: rxdma error dst ring size 1538 */ 1539 int 1540 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1541 1542 /* 1543 * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight 1544 * @wlan_cfg_soc_ctx 1545 * 1546 * Return: rx_sw_desc_weight 1547 */ 1548 int 1549 wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg); 1550 1551 /* 1552 * wlan_cfg_get_dp_soc_rx_sw_desc_num - Get rx sw desc num 1553 * @wlan_cfg_soc_ctx 1554 * 1555 * Return: rx_sw_desc_num 1556 */ 1557 int 1558 wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg); 1559 1560 /* 1561 * wlan_cfg_get_dp_caps - Get dp capabilities 1562 * @wlan_cfg_soc_ctx 1563 * @dp_caps: enum for dp capabilities 1564 * 1565 * Return: bool if a dp capabilities is enabled 1566 */ 1567 bool 1568 wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg, 1569 enum cdp_capabilities dp_caps); 1570 1571 /** 1572 * wlan_set_srng_cfg() - Fill per ring specific 1573 * configuration parameters 1574 * @wlan_cfg: global srng configuration table 1575 * 1576 * Return: None 1577 */ 1578 void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg); 1579 1580 #ifdef QCA_LL_TX_FLOW_CONTROL_V2 1581 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg); 1582 1583 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg); 1584 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */ 1585 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg); 1586 1587 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg); 1588 1589 /** 1590 * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST 1591 * in number of entries 1592 * 1593 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1594 * 1595 * Return: rx_fst_size 1596 */ 1597 uint16_t 1598 wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1599 1600 /** 1601 * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search 1602 * 1603 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1604 * 1605 * Return: max_search 1606 */ 1607 uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg); 1608 1609 /** 1610 * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST 1611 * search 1612 * 1613 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1614 * 1615 * Return: 320-bit Hash Key 1616 */ 1617 uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg); 1618 1619 /** 1620 * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in 1621 * DP soc context 1622 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1623 * @val: Rx flow tag feature flag value 1624 * 1625 * Return: None 1626 */ 1627 void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg, 1628 bool val); 1629 1630 /** 1631 * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from 1632 * DP soc context 1633 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1634 * 1635 * Return: true if feature is enabled, else false 1636 */ 1637 bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1638 1639 /** 1640 * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that 1641 * Rx FST is per pdev 1642 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1643 * @val: boolean flag indicating Rx FST per pdev or per SOC 1644 * 1645 * Return: None 1646 */ 1647 void 1648 wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg, 1649 bool val); 1650 1651 /** 1652 * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev 1653 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1654 * 1655 * Return: true if Rx FST is per pdev, else false 1656 */ 1657 bool 1658 wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg); 1659 1660 /** 1661 * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context 1662 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1663 * @val: Rx FST size in number of entries 1664 * 1665 * Return: None 1666 */ 1667 void 1668 wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg, 1669 uint16_t val); 1670 1671 /** 1672 * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag 1673 * in DP soc context 1674 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1675 * @val: Rx protocol or flow tag feature flag value in monitor mode from INI 1676 * 1677 * Return: None 1678 */ 1679 void 1680 wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg, 1681 bool val); 1682 1683 /** 1684 * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag 1685 * from DP soc context 1686 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1687 * 1688 * Return: true if feature is enabled in monitor mode for protocol or flow 1689 * tagging in INI, false otherwise 1690 */ 1691 bool 1692 wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1693 1694 /** 1695 * wlan_cfg_set_tx_per_pkt_vdev_id_check() - set flag to enable perpkt 1696 * vdev id check in tx. 1697 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1698 * @val: feature flag value 1699 * 1700 * Return: None 1701 */ 1702 void 1703 wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg, 1704 bool val); 1705 1706 /** 1707 * wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled() - get flag to check if 1708 * perpkt vdev id check is enabled in tx. 1709 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1710 * 1711 * Return: true if feature is enabled, false otherwise 1712 */ 1713 bool 1714 wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1715 1716 /** 1717 * wlan_cfg_fill_interrupt_mask() - set interrupt mask 1718 * 1719 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1720 * @num_dp_msi: Number of DP interrupts available (0 for integrated) 1721 * @interrupt_mode: Type of interrupt 1722 * @is_monitor_mode: is monitor mode enabled 1723 * 1724 * Return: void 1725 */ 1726 void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 1727 int num_dp_msi, int interrupt_mode, 1728 bool is_monitor_mode); 1729 1730 /** 1731 * wlan_cfg_is_rx_fisa_enabled() - Get Rx FISA enabled flag 1732 * 1733 * 1734 * @cfg: soc configuration context 1735 * 1736 * Return: true if enabled, false otherwise. 1737 */ 1738 bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1739 1740 /** 1741 * wlan_cfg_is_rx_fisa_lru_del_enabled() - Get Rx FISA LRU del enabled flag 1742 * 1743 * 1744 * @cfg: soc configuration context 1745 * 1746 * Return: true if enabled, false otherwise. 1747 */ 1748 bool wlan_cfg_is_rx_fisa_lru_del_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1749 1750 /** 1751 * wlan_cfg_is_rx_buffer_pool_enabled() - Get RX buffer pool enabled flag 1752 * 1753 * 1754 * @cfg: soc configuration context 1755 * 1756 * Return: true if enabled, false otherwise. 1757 */ 1758 bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1759 1760 /** 1761 * wlan_cfg_is_rx_refill_buffer_pool_enabled() - Get RX refill buffer pool enabled flag 1762 * 1763 * 1764 * @cfg: soc configuration context 1765 * 1766 * Return: true if enabled, false otherwise. 1767 */ 1768 bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1769 1770 1771 void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg, 1772 bool val); 1773 1774 bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg); 1775 1776 /** 1777 * wlan_cfg_get_reo_rings_mapping() - Get Reo destination ring bitmap 1778 * 1779 * 1780 * @cfg: soc configuration context 1781 * 1782 * Return: reo ring bitmap. 1783 */ 1784 uint32_t wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg); 1785 1786 /** 1787 * wlan_cfg_set_peer_ext_stats() - set peer extended stats 1788 * 1789 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1790 * @val: Flag value read from INI 1791 * 1792 * Return: void 1793 */ 1794 void 1795 wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg, 1796 bool val); 1797 1798 /** 1799 * wlan_cfg_set_peer_jitter_stats() - set peer jitter stats 1800 * 1801 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1802 * @val: Flag value read from INI 1803 * 1804 * Return: bool 1805 */ 1806 void 1807 wlan_cfg_set_peer_jitter_stats(struct wlan_cfg_dp_soc_ctxt *cfg, 1808 bool val); 1809 1810 /** 1811 * wlan_cfg_is_peer_ext_stats_enabled() - Check if peer extended 1812 * stats are enabled 1813 * 1814 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1815 * 1816 * Return: bool 1817 */ 1818 bool 1819 wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1820 1821 /** 1822 * wlan_cfg_is_peer_jitter_stats_enabled() - check if jitter stats are enabled 1823 * 1824 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1825 * 1826 * Return: bool 1827 */ 1828 bool 1829 wlan_cfg_is_peer_jitter_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1830 1831 /** 1832 * wlan_cfg_is_poll_mode_enabled() - Check if poll mode is enabled 1833 * 1834 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1835 * 1836 * Return: bool 1837 */ 1838 1839 bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1840 1841 /** 1842 * wlan_cfg_is_fst_in_cmem_enabled() - Check if FST in CMEM is enabled 1843 * @cfg: soc configuration context 1844 * 1845 * Return: true if enabled, false otherwise. 1846 */ 1847 bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1848 1849 /** 1850 * wlan_cfg_is_swlm_enabled() - Get SWLMenabled flag 1851 * @cfg: soc configuration context 1852 * 1853 * Return: true if enabled, false otherwise. 1854 */ 1855 bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1856 1857 #ifdef IPA_OFFLOAD 1858 /* 1859 * wlan_cfg_ipa_tx_ring_size - Get Tx DMA ring size (TCL Data Ring) 1860 * @wlan_cfg_soc_ctx: dp cfg context 1861 * 1862 * Return: IPA Tx Ring Size 1863 */ 1864 uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1865 1866 /* 1867 * wlan_cfg_ipa_tx_comp_ring_size - Get Tx completion ring size (WBM Ring) 1868 * @wlan_cfg_soc_ctx: dp cfg context 1869 * 1870 * Return: IPA Tx Completion ring size 1871 */ 1872 uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1873 1874 /* 1875 * wlan_cfg_ipa_tx_alt_ring_size - Get Tx alt DMA ring size (TCL Data Ring) 1876 * @wlan_cfg_soc_ctx: dp cfg context 1877 * 1878 * Return: IPA Tx alt Ring Size 1879 */ 1880 int wlan_cfg_ipa_tx_alt_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1881 1882 /* 1883 * wlan_cfg_ipa_tx_alt_comp_ring_size - Get Tx alt comp DMA ring size 1884 * (TCL Data Ring) 1885 * @wlan_cfg_soc_ctx: dp cfg context 1886 * 1887 * Return: IPA Tx alt comp Ring Size 1888 */ 1889 int 1890 wlan_cfg_ipa_tx_alt_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1891 1892 #else 1893 static inline 1894 uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1895 { 1896 return 0; 1897 } 1898 1899 static inline 1900 uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 1901 { 1902 return 0; 1903 } 1904 #endif 1905 1906 /** 1907 * wlan_cfg_radio0_default_reo_get - Get Radio0 default REO 1908 * @cfg: soc configuration context 1909 * 1910 * Return: None 1911 */ 1912 uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg); 1913 1914 /** 1915 * wlan_cfg_radio1_default_reo_get - Get Radio1 default REO 1916 * @cfg: soc configuration context 1917 * 1918 * Return: None 1919 */ 1920 uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg); 1921 1922 /** 1923 * wlan_cfg_radio2_default_reo_get() - Get Radio2 default REO 1924 * @cfg: soc configuration context 1925 * 1926 * Return: None 1927 */ 1928 uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg); 1929 1930 /** 1931 * wlan_cfg_set_rxdma1_enable() - Enable rxdma1 1932 * @cfg: soc configuration context 1933 * 1934 * Return: None 1935 */ 1936 void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1937 1938 /** 1939 * wlan_cfg_is_delay_mon_replenish() - Get if delayed monitor replenish 1940 * is enabled 1941 * @cfg: soc configuration context 1942 * 1943 * Return: true if enabled, false otherwise. 1944 */ 1945 bool 1946 wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg); 1947 1948 /** 1949 * wlan_cfg_set_delay_mon_replenish() - Set delayed monitor replenish 1950 * @cfg: soc configuration context 1951 * @val: val to set 1952 * 1953 * Return: None 1954 */ 1955 void 1956 wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg, bool val); 1957 1958 /** 1959 * wlan_cfg_dp_soc_ctx_dump() - Dump few DP cfg soc parameters 1960 * @cfg: soc configuration context 1961 * 1962 * Return: 1963 */ 1964 void wlan_cfg_dp_soc_ctx_dump(struct wlan_cfg_dp_soc_ctxt *cfg); 1965 1966 #ifdef WLAN_SUPPORT_PPEDS 1967 /* 1968 * wlan_cfg_get_dp_soc_is_ppe_enabled() - API to get ppe enable flag 1969 * @wlan_cfg_ctx - Configuration Handle 1970 * 1971 * Return: true if ppe is enabled else return false 1972 */ 1973 bool 1974 wlan_cfg_get_dp_soc_is_ppe_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1975 1976 /* 1977 * wlan_cfg_get_dp_soc_reo2ppe_ring_size() - get ppe rx ring size 1978 * @wlan_cfg_ctx - Configuration Handle 1979 * 1980 * Return: size of reo2ppe ring 1981 */ 1982 int 1983 wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1984 1985 /* 1986 * wlan_cfg_get_dp_soc_ppe2tcl_ring_size() - get ppe tx ring size 1987 * @wlan_cfg_ctx - Configuration Handle 1988 * 1989 * Return: size of ppe2tcl ring 1990 */ 1991 int 1992 wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1993 1994 /* 1995 * wlan_cfg_get_dp_soc_ppe_release_ring_size() - get ppe tx comp ring size 1996 * @wlan_cfg_ctx - Configuration Handle 1997 * 1998 * Return: size of ppe release ring 1999 */ 2000 int 2001 wlan_cfg_get_dp_soc_ppe_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 2002 2003 /* 2004 * wlan_cfg_get_dp_soc_ppe_num_tx_desc() - Number of ppeds tx Descriptors 2005 * @wlan_cfg_ctx - Configuration Handle 2006 * 2007 * Return: num_tx_desc 2008 */ 2009 int 2010 wlan_cfg_get_dp_soc_ppe_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg); 2011 #else 2012 static inline bool 2013 wlan_cfg_get_dp_soc_is_ppe_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) 2014 { 2015 return false; 2016 } 2017 2018 static inline int 2019 wlan_cfg_get_dp_soc_reo2ppe_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2020 { 2021 return 0; 2022 } 2023 2024 static inline int 2025 wlan_cfg_get_dp_soc_ppe2tcl_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2026 { 2027 return 0; 2028 } 2029 2030 static inline int 2031 wlan_cfg_get_dp_soc_ppe_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) 2032 { 2033 return 0; 2034 } 2035 2036 static inline int 2037 wlan_cfg_get_dp_soc_ppe_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg) 2038 { 2039 return 0; 2040 } 2041 #endif 2042 2043 /** 2044 * wlan_cfg_get_prealloc_cfg() - Get dp prealloc related cfg param 2045 * @ctrl_psoc - PSOC object 2046 * @cfg - cfg ctx where values will be populated 2047 * 2048 * Return: None 2049 */ 2050 void 2051 wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 2052 struct wlan_dp_prealloc_cfg *cfg); 2053 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2 2054 /** 2055 * wlan_cfg_get_pkt_capture_mode() - Get packet capture mode config 2056 * @cfg: config context 2057 * 2058 * Return: value of packet capture mode 2059 */ 2060 uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg); 2061 #else 2062 static inline 2063 uint32_t wlan_cfg_get_pkt_capture_mode(struct wlan_cfg_dp_soc_ctxt *cfg) 2064 { 2065 return 0; 2066 } 2067 #endif 2068 2069 /** 2070 * wlan_cfg_get_dp_soc_rx_mon_buf_ring_size() - Rx MON buf ring size 2071 * @cfg: Configuration Handle 2072 * 2073 * Return: Size of Rx MON buf ring size 2074 */ 2075 uint32_t 2076 wlan_cfg_get_dp_soc_rx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 2077 2078 /** 2079 * wlan_cfg_get_dp_soc_tx_mon_buf_ring_size() - Tx MON buf ring size 2080 * @cfg: Configuration Handle 2081 * 2082 * Return: Size of Tx MON buf ring size 2083 */ 2084 uint32_t 2085 wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 2086 2087 /** 2088 * wlan_cfg_get_dma_rx_mon_dest_ring_size() - Rx MON dest ring size 2089 * @cfg: Configuration Handle 2090 * 2091 * Return: Size of Rx MON dest ring size 2092 */ 2093 int wlan_cfg_get_dma_rx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg); 2094 2095 /** 2096 * wlan_cfg_get_dma_tx_mon_dest_ring_size() - Tx MON dest ring size 2097 * @cfg: Configuration Handle 2098 * 2099 * Return: Size of Tx MON dest ring size 2100 */ 2101 int wlan_cfg_get_dma_tx_mon_dest_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg); 2102 2103 /* 2104 * wlan_cfg_get_rx_rel_ring_id() - get wbm2sw ring id for Rx release ring 2105 * @wlan_cfg_ctx - Configuration Handle 2106 * 2107 * Return: wbm2sw ring id 2108 */ 2109 uint8_t 2110 wlan_cfg_get_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg); 2111 2112 /** 2113 * wlan_cfg_set_rx_rel_ring_id() - set wbm2sw ring id for Rx release ring 2114 * @cfg: soc configuration context 2115 * 2116 * Return: None 2117 */ 2118 void 2119 wlan_cfg_set_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg, 2120 uint8_t wbm2sw_ring_id); 2121 2122 /** 2123 * wlan_cfg_set_vdev_stats_hw_offload_config() - Set hw vdev stats offload 2124 * config 2125 * @cfg: config context 2126 * @value: value to be set 2127 * 2128 * Return: none 2129 */ 2130 void 2131 wlan_cfg_set_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg, 2132 bool value); 2133 2134 /** 2135 * wlan_cfg_get_vdev_stats_hw_offload_config() - Get hw vdev stats offload 2136 * config 2137 * @cfg: config context 2138 * 2139 * Return: value of hw vdev stats config 2140 */ 2141 bool 2142 wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg); 2143 2144 /** 2145 * wlan_cfg_get_vdev_stats_hw_offload_timer()- Get hw vdev stats timer duration 2146 * @cfg: config context 2147 * 2148 * Return: value of hw vdev stats timer duration 2149 */ 2150 int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg); 2151 2152 /** 2153 * wlan_cfg_set_sawf_config() - Set SAWF config enable/disable 2154 * @cfg: config context 2155 * @value: value to be set 2156 * 2157 * Return: none 2158 */ 2159 void 2160 wlan_cfg_set_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg, bool value); 2161 2162 /** 2163 * wlan_cfg_get_sawf_config() - Get SAWF config enable/disable 2164 * @cfg: config context 2165 * 2166 * Return: true or false 2167 */ 2168 bool 2169 wlan_cfg_get_sawf_config(struct wlan_cfg_dp_soc_ctxt *cfg); 2170 2171 /** 2172 * wlan_cfg_set_sawf_stats_config() - Set SAWF stats config 2173 * @cfg: config context 2174 * @value: value to be set 2175 * 2176 * Return: void 2177 */ 2178 void 2179 wlan_cfg_set_sawf_stats_config(struct wlan_cfg_dp_soc_ctxt *cfg, uint8_t value); 2180 2181 /** 2182 * wlan_cfg_get_sawf_stats_config() - Get SAWF stats config 2183 * @cfg: config context 2184 * 2185 * Return: value for sawf_stats_config 2186 */ 2187 uint8_t 2188 wlan_cfg_get_sawf_stats_config(struct wlan_cfg_dp_soc_ctxt *cfg); 2189 2190 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) 2191 /** 2192 * wlan_cfg_mlo_rx_ring_map_get() - get rx ring map 2193 * @cfg: soc configuration context 2194 * 2195 * Return: rx_ring_map 2196 */ 2197 uint8_t 2198 wlan_cfg_mlo_rx_ring_map_get(struct wlan_cfg_dp_soc_ctxt *cfg); 2199 #endif 2200 2201 /* 2202 * wlan_cfg_set_host2txmon_ring_mask() - Set host2txmon ring 2203 * interrupt mask mapped to an interrupt context 2204 * @wlan_cfg_ctx - Configuration Handle 2205 * 2206 * Return: None 2207 */ 2208 void wlan_cfg_set_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 2209 int context, int mask); 2210 /** 2211 * wlan_cfg_get_host2txmon_ring_mask() - Return host2txmon ring 2212 * interrupt mask mapped to an interrupt context 2213 * @wlan_cfg_ctx - Configuration Handle 2214 * @context - Numerical ID identifying the Interrupt/NAPI context 2215 * 2216 * Return: int_host2txmon_ring_mask[context] 2217 */ 2218 int wlan_cfg_get_host2txmon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 2219 int context); 2220 /** 2221 * wlan_cfg_set_txmon_hw_support () - Set txmon hw support 2222 * @cfg: Configuration Handle 2223 * @txmon_hw_support: value to set 2224 * 2225 * Return: None 2226 */ 2227 void wlan_cfg_set_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg, 2228 bool txmon_hw_support); 2229 2230 /** 2231 * wlan_cfg_get_txmon_hw_support () - Get txmon hw support 2232 * @cfg: Configuration Handle 2233 * 2234 * Return: txmon_hw_support 2235 */ 2236 bool wlan_cfg_get_txmon_hw_support(struct wlan_cfg_dp_soc_ctxt *cfg); 2237 2238 #ifdef WLAN_TX_PKT_CAPTURE_ENH 2239 /* 2240 * wlan_cfg_get_tx_capt_max_mem - Get max memory allowed for TX capture feature 2241 * @wlan_cfg_soc_ctx 2242 * 2243 * Return: user given size in bytes 2244 */ 2245 static inline int 2246 wlan_cfg_get_tx_capt_max_mem(struct wlan_cfg_dp_soc_ctxt *cfg) 2247 { 2248 return cfg->tx_capt_max_mem_allowed; 2249 } 2250 #endif /* WLAN_TX_PKT_CAPTURE_ENH */ 2251 2252 /** 2253 * wlan_cfg_get_napi_scale_factor() - Get napi scale factor 2254 * 2255 * 2256 * @cfg: soc configuration context 2257 * 2258 * Return: napi scale factor 2259 */ 2260 uint8_t wlan_cfg_get_napi_scale_factor(struct wlan_cfg_dp_soc_ctxt *cfg); 2261 2262 /** 2263 * wlan_cfg_soc_update_tgt_params() - Update band specific params 2264 * @wlan_cfg_ctx - SOC cfg context 2265 * @ctrl_obj - PSOC object 2266 * 2267 * Return: void 2268 */ 2269 void 2270 wlan_cfg_soc_update_tgt_params(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 2271 struct cdp_ctrl_objmgr_psoc *ctrl_obj); 2272 #endif /*__WLAN_CFG_H*/ 2273