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