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