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