qdf_ipa.h 19 KB

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