1 /* 2 * Copyright (c) 2013-2020 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 /* 23 * Temporary place holders. These should come either from target config 24 * or platform configuration 25 */ 26 #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1) 27 #define WLAN_CFG_DST_RING_CACHED_DESC 0 28 #define MAX_PDEV_CNT 1 29 #define WLAN_CFG_INT_NUM_CONTEXTS 7 30 #define WLAN_CFG_RXDMA1_ENABLE 1 31 /* 32 * This mask defines how many transmit frames account for 1 NAPI work unit 33 * 0 means each tx completion is 1 unit 34 */ 35 #define DP_TX_NAPI_BUDGET_DIV_MASK 0 36 37 /* PPDU Stats Configuration - Configure bitmask for enabling tx ppdu tlv's */ 38 #define DP_PPDU_TXLITE_STATS_BITMASK_CFG 0x3FFF 39 40 #define NUM_RXDMA_RINGS_PER_PDEV 2 41 42 /*Maximum Number of LMAC instances*/ 43 #define MAX_NUM_LMAC_HW 2 44 #else 45 #define WLAN_CFG_DST_RING_CACHED_DESC 1 46 #define MAX_PDEV_CNT 3 47 #define WLAN_CFG_INT_NUM_CONTEXTS 11 48 #define NUM_RXDMA_RINGS_PER_PDEV 1 49 #define MAX_NUM_LMAC_HW 3 50 51 #endif 52 53 #define WLAN_CFG_INT_NUM_CONTEXTS_MAX 11 54 55 /* Tx configuration */ 56 #define MAX_LINK_DESC_BANKS 8 57 #define MAX_TXDESC_POOLS 4 58 #define MAX_TCL_DATA_RINGS 4 59 60 /* Rx configuration */ 61 #define MAX_RXDESC_POOLS 4 62 #define MAX_REO_DEST_RINGS 4 63 #define MAX_RX_MAC_RINGS 2 64 65 /* DP process status */ 66 #if defined(MAX_PDEV_CNT) && (MAX_PDEV_CNT == 1) 67 #define CONFIG_PROCESS_RX_STATUS 1 68 #define CONFIG_PROCESS_TX_STATUS 1 69 #else 70 #define CONFIG_PROCESS_RX_STATUS 0 71 #define CONFIG_PROCESS_TX_STATUS 0 72 #endif 73 74 /* Miscellaneous configuration */ 75 #define MAX_IDLE_SCATTER_BUFS 16 76 #define DP_MAX_IRQ_PER_CONTEXT 12 77 #define MAX_HTT_METADATA_LEN 32 78 #define DP_MAX_TIDS 17 79 #define DP_NON_QOS_TID 16 80 #define DP_NULL_DATA_TID 17 81 82 #define WLAN_CFG_RX_FST_MAX_SEARCH 2 83 #define WLAN_CFG_RX_FST_TOEPLITZ_KEYLEN 40 84 85 #define INVALID_PDEV_ID 0xFF 86 87 struct wlan_cfg_dp_pdev_ctxt; 88 89 /** 90 * struct wlan_srng_cfg - Per ring configuration parameters 91 * @timer_threshold: Config to control interrupts based on timer duration 92 * @batch_count_threshold: Config to control interrupts based on 93 * number of packets in the ring 94 * @low_threshold: Config to control low threshold interrupts for SRC rings 95 */ 96 struct wlan_srng_cfg { 97 uint32_t timer_threshold; 98 uint32_t batch_count_threshold; 99 uint32_t low_threshold; 100 }; 101 102 /** 103 * struct wlan_cfg_dp_soc_ctxt - Configuration parameters for SoC (core TxRx) 104 * @num_int_ctxts: Number of NAPI/Interrupt contexts to be registered for DP 105 * @max_clients: Maximum number of peers/stations supported by device 106 * @max_alloc_size: Maximum allocation size for any dynamic memory 107 * allocation request for this device 108 * @per_pdev_tx_ring: 0: TCL ring is not mapped per radio 109 * 1: Each TCL ring is mapped to one radio/pdev 110 * @num_tcl_data_rings: Number of TCL Data rings supported by device 111 * @per_pdev_rx_ring: 0: REO ring is not mapped per radio 112 * 1: Each REO ring is mapped to one radio/pdev 113 * @num_tx_desc_pool: Number of Tx Descriptor pools 114 * @num_tx_ext_desc_pool: Number of Tx MSDU extension Descriptor pools 115 * @num_tx_desc: Number of Tx Descriptors per pool 116 * @min_tx_desc: Minimum number of Tx Descriptors per pool 117 * @num_tx_ext_desc: Number of Tx MSDU extension Descriptors per pool 118 * @max_peer_id: Maximum value of peer id that FW can assign for a client 119 * @htt_packet_type: Default 802.11 encapsulation type for any VAP created 120 * @int_tx_ring_mask: Bitmap of Tx interrupts mapped to each NAPI/Intr context 121 * @int_rx_ring_mask: Bitmap of Rx interrupts mapped to each NAPI/Intr context 122 * @int_rx_mon_ring_mask: Bitmap of Rx monitor ring interrupts mapped to each 123 * NAPI/Intr context 124 * @int_rx_err_ring_mask: Bitmap of Rx err ring interrupts mapped to each 125 * NAPI/Intr context 126 * @int_wbm_rel_ring_mask: Bitmap of wbm rel ring interrupts mapped to each 127 * NAPI/Intr context 128 * @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to 129 * each NAPI/Intr context 130 * @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context 131 * @lro_enabled: enable/disable lro feature 132 * @rx_hash: Enable hash based steering of rx packets 133 * @tso_enabled: enable/disable tso feature 134 * @lro_enabled: enable/disable LRO feature 135 * @sg_enabled: enable disable scatter gather feature 136 * @gro_enabled: enable disable GRO feature 137 * @ipa_enabled: Flag indicating if IPA is enabled 138 * @ol_tx_csum_enabled: Flag indicating if TX csum is enabled 139 * @ol_rx_csum_enabled: Flag indicating if Rx csum is enabled 140 * @rawmode_enabled: Flag indicating if RAW mode is enabled 141 * @peer_flow_ctrl_enabled: Flag indicating if peer flow control is enabled 142 * @napi_enabled: enable/disable interrupt mode for reaping tx and rx packets 143 * @p2p_tcp_udp_checksumoffload: enable/disable checksum offload for P2P mode 144 * @nan_tcp_udp_checksumoffload: enable/disable checksum offload for NAN mode 145 * @tcp_udp_checksumoffload: enable/disable checksum offload 146 * @nss_cfg: nss configuration 147 * @rx_defrag_min_timeout: rx defrag minimum timeout 148 * @wbm_release_ring: wbm release ring size 149 * @tcl_cmd_credit_ring: tcl command/credit ring size 150 * @tcl_status_ring: tcl status ring size 151 * @reo_reinject_ring: reo reinject ring 152 * @rx_release_ring: rx release ring size 153 * @reo_exception_ring: reo exception ring size 154 * @reo_cmd_ring: reo cmd ring size 155 * @reo_status_ring: reo status ting size 156 * @rxdma_refill_ring: rxdma refill ring size 157 * @rxdma_err_dst_ring: rxdma error detination ring size 158 * @raw_mode_war: enable/disable raw mode war 159 * @enable_data_stall_detection: flag to enable data stall detection 160 * @enable_force_rx_64_ba: flag to enable force 64 blockack in RX 161 * @disable_intra_bss_fwd: flag to disable intra bss forwarding 162 * @rxdma1_enable: flag to indicate if rxdma1 is enabled 163 * @delay_mon_replenish: delay monitor buffer replenish 164 * @tx_desc_limit_0: tx_desc limit for 5G H 165 * @tx_desc_limit_1: tx_desc limit for 2G 166 * @tx_desc_limit_2: tx_desc limit for 5G L 167 * @tx_device_limit: tx device limit 168 * @tx_sw_internode_queue: tx sw internode queue 169 * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop 170 * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop 171 * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates 172 * @rx_enable_eol_data_check: flag to enable check for more ring data at end of 173 * dp_rx_process loop 174 * @tx_comp_enable_eol_data_check: flag to enable/disable checking for more data 175 * at end of tx_comp_handler loop. 176 * @rx_sw_desc_weight: rx sw descriptor weight configuration 177 * @is_rx_mon_protocol_flow_tag_enabled: flag to enable/disable RX protocol or 178 * flow tagging in monitor/mon-lite mode 179 * @is_rx_flow_tag_enabled: flag to enable/disable RX flow tagging using FSE 180 * @is_rx_flow_search_table_per_pdev: flag to indicate if a per-SOC or per-pdev 181 * table should be used 182 * @rx_flow_search_table_size: indicates the number of flows in the flow search 183 * table 184 * @rx_flow_max_search: max skid length for each hash entry 185 * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over 186 * 5 tuple flow entry 187 * @pktlog_buffer_size: packet log buffer size 188 * @is_rx_fisa_enabled: flag to enable/disable FISA Rx 189 * @pext_stats_enabled: Flag to enable and disabled peer extended stats 190 * @is_rx_buff_pool_enabled: flag to enable/disable emergency RX buffer 191 * pool support 192 * @rx_pending_high_threshold: threshold of starting pkt drop 193 * @rx_pending_low_threshold: threshold of stopping pkt drop 194 * @is_swlm_enabled: flag to enable/disable SWLM 195 * @tx_per_pkt_vdev_id_check: Enable tx perpkt vdev id check 196 * @wow_check_rx_pending_enable: Enable RX frame pending check in WoW 197 */ 198 struct wlan_cfg_dp_soc_ctxt { 199 int num_int_ctxts; 200 int max_clients; 201 int max_alloc_size; 202 int per_pdev_tx_ring; 203 int num_tcl_data_rings; 204 int num_nss_tcl_data_rings; 205 int per_pdev_rx_ring; 206 int per_pdev_lmac_ring; 207 int num_reo_dest_rings; 208 int num_nss_reo_dest_rings; 209 int num_tx_desc_pool; 210 int num_tx_ext_desc_pool; 211 int num_tx_desc; 212 int min_tx_desc; 213 int num_tx_ext_desc; 214 int max_peer_id; 215 int htt_packet_type; 216 int int_batch_threshold_tx; 217 int int_timer_threshold_tx; 218 int int_batch_threshold_rx; 219 int int_timer_threshold_rx; 220 int int_batch_threshold_other; 221 int int_timer_threshold_other; 222 int int_timer_threshold_mon; 223 int tx_ring_size; 224 int tx_comp_ring_size; 225 int tx_comp_ring_size_nss; 226 int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 227 int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 228 int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 229 int int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 230 int int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 231 int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 232 int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 233 int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 234 int int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 235 int int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 236 int int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; 237 int hw_macid[MAX_PDEV_CNT]; 238 int hw_macid_pdev_id_map[MAX_NUM_LMAC_HW]; 239 int base_hw_macid; 240 bool rx_hash; 241 bool tso_enabled; 242 bool lro_enabled; 243 bool sg_enabled; 244 bool gro_enabled; 245 bool ipa_enabled; 246 bool ol_tx_csum_enabled; 247 bool ol_rx_csum_enabled; 248 bool rawmode_enabled; 249 bool peer_flow_ctrl_enabled; 250 bool napi_enabled; 251 bool p2p_tcp_udp_checksumoffload; 252 bool nan_tcp_udp_checksumoffload; 253 bool tcp_udp_checksumoffload; 254 bool legacy_mode_checksumoffload_disable; 255 bool defrag_timeout_check; 256 int nss_cfg; 257 uint32_t tx_flow_stop_queue_threshold; 258 uint32_t tx_flow_start_queue_offset; 259 int rx_defrag_min_timeout; 260 int reo_dst_ring_size; 261 int wbm_release_ring; 262 int tcl_cmd_credit_ring; 263 int tcl_status_ring; 264 int reo_reinject_ring; 265 int rx_release_ring; 266 int reo_exception_ring; 267 int reo_cmd_ring; 268 int reo_status_ring; 269 int rxdma_refill_ring; 270 int rxdma_err_dst_ring; 271 uint32_t per_pkt_trace; 272 bool raw_mode_war; 273 bool enable_data_stall_detection; 274 bool enable_force_rx_64_ba; 275 bool disable_intra_bss_fwd; 276 bool rxdma1_enable; 277 bool delay_mon_replenish; 278 int max_ast_idx; 279 int tx_desc_limit_0; 280 int tx_desc_limit_1; 281 int tx_desc_limit_2; 282 int tx_device_limit; 283 int tx_sw_internode_queue; 284 int mon_drop_thresh; 285 #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT 286 uint32_t tx_comp_loop_pkt_limit; 287 uint32_t rx_reap_loop_pkt_limit; 288 uint32_t rx_hp_oos_update_limit; 289 bool rx_enable_eol_data_check; 290 bool tx_comp_enable_eol_data_check; 291 #endif /* WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT */ 292 int rx_sw_desc_weight; 293 int rx_sw_desc_num; 294 bool is_rx_mon_protocol_flow_tag_enabled; 295 bool is_rx_flow_tag_enabled; 296 bool is_rx_flow_search_table_per_pdev; 297 uint16_t rx_flow_search_table_size; 298 uint16_t rx_flow_max_search; 299 uint8_t *rx_toeplitz_hash_key; 300 uint8_t pktlog_buffer_size; 301 uint8_t is_rx_fisa_enabled; 302 bool is_tso_desc_attach_defer; 303 uint32_t delayed_replenish_entries; 304 uint32_t reo_rings_mapping; 305 bool pext_stats_enabled; 306 bool is_rx_buff_pool_enabled; 307 uint32_t rx_pending_high_threshold; 308 uint32_t rx_pending_low_threshold; 309 bool is_poll_mode_enabled; 310 uint8_t is_swlm_enabled; 311 bool fst_in_cmem; 312 bool tx_per_pkt_vdev_id_check; 313 uint8_t radio0_rx_default_reo; 314 uint8_t radio1_rx_default_reo; 315 uint8_t radio2_rx_default_reo; 316 bool wow_check_rx_pending_enable; 317 }; 318 319 /** 320 * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio) 321 * @rx_dma_buf_ring_size - Size of RxDMA buffer ring 322 * @dma_mon_buf_ring_size - Size of RxDMA Monitor buffer ring 323 * @dma_mon_dest_ring_size - Size of RxDMA Monitor Destination ring 324 * @dma_mon_status_ring_size - Size of RxDMA Monitor Status ring 325 * @rxdma_monitor_desc_ring - rxdma monitor desc ring size 326 */ 327 struct wlan_cfg_dp_pdev_ctxt { 328 int rx_dma_buf_ring_size; 329 int dma_mon_buf_ring_size; 330 int dma_mon_dest_ring_size; 331 int dma_mon_status_ring_size; 332 int rxdma_monitor_desc_ring; 333 int num_mac_rings; 334 int nss_enabled; 335 }; 336 337 /** 338 * wlan_cfg_soc_attach() - Attach configuration interface for SoC 339 * @ctrl_obj - PSOC object 340 * 341 * Allocates context for Soc configuration parameters, 342 * Read configuration information from device tree/ini file and 343 * returns back handle 344 * 345 * Return: Handle to configuration context 346 */ 347 struct wlan_cfg_dp_soc_ctxt * 348 wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj); 349 350 /** 351 * wlan_cfg_soc_detach() - Detach soc configuration handle 352 * @wlan_cfg_ctx: soc configuration handle 353 * 354 * De-allocates memory allocated for SoC configuration 355 * 356 * Return:none 357 */ 358 void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 359 360 /** 361 * wlan_cfg_pdev_attach() Attach configuration interface for pdev 362 * @ctrl_obj - PSOC object 363 * 364 * Allocates context for pdev configuration parameters, 365 * Read configuration information from device tree/ini file and 366 * returns back handle 367 * 368 * Return: Handle to configuration context 369 */ 370 struct wlan_cfg_dp_pdev_ctxt * 371 wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj); 372 373 /** 374 * wlan_cfg_pdev_detach() Detach and free pdev configuration handle 375 * @wlan_cfg_pdev_ctx - PDEV Configuration Handle 376 * 377 * Return: void 378 */ 379 void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 380 381 void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num); 382 void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 383 int context, int mask); 384 void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 385 int context, int mask); 386 void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 387 int context, int mask); 388 void wlan_cfg_set_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 389 int context, int mask); 390 void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, 391 int mask); 392 void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val); 393 void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val); 394 int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg); 395 int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg); 396 int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 397 int context, int mask); 398 int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 399 int context, int mask); 400 int wlan_cfg_set_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 401 int context, int mask); 402 403 /** 404 * wlan_cfg_set_mon_delayed_replenish_entries() - number of buffers to replenish 405 * for monitor buffer ring at initialization 406 * @wlan_cfg_ctx - Configuration Handle 407 * @replenish_entries - number of entries to replenish at initialization 408 * 409 */ 410 void wlan_cfg_set_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt 411 *wlan_cfg_ctx, 412 uint32_t replenish_entries); 413 414 /** 415 * wlan_cfg_get_mon_delayed_replenish_entries() - get num of buffer to replenish 416 * for monitor buffer ring at initialization 417 * @wlan_cfg_ctx - Configuration Handle 418 * @replenish_entries - number of entries to replenish at initialization 419 * 420 * Return: delayed_replenish_entries; 421 */ 422 int wlan_cfg_get_mon_delayed_replenish_entries(struct wlan_cfg_dp_soc_ctxt 423 *wlan_cfg_ctx); 424 /** 425 * wlan_cfg_get_num_contexts() - Number of interrupt contexts to be registered 426 * @wlan_cfg_ctx - Configuration Handle 427 * 428 * For WIN, DP_NUM_INTERRUPT_CONTEXTS will be equal to number of CPU cores. 429 * Each context (for linux it is a NAPI context) will have a tx_ring_mask, 430 * rx_ring_mask ,and rx_monitor_ring mask to indicate the rings 431 * that are processed by the handler. 432 * 433 * Return: num_contexts 434 */ 435 int wlan_cfg_get_num_contexts(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 436 437 /** 438 * wlan_cfg_get_tx_ring_mask() - Return Tx interrupt mask mapped to an 439 * interrupt context 440 * @wlan_cfg_ctx - Configuration Handle 441 * @context - Numerical ID identifying the Interrupt/NAPI context 442 * 443 * Return: int_tx_ring_mask[context] 444 */ 445 int wlan_cfg_get_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 446 int context); 447 448 /** 449 * wlan_cfg_get_rx_ring_mask() - Return Rx interrupt mask mapped to an 450 * interrupt context 451 * @wlan_cfg_ctx - Configuration Handle 452 * @context - Numerical ID identifying the Interrupt/NAPI context 453 * 454 * Return: int_rx_ring_mask[context] 455 */ 456 int wlan_cfg_get_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 457 int context); 458 459 /** 460 * wlan_cfg_get_rx_mon_ring_mask() - Return Rx monitor ring interrupt mask 461 * mapped to an interrupt context 462 * @wlan_cfg_ctx - Configuration Handle 463 * @context - Numerical ID identifying the Interrupt/NAPI context 464 * 465 * Return: int_rx_mon_ring_mask[context] 466 */ 467 int wlan_cfg_get_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 468 int context); 469 470 /** 471 * wlan_cfg_set_rxdma2host_ring_mask() - Set rxdma2host ring interrupt mask 472 * for the given interrupt context 473 * @wlan_cfg_ctx - Configuration Handle 474 * @context - Numerical ID identifying the Interrupt/NAPI context 475 * 476 */ 477 void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 478 int context, int mask); 479 480 /** 481 * wlan_cfg_get_rxdma2host_ring_mask() - Return rxdma2host ring interrupt mask 482 * mapped to an interrupt context 483 * @wlan_cfg_ctx - Configuration Handle 484 * @context - Numerical ID identifying the Interrupt/NAPI context 485 * 486 * Return: int_rxdma2host_ring_mask[context] 487 */ 488 int wlan_cfg_get_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 489 int context); 490 491 /** 492 * wlan_cfg_set_host2rxdma_ring_mask() - Set host2rxdma ring interrupt mask 493 * for the given interrupt context 494 * @wlan_cfg_ctx - Configuration Handle 495 * @context - Numerical ID identifying the Interrupt/NAPI context 496 * 497 */ 498 void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 499 int context, int mask); 500 501 /** 502 * wlan_cfg_get_host2rxdma_ring_mask() - Return host2rxdma ring interrupt mask 503 * mapped to an interrupt context 504 * @wlan_cfg_ctx - Configuration Handle 505 * @context - Numerical ID identifying the Interrupt/NAPI context 506 * 507 * Return: int_host2rxdma_ring_mask[context] 508 */ 509 int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 510 int context); 511 512 /** 513 * wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring 514 * interrupt mask for the given interrupt context 515 * @wlan_cfg_ctx - Configuration Handle 516 * @context - Numerical ID identifying the Interrupt/NAPI context 517 * 518 */ 519 void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 520 int context, int mask); 521 522 /** 523 * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring 524 * interrupt mask mapped to an interrupt context 525 * @wlan_cfg_ctx - Configuration Handle 526 * @context - Numerical ID identifying the Interrupt/NAPI context 527 * 528 * Return: int_host2rxdma_mon_ring_mask[context] 529 */ 530 int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 531 int context); 532 533 /** 534 * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor 535 * destination ring interrupt mask 536 * for the given interrupt context 537 * @wlan_cfg_ctx - Configuration Handle 538 * @context - Numerical ID identifying the Interrupt/NAPI context 539 * 540 */ 541 void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 542 int context, int mask); 543 544 /** 545 * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor 546 * destination ring interrupt mask 547 * mapped to an interrupt context 548 * @wlan_cfg_ctx - Configuration Handle 549 * @context - Numerical ID identifying the Interrupt/NAPI context 550 * 551 * Return: int_rxdma2host_mon_ring_mask[context] 552 */ 553 int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, 554 int context); 555 556 /** 557 * wlan_cfg_set_hw_macidx() - Set HW MAC Idx for the given PDEV index 558 * 559 * @wlan_cfg_ctx - Configuration Handle 560 * @pdev_idx - Index of SW PDEV 561 * @hw_macid - HW MAC Id 562 * 563 */ 564 void wlan_cfg_set_hw_mac_idx 565 (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid); 566 567 /** 568 * wlan_cfg_get_hw_mac_idx() - Get 0 based HW MAC index for the given 569 * PDEV index 570 * 571 * @wlan_cfg_ctx - Configuration Handle 572 * @pdev_idx - Index of SW PDEV 573 * 574 * Return: HW MAC index 575 */ 576 int wlan_cfg_get_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx); 577 578 /** 579 * wlan_cfg_get_target_pdev_id() - Get target PDEV ID for HW MAC ID 580 * 581 * @wlan_cfg_ctx - Configuration Handle 582 * @hw_macid - Index of hw mac 583 * 584 * Return: PDEV ID 585 */ 586 int 587 wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid); 588 589 /** 590 * wlan_cfg_set_pdev_idx() - Set 0 based host PDEV index for the given 591 * hw mac index 592 * 593 * @wlan_cfg_ctx - Configuration Handle 594 * @pdev_idx - Index of SW PDEV 595 * @hw_macid - Index of hw mac 596 * 597 * Return: PDEV index 598 */ 599 void wlan_cfg_set_pdev_idx 600 (struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx, int hw_macid); 601 602 /** 603 * wlan_cfg_get_pdev_idx() - Get 0 based PDEV index for the given 604 * hw mac index 605 * 606 * @wlan_cfg_ctx - Configuration Handle 607 * @hw_macid - Index of hw mac 608 * 609 * Return: PDEV index 610 */ 611 int wlan_cfg_get_pdev_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int hw_macid); 612 613 /** 614 * wlan_cfg_get_rx_err_ring_mask() - Return Rx monitor ring interrupt mask 615 * mapped to an interrupt context 616 * @wlan_cfg_ctx - Configuration Handle 617 * @context - Numerical ID identifying the Interrupt/NAPI context 618 * 619 * Return: int_rx_err_ring_mask[context] 620 */ 621 int wlan_cfg_get_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 622 context); 623 624 /** 625 * wlan_cfg_get_rx_wbm_rel_ring_mask() - Return Rx monitor ring interrupt mask 626 * mapped to an interrupt context 627 * @wlan_cfg_ctx - Configuration Handle 628 * @context - Numerical ID identifying the Interrupt/NAPI context 629 * 630 * Return: int_wbm_rel_ring_mask[context] 631 */ 632 int wlan_cfg_get_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 633 context); 634 635 /** 636 * wlan_cfg_get_reo_status_ring_mask() - Return Rx monitor ring interrupt mask 637 * mapped to an interrupt context 638 * @wlan_cfg_ctx - Configuration Handle 639 * @context - Numerical ID identifying the Interrupt/NAPI context 640 * 641 * Return: int_reo_status_ring_mask[context] 642 */ 643 int wlan_cfg_get_reo_status_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int 644 context); 645 646 /** 647 * wlan_cfg_get_ce_ring_mask() - Return CE ring interrupt mask 648 * mapped to an interrupt context 649 * @wlan_cfg_ctx - Configuration Handle 650 * @context - Numerical ID identifying the Interrupt/NAPI context 651 * 652 * Return: int_ce_ring_mask[context] 653 */ 654 int wlan_cfg_get_ce_ring_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 655 int context); 656 657 /** 658 * wlan_cfg_get_max_clients() - Return maximum number of peers/stations 659 * supported by device 660 * @wlan_cfg_ctx - Configuration Handle 661 * 662 * Return: max_clients 663 */ 664 uint32_t wlan_cfg_get_max_clients(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 665 666 /** 667 * wlan_cfg_max_alloc_size() - Return Maximum allocation size for any dynamic 668 * memory allocation request for this device 669 * @wlan_cfg_ctx - Configuration Handle 670 * 671 * Return: max_alloc_size 672 */ 673 uint32_t wlan_cfg_max_alloc_size(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 674 675 /* 676 * wlan_cfg_per_pdev_tx_ring() - Return true if Tx rings are mapped as 677 * one per radio 678 * @wlan_cfg_ctx - Configuration Handle 679 * 680 * Return: per_pdev_tx_ring 681 */ 682 int wlan_cfg_per_pdev_tx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 683 684 /* 685 * wlan_cfg_num_tcl_data_rings() - Number of TCL Data rings (HOST mode) 686 * @wlan_cfg_ctx 687 * 688 * Return: num_tcl_data_rings 689 */ 690 int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 691 692 /* 693 * wlan_cfg_num_nss_tcl_data_rings() - Number of TCL Data rings (NSS offload) 694 * @wlan_cfg_ctx 695 * 696 * Return: num_tcl_data_rings 697 */ 698 int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 699 700 /* 701 * wlan_cfg_per_pdev_rx_ring() - Return true if Rx rings are mapped as 702 * one per radio 703 * @wlan_cfg_ctx 704 * 705 * Return: per_pdev_rx_ring 706 */ 707 int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 708 709 /* 710 * wlan_cfg_per_pdev_lmac_ring() - Return true if error rings are mapped as 711 * one per radio 712 * @wlan_cfg_ctx 713 * 714 * Return: return 1 if per pdev error ring else 0 715 */ 716 int wlan_cfg_per_pdev_lmac_ring(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 717 718 /* 719 * wlan_cfg_num_reo_dest_rings() - Number of REO Data rings (HOST mode) 720 * @wlan_cfg_ctx - Configuration Handle 721 * 722 * Return: num_reo_dest_rings 723 */ 724 int wlan_cfg_num_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 725 726 /* 727 * wlan_cfg_num_nss_reo_dest_rings() - Number of REO Data rings (NSS offload) 728 * @wlan_cfg_ctx - Configuration Handle 729 * 730 * Return: num_reo_dest_rings 731 */ 732 int wlan_cfg_num_nss_reo_dest_rings(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 733 734 /* 735 * wlan_cfg_pkt_type() - Default 802.11 encapsulation type 736 * @wlan_cfg_ctx - Configuration Handle 737 * 738 * Return: htt_pkt_type_ethernet 739 */ 740 int wlan_cfg_pkt_type(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 741 742 /* 743 * wlan_cfg_get_num_tx_desc_pool() - Number of Tx Descriptor pools for the 744 * device 745 * @wlan_cfg_ctx - Configuration Handle 746 * 747 * Return: num_tx_desc_pool 748 */ 749 int wlan_cfg_get_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 750 751 /* 752 * wlan_cfg_set_num_tx_desc_pool() - Set the number of Tx Descriptor pools for the 753 * device 754 * @wlan_cfg_ctx - Configuration Handle 755 * @num_pool - Number of pool 756 */ 757 void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool); 758 759 /* 760 * wlan_cfg_get_num_tx_ext_desc_pool() - Number of Tx MSDU ext Descriptor 761 * pools 762 * @wlan_cfg_ctx - Configuration Handle 763 * 764 * Return: num_tx_ext_desc_pool 765 */ 766 int wlan_cfg_get_num_tx_ext_desc_pool( 767 struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 768 769 /* 770 * wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size 771 * 772 * @wlan_cfg_ctx - Configuration Handle 773 * 774 * Return: reo_dst_ring_size 775 */ 776 int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 777 778 /* 779 * wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size 780 * 781 * @wlan_cfg_ctx - Configuration Handle 782 * @reo_dst_ring_size - REO Destination ring size 783 */ 784 void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, 785 int reo_dst_ring_size); 786 787 /* 788 * wlan_cfg_set_raw_mode_war() - Set raw mode war configuration 789 * 790 * @wlan_cfg_ctx - Configuration Handle 791 * @raw_mode_war - raw mode war configuration 792 */ 793 void wlan_cfg_set_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg, 794 bool raw_mode_war); 795 796 /* 797 * wlan_cfg_get_raw_mode_war() - Get raw mode war configuration 798 * 799 * @wlan_cfg_ctx - Configuration Handle 800 * 801 * Return: reo_dst_ring_size 802 */ 803 bool wlan_cfg_get_raw_mode_war(struct wlan_cfg_dp_soc_ctxt *cfg); 804 805 /* 806 * wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor 807 * pools 808 * @wlan_cfg_ctx - Configuration Handle 809 * @num_pool - Number of pool 810 */ 811 void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_pool); 812 813 /* 814 * wlan_cfg_get_num_tx_desc() - Number of Tx Descriptors per pool 815 * @wlan_cfg_ctx - Configuration Handle 816 * 817 * Return: num_tx_desc 818 */ 819 int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 820 821 /* 822 * wlan_cfg_get_min_tx_desc() - Minimum number of Tx Descriptors per pool 823 * @wlan_cfg_ctx - Configuration Handle 824 * 825 * Return: num_tx_desc 826 */ 827 int wlan_cfg_get_min_tx_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 828 829 /* 830 * wlan_cfg_set_num_tx_desc() - Set the number of Tx Descriptors per pool 831 * 832 * @wlan_cfg_ctx - Configuration Handle 833 * @num_desc: Number of descriptor 834 */ 835 void wlan_cfg_set_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_desc); 836 837 /* 838 * wlan_cfg_get_num_tx_ext_desc() - Number of Tx MSDU extension Descriptors 839 * per pool 840 * @wlan_cfg_ctx - Configuration Handle 841 * 842 * Return: num_tx_ext_desc 843 */ 844 int wlan_cfg_get_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 845 846 /* 847 * wlan_cfg_set_num_tx_ext_desc() - Set the number of Tx MSDU extension Descriptors 848 * per pool 849 * @wlan_cfg_ctx - Configuration Handle 850 * @num_desc: Number of descriptor 851 */ 852 void wlan_cfg_set_num_tx_ext_desc(struct wlan_cfg_dp_soc_ctxt *cfg, int num_ext_desc); 853 854 /* 855 * wlan_cfg_max_peer_id() - Get maximum peer ID 856 * @cfg: Configuration Handle 857 * 858 * Return: maximum peer ID 859 */ 860 uint32_t wlan_cfg_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg); 861 862 /* 863 * wlan_cfg_get_dma_mon_buf_ring_size() - Return Size of monitor buffer ring 864 * @wlan_cfg_pdev_ctx 865 * 866 * Return: dma_mon_buf_ring_size 867 */ 868 int wlan_cfg_get_dma_mon_buf_ring_size( 869 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 870 871 /* 872 * wlan_cfg_get_dma_mon_dest_ring_size() - Return Size of RxDMA Monitor 873 * Destination ring 874 * @wlan_cfg_pdev_ctx 875 * 876 * Return: dma_mon_dest_size 877 */ 878 int wlan_cfg_get_dma_mon_dest_ring_size( 879 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 880 881 /* 882 * wlan_cfg_get_dma_mon_stat_ring_size() - Return size of Monitor Status ring 883 * @wlan_cfg_pdev_ctx 884 * 885 * Return: dma_mon_stat_ring_size 886 */ 887 int wlan_cfg_get_dma_mon_stat_ring_size( 888 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 889 890 /* 891 * wlan_cfg_get_dma_mon_desc_ring_size - Get rxdma monitor size 892 * @wlan_cfg_soc_ctx 893 * 894 * Return: rxdma monitor desc ring size 895 */ 896 int 897 wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg); 898 899 /* 900 * wlan_cfg_get_rx_dma_buf_ring_size() - Return Size of RxDMA buffer ring 901 * @wlan_cfg_pdev_ctx 902 * 903 * Return: rx_dma_buf_ring_size 904 */ 905 int wlan_cfg_get_rx_dma_buf_ring_size( 906 struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); 907 908 /* 909 * wlan_cfg_rx_pending_hl_threshold() - Return high threshold of rx pending 910 * @wlan_cfg_pdev_ctx 911 * 912 * Return: rx_pending_high_threshold 913 */ 914 uint32_t 915 wlan_cfg_rx_pending_hl_threshold(struct wlan_cfg_dp_soc_ctxt *cfg); 916 917 /* 918 * wlan_cfg_rx_pending_lo_threshold() - Return low threshold of rx pending 919 * @wlan_cfg_pdev_ctx 920 * 921 * Return: rx_pending_low_threshold 922 */ 923 uint32_t 924 wlan_cfg_rx_pending_lo_threshold(struct wlan_cfg_dp_soc_ctxt *cfg); 925 926 /* 927 * wlan_cfg_get_num_mac_rings() - Return the number of MAC RX DMA rings 928 * per pdev 929 * @wlan_cfg_pdev_ctx 930 * 931 * Return: number of mac DMA rings per pdev 932 */ 933 int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg); 934 935 /* 936 * wlan_cfg_is_lro_enabled - Return LRO enabled/disabled 937 * @wlan_cfg_dp_soc_ctxt 938 * 939 * Return: true - LRO enabled false - LRO disabled 940 */ 941 bool wlan_cfg_is_lro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 942 943 /* 944 * wlan_cfg_is_gro_enabled - Return GRO enabled/disabled 945 * @wlan_cfg_dp_soc_ctxt 946 * 947 * Return: true - GRO enabled false - GRO disabled 948 */ 949 bool wlan_cfg_is_gro_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 950 951 /* 952 * wlan_cfg_is_rx_hash_enabled - Return RX hash enabled/disabled 953 * @wlan_cfg_dp_soc_ctxt 954 * 955 * Return: true - enabled false - disabled 956 */ 957 bool wlan_cfg_is_rx_hash_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 958 959 /* 960 * wlan_cfg_is_ipa_enabled - Return IPA enabled/disabled 961 * @wlan_cfg_dp_soc_ctxt 962 * 963 * Return: true - enabled false - disabled 964 */ 965 bool wlan_cfg_is_ipa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 966 967 /* 968 * wlan_cfg_set_rx_hash - set rx hash enabled/disabled 969 * @wlan_cfg_soc_ctx 970 * @rx_hash 971 */ 972 void wlan_cfg_set_rx_hash(struct wlan_cfg_dp_soc_ctxt *cfg, bool rx_hash); 973 974 /* 975 * wlan_cfg_get_dp_pdev_nss_enabled - Return pdev nss enabled/disabled 976 * @wlan_cfg_pdev_ctx 977 * 978 * Return: 1 - enabled 0 - disabled 979 */ 980 int wlan_cfg_get_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg); 981 982 /* 983 * wlan_cfg_set_dp_pdev_nss_enabled - set pdev nss enabled/disabled 984 * @wlan_cfg_pdev_ctx 985 */ 986 void wlan_cfg_set_dp_pdev_nss_enabled(struct wlan_cfg_dp_pdev_ctxt *cfg, int nss_enabled); 987 988 /* 989 * wlan_cfg_get_dp_soc_nss_cfg - Return soc nss config 990 * @wlan_cfg_pdev_ctx 991 * 992 * Return: nss_cfg 993 */ 994 int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg); 995 996 /* 997 * wlan_cfg_set_dp_soc_nss_cfg - set soc nss config 998 * @wlan_cfg_pdev_ctx 999 * 1000 */ 1001 void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg); 1002 1003 /* 1004 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for Tx 1005 * @wlan_cfg_soc_ctx 1006 * 1007 * Return: Batch threshold 1008 */ 1009 int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg); 1010 1011 /* 1012 * wlan_cfg_get_int_timer_threshold_tx - Get interrupt mitigation cfg for Tx 1013 * @wlan_cfg_soc_ctx 1014 * 1015 * Return: Timer threshold 1016 */ 1017 int wlan_cfg_get_int_timer_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg); 1018 1019 /* 1020 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx 1021 * @wlan_cfg_soc_ctx 1022 * 1023 * Return: Batch threshold 1024 */ 1025 int wlan_cfg_get_int_batch_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg); 1026 1027 /* 1028 * wlan_cfg_get_int_batch_threshold_rx - Get interrupt mitigation cfg for Rx 1029 * @wlan_cfg_soc_ctx 1030 * 1031 * Return: Timer threshold 1032 */ 1033 int wlan_cfg_get_int_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg); 1034 1035 /* 1036 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs 1037 * @wlan_cfg_soc_ctx 1038 * 1039 * Return: Batch threshold 1040 */ 1041 int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); 1042 1043 /* 1044 * wlan_cfg_get_int_batch_threshold_tx - Get interrupt mitigation cfg for other srngs 1045 * @wlan_cfg_soc_ctx 1046 * 1047 * Return: Timer threshold 1048 */ 1049 int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); 1050 1051 /* 1052 * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs 1053 * @wlan_cfg_soc_ctx 1054 * 1055 * Return: Timer threshold 1056 */ 1057 int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg); 1058 1059 /* 1060 * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status 1061 * @wlan_cfg_soc_ctx 1062 * 1063 * Return: Checksum offload enable or disable 1064 */ 1065 int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg); 1066 1067 /* 1068 * wlan_cfg_get_nan_checksum_offload - Get checksum offload enable/disable val 1069 * @wlan_cfg_soc_ctx 1070 * 1071 * Return: Checksum offload enable or disable value for NAN mode 1072 */ 1073 int wlan_cfg_get_nan_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg); 1074 1075 /* 1076 * wlan_cfg_get_p2p_checksum_offload - Get checksum offload enable/disable val 1077 * @wlan_cfg_soc_ctx 1078 * 1079 * Return: Checksum offload enable or disable value for P2P mode 1080 */ 1081 int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg); 1082 1083 /* 1084 * wlan_cfg_tx_ring_size - Get Tx DMA ring size (TCL Data Ring) 1085 * @wlan_cfg_soc_ctx 1086 * 1087 * Return: Tx Ring Size 1088 */ 1089 int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1090 1091 /* 1092 * wlan_cfg_tx_comp_ring_size - Get Tx completion ring size (WBM Ring) 1093 * @wlan_cfg_soc_ctx 1094 * 1095 * Return: Tx Completion ring size 1096 */ 1097 int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1098 1099 /* 1100 * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size 1101 * @wlan_cfg_soc_ctx 1102 * 1103 * Return: wbm_release_ring size 1104 */ 1105 int 1106 wlan_cfg_get_dp_soc_wbm_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1107 1108 /* 1109 * wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size - Get command/credit ring size 1110 * @wlan_cfg_soc_ctx 1111 * 1112 * Return: tcl_cmd_credit_ring size 1113 */ 1114 int 1115 wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1116 1117 /* 1118 * wlan_cfg_get_dp_soc_tcl_status_ring_size - Get tcl_status_ring size 1119 * @wlan_cfg_soc_ctx 1120 * 1121 * Return: tcl_status_ring size 1122 */ 1123 int 1124 wlan_cfg_get_dp_soc_tcl_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1125 1126 /* 1127 * wlan_cfg_get_dp_soc_reo_reinject_ring_size - Get reo_reinject_ring size 1128 * @wlan_cfg_soc_ctx 1129 * 1130 * Return: reo_reinject_ring size 1131 */ 1132 int 1133 wlan_cfg_get_dp_soc_reo_reinject_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1134 1135 /* 1136 * wlan_cfg_get_dp_soc_rx_release_ring_size - Get rx_release_ring size 1137 * @wlan_cfg_soc_ctx 1138 * 1139 * Return: rx_release_ring size 1140 */ 1141 int 1142 wlan_cfg_get_dp_soc_rx_release_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1143 1144 /* 1145 * wlan_cfg_get_dp_soc_reo_exception_ring_size - Get reo_exception_ring size 1146 * @wlan_cfg_soc_ctx 1147 * 1148 * Return: reo_exception_ring size 1149 */ 1150 int 1151 wlan_cfg_get_dp_soc_reo_exception_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1152 1153 /* 1154 * wlan_cfg_get_dp_soc_reo_cmd_ring_size - Get reo_cmd_ring size 1155 * @wlan_cfg_soc_ctx 1156 * 1157 * Return: reo_cmd_ring size 1158 */ 1159 int 1160 wlan_cfg_get_dp_soc_reo_cmd_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1161 1162 /* 1163 * wlan_cfg_get_dp_soc_reo_status_ring_size - Get reo_status_ring size 1164 * @wlan_cfg_soc_ctx 1165 * 1166 * Return: reo_status_ring size 1167 */ 1168 int 1169 wlan_cfg_get_dp_soc_reo_status_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1170 1171 /* 1172 * wlan_cfg_get_dp_soc_tx_desc_limit_0 - Get tx desc limit for 5G H 1173 * @wlan_cfg_soc_ctx 1174 * 1175 * Return: tx desc limit for 5G H 1176 */ 1177 int 1178 wlan_cfg_get_dp_soc_tx_desc_limit_0(struct wlan_cfg_dp_soc_ctxt *cfg); 1179 1180 /* 1181 * wlan_cfg_get_dp_soc_tx_desc_limit_1 - Get tx desc limit for 2G 1182 * @wlan_cfg_soc_ctx 1183 * 1184 * Return: tx desc limit for 2G 1185 */ 1186 int 1187 wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg); 1188 1189 /* 1190 * wlan_cfg_get_dp_soc_tx_desc_limit_2 - Get tx desc limit for 5G L 1191 * @wlan_cfg_soc_ctx 1192 * 1193 * Return: tx desc limit for 5G L 1194 */ 1195 int 1196 wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg); 1197 1198 /* 1199 * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit 1200 * @wlan_cfg_soc_ctx 1201 * 1202 * Return: tx device limit 1203 */ 1204 int 1205 wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg); 1206 1207 /* 1208 * wlan_cfg_get_dp_soc_tx_sw_internode_queue - Get tx sw internode queue 1209 * @wlan_cfg_soc_ctx 1210 * 1211 * Return: tx sw internode queue 1212 */ 1213 int 1214 wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg); 1215 1216 /* 1217 * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size 1218 * @wlan_cfg_soc_ctx 1219 * 1220 * Return: rxdma refill ring size 1221 */ 1222 int 1223 wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1224 1225 /* 1226 * wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size - Get rxdma dst ring size 1227 * @wlan_cfg_soc_ctx 1228 * 1229 * Return: rxdma error dst ring size 1230 */ 1231 int 1232 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1233 1234 /* 1235 * wlan_cfg_get_dp_soc_rx_sw_desc_weight - Get rx sw desc weight 1236 * @wlan_cfg_soc_ctx 1237 * 1238 * Return: rx_sw_desc_weight 1239 */ 1240 int 1241 wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg); 1242 1243 /* 1244 * wlan_cfg_get_dp_soc_rx_sw_desc_num - Get rx sw desc num 1245 * @wlan_cfg_soc_ctx 1246 * 1247 * Return: rx_sw_desc_num 1248 */ 1249 int 1250 wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg); 1251 1252 /* 1253 * wlan_cfg_get_dp_caps - Get dp capablities 1254 * @wlan_cfg_soc_ctx 1255 * @dp_caps: enum for dp capablities 1256 * 1257 * Return: bool if a dp capabilities is enabled 1258 */ 1259 bool 1260 wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg, 1261 enum cdp_capabilities dp_caps); 1262 1263 /** 1264 * wlan_set_srng_cfg() - Fill per ring specific 1265 * configuration parameters 1266 * @wlan_cfg: global srng configuration table 1267 * 1268 * Return: None 1269 */ 1270 void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg); 1271 1272 #ifdef QCA_LL_TX_FLOW_CONTROL_V2 1273 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg); 1274 1275 int wlan_cfg_get_tx_flow_start_queue_offset(struct wlan_cfg_dp_soc_ctxt *cfg); 1276 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */ 1277 int wlan_cfg_get_rx_defrag_min_timeout(struct wlan_cfg_dp_soc_ctxt *cfg); 1278 1279 int wlan_cfg_get_defrag_timeout_check(struct wlan_cfg_dp_soc_ctxt *cfg); 1280 1281 /** 1282 * wlan_cfg_get_rx_flow_search_table_size() - Return the size of Rx FST 1283 * in number of entries 1284 * 1285 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1286 * 1287 * Return: rx_fst_size 1288 */ 1289 uint16_t 1290 wlan_cfg_get_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg); 1291 1292 /** 1293 * wlan_cfg_rx_fst_get_max_search() - Return the max skid length for FST search 1294 * 1295 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1296 * 1297 * Return: max_search 1298 */ 1299 uint8_t wlan_cfg_rx_fst_get_max_search(struct wlan_cfg_dp_soc_ctxt *cfg); 1300 1301 /** 1302 * wlan_cfg_rx_fst_get_hash_key() - Return Toeplitz Hash Key used for FST 1303 * search 1304 * 1305 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1306 * 1307 * Return: 320-bit Hash Key 1308 */ 1309 uint8_t *wlan_cfg_rx_fst_get_hash_key(struct wlan_cfg_dp_soc_ctxt *cfg); 1310 1311 /** 1312 * wlan_cfg_set_rx_flow_tag_enabled() - set rx flow tag enabled flag in 1313 * DP soc context 1314 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1315 * @val: Rx flow tag feature flag value 1316 * 1317 * Return: None 1318 */ 1319 void wlan_cfg_set_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg, 1320 bool val); 1321 1322 /** 1323 * wlan_cfg_is_rx_flow_tag_enabled() - get rx flow tag enabled flag from 1324 * DP soc context 1325 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1326 * 1327 * Return: true if feature is enabled, else false 1328 */ 1329 bool wlan_cfg_is_rx_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1330 1331 /** 1332 * wlan_cfg_set_rx_flow_search_table_per_pdev() - Set flag to indicate that 1333 * Rx FST is per pdev 1334 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1335 * @val: boolean flag indicating Rx FST per pdev or per SOC 1336 * 1337 * Return: None 1338 */ 1339 void 1340 wlan_cfg_set_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg, 1341 bool val); 1342 1343 /** 1344 * wlan_cfg_is_rx_flow_search_table_per_pdev() - get RX FST flag for per pdev 1345 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1346 * 1347 * Return: true if Rx FST is per pdev, else false 1348 */ 1349 bool 1350 wlan_cfg_is_rx_flow_search_table_per_pdev(struct wlan_cfg_dp_soc_ctxt *cfg); 1351 1352 /** 1353 * wlan_cfg_set_rx_flow_search_table_size() - set RX FST size in DP SoC context 1354 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1355 * @val: Rx FST size in number of entries 1356 * 1357 * Return: None 1358 */ 1359 void 1360 wlan_cfg_set_rx_flow_search_table_size(struct wlan_cfg_dp_soc_ctxt *cfg, 1361 uint16_t val); 1362 1363 /** 1364 * wlan_cfg_set_rx_mon_protocol_flow_tag_enabled() - set mon rx tag enabled flag 1365 * in DP soc context 1366 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1367 * @val: Rx protocol or flow tag feature flag value in monitor mode from INI 1368 * 1369 * Return: None 1370 */ 1371 void 1372 wlan_cfg_set_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg, 1373 bool val); 1374 1375 /** 1376 * wlan_cfg_is_rx_mon_protocol_flow_tag_enabled() - get mon rx tag enabled flag 1377 * from DP soc context 1378 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1379 * 1380 * Return: true if feature is enabled in monitor mode for protocol or flow 1381 * tagging in INI, false otherwise 1382 */ 1383 bool 1384 wlan_cfg_is_rx_mon_protocol_flow_tag_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1385 1386 /** 1387 * wlan_cfg_set_tx_per_pkt_vdev_id_check() - set flag to enable perpkt 1388 * vdev id check in tx. 1389 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1390 * @val: feature flag value 1391 * 1392 * Return: None 1393 */ 1394 void 1395 wlan_cfg_set_tx_per_pkt_vdev_id_check(struct wlan_cfg_dp_soc_ctxt *cfg, 1396 bool val); 1397 1398 /** 1399 * wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled() - get flag to check if 1400 * perpkt vdev id check is enabled in tx. 1401 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1402 * 1403 * Return: true if feature is enabled, false otherwise 1404 */ 1405 bool 1406 wlan_cfg_is_tx_per_pkt_vdev_id_check_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1407 1408 /** 1409 * wlan_cfg_fill_interrupt_mask() - set interrupt mask 1410 * 1411 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1412 * @interrupt_mode: interrupt_mode: MSI/LEGACY 1413 * @is_monitor_mode: is monitor mode enabled 1414 * 1415 * Return: void 1416 */ 1417 void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, 1418 int interrupt_mode, bool is_monitor_mode); 1419 1420 /** 1421 * wlan_cfg_is_rx_fisa_enabled() - Get Rx FISA enabled flag 1422 * 1423 * 1424 * @cfg: soc configuration context 1425 * 1426 * Return: true if enabled, false otherwise. 1427 */ 1428 bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1429 1430 /** 1431 * wlan_cfg_is_rx_buffer_pool_enabled() - Get RX buffer pool enabled flag 1432 * 1433 * 1434 * @cfg: soc configuration context 1435 * 1436 * Return: true if enabled, false otherwise. 1437 */ 1438 bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1439 1440 void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg, 1441 bool val); 1442 1443 bool wlan_cfg_is_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg); 1444 1445 /** 1446 * wlan_cfg_get_reo_rings_mapping() - Get Reo destination ring bitmap 1447 * 1448 * 1449 * @cfg: soc configuration context 1450 * 1451 * Return: reo ring bitmap. 1452 */ 1453 uint32_t wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg); 1454 1455 /** 1456 * wlan_cfg_set_peer_ext_stats() - set peer extended stats 1457 * 1458 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1459 * @val: Flag value read from INI 1460 * 1461 * Return: void 1462 */ 1463 void 1464 wlan_cfg_set_peer_ext_stats(struct wlan_cfg_dp_soc_ctxt *cfg, 1465 bool val); 1466 1467 /** 1468 * wlan_cfg_is_peer_ext_stats_enabled() - Check if peer extended 1469 * stats are enabled 1470 * 1471 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1472 * 1473 * Return: bool 1474 */ 1475 bool 1476 wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1477 1478 /** 1479 * wlan_cfg_is_poll_mode_enabled() - Check if poll mode is enabled 1480 * 1481 * @wlan_cfg_dp_soc_ctxt: soc configuration context 1482 * 1483 * Return: bool 1484 */ 1485 1486 bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1487 1488 /** 1489 * wlan_cfg_is_fst_in_cmem_enabled() - Check if FST in CMEM is enabled 1490 * @cfg: soc configuration context 1491 * 1492 * Return: true if enabled, false otherwise. 1493 */ 1494 bool wlan_cfg_is_fst_in_cmem_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1495 1496 /** 1497 * wlan_cfg_is_swlm_enabled() - Get SWLMenabled flag 1498 * @cfg: soc configuration context 1499 * 1500 * Return: true if enabled, false otherwise. 1501 */ 1502 bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); 1503 1504 /** 1505 * wlan_cfg_is_dp_force_rx_64_ba() - Get force use 64 BA flag 1506 * @cfg: config context 1507 * 1508 * Return: force use 64 BA flag 1509 */ 1510 bool wlan_cfg_is_dp_force_rx_64_ba(struct wlan_cfg_dp_soc_ctxt *cfg); 1511 #endif 1512 1513 /** 1514 * wlan_cfg_radio0_default_reo_get - Get Radio0 default REO 1515 * @cfg: soc configuration context 1516 * 1517 * Return: . 1518 */ 1519 uint8_t wlan_cfg_radio0_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg); 1520 1521 /** 1522 * wlan_cfg_radio1_default_reo_get - Get Radio1 default REO 1523 * @cfg: soc configuration context 1524 * 1525 * Return: . 1526 */ 1527 uint8_t wlan_cfg_radio1_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg); 1528 1529 /** 1530 * wlan_cfg_radio2_default_reo_get() - Get Radio2 default REO 1531 * @cfg: soc configuration context 1532 * 1533 * Return: . 1534 */ 1535 uint8_t wlan_cfg_radio2_default_reo_get(struct wlan_cfg_dp_soc_ctxt *cfg); 1536 1537 /** 1538 * wlan_cfg_set_rxdma1_enable() - Enable rxdma1 1539 * @cfg: soc configuration context 1540 * 1541 * Return: . 1542 */ 1543 void wlan_cfg_set_rxdma1_enable(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); 1544 1545 /** 1546 * wlan_cfg_is_delay_mon_replenish() - Get if delayed monitor replenish 1547 * is enabled 1548 * @cfg: soc configuration context 1549 * 1550 * Return: . 1551 */ 1552 void 1553 wlan_cfg_set_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg, bool val); 1554 /** 1555 * wlan_cfg_set_delay_mon_replenish() - Set delayed monitor replenish 1556 * @cfg: soc configuration context 1557 * @val: val to set 1558 * 1559 * Return: . 1560 */ 1561 bool 1562 wlan_cfg_is_delay_mon_replenish(struct wlan_cfg_dp_soc_ctxt *cfg); 1563