qdf_ipa.h 19 KB

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