xref: /wlan-dirver/qca-wifi-host-cmn/qdf/inc/qdf_ipa.h (revision 8cfe6b10058a04cafb17eed051f2ddf11bee8931)
1 /*
2  * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 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 _QDF_IPA_H
19 #define _QDF_IPA_H
20 
21 #ifdef IPA_OFFLOAD
22 
23 #include <i_qdf_ipa.h>
24 
25 /**
26  * enum qdf_ipa_wlan_event - QDF IPA events
27  * @QDF_IPA_CLIENT_CONNECT: Client Connects
28  * @QDF_IPA_CLIENT_DISCONNECT: Client Disconnects
29  * @QDF_IPA_AP_CONNECT: SoftAP is started
30  * @QDF_IPA_AP_DISCONNECT: SoftAP is stopped
31  * @QDF_IPA_STA_CONNECT: STA associates to AP
32  * @QDF_IPA_STA_DISCONNECT: STA dissociates from AP
33  * @QDF_IPA_CLIENT_CONNECT_EX: Peer associates/re-associates to softap
34  * @QDF_SWITCH_TO_SCC: WLAN interfaces in scc mode
35  * @QDF_SWITCH_TO_MCC: WLAN interfaces in mcc mode
36  * @QDF_WDI_ENABLE: WDI enable complete
37  * @QDF_WDI_DISABLE: WDI teardown
38  * @QDF_FWR_SSR_BEFORE_SHUTDOWN: WLAN FW recovery
39  * @QDF_IPA_WLAN_EVENT_MAX: Max value for the enum
40  */
41 typedef enum {
42 	QDF_IPA_CLIENT_CONNECT,
43 	QDF_IPA_CLIENT_DISCONNECT,
44 	QDF_IPA_AP_CONNECT,
45 	QDF_IPA_AP_DISCONNECT,
46 	QDF_IPA_STA_CONNECT,
47 	QDF_IPA_STA_DISCONNECT,
48 	QDF_IPA_CLIENT_CONNECT_EX,
49 	QDF_SWITCH_TO_SCC,
50 	QDF_SWITCH_TO_MCC,
51 	QDF_WDI_ENABLE,
52 	QDF_WDI_DISABLE,
53 	QDF_FWR_SSR_BEFORE_SHUTDOWN,
54 	QDF_IPA_WLAN_EVENT_MAX
55 } qdf_ipa_wlan_event;
56 
57 /**
58  * qdf_ipa_wdi_meter_evt_type_t - type of event client callback is
59  * for AP+STA mode metering
60  * @IPA_GET_WDI_SAP_STATS: get IPA_stats between SAP and STA -
61  *			use ipa_get_wdi_sap_stats structure
62  * @IPA_SET_WIFI_QUOTA: set quota limit on STA -
63  *			use ipa_set_wifi_quota structure
64  */
65 typedef __qdf_ipa_wdi_meter_evt_type_t qdf_ipa_wdi_meter_evt_type_t;
66 
67 typedef __qdf_ipa_get_wdi_sap_stats_t qdf_ipa_get_wdi_sap_stats_t;
68 
69 /**
70  * qdf_ipa_set_wifi_quota_t - structure used for
71  *                                   IPA_SET_WIFI_QUOTA.
72  */
73 typedef __qdf_ipa_set_wifi_quota_t qdf_ipa_set_wifi_quota_t;
74 
75 /**
76  * qdf_ipa_connect_params_t - low-level client connect input parameters. Either
77  * client allocates the data and desc FIFO and specifies that in data+desc OR
78  * specifies sizes and pipe_mem pref and IPA does the allocation.
79  */
80 typedef __qdf_ipa_connect_params_t qdf_ipa_connect_params_t;
81 
82 /**
83  * qdf_ipa_tx_meta_t - meta-data for the TX packet
84  */
85 typedef __qdf_ipa_tx_meta_t qdf_ipa_tx_meta_t;
86 
87 /**
88  *  __qdf_ipa_sps_params_t - SPS related output parameters resulting from
89  */
90 typedef __qdf_ipa_sps_params_t qdf_ipa_sps_params_t;
91 
92 /**
93  * qdf_ipa_tx_intf_t - interface tx properties
94  */
95 typedef __qdf_ipa_tx_intf_t qdf_ipa_tx_intf_t;
96 
97 /**
98  * qdf_ipa_rx_intf_t - interface rx properties
99  */
100 typedef __qdf_ipa_rx_intf_t qdf_ipa_rx_intf_t;
101 
102 /**
103  * qdf_ipa_ext_intf_t - interface ext properties
104  */
105 typedef __qdf_ipa_ext_intf_t qdf_ipa_ext_intf_t;
106 
107 /**
108  * qdf_ipa_sys_connect_params_t - information needed to setup an IPA end-point
109  * in system-BAM mode
110  */
111 typedef __qdf_ipa_sys_connect_params_t qdf_ipa_sys_connect_params_t;
112 
113 /**
114  * __qdf_pa_rm_event_t - IPA RM events
115  *
116  * Indicate the resource state change
117  */
118 typedef __qdf_ipa_rm_event_t qdf_ipa_rm_event_t;
119 
120 /**
121  * struct qdf_ipa_rm_register_params_t - information needed to
122  *      register IPA RM client with IPA RM
123  */
124 typedef __qdf_ipa_rm_register_params_t qdf_ipa_rm_register_params_t;
125 
126 /**
127  * struct qdf_ipa_rm_create_params_t - information needed to initialize
128  *				the resource
129  *
130  * IPA RM client is expected to perform non blocking operations only
131  * in request_resource and release_resource functions and
132  * release notification context as soon as possible.
133  */
134 typedef __qdf_ipa_rm_create_params_t qdf_ipa_rm_create_params_t;
135 
136 /**
137  * qdf_ipa_rm_perf_profile_t - information regarding IPA RM client performance
138  * profile
139  */
140 typedef __qdf_ipa_rm_perf_profile_t qdf_ipa_rm_perf_profile_t;
141 
142 /**
143  * qdf_ipa_tx_data_desc_t - information needed
144  * to send data packet to HW link: link to data descriptors
145  * priv: client specific private data
146  */
147 typedef __qdf_ipa_tx_data_desc_t qdf_ipa_tx_data_desc_t;
148 
149 /**
150  * qdf_ipa_rx_data_t - information needed
151  * to send to wlan driver on receiving data from ipa hw
152  */
153 typedef __qdf_ipa_rx_data_t qdf_ipa_rx_data_t;
154 
155 /**
156  * qdf_ipa_wdi_ul_params_t - WDI_RX configuration
157  */
158 typedef __qdf_ipa_wdi_ul_params_t qdf_ipa_wdi_ul_params_t;
159 
160 /**
161  * qdf_ipa_wdi_ul_params_smmu_t - WDI_RX configuration (with WLAN SMMU)
162  */
163 typedef __qdf_ipa_wdi_ul_params_smmu_t qdf_ipa_wdi_ul_params_smmu_t;
164 
165 /**
166  * qdf_ipa_wdi_dl_params_t - WDI_TX configuration
167  */
168 typedef __qdf_ipa_wdi_dl_params_t qdf_ipa_wdi_dl_params_t;
169 
170 /**
171  * qdf_ipa_wdi_dl_params_smmu_t - WDI_TX configuration (with WLAN SMMU)
172  */
173 typedef __qdf_ipa_wdi_dl_params_smmu_t qdf_ipa_wdi_dl_params_smmu_t;
174 
175 /**
176  * qdf_ipa_wdi_in_params_t - information provided by WDI client
177  */
178 typedef __qdf_ipa_wdi_in_params_t qdf_ipa_wdi_in_params_t;
179 
180 /**
181  * qdf_ipa_wdi_out_params_t - information provided to WDI client
182  */
183 typedef __qdf_ipa_wdi_out_params_t qdf_ipa_wdi_out_params_t;
184 
185 /**
186  * qdf_ipa_wdi_db_params_t - information provided to retrieve
187  *       physical address of uC doorbell
188  */
189 typedef __qdf_ipa_wdi_db_params_t qdf_ipa_wdi_db_params_t;
190 
191 /**
192  * qdf_ipa_wdi_uc_ready_params_t - uC ready CB parameters
193  */
194 typedef void (*qdf_ipa_uc_ready_cb)(void *priv);
195 typedef __qdf_ipa_wdi_uc_ready_params_t qdf_ipa_wdi_uc_ready_params_t;
196 
197 /**
198  * qdf_ipa_wdi_buffer_info_t - address info of a WLAN allocated buffer
199  *
200  * IPA driver will create/release IOMMU mapping in IPA SMMU from iova->pa
201  */
202 typedef __qdf_ipa_wdi_buffer_info_t qdf_ipa_wdi_buffer_info_t;
203 
204 /**
205  * qdf_ipa_gsi_ep_config_t - IPA GSI endpoint configurations
206  */
207 typedef __qdf_ipa_gsi_ep_config_t qdf_ipa_gsi_ep_config_t;
208 
209 /**
210  * qdf_ipa_dp_evt_type_t - type of event client callback is
211  * invoked for on data path
212  * @IPA_RECEIVE: data is struct sk_buff
213  * @IPA_WRITE_DONE: data is struct sk_buff
214  */
215 typedef __qdf_ipa_dp_evt_type_t qdf_ipa_dp_evt_type_t;
216 
217 #ifdef WDI3_STATS_UPDATE
218 /**
219  * qdf_ipa_wdi_tx_info_t - WLAN embedded TX bytes information
220  *
221  * WLAN host fills this structure to update IPA driver about
222  * embedded TX information.
223  */
224 typedef __qdf_ipa_wdi_tx_info_t qdf_ipa_wdi_tx_info_t;
225 
226 /**
227  * qdf_ipa_wdi_bw_info_t - BW threshold levels to be monitored
228  * by IPA uC
229  */
230 typedef __qdf_ipa_wdi_bw_info_t qdf_ipa_wdi_bw_info_t;
231 
232 /**
233  * qdf_ipa_inform_wlan_bw_t - BW information given by IPA driver
234  * whenever uC detects threshold level reached
235  */
236 typedef __qdf_ipa_inform_wlan_bw_t qdf_ipa_inform_wlan_bw_t;
237 #endif
238 
239 typedef __qdf_ipa_hdr_add_t qdf_ipa_hdr_add_t;
240 typedef __qdf_ipa_hdr_del_t qdf_ipa_hdr_del_t;
241 typedef __qdf_ipa_ioc_add_hdr_t qdf_ipa_ioc_add_hdr_t;
242 typedef __qdf_ipa_ioc_del_hdr_t qdf_ipa_ioc_del_hdr_t;
243 typedef __qdf_ipa_ioc_get_hdr_t qdf_ipa_ioc_get_hdr_t;
244 typedef __qdf_ipa_ioc_copy_hdr_t qdf_ipa_ioc_copy_hdr_t;
245 typedef __qdf_ipa_ioc_add_hdr_proc_ctx_t qdf_ipa_ioc_add_hdr_proc_ctx_t;
246 typedef __qdf_ipa_ioc_del_hdr_proc_ctx_t qdf_ipa_ioc_del_hdr_proc_ctx_t;
247 typedef __qdf_ipa_msg_meta_t qdf_ipa_msg_meta_t;
248 typedef __qdf_ipa_client_type_t qdf_ipa_client_type_t;
249 typedef __qdf_ipa_hw_stats_wdi_info_data_t qdf_ipa_hw_stats_wdi_info_data_t;
250 typedef __qdf_ipa_rm_resource_name_t  qdf_ipa_rm_resource_name_t;
251 typedef __qdf_ipa_wlan_event_t qdf_ipa_wlan_event_t;
252 typedef __qdf_ipa_wlan_msg_t qdf_ipa_wlan_msg_t;
253 typedef __qdf_ipa_wlan_msg_ex_t qdf_ipa_wlan_msg_ex_t;
254 typedef __qdf_ipa_ioc_tx_intf_prop_t qdf_ipa_ioc_tx_intf_prop_t;
255 typedef __qdf_ipa_ioc_rx_intf_prop_t qdf_ipa_ioc_rx_intf_prop_t;
256 typedef __qdf_ipa_wlan_hdr_attrib_val_t qdf_ipa_wlan_hdr_attrib_val_t;
257 typedef int (*qdf_ipa_msg_pull_fn)(void *buff, u32 len, u32 type);
258 typedef void (*qdf_ipa_ready_cb)(void *user_data);
259 
260 #ifdef IPA_WDS_EASYMESH_FEATURE
261 /**
262  * __qdf_ipa_ast_info_type_t - AST entry create/update information
263  */
264 typedef __qdf_ipa_ast_info_type_t qdf_ipa_ast_info_type_t;
265 #endif
266 
267 #define QDF_IPA_SET_META_MSG_TYPE(meta, msg_type) \
268 	__QDF_IPA_SET_META_MSG_TYPE(meta, msg_type)
269 
270 #define QDF_IPA_RM_RESOURCE_GRANTED __QDF_IPA_RM_RESOURCE_GRANTED
271 #define QDF_IPA_RM_RESOURCE_RELEASED __QDF_IPA_RM_RESOURCE_RELEASED
272 
273 #define QDF_IPA_VOLTAGE_LEVEL __QDF_IPA_VOLTAGE_LEVEL
274 
275 #define QDF_IPA_RM_RESOURCE_WLAN_PROD __QDF_IPA_RM_RESOURCE_WLAN_PROD
276 #define QDF_IPA_RM_RESOURCE_WLAN_CONS __QDF_IPA_RM_RESOURCE_WLAN_CONS
277 #define QDF_IPA_RM_RESOURCE_APPS_CONS __QDF_IPA_RM_RESOURCE_APPS_CONS
278 
279 #define QDF_IPA_CLIENT_WLAN1_PROD __QDF_IPA_CLIENT_WLAN1_PROD
280 #define QDF_IPA_CLIENT_WLAN3_PROD __QDF_IPA_CLIENT_WLAN3_PROD
281 #define QDF_IPA_CLIENT_WLAN1_CONS __QDF_IPA_CLIENT_WLAN1_CONS
282 #define QDF_IPA_CLIENT_WLAN2_CONS __QDF_IPA_CLIENT_WLAN2_CONS
283 #define QDF_IPA_CLIENT_WLAN3_CONS __QDF_IPA_CLIENT_WLAN3_CONS
284 #define QDF_IPA_CLIENT_WLAN4_CONS __QDF_IPA_CLIENT_WLAN4_CONS
285 #define QDF_IPA_CLIENT_WLAN4_PROD __QDF_IPA_CLIENT_WLAN4_PROD
286 #ifdef FEATURE_IPA_PIPE_CHANGE_WDI1
287 #define QDF_IPA_CLIENT_WLAN_LEGACY_CONS   QDF_IPA_CLIENT_WLAN3_CONS
288 #define QDF_IPA_CLIENT_WLAN_LEGACY_PROD   QDF_IPA_CLIENT_WLAN3_PROD
289 #define QDF_IPA_CLIENT_MCC2_CONS          QDF_IPA_CLIENT_WLAN4_CONS
290 #else
291 #define QDF_IPA_CLIENT_WLAN_LEGACY_CONS   QDF_IPA_CLIENT_WLAN1_CONS
292 #define QDF_IPA_CLIENT_WLAN_LEGACY_PROD   QDF_IPA_CLIENT_WLAN1_PROD
293 #define QDF_IPA_CLIENT_MCC2_CONS          QDF_IPA_CLIENT_WLAN3_CONS
294 #endif
295 
296 #ifdef QCN7605_SUPPORT
297 #define QDF_IPA_CLIENT_WLAN_WDI2_CONS __QDF_IPA_CLIENT_WLAN_WDI2_CONS
298 #define QDF_IPA_CLIENT_WLAN_WDI2_PROD __QDF_IPA_CLIENT_WLAN_WDI2_PROD
299 #else
300 #define QDF_IPA_CLIENT_WLAN_WDI2_CONS QDF_IPA_CLIENT_WLAN1_CONS
301 #define QDF_IPA_CLIENT_WLAN_WDI2_PROD QDF_IPA_CLIENT_WLAN1_PROD
302 #endif
303 
304 /*
305  * Resume / Suspend
306  */
307 
308 #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
309 static inline int qdf_ipa_reset_endpoint(u32 clnt_hdl)
310 {
311 	return __qdf_ipa_reset_endpoint(clnt_hdl);
312 }
313 
314 /*
315  * Remove ep delay
316  */
317 static inline int qdf_ipa_clear_endpoint_delay(u32 clnt_hdl)
318 {
319 	return __qdf_ipa_clear_endpoint_delay(clnt_hdl);
320 }
321 
322 /*
323  * Header removal / addition
324  */
325 static inline int qdf_ipa_add_hdr(qdf_ipa_ioc_add_hdr_t *hdrs)
326 {
327 	return __qdf_ipa_add_hdr(hdrs);
328 }
329 
330 static inline int qdf_ipa_del_hdr(qdf_ipa_ioc_del_hdr_t *hdls)
331 {
332 	return __qdf_ipa_del_hdr(hdls);
333 }
334 
335 static inline int qdf_ipa_commit_hdr(void)
336 {
337 	return __qdf_ipa_commit_hdr();
338 }
339 
340 static inline int qdf_ipa_get_hdr(qdf_ipa_ioc_get_hdr_t *lookup)
341 {
342 	return __qdf_ipa_get_hdr(lookup);
343 }
344 
345 static inline int qdf_ipa_put_hdr(u32 hdr_hdl)
346 {
347 	return __qdf_ipa_put_hdr(hdr_hdl);
348 }
349 
350 static inline int qdf_ipa_copy_hdr(qdf_ipa_ioc_copy_hdr_t *copy)
351 {
352 	return __qdf_ipa_copy_hdr(copy);
353 }
354 
355 static inline int qdf_ipa_register_pull_msg(qdf_ipa_msg_meta_t *meta,
356 		qdf_ipa_msg_pull_fn callback)
357 {
358 	return __qdf_ipa_register_pull_msg(meta, callback);
359 }
360 
361 static inline int qdf_ipa_deregister_pull_msg(qdf_ipa_msg_meta_t *meta)
362 {
363 	return __qdf_ipa_deregister_pull_msg(meta);
364 }
365 
366 /*
367  * Interface
368  */
369 static inline int qdf_ipa_register_intf(const char *name,
370 				     const qdf_ipa_tx_intf_t *tx,
371 				     const qdf_ipa_rx_intf_t *rx)
372 {
373 	return __qdf_ipa_register_intf(name, tx, rx);
374 }
375 
376 static inline int qdf_ipa_register_intf_ext(const char *name,
377 		const qdf_ipa_tx_intf_t *tx,
378 		const qdf_ipa_rx_intf_t *rx,
379 		const qdf_ipa_ext_intf_t *ext)
380 {
381 	return __qdf_ipa_register_intf_ext(name, tx, rx, ext);
382 }
383 
384 static inline int qdf_ipa_deregister_intf(const char *name)
385 {
386 	return __qdf_ipa_deregister_intf(name);
387 }
388 
389 /*
390  * Data path
391  */
392 static inline int qdf_ipa_tx_dp(qdf_ipa_client_type_t dst, struct sk_buff *skb,
393 		qdf_ipa_tx_meta_t *metadata)
394 {
395 	return __qdf_ipa_tx_dp(dst, skb, metadata);
396 }
397 
398 /*
399  * To transfer multiple data packets
400  */
401 static inline int qdf_ipa_tx_dp_mul(
402 	qdf_ipa_client_type_t dst,
403 	qdf_ipa_tx_data_desc_t *data_desc)
404 {
405 	return __qdf_ipa_tx_dp_mul(dst, data_desc);
406 }
407 
408 /*
409  * System pipes
410  */
411 static inline u16 qdf_ipa_get_smem_restr_bytes(void)
412 {
413 	return __qdf_ipa_get_smem_restr_bytes();
414 }
415 
416 static inline int qdf_ipa_connect_wdi_pipe(qdf_ipa_wdi_in_params_t *in,
417 		qdf_ipa_wdi_out_params_t *out)
418 {
419 	return __qdf_ipa_connect_wdi_pipe(in, out);
420 }
421 
422 static inline int qdf_ipa_disconnect_wdi_pipe(u32 clnt_hdl)
423 {
424 	return __qdf_ipa_disconnect_wdi_pipe(clnt_hdl);
425 }
426 
427 static inline int qdf_ipa_enable_wdi_pipe(u32 clnt_hdl)
428 {
429 	return __qdf_ipa_enable_wdi_pipe(clnt_hdl);
430 }
431 
432 static inline int qdf_ipa_disable_wdi_pipe(u32 clnt_hdl)
433 {
434 	return __qdf_ipa_disable_wdi_pipe(clnt_hdl);
435 }
436 
437 static inline int qdf_ipa_resume_wdi_pipe(u32 clnt_hdl)
438 {
439 	return __qdf_ipa_resume_wdi_pipe(clnt_hdl);
440 }
441 
442 static inline int qdf_ipa_suspend_wdi_pipe(u32 clnt_hdl)
443 {
444 	return __qdf_ipa_suspend_wdi_pipe(clnt_hdl);
445 }
446 
447 static inline int qdf_ipa_uc_wdi_get_dbpa(
448 	qdf_ipa_wdi_db_params_t *out)
449 {
450 	return __qdf_ipa_uc_wdi_get_dbpa(out);
451 }
452 
453 
454 /*
455  * Resource manager
456  */
457 static inline int qdf_ipa_rm_create_resource(
458 		qdf_ipa_rm_create_params_t *create_params)
459 {
460 	return __qdf_ipa_rm_create_resource(create_params);
461 }
462 
463 static inline int qdf_ipa_rm_delete_resource(
464 		qdf_ipa_rm_resource_name_t resource_name)
465 {
466 	return __qdf_ipa_rm_delete_resource(resource_name);
467 }
468 
469 static inline int qdf_ipa_rm_register(qdf_ipa_rm_resource_name_t resource_name,
470 			qdf_ipa_rm_register_params_t *reg_params)
471 {
472 	return __qdf_ipa_rm_register(resource_name, reg_params);
473 }
474 
475 static inline int qdf_ipa_rm_set_perf_profile(
476 		qdf_ipa_rm_resource_name_t resource_name,
477 		qdf_ipa_rm_perf_profile_t *profile)
478 {
479 	return __qdf_ipa_rm_set_perf_profile(resource_name, profile);
480 }
481 
482 static inline int qdf_ipa_rm_deregister(qdf_ipa_rm_resource_name_t resource_name,
483 			qdf_ipa_rm_register_params_t *reg_params)
484 {
485 	return __qdf_ipa_rm_deregister(resource_name, reg_params);
486 }
487 
488 static inline int qdf_ipa_rm_add_dependency(
489 		qdf_ipa_rm_resource_name_t resource_name,
490 		qdf_ipa_rm_resource_name_t depends_on_name)
491 {
492 	return __qdf_ipa_rm_add_dependency(resource_name, depends_on_name);
493 }
494 
495 static inline int qdf_ipa_rm_add_dependency_sync(
496 		qdf_ipa_rm_resource_name_t resource_name,
497 		qdf_ipa_rm_resource_name_t depends_on_name)
498 {
499 	return __qdf_ipa_rm_add_dependency_sync(resource_name, depends_on_name);
500 }
501 
502 static inline int qdf_ipa_rm_delete_dependency(
503 		qdf_ipa_rm_resource_name_t resource_name,
504 		qdf_ipa_rm_resource_name_t depends_on_name)
505 {
506 	return __qdf_ipa_rm_delete_dependency(resource_name, depends_on_name);
507 }
508 
509 static inline int qdf_ipa_rm_request_resource(
510 		qdf_ipa_rm_resource_name_t resource_name)
511 {
512 	return __qdf_ipa_rm_request_resource(resource_name);
513 }
514 
515 static inline int qdf_ipa_rm_release_resource(
516 		qdf_ipa_rm_resource_name_t resource_name)
517 {
518 	return __qdf_ipa_rm_release_resource(resource_name);
519 }
520 
521 static inline int qdf_ipa_rm_notify_completion(qdf_ipa_rm_event_t event,
522 		qdf_ipa_rm_resource_name_t resource_name)
523 {
524 	return __qdf_ipa_rm_notify_completion(event, resource_name);
525 }
526 
527 static inline int qdf_ipa_rm_inactivity_timer_init(
528 		qdf_ipa_rm_resource_name_t resource_name,
529 			unsigned long msecs)
530 {
531 	return __qdf_ipa_rm_inactivity_timer_init(resource_name, msecs);
532 }
533 
534 static inline int qdf_ipa_rm_inactivity_timer_destroy(
535 		qdf_ipa_rm_resource_name_t resource_name)
536 {
537 	return __qdf_ipa_rm_inactivity_timer_destroy(resource_name);
538 }
539 
540 static inline int qdf_ipa_rm_inactivity_timer_request_resource(
541 				qdf_ipa_rm_resource_name_t resource_name)
542 {
543 	return __qdf_ipa_rm_inactivity_timer_request_resource(resource_name);
544 }
545 
546 static inline int qdf_ipa_rm_inactivity_timer_release_resource(
547 				qdf_ipa_rm_resource_name_t resource_name)
548 {
549 	return __qdf_ipa_rm_inactivity_timer_release_resource(resource_name);
550 }
551 
552 /*
553  * Miscellaneous
554  */
555 static inline void qdf_ipa_bam_reg_dump(void)
556 {
557 	return __qdf_ipa_bam_reg_dump();
558 }
559 
560 static inline int qdf_ipa_get_ep_mapping(qdf_ipa_client_type_t client)
561 {
562 	return __qdf_ipa_get_ep_mapping(client);
563 }
564 
565 static inline void qdf_ipa_proxy_clk_vote(void)
566 {
567 	return __qdf_ipa_proxy_clk_vote();
568 }
569 
570 static inline void qdf_ipa_proxy_clk_unvote(void)
571 {
572 	return __qdf_ipa_proxy_clk_unvote();
573 }
574 
575 static inline bool qdf_ipa_is_client_handle_valid(u32 clnt_hdl)
576 {
577 	return __qdf_ipa_is_client_handle_valid(clnt_hdl);
578 }
579 
580 static inline qdf_ipa_client_type_t qdf_ipa_get_client_mapping(int pipe_idx)
581 {
582 	return __qdf_ipa_get_client_mapping(pipe_idx);
583 }
584 
585 static inline qdf_ipa_rm_resource_name_t qdf_ipa_get_rm_resource_from_ep(
586 	int pipe_idx)
587 {
588 	return __qdf_ipa_get_rm_resource_from_ep(pipe_idx);
589 }
590 
591 static inline bool qdf_ipa_get_modem_cfg_emb_pipe_flt(void)
592 {
593 	return __qdf_ipa_get_modem_cfg_emb_pipe_flt();
594 }
595 
596 static inline int qdf_ipa_create_wdi_mapping(u32 num_buffers,
597 		__qdf_ipa_wdi_buffer_info_t *info)
598 {
599 	return __qdf_ipa_create_wdi_mapping(num_buffers, info);
600 }
601 
602 static inline int qdf_ipa_release_wdi_mapping(u32 num_buffers,
603 		qdf_ipa_wdi_buffer_info_t *info)
604 {
605 	return __qdf_ipa_release_wdi_mapping(num_buffers, info);
606 }
607 
608 static inline int qdf_ipa_disable_apps_wan_cons_deaggr(uint32_t agg_size,
609 		uint32_t agg_count)
610 {
611 	return __qdf_ipa_disable_apps_wan_cons_deaggr(agg_size, agg_count);
612 }
613 
614 static inline const qdf_ipa_gsi_ep_config_t *qdf_ipa_get_gsi_ep_info(qdf_ipa_client_type_t client)
615 {
616 	return __qdf_ipa_get_gsi_ep_info(client);
617 }
618 
619 static inline int qdf_ipa_stop_gsi_channel(u32 clnt_hdl)
620 {
621 	return __qdf_ipa_stop_gsi_channel(clnt_hdl);
622 }
623 
624 #endif
625 static inline void qdf_ipa_free_skb(qdf_ipa_rx_data_t *rx_in)
626 {
627 	return __qdf_ipa_free_skb(rx_in);
628 }
629 
630 static inline int qdf_ipa_uc_reg_rdyCB(
631 	qdf_ipa_wdi_uc_ready_params_t *param)
632 {
633 	return __qdf_ipa_uc_reg_rdyCB(param);
634 }
635 
636 static inline int qdf_ipa_uc_dereg_rdyCB(void)
637 {
638 	return __qdf_ipa_uc_dereg_rdyCB();
639 }
640 
641 static inline int qdf_ipa_get_wdi_stats(qdf_ipa_hw_stats_wdi_info_data_t *stats)
642 {
643 	return __qdf_ipa_get_wdi_stats(stats);
644 }
645 
646 static inline int qdf_ipa_register_ipa_ready_cb(
647 	void (*qdf_ipa_ready_cb)(void *user_data),
648 	void *user_data)
649 {
650 	return __qdf_ipa_register_ipa_ready_cb(qdf_ipa_ready_cb, user_data);
651 }
652 
653 static inline int qdf_ipa_setup_sys_pipe(qdf_ipa_sys_connect_params_t *sys_in,
654 					 u32 *clnt_hdl)
655 {
656 	return __qdf_ipa_setup_sys_pipe(sys_in, clnt_hdl);
657 }
658 
659 static inline int qdf_ipa_teardown_sys_pipe(u32 clnt_hdl)
660 {
661 	return __qdf_ipa_teardown_sys_pipe(clnt_hdl);
662 }
663 
664 /*
665  * Messaging
666  */
667 static inline int qdf_ipa_send_msg(qdf_ipa_msg_meta_t *meta, void *buff,
668 				   ipa_msg_free_fn callback)
669 {
670 	return __qdf_ipa_send_msg(meta, buff, callback);
671 }
672 
673 static inline bool qdf_ipa_is_ready(void)
674 {
675 	return __qdf_ipa_is_ready();
676 }
677 
678 #ifdef FEATURE_METERING
679 static inline int qdf_ipa_broadcast_wdi_quota_reach_ind(uint32_t index,
680 							uint64_t quota_bytes)
681 {
682 	return __qdf_ipa_broadcast_wdi_quota_reach_ind(index, quota_bytes);
683 }
684 #endif
685 
686 #ifdef ENABLE_SMMU_S1_TRANSLATION
687 /**
688  * qdf_get_ipa_smmu_enabled() - to get IPA SMMU enable status
689  *
690  * Return: true when IPA SMMU enabled, otherwise false
691  */
692 static inline bool qdf_get_ipa_smmu_enabled(void)
693 {
694 	return __qdf_get_ipa_smmu_enabled();
695 }
696 #endif
697 
698 #ifdef IPA_LAN_RX_NAPI_SUPPORT
699 /**
700  * qdf_ipa_get_lan_rx_napi() - Check if NAPI is enabled in LAN
701  * RX DP
702  *
703  * Returns: true if enabled, false otherwise
704  */
705 static inline bool qdf_ipa_get_lan_rx_napi(void)
706 {
707 	return __qdf_ipa_get_lan_rx_napi();
708 }
709 #else
710 static inline bool qdf_ipa_get_lan_rx_napi(void)
711 {
712 	return false;
713 }
714 #endif /* IPA_LAN_RX_NAPI_SUPPORT */
715 #else
716 #ifdef ENABLE_SMMU_S1_TRANSLATION
717 static inline bool qdf_get_ipa_smmu_enabled(void)
718 {
719 	return false;
720 }
721 #endif
722 #endif /* IPA_OFFLOAD */
723 #endif /* _QDF_IPA_H */
724