wlan_twt_api.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /*
  2. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: wlan_twt_api.h
  20. */
  21. #ifndef _WLAN_TWT_API_H_
  22. #define _WLAN_TWT_API_H_
  23. #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
  24. #include <wlan_objmgr_psoc_obj.h>
  25. #include <wlan_objmgr_global_obj.h>
  26. #include <wlan_lmac_if_def.h>
  27. #include <wlan_twt_public_structs.h>
  28. #define twt_alert(params...) \
  29. QDF_TRACE_FATAL(QDF_MODULE_ID_TWT, params)
  30. #define twt_err(params...) \
  31. QDF_TRACE_ERROR(QDF_MODULE_ID_TWT, params)
  32. #define twt_warn(params...) \
  33. QDF_TRACE_WARN(QDF_MODULE_ID_TWT, params)
  34. #define twt_notice(params...) \
  35. QDF_TRACE_INFO(QDF_MODULE_ID_TWT, params)
  36. #define twt_debug(params...) \
  37. QDF_TRACE_DEBUG(QDF_MODULE_ID_TWT, params)
  38. #define twt_nofl_alert(params...) \
  39. QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_TWT, params)
  40. #define twt_nofl_err(params...) \
  41. QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_TWT, params)
  42. #define twt_nofl_warn(params...) \
  43. QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_TWT, params)
  44. #define twt_nofl_notice(params...) \
  45. QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_TWT, params)
  46. #define twt_nofl_debug(params...) \
  47. QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_TWT, params)
  48. /**
  49. * twt_psoc_enable() - twt psoc enable
  50. * @psoc: psoc handle
  51. *
  52. * return: QDF_STATUS
  53. */
  54. QDF_STATUS twt_psoc_enable(struct wlan_objmgr_psoc *psoc);
  55. /**
  56. * twt_psoc_disable() - twt psoc disable
  57. * @psoc: psoc handle
  58. *
  59. * return: QDF_STATUS
  60. */
  61. QDF_STATUS twt_psoc_disable(struct wlan_objmgr_psoc *psoc);
  62. /**
  63. * wlan_twt_init() - twt init
  64. *
  65. * return: QDF_STATUS
  66. */
  67. QDF_STATUS wlan_twt_init(void);
  68. /**
  69. * wlan_twt_deinit() - twt de-init
  70. *
  71. * return: QDF_STATUS
  72. */
  73. QDF_STATUS wlan_twt_deinit(void);
  74. /**
  75. * wlan_twt_get_tx_ops() - get tx ops
  76. * @psoc: psoc handle
  77. *
  78. * return: QDF_STATUS
  79. */
  80. struct wlan_lmac_if_twt_tx_ops *
  81. wlan_twt_get_tx_ops(struct wlan_objmgr_psoc *psoc);
  82. /**
  83. * wlan_twt_get_rx_ops() - get rx ops
  84. * @psoc: psoc handle
  85. *
  86. * return: QDF_STATUS
  87. */
  88. struct wlan_lmac_if_twt_rx_ops *
  89. wlan_twt_get_rx_ops(struct wlan_objmgr_psoc *psoc);
  90. /**
  91. * wlan_twt_psoc_get_comp_private_obj() - get twt priv obj
  92. * @psoc: psoc handle
  93. *
  94. * return: QDF_STATUS
  95. */
  96. struct twt_psoc_priv_obj*
  97. wlan_twt_psoc_get_comp_private_obj(struct wlan_objmgr_psoc *psoc);
  98. /**
  99. * wlan_set_peer_twt_capabilities() - set peer twt capabilities
  100. * @psoc: psoc handle
  101. * @peer_mac: peer mac address
  102. * @peer_cap: TWT peer capability bitmap. Refer enum
  103. * wlan_twt_capabilities for representation.
  104. *
  105. * return: QDF_STATUS
  106. */
  107. QDF_STATUS
  108. wlan_set_peer_twt_capabilities(struct wlan_objmgr_psoc *psoc,
  109. struct qdf_mac_addr *peer_mac,
  110. uint8_t peer_cap);
  111. /**
  112. * wlan_twt_psoc_set_pmo_enable() - twt psoc set enable
  113. * @psoc: psoc handle
  114. * @reason: twt enable reason
  115. *
  116. * return: QDF_STATUS
  117. */
  118. QDF_STATUS
  119. wlan_twt_psoc_set_pmo_enable(struct wlan_objmgr_psoc *psoc,
  120. enum twt_disable_reason reason);
  121. /**
  122. * wlan_twt_psoc_set_pmo_disable() - twt psoc set disable
  123. * @psoc: psoc handle
  124. * @reason: twt disable reason
  125. *
  126. * return: QDF_STATUS
  127. */
  128. QDF_STATUS
  129. wlan_twt_psoc_set_pmo_disable(struct wlan_objmgr_psoc *psoc,
  130. enum twt_disable_reason reason);
  131. #else
  132. static inline
  133. QDF_STATUS twt_psoc_enable(struct wlan_objmgr_psoc *psoc)
  134. {
  135. return QDF_STATUS_SUCCESS;
  136. }
  137. static inline
  138. QDF_STATUS twt_psoc_disable(struct wlan_objmgr_psoc *psoc)
  139. {
  140. return QDF_STATUS_SUCCESS;
  141. }
  142. static inline
  143. QDF_STATUS wlan_twt_init(void)
  144. {
  145. return QDF_STATUS_SUCCESS;
  146. }
  147. static inline
  148. QDF_STATUS wlan_twt_deinit(void)
  149. {
  150. return QDF_STATUS_SUCCESS;
  151. }
  152. static inline
  153. QDF_STATUS wlan_set_peer_twt_capabilities(struct wlan_objmgr_psoc *psoc,
  154. struct qdf_mac_addr *peer_mac,
  155. uint8_t peer_cap)
  156. {
  157. return QDF_STATUS_SUCCESS;
  158. }
  159. QDF_STATUS
  160. wlan_twt_psoc_set_pmo_enable(struct wlan_objmgr_psoc *psoc,
  161. enum twt_disable_reason reason);
  162. QDF_STATUS
  163. wlan_twt_psoc_set_pmo_disable(struct wlan_objmgr_psoc *psoc,
  164. enum twt_disable_reason reason);
  165. #endif
  166. #endif /* _WLAN_TWT_API_H_ */