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