cfg_mlme_twt.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * Copyright (c) 2011-2018, 2020-2021 The Linux Foundation. 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: This file contains centralized definitions of converged configuration.
  20. */
  21. #ifndef __CFG_MLME_TWT_H
  22. #define __CFG_MLME_TWT_H
  23. /*
  24. * <ini>
  25. * twt_requestor - twt requestor.
  26. * @Min: 0
  27. * @Max: 1
  28. * @Default: 1
  29. *
  30. * This cfg is used to store twt requestor config.
  31. *
  32. * Related: NA
  33. *
  34. * Supported Feature: 11AX
  35. *
  36. * Usage: Internal
  37. *
  38. * </ini>
  39. */
  40. #define CFG_TWT_REQUESTOR CFG_INI_BOOL( \
  41. "twt_requestor", \
  42. 1, \
  43. "TWT requestor")
  44. /*
  45. * <ini>
  46. * twt_responder - twt responder.
  47. * @Min: 0
  48. * @Max: 1
  49. * @Default: 1
  50. *
  51. * This cfg is used to store twt responder config.
  52. *
  53. * Related: NA
  54. *
  55. * Supported Feature: 11AX
  56. *
  57. * Usage: Internal
  58. *
  59. * </ini>
  60. */
  61. #define CFG_TWT_RESPONDER CFG_INI_BOOL( \
  62. "twt_responder", \
  63. 1, \
  64. "TWT responder")
  65. /*
  66. * <ini>
  67. * enable_twt - Enable Target Wake Time support.
  68. * @Min: 0
  69. * @Max: 1
  70. * @Default: 1
  71. *
  72. * This ini is used to enable or disable TWT support.
  73. *
  74. * Related: NA
  75. *
  76. * Supported Feature: 11AX
  77. *
  78. * Usage: External
  79. *
  80. * </ini>
  81. */
  82. #define CFG_ENABLE_TWT CFG_INI_BOOL( \
  83. "enable_twt", \
  84. 1, \
  85. "TWT support")
  86. /*
  87. * <ini>
  88. * twt_congestion_timeout - Target wake time congestion timeout.
  89. * @Min: 0
  90. * @Max: 10000
  91. * @Default: 100
  92. *
  93. * STA uses this timer to continuously monitor channel congestion levels to
  94. * decide whether to start or stop TWT. This ini is used to configure the
  95. * target wake time congestion timeout value in the units of milliseconds.
  96. * A value of Zero indicates that this is a host triggered TWT and all the
  97. * necessary configuration for TWT will be directed from the host.
  98. *
  99. * Related: NA
  100. *
  101. * Supported Feature: 11AX
  102. *
  103. * Usage: External
  104. *
  105. * </ini>
  106. */
  107. #define CFG_TWT_CONGESTION_TIMEOUT CFG_INI_UINT( \
  108. "twt_congestion_timeout", \
  109. 0, \
  110. 10000, \
  111. 100, \
  112. CFG_VALUE_OR_DEFAULT, \
  113. "twt congestion timeout")
  114. /*
  115. * <ini>
  116. * twt_bcast_req_resp_config - To enable broadcast twt requestor and responder.
  117. * @Min: 0 Disable the extended twt capability
  118. * @Max: 3
  119. * @Default: 1
  120. *
  121. * This cfg is used to configure the broadcast TWT requestor and responder.
  122. * Bitmap for enabling the broadcast twt requestor and responder.
  123. * BIT 0: Enable/Disable broadcast twt requestor.
  124. * BIT 1: Enable/Disable broadcast twt responder.
  125. * BIT 2-31: Reserved
  126. *
  127. * Related: CFG_ENABLE_TWT
  128. * Related: CFG_TWT_RESPONDER
  129. * Related: CFG_TWT_REQUESTOR
  130. *
  131. * Supported Feature: 11AX
  132. *
  133. * Usage: External
  134. *
  135. * </ini>
  136. */
  137. /* defines to extract the requestor/responder capabilities from cfg */
  138. #define TWT_BCAST_REQ_INDEX 0
  139. #define TWT_BCAST_REQ_BITS 1
  140. #define TWT_BCAST_RES_INDEX 1
  141. #define TWT_BCAST_RES_BITS 1
  142. #define CFG_BCAST_TWT_REQ_RESP CFG_INI_UINT( \
  143. "twt_bcast_req_resp_config", \
  144. 0, \
  145. 3, \
  146. 1, \
  147. CFG_VALUE_OR_DEFAULT, \
  148. "BROADCAST TWT CAPABILITY")
  149. #define CFG_TWT_GET_BCAST_REQ(_bcast_conf) \
  150. QDF_GET_BITS(_bcast_conf, \
  151. TWT_BCAST_REQ_INDEX, \
  152. TWT_BCAST_REQ_BITS)
  153. #define CFG_TWT_GET_BCAST_RES(_bcast_conf) \
  154. QDF_GET_BITS(_bcast_conf, \
  155. TWT_BCAST_RES_INDEX, \
  156. TWT_BCAST_RES_BITS)
  157. #define CFG_TWT_ALL \
  158. CFG(CFG_ENABLE_TWT) \
  159. CFG(CFG_TWT_REQUESTOR) \
  160. CFG(CFG_TWT_RESPONDER) \
  161. CFG(CFG_TWT_CONGESTION_TIMEOUT) \
  162. CFG(CFG_BCAST_TWT_REQ_RESP)
  163. #endif /* __CFG_MLME_TWT_H */