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