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