xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_ipa.h (revision bea437e2293c3d4fb1b5704fcf633aedac996962)
1 /*
2  * Copyright (c) 2016-2019 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 /**
20  * @file cdp_txrx_ipa.h
21  * @brief Define the host data path IP Acceleraor API functions
22  */
23 #ifndef _CDP_TXRX_IPA_H_
24 #define _CDP_TXRX_IPA_H_
25 
26 #ifdef IPA_OFFLOAD
27 #ifdef CONFIG_IPA_WDI_UNIFIED_API
28 #include <qdf_ipa_wdi3.h>
29 #else
30 #include <qdf_ipa.h>
31 #endif
32 #include <cdp_txrx_cmn.h>
33 #include "cdp_txrx_handle.h"
34 
35 /**
36  * cdp_ipa_get_resource() - Get allocated WLAN resources for IPA data path
37  * @soc - data path soc handle
38  * @pdev_id - device instance id
39  *
40  * Get allocated WLAN resources for IPA data path
41  *
42  * return QDF_STATUS_SUCCESS
43  */
44 static inline QDF_STATUS
45 cdp_ipa_get_resource(ol_txrx_soc_handle soc, uint8_t pdev_id)
46 {
47 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
48 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
49 			"%s invalid instance", __func__);
50 		return QDF_STATUS_E_FAILURE;
51 	}
52 
53 	if (soc->ops->ipa_ops->ipa_get_resource)
54 		return soc->ops->ipa_ops->ipa_get_resource(soc, pdev_id);
55 
56 	return QDF_STATUS_SUCCESS;
57 }
58 
59 /**
60  * cdp_ipa_set_doorbell_paddr() - give IPA db paddr to FW
61  * @soc - data path soc handle
62  * @pdev_id - device instance id
63  *
64  * give IPA db paddr to FW
65  *
66  * return QDF_STATUS_SUCCESS
67  */
68 static inline QDF_STATUS
69 cdp_ipa_set_doorbell_paddr(ol_txrx_soc_handle soc, uint8_t pdev_id)
70 {
71 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
72 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
73 			"%s invalid instance", __func__);
74 		return QDF_STATUS_E_FAILURE;
75 	}
76 
77 	if (soc->ops->ipa_ops->ipa_set_doorbell_paddr)
78 		return soc->ops->ipa_ops->ipa_set_doorbell_paddr(soc, pdev_id);
79 
80 	return QDF_STATUS_SUCCESS;
81 }
82 
83 /**
84  * cdp_ipa_set_active() - activate/de-ctivate IPA offload path
85  * @soc - data path soc handle
86  * @pdev_id - device instance id
87  * @uc_active - activate or de-activate
88  * @is_tx - toggle tx or rx data path
89  *
90  * activate/de-ctivate IPA offload path
91  *
92  * return QDF_STATUS_SUCCESS
93  */
94 static inline QDF_STATUS
95 cdp_ipa_set_active(ol_txrx_soc_handle soc, uint8_t pdev_id, bool uc_active,
96 		   bool is_tx)
97 {
98 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
99 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
100 			"%s invalid instance", __func__);
101 		return QDF_STATUS_E_FAILURE;
102 	}
103 
104 	if (soc->ops->ipa_ops->ipa_set_active)
105 		return soc->ops->ipa_ops->ipa_set_active(soc, pdev_id,
106 				uc_active, is_tx);
107 
108 	return QDF_STATUS_SUCCESS;
109 }
110 
111 /**
112  * cdp_ipa_op_response() - event handler from FW
113  * @soc - data path soc handle
114  * @pdev_id - device instance id
115  * @op_msg - event contents from firmware
116  *
117  * event handler from FW
118  *
119  * return QDF_STATUS_SUCCESS
120  */
121 static inline QDF_STATUS
122 cdp_ipa_op_response(ol_txrx_soc_handle soc, uint8_t pdev_id, uint8_t *op_msg)
123 {
124 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
125 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
126 			"%s invalid instance", __func__);
127 		return QDF_STATUS_E_FAILURE;
128 	}
129 
130 	if (soc->ops->ipa_ops->ipa_op_response)
131 		return soc->ops->ipa_ops->ipa_op_response(soc, pdev_id, op_msg);
132 
133 	return QDF_STATUS_SUCCESS;
134 }
135 
136 /**
137  * cdp_ipa_register_op_cb() - register event handler function pointer
138  * @soc - data path soc handle
139  * @pdev_id - device instance id
140  * @op_cb - event handler callback function pointer
141  * @usr_ctxt - user context to registered
142  *
143  * register event handler function pointer
144  *
145  * return QDF_STATUS_SUCCESS
146  */
147 static inline QDF_STATUS
148 cdp_ipa_register_op_cb(ol_txrx_soc_handle soc, uint8_t pdev_id,
149 		       ipa_uc_op_cb_type op_cb, void *usr_ctxt)
150 {
151 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
152 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
153 			"%s invalid instance", __func__);
154 		return QDF_STATUS_E_FAILURE;
155 	}
156 
157 	if (soc->ops->ipa_ops->ipa_register_op_cb)
158 		return soc->ops->ipa_ops->ipa_register_op_cb(soc, pdev_id,
159 							     op_cb, usr_ctxt);
160 
161 	return QDF_STATUS_SUCCESS;
162 }
163 
164 /**
165  * cdp_ipa_get_stat() - get IPA data path stats from FW
166  * @soc - data path soc handle
167  * @pdev_id - device instance id
168  *
169  * get IPA data path stats from FW async
170  *
171  * return QDF_STATUS_SUCCESS
172  */
173 static inline QDF_STATUS
174 cdp_ipa_get_stat(ol_txrx_soc_handle soc, uint8_t pdev_id)
175 {
176 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
177 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
178 			"%s invalid instance", __func__);
179 		return QDF_STATUS_E_FAILURE;
180 	}
181 
182 	if (soc->ops->ipa_ops->ipa_get_stat)
183 		return soc->ops->ipa_ops->ipa_get_stat(soc, pdev_id);
184 
185 	return QDF_STATUS_SUCCESS;
186 }
187 
188 /**
189  * cdp_tx_send_ipa_data_frame() - send IPA data frame
190  * @soc - data path soc handle
191  * @vdev_id: vdev id
192  * @skb: skb
193  *
194  * Return: skb/ NULL is for success
195  */
196 static inline qdf_nbuf_t cdp_ipa_tx_send_data_frame(ol_txrx_soc_handle soc,
197 						    uint8_t vdev_id,
198 						    qdf_nbuf_t skb)
199 {
200 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
201 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
202 			"%s invalid instance", __func__);
203 		return skb;
204 	}
205 
206 	if (soc->ops->ipa_ops->ipa_tx_data_frame)
207 		return soc->ops->ipa_ops->ipa_tx_data_frame(soc, vdev_id, skb);
208 
209 	return skb;
210 }
211 
212 /**
213  * cdp_ipa_set_uc_tx_partition_base() - set tx packet partition base
214  * @soc - data path soc handle
215  * @cfg_pdev: physical device instance config
216  * @value: partition base value
217  *
218  * Return: QDF_STATUS
219  */
220 static inline QDF_STATUS
221 cdp_ipa_set_uc_tx_partition_base(ol_txrx_soc_handle soc,
222 				struct cdp_cfg *cfg_pdev, uint32_t value)
223 {
224 	if (!soc || !soc->ops || !soc->ops->ipa_ops || !cfg_pdev) {
225 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
226 			"%s invalid instance", __func__);
227 		return QDF_STATUS_E_FAILURE;
228 	}
229 
230 	if (soc->ops->ipa_ops->ipa_set_uc_tx_partition_base)
231 		soc->ops->ipa_ops->ipa_set_uc_tx_partition_base(cfg_pdev,
232 								value);
233 
234 	return QDF_STATUS_SUCCESS;
235 }
236 
237 #ifdef FEATURE_METERING
238 /**
239  * cdp_ipa_uc_get_share_stats() - get Tx/Rx byte stats from FW
240  * @soc - data path soc handle
241  * @pdev_id: physical device instance number
242  * @value: reset stats
243  *
244  * Return: QDF_STATUS
245  */
246 static inline QDF_STATUS
247 cdp_ipa_uc_get_share_stats(ol_txrx_soc_handle soc, uint8_t pdev_id,
248 			   uint8_t value)
249 {
250 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
251 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
252 			"%s invalid instance", __func__);
253 		return QDF_STATUS_E_FAILURE;
254 	}
255 
256 	if (soc->ops->ipa_ops->ipa_uc_get_share_stats)
257 		return soc->ops->ipa_ops->ipa_uc_get_share_stats(soc, pdev_id,
258 								 value);
259 
260 	return QDF_STATUS_SUCCESS;
261 }
262 
263 /**
264  * cdp_ipa_uc_set_quota() - set quota limit to FW
265  * @soc - data path soc handle
266  * @pdev_id: physical device instance number
267  * @value: quota limit bytes
268  *
269  * Return: QDF_STATUS
270  */
271 static inline QDF_STATUS
272 cdp_ipa_uc_set_quota(ol_txrx_soc_handle soc, uint8_t pdev_id, uint64_t value)
273 {
274 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
275 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
276 			"%s invalid instance", __func__);
277 		return QDF_STATUS_E_FAILURE;
278 	}
279 
280 	if (soc->ops->ipa_ops->ipa_uc_set_quota)
281 		return soc->ops->ipa_ops->ipa_uc_set_quota(soc, pdev_id, value);
282 
283 	return QDF_STATUS_SUCCESS;
284 }
285 #endif
286 
287 /**
288  * cdp_ipa_enable_autonomy() - Enable autonomy RX data path
289  * @soc: data path soc handle
290  * @pdev_id: physical device instance number
291  *
292  * IPA Data path is enabled and resumed.
293  * All autonomy data path elements are ready to deliver packet
294  * All RX packet should routed to IPA_REO ring, then IPA can receive packet
295  * from WLAN
296  *
297  * Return: QDF_STATUS
298  */
299 static inline QDF_STATUS
300 cdp_ipa_enable_autonomy(ol_txrx_soc_handle soc, uint8_t pdev_id)
301 {
302 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
303 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
304 			"%s invalid instance", __func__);
305 		return QDF_STATUS_E_FAILURE;
306 	}
307 
308 	if (soc->ops->ipa_ops->ipa_enable_autonomy)
309 		return soc->ops->ipa_ops->ipa_enable_autonomy(soc, pdev_id);
310 
311 	return QDF_STATUS_SUCCESS;
312 }
313 
314 /**
315  * cdp_ipa_disable_autonomy() - Disable autonomy RX data path
316  * @soc: data path soc handle
317  * @pdev_id: physical device instance number
318  *
319  * IPA Data path is enabled and resumed.
320  * All autonomy datapath elements are ready to deliver packet
321  * All RX packet should routed to IPA_REO ring, then IPA can receive packet
322  * from WLAN
323  *
324  * Return: QDF_STATUS
325  */
326 static inline QDF_STATUS
327 cdp_ipa_disable_autonomy(ol_txrx_soc_handle soc, uint8_t pdev_id)
328 {
329 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
330 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
331 			"%s invalid instance", __func__);
332 		return QDF_STATUS_E_FAILURE;
333 	}
334 	if (soc->ops->ipa_ops->ipa_disable_autonomy)
335 		return soc->ops->ipa_ops->ipa_disable_autonomy(soc, pdev_id);
336 
337 	return QDF_STATUS_SUCCESS;
338 }
339 
340 #ifdef CONFIG_IPA_WDI_UNIFIED_API
341 /**
342  * cdp_ipa_setup() - Setup and connect IPA pipes
343  * @soc: data path soc handle
344  * @pdev_id: handle to the device instance number
345  * @ipa_i2w_cb: IPA to WLAN callback
346  * @ipa_w2i_cb: WLAN to IPA callback
347  * @ipa_wdi_meter_notifier_cb: IPA WDI metering callback
348  * @ipa_desc_size: IPA descriptor size
349  * @ipa_priv: handle to the HTT instance
350  * @is_rm_enabled: Is IPA RM enabled or not
351  * @tx_pipe_handle: pointer to Tx pipe handle
352  * @rx_pipe_handle: pointer to Rx pipe handle
353  * @is_smmu_enabled: Is SMMU enabled or not
354  * @sys_in: parameters to setup sys pipe in mcc mode
355  * @over_gsi: Is IPA using GSI
356  *
357  * Return: QDF_STATUS
358  */
359 static inline QDF_STATUS
360 cdp_ipa_setup(ol_txrx_soc_handle soc, uint8_t pdev_id, void *ipa_i2w_cb,
361 	      void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
362 	      uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled,
363 	      uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle,
364 	      bool is_smmu_enabled, qdf_ipa_sys_connect_params_t *sys_in,
365 	      bool over_gsi)
366 {
367 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
368 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
369 			"%s invalid instance", __func__);
370 		return QDF_STATUS_E_FAILURE;
371 	}
372 
373 	if (soc->ops->ipa_ops->ipa_setup)
374 		return soc->ops->ipa_ops->ipa_setup(soc, pdev_id, ipa_i2w_cb,
375 						    ipa_w2i_cb,
376 						    ipa_wdi_meter_notifier_cb,
377 						    ipa_desc_size, ipa_priv,
378 						    is_rm_enabled,
379 						    tx_pipe_handle,
380 						    rx_pipe_handle,
381 						    is_smmu_enabled,
382 						    sys_in, over_gsi);
383 
384 	return QDF_STATUS_SUCCESS;
385 }
386 #else /* CONFIG_IPA_WDI_UNIFIED_API */
387 /**
388  * cdp_ipa_setup() - Setup and connect IPA pipes
389  * @soc: data path soc handle
390  * @pdev_id: handle to the device instance number
391  * @ipa_i2w_cb: IPA to WLAN callback
392  * @ipa_w2i_cb: WLAN to IPA callback
393  * @ipa_wdi_meter_notifier_cb: IPA WDI metering callback
394  * @ipa_desc_size: IPA descriptor size
395  * @ipa_priv: handle to the HTT instance
396  * @is_rm_enabled: Is IPA RM enabled or not
397  * @tx_pipe_handle: pointer to Tx pipe handle
398  * @rx_pipe_handle: pointer to Rx pipe handle
399  *
400  * Return: QDF_STATUS
401  */
402 static inline QDF_STATUS
403 cdp_ipa_setup(ol_txrx_soc_handle soc, uint8_t pdev_id, void *ipa_i2w_cb,
404 	      void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
405 	      uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled,
406 	      uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle)
407 {
408 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
409 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
410 			"%s invalid instance", __func__);
411 		return QDF_STATUS_E_FAILURE;
412 	}
413 
414 	if (soc->ops->ipa_ops->ipa_setup)
415 		return soc->ops->ipa_ops->ipa_setup(soc, pdev_id, ipa_i2w_cb,
416 						    ipa_w2i_cb,
417 						    ipa_wdi_meter_notifier_cb,
418 						    ipa_desc_size, ipa_priv,
419 						    is_rm_enabled,
420 						    tx_pipe_handle,
421 						    rx_pipe_handle);
422 
423 	return QDF_STATUS_SUCCESS;
424 }
425 #endif /* CONFIG_IPA_WDI_UNIFIED_API */
426 
427 /**
428  * cdp_ipa_cleanup() - Disconnect IPA pipes
429  * @soc: data path soc handle
430  * @tx_pipe_handle: Tx pipe handle
431  * @rx_pipe_handle: Rx pipe handle
432  *
433  * Return: QDF_STATUS
434  */
435 static inline QDF_STATUS
436 cdp_ipa_cleanup(ol_txrx_soc_handle soc, uint32_t tx_pipe_handle,
437 		uint32_t rx_pipe_handle)
438 {
439 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
440 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
441 			"%s invalid instance", __func__);
442 		return QDF_STATUS_E_FAILURE;
443 	}
444 
445 	if (soc->ops->ipa_ops->ipa_cleanup)
446 		return soc->ops->ipa_ops->ipa_cleanup(tx_pipe_handle,
447 						      rx_pipe_handle);
448 
449 	return QDF_STATUS_SUCCESS;
450 }
451 
452 /**
453  * cdp_ipa_setup_iface() - Setup IPA header and register interface
454  * @soc: data path soc handle
455  * @ifname: Interface name
456  * @mac_addr: Interface MAC address
457  * @prod_client: IPA prod client type
458  * @cons_client: IPA cons client type
459  * @session_id: Session ID
460  * @is_ipv6_enabled: Is IPV6 enabled or not
461  *
462  * Return: QDF_STATUS
463  */
464 static inline QDF_STATUS
465 cdp_ipa_setup_iface(ol_txrx_soc_handle soc, char *ifname, uint8_t *mac_addr,
466 		    qdf_ipa_client_type_t prod_client,
467 		    qdf_ipa_client_type_t cons_client,
468 		    uint8_t session_id, bool is_ipv6_enabled)
469 {
470 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
471 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
472 			"%s invalid instance", __func__);
473 		return QDF_STATUS_E_FAILURE;
474 	}
475 
476 	if (soc->ops->ipa_ops->ipa_setup_iface)
477 		return soc->ops->ipa_ops->ipa_setup_iface(ifname, mac_addr,
478 							  prod_client,
479 							  cons_client,
480 							  session_id,
481 							  is_ipv6_enabled);
482 
483 	return QDF_STATUS_SUCCESS;
484 }
485 
486 /**
487  * cdp_ipa_cleanup_iface() - Cleanup IPA header and deregister interface
488  * @soc: data path soc handle
489  * @ifname: Interface name
490  * @is_ipv6_enabled: Is IPV6 enabled or not
491  *
492  * Return: QDF_STATUS
493  */
494 static inline QDF_STATUS
495 cdp_ipa_cleanup_iface(ol_txrx_soc_handle soc, char *ifname,
496 		      bool is_ipv6_enabled)
497 {
498 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
499 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
500 			"%s invalid instance", __func__);
501 		return QDF_STATUS_E_FAILURE;
502 	}
503 
504 	if (soc->ops->ipa_ops->ipa_cleanup_iface)
505 		return soc->ops->ipa_ops->ipa_cleanup_iface(ifname,
506 							    is_ipv6_enabled);
507 
508 	return QDF_STATUS_SUCCESS;
509 }
510 
511  /**
512  * cdp_ipa_uc_enable_pipes() - Enable and resume traffic on Tx/Rx pipes
513  * @soc - data path soc handle
514  * @pdev_id - device instance id
515  *
516  * Return: QDF_STATUS
517  */
518 static inline QDF_STATUS
519 cdp_ipa_enable_pipes(ol_txrx_soc_handle soc, uint8_t pdev_id)
520 {
521 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
522 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
523 			"%s invalid instance", __func__);
524 		return QDF_STATUS_E_FAILURE;
525 	}
526 
527 	if (soc->ops->ipa_ops->ipa_enable_pipes)
528 		return soc->ops->ipa_ops->ipa_enable_pipes(soc, pdev_id);
529 
530 	return QDF_STATUS_SUCCESS;
531 }
532 
533 /**
534  * cdp_ipa_uc_disable_pipes() - Suspend traffic and disable Tx/Rx pipes
535  * @soc: data path soc handle
536  * @pdev_id - device instance id
537  *
538  * Return: QDF_STATUS
539  */
540 static inline QDF_STATUS
541 cdp_ipa_disable_pipes(ol_txrx_soc_handle soc, uint8_t pdev_id)
542 {
543 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
544 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
545 			"%s invalid instance", __func__);
546 		return QDF_STATUS_E_FAILURE;
547 	}
548 
549 	if (soc->ops->ipa_ops->ipa_disable_pipes)
550 		return soc->ops->ipa_ops->ipa_disable_pipes(soc, pdev_id);
551 
552 	return QDF_STATUS_SUCCESS;
553 }
554 
555 /**
556  * cdp_ipa_set_perf_level() - Set IPA clock bandwidth based on data rates
557  * @soc: data path soc handle
558  * @client: WLAN Client ID
559  * @max_supported_bw_mbps: Maximum bandwidth needed (in Mbps)
560  *
561  * Return: 0 on success, negative errno on error
562  */
563 static inline QDF_STATUS
564 cdp_ipa_set_perf_level(ol_txrx_soc_handle soc, int client,
565 		       uint32_t max_supported_bw_mbps)
566 {
567 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
568 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
569 			"%s invalid instance", __func__);
570 		return QDF_STATUS_E_FAILURE;
571 	}
572 
573 	if (soc->ops->ipa_ops->ipa_set_perf_level)
574 		return soc->ops->ipa_ops->ipa_set_perf_level(client,
575 				max_supported_bw_mbps);
576 
577 	return QDF_STATUS_SUCCESS;
578 }
579 
580 /**
581  * cdp_ipa_rx_intrabss_fwd() - Perform intra-bss fwd for IPA RX path
582  *
583  * @soc: data path soc handle
584  * @vdev_id: vdev id
585  * @nbuf: pointer to skb of ethernet packet received from IPA RX path
586  * @fwd_success: pointer to indicate if skb succeeded in intra-bss TX
587  *
588  * This function performs intra-bss forwarding for WDI 3.0 IPA RX path.
589  *
590  * Return: true if packet is intra-bss fwd-ed and no need to pass to
591  *	   network stack. false if packet needs to be passed to network stack.
592  */
593 static inline bool
594 cdp_ipa_rx_intrabss_fwd(ol_txrx_soc_handle soc, uint8_t vdev_id,
595 			qdf_nbuf_t nbuf, bool *fwd_success)
596 {
597 	if (!soc || !soc->ops || !soc->ops->ipa_ops || !fwd_success) {
598 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
599 			  "%s invalid instance", __func__);
600 		return QDF_STATUS_E_FAILURE;
601 	}
602 
603 	if (soc->ops->ipa_ops->ipa_rx_intrabss_fwd)
604 		return soc->ops->ipa_ops->ipa_rx_intrabss_fwd(soc, vdev_id,
605 							      nbuf,
606 							      fwd_success);
607 
608 	/* Fall back to pass up to stack */
609 	return false;
610 }
611 
612 #endif /* IPA_OFFLOAD */
613 
614 #endif /* _CDP_TXRX_IPA_H_ */
615 
616