wlan_twt_api.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. #define twt_alert(params...) \
  28. QDF_TRACE_FATAL(QDF_MODULE_ID_TWT, params)
  29. #define twt_err(params...) \
  30. QDF_TRACE_ERROR(QDF_MODULE_ID_TWT, params)
  31. #define twt_warn(params...) \
  32. QDF_TRACE_WARN(QDF_MODULE_ID_TWT, params)
  33. #define twt_notice(params...) \
  34. QDF_TRACE_INFO(QDF_MODULE_ID_TWT, params)
  35. #define twt_debug(params...) \
  36. QDF_TRACE_DEBUG(QDF_MODULE_ID_TWT, params)
  37. #define twt_nofl_alert(params...) \
  38. QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_TWT, params)
  39. #define twt_nofl_err(params...) \
  40. QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_TWT, params)
  41. #define twt_nofl_warn(params...) \
  42. QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_TWT, params)
  43. #define twt_nofl_notice(params...) \
  44. QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_TWT, params)
  45. #define twt_nofl_debug(params...) \
  46. QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_TWT, params)
  47. /**
  48. * twt_psoc_enable() - twt psoc enable
  49. * @psoc: psoc handle
  50. *
  51. * return: QDF_STATUS
  52. */
  53. QDF_STATUS twt_psoc_enable(struct wlan_objmgr_psoc *psoc);
  54. /**
  55. * twt_psoc_disable() - twt psoc disable
  56. * @psoc: psoc handle
  57. *
  58. * return: QDF_STATUS
  59. */
  60. QDF_STATUS twt_psoc_disable(struct wlan_objmgr_psoc *psoc);
  61. /**
  62. * wlan_twt_init() - twt init
  63. *
  64. * return: QDF_STATUS
  65. */
  66. QDF_STATUS wlan_twt_init(void);
  67. /**
  68. * wlan_twt_deinit() - twt de-init
  69. *
  70. * return: QDF_STATUS
  71. */
  72. QDF_STATUS wlan_twt_deinit(void);
  73. /**
  74. * wlan_twt_get_tx_ops() - get tx ops
  75. * @psoc: psoc handle
  76. *
  77. * return: QDF_STATUS
  78. */
  79. struct wlan_lmac_if_twt_tx_ops *
  80. wlan_twt_get_tx_ops(struct wlan_objmgr_psoc *psoc);
  81. /**
  82. * wlan_twt_get_rx_ops() - get rx ops
  83. * @psoc: psoc handle
  84. *
  85. * return: QDF_STATUS
  86. */
  87. struct wlan_lmac_if_twt_rx_ops *
  88. wlan_twt_get_rx_ops(struct wlan_objmgr_psoc *psoc);
  89. /**
  90. * wlan_twt_psoc_get_comp_private_obj() - get twt priv obj
  91. * @psoc: psoc handle
  92. *
  93. * return: QDF_STATUS
  94. */
  95. struct twt_psoc_priv_obj*
  96. wlan_twt_psoc_get_comp_private_obj(struct wlan_objmgr_psoc *psoc);
  97. /**
  98. * wlan_set_peer_twt_capabilities() - set peer twt capabilities
  99. * @psoc: psoc handle
  100. * @peer_mac: peer mac address
  101. * @peer_cap: TWT peer capability bitmap. Refer enum
  102. * wlan_twt_capabilities for representation.
  103. *
  104. * return: QDF_STATUS
  105. */
  106. QDF_STATUS
  107. wlan_set_peer_twt_capabilities(struct wlan_objmgr_psoc *psoc,
  108. struct qdf_mac_addr *peer_mac,
  109. uint8_t peer_cap);
  110. #else
  111. static inline
  112. QDF_STATUS twt_psoc_enable(struct wlan_objmgr_psoc *psoc)
  113. {
  114. return QDF_STATUS_SUCCESS;
  115. }
  116. static inline
  117. QDF_STATUS twt_psoc_disable(struct wlan_objmgr_psoc *psoc)
  118. {
  119. return QDF_STATUS_SUCCESS;
  120. }
  121. static inline
  122. QDF_STATUS wlan_twt_init(void)
  123. {
  124. return QDF_STATUS_SUCCESS;
  125. }
  126. static inline
  127. QDF_STATUS wlan_twt_deinit(void)
  128. {
  129. return QDF_STATUS_SUCCESS;
  130. }
  131. static inline
  132. QDF_STATUS wlan_set_peer_twt_capabilities(struct wlan_objmgr_psoc *psoc,
  133. struct qdf_mac_addr *peer_mac,
  134. uint8_t peer_cap)
  135. {
  136. return QDF_STATUS_SUCCESS;
  137. }
  138. #endif
  139. #endif /* _WLAN_TWT_API_H_ */