qdf_ipa_wdi3.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. /*
  2. * Copyright (c) 2017-2018, 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. /**
  17. * DOC: qdf_ipa_wdi3.h
  18. * This file provides OS abstraction for IPA WDI APIs.
  19. */
  20. #ifndef _QDF_IPA_WDI3_H
  21. #define _QDF_IPA_WDI3_H
  22. #ifdef IPA_OFFLOAD
  23. #ifdef CONFIG_IPA_WDI_UNIFIED_API
  24. #include <qdf_ipa.h>
  25. #include <i_qdf_ipa_wdi3.h>
  26. /**
  27. * qdf_ipa_wdi_version_t - IPA WDI version
  28. */
  29. typedef __qdf_ipa_wdi_version_t qdf_ipa_wdi_version_t;
  30. /**
  31. * qdf_ipa_wdi_init_in_params_t - wdi init input parameters
  32. */
  33. typedef __qdf_ipa_wdi_init_in_params_t qdf_ipa_wdi_init_in_params_t;
  34. /**
  35. * qdf_ipa_wdi_init_out_params_t - wdi init output parameters
  36. */
  37. typedef __qdf_ipa_wdi_init_out_params_t qdf_ipa_wdi_init_out_params_t;
  38. /**
  39. * qdf_ipa_wdi_pipe_setup_info_smmu_t - WDI TX/Rx configuration
  40. */
  41. typedef __qdf_ipa_wdi_pipe_setup_info_smmu_t qdf_ipa_wdi_pipe_setup_info_smmu_t;
  42. typedef __qdf_ipa_ep_cfg_t qdf_ipa_ep_cfg_t;
  43. /**
  44. * qdf_ipa_wdi_init - Client should call this function to
  45. * init WDI IPA offload data path
  46. *
  47. * Note: Should not be called from atomic context and only
  48. * after checking IPA readiness using ipa_register_ipa_ready_cb()
  49. *
  50. * @Return 0 on success, negative on failure
  51. */
  52. static inline int qdf_ipa_wdi_init(qdf_ipa_wdi_init_in_params_t *in,
  53. qdf_ipa_wdi_init_out_params_t *out)
  54. {
  55. return __qdf_ipa_wdi_init(in, out);
  56. }
  57. /**
  58. * qdf_ipa_wdi_cleanup - Client should call this function to
  59. * clean up WDI IPA offload data path
  60. *
  61. * @Return 0 on success, negative on failure
  62. */
  63. static inline int qdf_ipa_wdi_cleanup(void)
  64. {
  65. return __qdf_ipa_wdi_cleanup();
  66. }
  67. /**
  68. * qdf_ipa_wdi_hdr_info_t - Header to install on IPA HW
  69. */
  70. typedef __qdf_ipa_wdi_hdr_info_t qdf_ipa_wdi_hdr_info_t;
  71. /**
  72. * qdf_ipa_wdi_reg_intf_in_params_t - parameters for uC offload
  73. * interface registration
  74. */
  75. typedef __qdf_ipa_wdi_reg_intf_in_params_t qdf_ipa_wdi_reg_intf_in_params_t;
  76. /**
  77. * qdf_ipa_wdi_pipe_setup_info_t - WDI TX/Rx configuration
  78. */
  79. typedef __qdf_ipa_wdi_pipe_setup_info_t qdf_ipa_wdi_pipe_setup_info_t;
  80. /**
  81. * qdf_ipa_wdi_conn_in_params_t - information provided by
  82. * uC offload client
  83. */
  84. typedef __qdf_ipa_wdi_conn_in_params_t qdf_ipa_wdi_conn_in_params_t;
  85. /**
  86. * qdf_ipa_wdi_conn_out_params_t - information provided
  87. * to WLAN druver
  88. */
  89. typedef __qdf_ipa_wdi_conn_out_params_t qdf_ipa_wdi_conn_out_params_t;
  90. /**
  91. * qdf_ipa_wdi_perf_profile_t - To set BandWidth profile
  92. */
  93. typedef __qdf_ipa_wdi_perf_profile_t qdf_ipa_wdi_perf_profile_t;
  94. /**
  95. * qdf_ipa_wdi_reg_intf - Client should call this function to
  96. * init WDI IPA offload data path
  97. *
  98. * Note: Should not be called from atomic context and only
  99. * after checking IPA readiness using ipa_register_ipa_ready_cb()
  100. *
  101. * @Return 0 on success, negative on failure
  102. */
  103. static inline int qdf_ipa_wdi_reg_intf(
  104. qdf_ipa_wdi_reg_intf_in_params_t *in)
  105. {
  106. return __qdf_ipa_wdi_reg_intf(in);
  107. }
  108. /**
  109. * qdf_ipa_wdi_dereg_intf - Client Driver should call this
  110. * function to deregister before unload and after disconnect
  111. *
  112. * @Return 0 on success, negative on failure
  113. */
  114. static inline int qdf_ipa_wdi_dereg_intf(const char *netdev_name)
  115. {
  116. return __qdf_ipa_wdi_dereg_intf(netdev_name);
  117. }
  118. /**
  119. * qdf_ipa_wdi_conn_pipes - Client should call this
  120. * function to connect pipes
  121. *
  122. * @in: [in] input parameters from client
  123. * @out: [out] output params to client
  124. *
  125. * Note: Should not be called from atomic context and only
  126. * after checking IPA readiness using ipa_register_ipa_ready_cb()
  127. *
  128. * @Return 0 on success, negative on failure
  129. */
  130. static inline int qdf_ipa_wdi_conn_pipes(qdf_ipa_wdi_conn_in_params_t *in,
  131. qdf_ipa_wdi_conn_out_params_t *out)
  132. {
  133. return __qdf_ipa_wdi_conn_pipes(in, out);
  134. }
  135. /**
  136. * qdf_ipa_wdi_disconn_pipes() - Client should call this
  137. * function to disconnect pipes
  138. *
  139. * Note: Should not be called from atomic context
  140. *
  141. * Returns: 0 on success, negative on failure
  142. */
  143. static inline int qdf_ipa_wdi_disconn_pipes(void)
  144. {
  145. return __qdf_ipa_wdi_disconn_pipes();
  146. }
  147. /**
  148. * qdf_ipa_wdi_enable_pipes() - Client should call this
  149. * function to enable IPA offload data path
  150. *
  151. * Note: Should not be called from atomic context
  152. *
  153. * Returns: 0 on success, negative on failure
  154. */
  155. static inline int qdf_ipa_wdi_enable_pipes(void)
  156. {
  157. return __qdf_ipa_wdi_enable_pipes();
  158. }
  159. /**
  160. * qdf_ipa_wdi_disable_pipes() - Client should call this
  161. * function to disable IPA offload data path
  162. *
  163. * Note: Should not be called from atomic context
  164. *
  165. * Returns: 0 on success, negative on failure
  166. */
  167. static inline int qdf_ipa_wdi_disable_pipes(void)
  168. {
  169. return __qdf_ipa_wdi_disable_pipes();
  170. }
  171. /**
  172. * qdf_ipa_wdi_set_perf_profile() - Client should call this function to
  173. * set IPA clock bandwidth based on data rates
  174. *
  175. * @profile: [in] BandWidth profile to use
  176. *
  177. * Returns: 0 on success, negative on failure
  178. */
  179. static inline int qdf_ipa_wdi_set_perf_profile(
  180. qdf_ipa_wdi_perf_profile_t *profile)
  181. {
  182. return __qdf_ipa_wdi_set_perf_profile(profile);
  183. }
  184. #else /* CONFIG_IPA_WDI_UNIFIED_API */
  185. #include <i_qdf_ipa_wdi3.h>
  186. /**
  187. * qdf_ipa_wdi3_hdr_info_t - Header to install on IPA HW
  188. */
  189. typedef __qdf_ipa_wdi3_hdr_info_t qdf_ipa_wdi3_hdr_info_t;
  190. /**
  191. * qdf_ipa_wdi3_reg_intf_in_params_t - parameters for uC offload
  192. * interface registration
  193. */
  194. typedef __qdf_ipa_wdi3_reg_intf_in_params_t qdf_ipa_wdi3_reg_intf_in_params_t;
  195. /**
  196. * qdf_ipa_wdi3_setup_info_t - WDI3 TX/Rx configuration
  197. */
  198. typedef __qdf_ipa_wdi3_setup_info_t qdf_ipa_wdi3_setup_info_t;
  199. /**
  200. * qdf_ipa_wdi3_conn_in_params_t - information provided by
  201. * uC offload client
  202. */
  203. typedef __qdf_ipa_wdi3_conn_in_params_t qdf_ipa_wdi3_conn_in_params_t;
  204. /**
  205. * qdf_ipa_wdi3_conn_out_params_t - information provided
  206. * to WLAN druver
  207. */
  208. typedef __qdf_ipa_wdi3_conn_out_params_t qdf_ipa_wdi3_conn_out_params_t;
  209. /**
  210. * qdf_ipa_wdi3_perf_profile_t - To set BandWidth profile
  211. */
  212. typedef __qdf_ipa_wdi3_perf_profile_t qdf_ipa_wdi3_perf_profile_t;
  213. /**
  214. * qdf_ipa_wdi3_reg_intf - Client should call this function to
  215. * init WDI3 IPA offload data path
  216. *
  217. * Note: Should not be called from atomic context and only
  218. * after checking IPA readiness using ipa_register_ipa_ready_cb()
  219. *
  220. * @Return 0 on success, negative on failure
  221. */
  222. static inline int qdf_ipa_wdi3_reg_intf(
  223. struct ipa_wdi3_reg_intf_in_params *in)
  224. {
  225. return __qdf_ipa_wdi3_reg_intf(in);
  226. }
  227. /**
  228. * qdf_ipa_wdi3_dereg_intf - Client Driver should call this
  229. * function to deregister before unload and after disconnect
  230. *
  231. * @Return 0 on success, negative on failure
  232. */
  233. static inline int qdf_ipa_wdi3_dereg_intf(const char *netdev_name)
  234. {
  235. return __qdf_ipa_wdi3_dereg_intf(netdev_name);
  236. }
  237. /**
  238. * qdf_ipa_wdi3_conn_pipes - Client should call this
  239. * function to connect pipes
  240. *
  241. * @in: [in] input parameters from client
  242. * @out: [out] output params to client
  243. *
  244. * Note: Should not be called from atomic context and only
  245. * after checking IPA readiness using ipa_register_ipa_ready_cb()
  246. *
  247. * @Return 0 on success, negative on failure
  248. */
  249. static inline int qdf_ipa_wdi3_conn_pipes(struct ipa_wdi3_conn_in_params *in,
  250. struct ipa_wdi3_conn_out_params *out)
  251. {
  252. return __qdf_ipa_wdi3_conn_pipes(in, out);
  253. }
  254. /**
  255. * qdf_ipa_wdi3_disconn_pipes() - Client should call this
  256. * function to disconnect pipes
  257. *
  258. * Note: Should not be called from atomic context
  259. *
  260. * Returns: 0 on success, negative on failure
  261. */
  262. static inline int qdf_ipa_wdi3_disconn_pipes(void)
  263. {
  264. return __qdf_ipa_wdi3_disconn_pipes();
  265. }
  266. /**
  267. * qdf_ipa_wdi3_enable_pipes() - Client should call this
  268. * function to enable IPA offload data path
  269. *
  270. * Note: Should not be called from atomic context
  271. *
  272. * Returns: 0 on success, negative on failure
  273. */
  274. static inline int qdf_ipa_wdi3_enable_pipes(void)
  275. {
  276. return __qdf_ipa_wdi3_enable_pipes();
  277. }
  278. /**
  279. * qdf_ipa_wdi3_disable_pipes() - Client should call this
  280. * function to disable IPA offload data path
  281. *
  282. * Note: Should not be called from atomic context
  283. *
  284. * Returns: 0 on success, negative on failure
  285. */
  286. static inline int qdf_ipa_wdi3_disable_pipes(void)
  287. {
  288. return __qdf_ipa_wdi3_disable_pipes();
  289. }
  290. /**
  291. * qdf_ipa_wdi3_set_perf_profile() - Client should call this function to
  292. * set IPA clock bandwidth based on data rates
  293. *
  294. * @profile: [in] BandWidth profile to use
  295. *
  296. * Returns: 0 on success, negative on failure
  297. */
  298. static inline int qdf_ipa_wdi3_set_perf_profile(
  299. struct ipa_wdi3_perf_profile *profile)
  300. {
  301. return __qdf_ipa_wdi3_set_perf_profile(profile);
  302. }
  303. #endif /* CONFIG_IPA_WDI_UNIFIED_API */
  304. #endif /* IPA_OFFLOAD */
  305. #endif /* _QDF_IPA_WDI3_H */