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