1 /* 2 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. 3 * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 18 #ifndef _DP_IPA_H_ 19 #define _DP_IPA_H_ 20 21 #if defined(QCA_WIFI_KIWI) || defined(QCA_WIFI_KIWI_V2) || \ 22 defined(QCA_WIFI_QCN9224) 23 /* Index into soc->tcl_data_ring[] */ 24 #define IPA_TCL_DATA_RING_IDX 3 25 #else 26 #define IPA_TCL_DATA_RING_IDX 2 27 #endif 28 /* Index into soc->tx_comp_ring[] */ 29 #define IPA_TX_COMP_RING_IDX IPA_TCL_DATA_RING_IDX 30 31 #ifdef IPA_OFFLOAD 32 33 #define DP_IPA_MAX_IFACE 3 34 #define IPA_REO_DEST_RING_IDX 3 35 #define IPA_REO_DEST_RING_IDX_2 7 36 37 #define IPA_RX_REFILL_BUF_RING_IDX 2 38 39 #define IPA_ALT_REO_DEST_RING_IDX 2 40 #define IPA_RX_ALT_REFILL_BUF_RING_IDX 3 41 42 /* Adding delay before disabling ipa pipes if any Tx Completions are pending */ 43 #define TX_COMP_DRAIN_WAIT_MS 50 44 #define TX_COMP_DRAIN_WAIT_TIMEOUT_MS 100 45 46 #ifdef IPA_WDI3_TX_TWO_PIPES 47 #if defined(QCA_WIFI_KIWI) || defined(QCA_WIFI_KIWI_V2) 48 /* Index into soc->tcl_data_ring[] and soc->tx_comp_ring[] */ 49 #define IPA_TX_ALT_RING_IDX 4 50 #define IPA_TX_ALT_COMP_RING_IDX IPA_TX_ALT_RING_IDX 51 #else /* !KIWI */ 52 #define IPA_TX_ALT_RING_IDX 1 53 /* 54 * must be same as IPA_TX_ALT_RING_IDX as tcl and wbm ring 55 * are initialized with same index as a pair. 56 */ 57 #define IPA_TX_ALT_COMP_RING_IDX 1 58 #endif /* KIWI */ 59 60 #define IPA_SESSION_ID_SHIFT 1 61 #endif /* IPA_WDI3_TX_TWO_PIPES */ 62 63 /** 64 * struct dp_ipa_uc_tx_hdr - full tx header registered to IPA hardware 65 * @eth: ether II header 66 */ 67 struct dp_ipa_uc_tx_hdr { 68 struct ethhdr eth; 69 } __packed; 70 71 /** 72 * struct dp_ipa_uc_tx_vlan_hdr - full tx header registered to IPA hardware 73 * @eth: ether II header 74 */ 75 struct dp_ipa_uc_tx_vlan_hdr { 76 struct vlan_ethhdr eth; 77 } __packed; 78 79 /** 80 * struct dp_ipa_uc_rx_hdr - full rx header registered to IPA hardware 81 * @eth: ether II header 82 */ 83 struct dp_ipa_uc_rx_hdr { 84 struct ethhdr eth; 85 } __packed; 86 87 #define DP_IPA_UC_WLAN_TX_HDR_LEN sizeof(struct dp_ipa_uc_tx_hdr) 88 #define DP_IPA_UC_WLAN_TX_VLAN_HDR_LEN sizeof(struct dp_ipa_uc_tx_vlan_hdr) 89 #define DP_IPA_UC_WLAN_RX_HDR_LEN sizeof(struct dp_ipa_uc_rx_hdr) 90 /* 28 <bytes of rx_msdu_end_tlv> + 16 <bytes of attn tlv> + 91 * 52 <bytes of rx_mpdu_start_tlv> + <L2 Header> 92 */ 93 #define DP_IPA_UC_WLAN_RX_HDR_LEN_AST 110 94 #define DP_IPA_UC_WLAN_RX_HDR_LEN_AST_VLAN 114 95 #define DP_IPA_UC_WLAN_HDR_DES_MAC_OFFSET 0 96 97 #define DP_IPA_HDL_INVALID 0xFF 98 #define DP_IPA_HDL_FIRST 0 99 #define DP_IPA_HDL_SECOND 1 100 #define DP_IPA_HDL_THIRD 2 101 /** 102 * wlan_ipa_get_hdl() - Get ipa handle from IPA component 103 * @psoc: control psoc object 104 * @pdev_id: pdev id 105 * 106 * IPA componenet will return the IPA handle based on pdev_id 107 * 108 * Return: IPA handle 109 */ 110 qdf_ipa_wdi_hdl_t wlan_ipa_get_hdl(void *psoc, uint8_t pdev_id); 111 112 /** 113 * dp_ipa_get_resource() - Client request resource information 114 * @soc_hdl: data path soc handle 115 * @pdev_id: device instance id 116 * 117 * IPA client will request IPA UC related resource information 118 * Resource information will be distributed to IPA module 119 * All of the required resources should be pre-allocated 120 * 121 * Return: QDF_STATUS 122 */ 123 QDF_STATUS dp_ipa_get_resource(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 124 125 /** 126 * dp_ipa_set_doorbell_paddr() - Set doorbell register physical address to SRNG 127 * @soc_hdl: data path soc handle 128 * @pdev_id: device instance id 129 * 130 * Set TX_COMP_DOORBELL register physical address to WBM Head_Ptr_MemAddr_LSB 131 * Set RX_READ_DOORBELL register physical address to REO Head_Ptr_MemAddr_LSB 132 * 133 * Return: QDF_STATUS 134 */ 135 QDF_STATUS dp_ipa_set_doorbell_paddr(struct cdp_soc_t *soc_hdl, 136 uint8_t pdev_id); 137 138 /** 139 * dp_ipa_iounmap_doorbell_vaddr() - unmap ipa RX db vaddr 140 * @soc_hdl: data path soc handle 141 * @pdev_id: device instance id 142 * 143 * Return: QDF_STATUS 144 */ 145 QDF_STATUS dp_ipa_iounmap_doorbell_vaddr(struct cdp_soc_t *soc_hdl, 146 uint8_t pdev_id); 147 148 /** 149 * dp_ipa_op_response() - Handle OP command response from firmware 150 * @soc_hdl: data path soc handle 151 * @pdev_id: device instance id 152 * @op_msg: op response message from firmware 153 * 154 * Return: QDF_STATUS 155 */ 156 QDF_STATUS dp_ipa_op_response(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 157 uint8_t *op_msg); 158 159 /** 160 * dp_ipa_register_op_cb() - Register OP handler function 161 * @soc_hdl: data path soc handle 162 * @pdev_id: device instance id 163 * @op_cb: handler function pointer 164 * @usr_ctxt: user context passed back to handler function 165 * 166 * Return: QDF_STATUS 167 */ 168 QDF_STATUS dp_ipa_register_op_cb(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 169 ipa_uc_op_cb_type op_cb, void *usr_ctxt); 170 171 /** 172 * dp_ipa_deregister_op_cb() - Deregister OP handler function 173 * @soc_hdl: data path soc handle 174 * @pdev_id: device instance id 175 * 176 * Return: none 177 */ 178 void dp_ipa_deregister_op_cb(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 179 180 /** 181 * dp_ipa_get_stat() - Get firmware wdi status 182 * @soc_hdl: data path soc handle 183 * @pdev_id: device instance id 184 * 185 * Return: QDF_STATUS 186 */ 187 QDF_STATUS dp_ipa_get_stat(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 188 189 /** 190 * dp_tx_send_ipa_data_frame() - send IPA data frame 191 * @soc_hdl: datapath soc handle 192 * @vdev_id: virtual device/interface id 193 * @skb: skb 194 * 195 * Return: skb/ NULL is for success 196 */ 197 qdf_nbuf_t dp_tx_send_ipa_data_frame(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 198 qdf_nbuf_t skb); 199 200 /** 201 * dp_ipa_enable_autonomy() - Enable autonomy RX path 202 * @soc_hdl: data path soc handle 203 * @pdev_id: device instance id 204 * 205 * Set all RX packet route to IPA REO ring 206 * Program Destination_Ring_Ctrl_IX_0 REO register to point IPA REO ring 207 * 208 * Return: QDF_STATUS 209 */ 210 QDF_STATUS dp_ipa_enable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 211 212 /** 213 * dp_ipa_disable_autonomy() - Disable autonomy RX path 214 * @soc_hdl: data path soc handle 215 * @pdev_id: device instance id 216 * 217 * Disable RX packet routing to IPA REO 218 * Program Destination_Ring_Ctrl_IX_0 REO register to disable 219 * 220 * Return: QDF_STATUS 221 */ 222 QDF_STATUS dp_ipa_disable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 223 224 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ 225 defined(CONFIG_IPA_WDI_UNIFIED_API) 226 /** 227 * dp_ipa_setup() - Setup and connect IPA pipes 228 * @soc_hdl: data path soc handle 229 * @pdev_id: device instance id 230 * @ipa_i2w_cb: IPA to WLAN callback 231 * @ipa_w2i_cb: WLAN to IPA callback 232 * @ipa_wdi_meter_notifier_cb: IPA WDI metering callback 233 * @ipa_desc_size: IPA descriptor size 234 * @ipa_priv: handle to the HTT instance 235 * @is_rm_enabled: Is IPA RM enabled or not 236 * @tx_pipe_handle: pointer to Tx pipe handle 237 * @rx_pipe_handle: pointer to Rx pipe handle 238 * @is_smmu_enabled: Is SMMU enabled or not 239 * @sys_in: parameters to setup sys pipe in mcc mode 240 * @over_gsi: 241 * @hdl: IPA handle 242 * @id: IPA instance id 243 * @ipa_ast_notify_cb: IPA to WLAN callback for ast create and update 244 * 245 * Return: QDF_STATUS 246 */ 247 QDF_STATUS dp_ipa_setup(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 248 void *ipa_i2w_cb, void *ipa_w2i_cb, 249 void *ipa_wdi_meter_notifier_cb, 250 uint32_t ipa_desc_size, void *ipa_priv, 251 bool is_rm_enabled, uint32_t *tx_pipe_handle, 252 uint32_t *rx_pipe_handle, 253 bool is_smmu_enabled, 254 qdf_ipa_sys_connect_params_t *sys_in, bool over_gsi, 255 qdf_ipa_wdi_hdl_t hdl, qdf_ipa_wdi_hdl_t id, 256 void *ipa_ast_notify_cb); 257 #else /* CONFIG_IPA_WDI_UNIFIED_API */ 258 /** 259 * dp_ipa_setup() - Setup and connect IPA pipes 260 * @soc_hdl: data path soc handle 261 * @pdev_id: device instance id 262 * @ipa_i2w_cb: IPA to WLAN callback 263 * @ipa_w2i_cb: WLAN to IPA callback 264 * @ipa_wdi_meter_notifier_cb: IPA WDI metering callback 265 * @ipa_desc_size: IPA descriptor size 266 * @ipa_priv: handle to the HTT instance 267 * @is_rm_enabled: Is IPA RM enabled or not 268 * @tx_pipe_handle: pointer to Tx pipe handle 269 * @rx_pipe_handle: pointer to Rx pipe handle 270 * 271 * Return: QDF_STATUS 272 */ 273 QDF_STATUS dp_ipa_setup(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 274 void *ipa_i2w_cb, void *ipa_w2i_cb, 275 void *ipa_wdi_meter_notifier_cb, 276 uint32_t ipa_desc_size, void *ipa_priv, 277 bool is_rm_enabled, uint32_t *tx_pipe_handle, 278 uint32_t *rx_pipe_handle); 279 #endif /* CONFIG_IPA_WDI_UNIFIED_API */ 280 281 /** 282 * dp_ipa_cleanup() - Disconnect IPA pipes 283 * @soc_hdl: dp soc handle 284 * @pdev_id: dp pdev id 285 * @tx_pipe_handle: Tx pipe handle 286 * @rx_pipe_handle: Rx pipe handle 287 * @hdl: IPA handle 288 * 289 * Return: QDF_STATUS 290 */ 291 QDF_STATUS dp_ipa_cleanup(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 292 uint32_t tx_pipe_handle, uint32_t rx_pipe_handle, 293 qdf_ipa_wdi_hdl_t hdl); 294 295 /** 296 * dp_ipa_setup_iface() - Setup IPA header and register interface 297 * @ifname: Interface name 298 * @mac_addr: Interface MAC address 299 * @prod_client: IPA prod client type 300 * @cons_client: IPA cons client type 301 * @session_id: Session ID 302 * @is_ipv6_enabled: Is IPV6 enabled or not 303 * @hdl: IPA handle 304 * 305 * Return: QDF_STATUS 306 */ 307 QDF_STATUS dp_ipa_setup_iface(char *ifname, uint8_t *mac_addr, 308 qdf_ipa_client_type_t prod_client, 309 qdf_ipa_client_type_t cons_client, 310 uint8_t session_id, bool is_ipv6_enabled, 311 qdf_ipa_wdi_hdl_t hdl); 312 313 /** 314 * dp_ipa_cleanup_iface() - Cleanup IPA header and deregister interface 315 * @ifname: Interface name 316 * @is_ipv6_enabled: Is IPV6 enabled or not 317 * @hdl: IPA handle 318 * 319 * Return: QDF_STATUS 320 */ 321 QDF_STATUS dp_ipa_cleanup_iface(char *ifname, bool is_ipv6_enabled, 322 qdf_ipa_wdi_hdl_t hdl); 323 324 /** 325 * dp_ipa_enable_pipes() - Enable and resume traffic on Tx/Rx pipes 326 * @soc_hdl: handle to the soc 327 * @pdev_id: pdev id number, to get the handle 328 * @hdl: IPA handle 329 * 330 * Return: QDF_STATUS 331 */ 332 QDF_STATUS dp_ipa_enable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 333 qdf_ipa_wdi_hdl_t hdl); 334 335 /** 336 * dp_ipa_disable_pipes() - Suspend traffic and disable Tx/Rx pipes 337 * @soc_hdl: handle to the soc 338 * @pdev_id: pdev id number, to get the handle 339 * @hdl: IPA handle 340 * 341 * Return: QDF_STATUS 342 */ 343 QDF_STATUS dp_ipa_disable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 344 qdf_ipa_wdi_hdl_t hdl); 345 346 /** 347 * dp_ipa_set_perf_level() - Set IPA clock bandwidth based on data rates 348 * @client: Client type 349 * @max_supported_bw_mbps: Maximum bandwidth needed (in Mbps) 350 * @hdl: IPA handle 351 * 352 * Return: QDF_STATUS 353 */ 354 QDF_STATUS dp_ipa_set_perf_level(int client, uint32_t max_supported_bw_mbps, 355 qdf_ipa_wdi_hdl_t hdl); 356 #ifdef IPA_OPT_WIFI_DP 357 QDF_STATUS dp_ipa_rx_super_rule_setup(struct cdp_soc_t *soc_hdl, 358 void *flt_params); 359 int dp_ipa_pcie_link_up(struct cdp_soc_t *soc_hdl); 360 void dp_ipa_pcie_link_down(struct cdp_soc_t *soc_hdl); 361 #endif 362 363 /** 364 * dp_ipa_rx_intrabss_fwd() - Perform intra-bss fwd for IPA RX path 365 * 366 * @soc_hdl: data path soc handle 367 * @vdev_id: virtual device/interface id 368 * @nbuf: pointer to skb of ethernet packet received from IPA RX path 369 * @fwd_success: pointer to indicate if skb succeeded in intra-bss TX 370 * 371 * This function performs intra-bss forwarding for WDI 3.0 IPA RX path. 372 * 373 * Return: true if packet is intra-bss fwd-ed and no need to pass to 374 * network stack. false if packet needs to be passed to network stack. 375 */ 376 bool dp_ipa_rx_intrabss_fwd(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 377 qdf_nbuf_t nbuf, bool *fwd_success); 378 int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev); 379 int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev); 380 381 /** 382 * dp_ipa_ring_resource_setup() - setup IPA ring resources 383 * @soc: data path SoC handle 384 * @pdev: 385 * 386 * Return: status 387 */ 388 int dp_ipa_ring_resource_setup(struct dp_soc *soc, 389 struct dp_pdev *pdev); 390 391 bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap0, 392 uint32_t *remap1, uint32_t *remap2); 393 bool dp_ipa_is_mdm_platform(void); 394 395 /** 396 * dp_ipa_handle_rx_reo_reinject() - Handle RX REO reinject skb buffer 397 * @soc: soc 398 * @nbuf: skb 399 * 400 * Return: nbuf if success and otherwise NULL 401 */ 402 qdf_nbuf_t dp_ipa_handle_rx_reo_reinject(struct dp_soc *soc, qdf_nbuf_t nbuf); 403 404 QDF_STATUS dp_ipa_handle_rx_buf_smmu_mapping(struct dp_soc *soc, 405 qdf_nbuf_t nbuf, 406 uint32_t size, 407 bool create, 408 const char *func, 409 uint32_t line); 410 411 /** 412 * dp_ipa_tx_buf_smmu_mapping() - Create SMMU mappings for IPA 413 * allocated TX buffers 414 * @soc_hdl: handle to the soc 415 * @pdev_id: pdev id number, to get the handle 416 * @func: caller function 417 * @line: line number 418 * 419 * Return: QDF_STATUS 420 */ 421 QDF_STATUS dp_ipa_tx_buf_smmu_mapping(struct cdp_soc_t *soc_hdl, 422 uint8_t pdev_id, const char *func, 423 uint32_t line); 424 425 /** 426 * dp_ipa_tx_buf_smmu_unmapping() - Release SMMU mappings for IPA 427 * allocated TX buffers 428 * @soc_hdl: handle to the soc 429 * @pdev_id: pdev id number, to get the handle 430 * @func: caller function 431 * @line: line number 432 * 433 * Return: QDF_STATUS 434 */ 435 QDF_STATUS dp_ipa_tx_buf_smmu_unmapping(struct cdp_soc_t *soc_hdl, 436 uint8_t pdev_id, const char *func, 437 uint32_t line); 438 439 #ifndef QCA_OL_DP_SRNG_LOCK_LESS_ACCESS 440 static inline void 441 dp_ipa_rx_buf_smmu_mapping_lock(struct dp_soc *soc) 442 { 443 if (soc->ipa_rx_buf_map_lock_initialized) 444 qdf_spin_lock_bh(&soc->ipa_rx_buf_map_lock); 445 } 446 447 static inline void 448 dp_ipa_rx_buf_smmu_mapping_unlock(struct dp_soc *soc) 449 { 450 if (soc->ipa_rx_buf_map_lock_initialized) 451 qdf_spin_unlock_bh(&soc->ipa_rx_buf_map_lock); 452 } 453 454 static inline void 455 dp_ipa_reo_ctx_buf_mapping_lock(struct dp_soc *soc, 456 uint32_t reo_ring_num) 457 { 458 if (!soc->ipa_reo_ctx_lock_required[reo_ring_num]) 459 return; 460 461 qdf_spin_lock_bh(&soc->ipa_rx_buf_map_lock); 462 } 463 464 static inline void 465 dp_ipa_reo_ctx_buf_mapping_unlock(struct dp_soc *soc, 466 uint32_t reo_ring_num) 467 { 468 if (!soc->ipa_reo_ctx_lock_required[reo_ring_num]) 469 return; 470 471 qdf_spin_unlock_bh(&soc->ipa_rx_buf_map_lock); 472 } 473 #else 474 475 static inline void 476 dp_ipa_rx_buf_smmu_mapping_lock(struct dp_soc *soc) 477 { 478 } 479 480 static inline void 481 dp_ipa_rx_buf_smmu_mapping_unlock(struct dp_soc *soc) 482 { 483 } 484 485 static inline void 486 dp_ipa_reo_ctx_buf_mapping_lock(struct dp_soc *soc, 487 uint32_t reo_ring_num) 488 { 489 } 490 491 static inline void 492 dp_ipa_reo_ctx_buf_mapping_unlock(struct dp_soc *soc, 493 uint32_t reo_ring_num) 494 { 495 } 496 #endif 497 498 #ifdef IPA_WDS_EASYMESH_FEATURE 499 /** 500 * dp_ipa_ast_create() - Create/update AST entry in AST table 501 * for learning/roaming packets from IPA 502 * @soc_hdl: data path soc handle 503 * @data: Structure used for updating the AST table 504 * 505 * Create/update AST entry in AST table for learning/roaming packets from IPA 506 * 507 * Return: QDF_STATUS 508 */ 509 QDF_STATUS dp_ipa_ast_create(struct cdp_soc_t *soc_hdl, 510 qdf_ipa_ast_info_type_t *data); 511 512 /** 513 * dp_ipa_ast_notify_cb() - Provide ast notify cb to IPA 514 * @pipe_in: WDI conn pipe in params 515 * @ipa_ast_notify_cb: ipa ast notify cb 516 * 517 * Return: None 518 */ 519 static inline void 520 dp_ipa_ast_notify_cb(qdf_ipa_wdi_conn_in_params_t *pipe_in, 521 void *ipa_ast_notify_cb) 522 { 523 QDF_IPA_WDI_CONN_IN_PARAMS_AST_NOTIFY(pipe_in) = ipa_ast_notify_cb; 524 } 525 #else 526 static inline void 527 dp_ipa_ast_notify_cb(qdf_ipa_wdi_conn_in_params_t *pipe_in, 528 void *ipa_ast_notify_cb) 529 { 530 } 531 #endif 532 533 #ifdef IPA_OPT_WIFI_DP 534 static inline void dp_ipa_opt_dp_ixo_remap(uint8_t *ix0_map) 535 { 536 ix0_map[0] = REO_REMAP_SW1; 537 ix0_map[1] = REO_REMAP_SW1; 538 ix0_map[2] = REO_REMAP_SW2; 539 ix0_map[3] = REO_REMAP_SW3; 540 ix0_map[4] = REO_REMAP_SW4; 541 ix0_map[5] = REO_REMAP_RELEASE; 542 ix0_map[6] = REO_REMAP_FW; 543 ix0_map[7] = REO_REMAP_FW; 544 } 545 #else 546 static inline void dp_ipa_opt_dp_ixo_remap(uint8_t *ix0_map) 547 { 548 } 549 #endif 550 #ifdef QCA_ENHANCED_STATS_SUPPORT 551 /** 552 * dp_ipa_txrx_get_peer_stats - fetch peer stats 553 * @soc: soc handle 554 * @vdev_id: id of vdev handle 555 * @peer_mac: peer mac address 556 * @peer_stats: buffer to hold peer stats 557 * 558 * Return: status success/failure 559 */ 560 QDF_STATUS dp_ipa_txrx_get_peer_stats(struct cdp_soc_t *soc, uint8_t vdev_id, 561 uint8_t *peer_mac, 562 struct cdp_peer_stats *peer_stats); 563 564 /** 565 * dp_ipa_txrx_get_vdev_stats - fetch vdev stats 566 * @soc_hdl: soc handle 567 * @vdev_id: id of vdev handle 568 * @buf: buffer to hold vdev stats 569 * @is_aggregate: for aggregation 570 * 571 * Return: int 572 */ 573 int dp_ipa_txrx_get_vdev_stats(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 574 void *buf, bool is_aggregate); 575 576 /** 577 * dp_ipa_txrx_get_pdev_stats() - fetch pdev stats 578 * @soc: DP soc handle 579 * @pdev_id: id of DP pdev handle 580 * @pdev_stats: buffer to hold pdev stats 581 * 582 * Return: status success/failure 583 */ 584 QDF_STATUS dp_ipa_txrx_get_pdev_stats(struct cdp_soc_t *soc, uint8_t pdev_id, 585 struct cdp_pdev_stats *pdev_stats); 586 587 /** 588 * dp_ipa_update_peer_rx_stats() - update peer rx stats 589 * @soc: soc handle 590 * @vdev_id: vdev id 591 * @peer_mac: Peer Mac Address 592 * @nbuf: data nbuf 593 * 594 * Return: status success/failure 595 */ 596 QDF_STATUS dp_ipa_update_peer_rx_stats(struct cdp_soc_t *soc, uint8_t vdev_id, 597 uint8_t *peer_mac, qdf_nbuf_t nbuf); 598 #endif 599 /** 600 * dp_ipa_get_wdi_version() - Get WDI version 601 * @soc_hdl: data path soc handle 602 * @wdi_ver: Out parameter for wdi version 603 * 604 * Get WDI version based on soc arch 605 * 606 * Return: None 607 */ 608 void dp_ipa_get_wdi_version(struct cdp_soc_t *soc_hdl, uint8_t *wdi_ver); 609 #else 610 static inline int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev) 611 { 612 return QDF_STATUS_SUCCESS; 613 } 614 615 static inline int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev) 616 { 617 return QDF_STATUS_SUCCESS; 618 } 619 620 static inline int dp_ipa_ring_resource_setup(struct dp_soc *soc, 621 struct dp_pdev *pdev) 622 { 623 return 0; 624 } 625 626 static inline QDF_STATUS dp_ipa_handle_rx_buf_smmu_mapping(struct dp_soc *soc, 627 qdf_nbuf_t nbuf, 628 uint32_t size, 629 bool create, 630 const char *func, 631 uint32_t line) 632 { 633 return QDF_STATUS_SUCCESS; 634 } 635 636 static inline void 637 dp_ipa_rx_buf_smmu_mapping_lock(struct dp_soc *soc) 638 { 639 } 640 641 static inline void 642 dp_ipa_rx_buf_smmu_mapping_unlock(struct dp_soc *soc) 643 { 644 } 645 646 static inline void 647 dp_ipa_reo_ctx_buf_mapping_lock(struct dp_soc *soc, 648 uint32_t reo_ring_num) 649 { 650 } 651 652 static inline void 653 dp_ipa_reo_ctx_buf_mapping_unlock(struct dp_soc *soc, 654 uint32_t reo_ring_num) 655 { 656 } 657 658 static inline qdf_nbuf_t dp_ipa_handle_rx_reo_reinject(struct dp_soc *soc, 659 qdf_nbuf_t nbuf) 660 { 661 return nbuf; 662 } 663 664 static inline QDF_STATUS dp_ipa_tx_buf_smmu_mapping(struct cdp_soc_t *soc_hdl, 665 uint8_t pdev_id, 666 const char *func, 667 uint32_t line) 668 { 669 return QDF_STATUS_SUCCESS; 670 } 671 672 static inline QDF_STATUS dp_ipa_tx_buf_smmu_unmapping(struct cdp_soc_t *soc_hdl, 673 uint8_t pdev_id, 674 const char *func, 675 uint32_t line) 676 { 677 return QDF_STATUS_SUCCESS; 678 } 679 680 #ifdef IPA_WDS_EASYMESH_FEATURE 681 static inline QDF_STATUS dp_ipa_ast_create(struct cdp_soc_t *soc_hdl, 682 qdf_ipa_ast_info_type_t *data) 683 { 684 return QDF_STATUS_SUCCESS; 685 } 686 #endif 687 static inline void dp_ipa_get_wdi_version(struct cdp_soc_t *soc_hdl, 688 uint8_t *wdi_ver) 689 { 690 } 691 #endif 692 #endif /* _DP_IPA_H_ */ 693