qdf_ipa_wdi3.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * Copyright (c) 2017, 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 WDI3 APIs.
  19. */
  20. #ifndef _QDF_IPA_WDI3_H
  21. #define _QDF_IPA_WDI3_H
  22. #include <i_qdf_ipa_wdi3.h>
  23. /**
  24. * qdf_ipa_wdi3_hdr_info_t - Header to install on IPA HW
  25. */
  26. typedef __qdf_ipa_wdi3_hdr_info_t qdf_ipa_wdi3_hdr_info_t;
  27. /**
  28. * qdf_ipa_wdi3_reg_intf_in_params_t - parameters for uC offload
  29. * interface registration
  30. */
  31. typedef __qdf_ipa_wdi3_reg_intf_in_params_t qdf_ipa_wdi3_reg_intf_in_params_t;
  32. /**
  33. * qdf_ipa_wdi3_setup_info_t - WDI3 TX/Rx configuration
  34. */
  35. typedef __qdf_ipa_wdi3_setup_info_t qdf_ipa_wdi3_setup_info_t;
  36. /**
  37. * qdf_ipa_wdi3_conn_in_params_t - information provided by
  38. * uC offload client
  39. */
  40. typedef __qdf_ipa_wdi3_conn_in_params_t qdf_ipa_wdi3_conn_in_params_t;
  41. /**
  42. * qdf_ipa_wdi3_conn_out_params_t - information provided
  43. * to WLAN druver
  44. */
  45. typedef __qdf_ipa_wdi3_conn_out_params_t qdf_ipa_wdi3_conn_out_params_t;
  46. /**
  47. * qdf_ipa_wdi3_perf_profile_t - To set BandWidth profile
  48. */
  49. typedef __qdf_ipa_wdi3_perf_profile_t qdf_ipa_wdi3_perf_profile_t;
  50. /**
  51. * qdf_ipa_wdi3_reg_intf - Client should call this function to
  52. * init WDI3 IPA offload data path
  53. *
  54. * Note: Should not be called from atomic context and only
  55. * after checking IPA readiness using ipa_register_ipa_ready_cb()
  56. *
  57. * @Return 0 on success, negative on failure
  58. */
  59. static inline int qdf_ipa_wdi3_reg_intf(
  60. struct ipa_wdi3_reg_intf_in_params *in)
  61. {
  62. return __qdf_ipa_wdi3_reg_intf(in);
  63. }
  64. /**
  65. * qdf_ipa_wdi3_dereg_intf - Client Driver should call this
  66. * function to deregister before unload and after disconnect
  67. *
  68. * @Return 0 on success, negative on failure
  69. */
  70. static inline int qdf_ipa_wdi3_dereg_intf(const char *netdev_name)
  71. {
  72. return __qdf_ipa_wdi3_dereg_intf(netdev_name);
  73. }
  74. /**
  75. * qdf_ipa_wdi3_conn_pipes - Client should call this
  76. * function to connect pipes
  77. *
  78. * @in: [in] input parameters from client
  79. * @out: [out] output params to client
  80. *
  81. * Note: Should not be called from atomic context and only
  82. * after checking IPA readiness using ipa_register_ipa_ready_cb()
  83. *
  84. * @Return 0 on success, negative on failure
  85. */
  86. static inline int qdf_ipa_wdi3_conn_pipes(struct ipa_wdi3_conn_in_params *in,
  87. struct ipa_wdi3_conn_out_params *out)
  88. {
  89. return __qdf_ipa_wdi3_conn_pipes(in, out);
  90. }
  91. /**
  92. * qdf_ipa_wdi3_disconn_pipes() - Client should call this
  93. * function to disconnect pipes
  94. *
  95. * Note: Should not be called from atomic context
  96. *
  97. * Returns: 0 on success, negative on failure
  98. */
  99. static inline int qdf_ipa_wdi3_disconn_pipes(void)
  100. {
  101. return __qdf_ipa_wdi3_disconn_pipes();
  102. }
  103. /**
  104. * qdf_ipa_wdi3_enable_pipes() - Client should call this
  105. * function to enable IPA offload data path
  106. *
  107. * Note: Should not be called from atomic context
  108. *
  109. * Returns: 0 on success, negative on failure
  110. */
  111. static inline int qdf_ipa_wdi3_enable_pipes(void)
  112. {
  113. return __qdf_ipa_wdi3_enable_pipes();
  114. }
  115. /**
  116. * qdf_ipa_wdi3_disable_pipes() - Client should call this
  117. * function to disable IPA offload data path
  118. *
  119. * Note: Should not be called from atomic context
  120. *
  121. * Returns: 0 on success, negative on failure
  122. */
  123. static inline int qdf_ipa_wdi3_disable_pipes(void)
  124. {
  125. return __qdf_ipa_wdi3_disable_pipes();
  126. }
  127. /**
  128. * qdf_ipa_wdi3_set_perf_profile() - Client should call this function to
  129. * set IPA clock bandwidth based on data rates
  130. *
  131. * @profile: [in] BandWidth profile to use
  132. *
  133. * Returns: 0 on success, negative on failure
  134. */
  135. static inline int qdf_ipa_wdi3_set_perf_profile(
  136. struct ipa_wdi3_perf_profile *profile)
  137. {
  138. return __qdf_ipa_wdi3_set_perf_profile(profile);
  139. }
  140. #endif