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