wlan_twt_api.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * Copyright (c) 2022 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. * @psoc: psoc handle
  64. *
  65. * return: QDF_STATUS
  66. */
  67. QDF_STATUS wlan_twt_init(void);
  68. /**
  69. * wlan_twt_deinit() - twt de-init
  70. * @psoc: psoc handle
  71. *
  72. * return: QDF_STATUS
  73. */
  74. QDF_STATUS wlan_twt_deinit(void);
  75. /**
  76. * wlan_twt_get_tx_ops() - get tx ops
  77. * @psoc: psoc handle
  78. *
  79. * return: QDF_STATUS
  80. */
  81. struct wlan_lmac_if_twt_tx_ops *
  82. wlan_twt_get_tx_ops(struct wlan_objmgr_psoc *psoc);
  83. /**
  84. * wlan_twt_get_rx_ops() - get rx ops
  85. * @psoc: psoc handle
  86. *
  87. * return: QDF_STATUS
  88. */
  89. struct wlan_lmac_if_twt_rx_ops *
  90. wlan_twt_get_rx_ops(struct wlan_objmgr_psoc *psoc);
  91. /**
  92. * wlan_twt_psoc_get_comp_private_obj() - get twt priv obj
  93. * @psoc: psoc handle
  94. *
  95. * return: QDF_STATUS
  96. */
  97. struct twt_psoc_priv_obj*
  98. wlan_twt_psoc_get_comp_private_obj(struct wlan_objmgr_psoc *psoc);
  99. #else
  100. static inline
  101. QDF_STATUS twt_psoc_enable(struct wlan_objmgr_psoc *psoc)
  102. {
  103. return QDF_STATUS_SUCCESS;
  104. }
  105. static inline
  106. QDF_STATUS twt_psoc_disable(struct wlan_objmgr_psoc *psoc)
  107. {
  108. return QDF_STATUS_SUCCESS;
  109. }
  110. static inline
  111. QDF_STATUS wlan_twt_init(void)
  112. {
  113. return QDF_STATUS_SUCCESS;
  114. }
  115. static inline
  116. QDF_STATUS wlan_twt_deinit(void)
  117. {
  118. return QDF_STATUS_SUCCESS;
  119. }
  120. #endif
  121. #endif /* _WLAN_TWT_API_H_ */