cfg_mlme_twt.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /*
  2. * Copyright (c) 2011-2018, 2020-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * DOC: This file contains centralized definitions of converged configuration.
  21. */
  22. #ifndef __CFG_MLME_TWT_H
  23. #define __CFG_MLME_TWT_H
  24. #if defined(WLAN_SUPPORT_TWT) && !defined(WLAN_TWT_CONV_SUPPORTED)
  25. /*
  26. * <ini>
  27. * twt_requestor - twt requestor.
  28. * @Min: 0
  29. * @Max: 1
  30. * @Default: 1
  31. *
  32. * This cfg is used to store twt requestor config.
  33. *
  34. * Related: NA
  35. *
  36. * Supported Feature: 11AX
  37. *
  38. * Usage: Internal
  39. *
  40. * </ini>
  41. */
  42. #define CFG_TWT_REQUESTOR CFG_INI_BOOL( \
  43. "twt_requestor", \
  44. 1, \
  45. "TWT requestor")
  46. /*
  47. * <ini>
  48. * twt_responder - twt responder.
  49. * @Min: 0
  50. * @Max: 1
  51. * @Default: 0
  52. *
  53. * This cfg is used to store twt responder config.
  54. *
  55. * Related: NA
  56. *
  57. * Supported Feature: 11AX
  58. *
  59. * Usage: Internal
  60. *
  61. * </ini>
  62. */
  63. #define CFG_TWT_RESPONDER CFG_INI_BOOL( \
  64. "twt_responder", \
  65. false, \
  66. "TWT responder")
  67. /*
  68. * <ini>
  69. * enable_twt - Enable Target Wake Time support.
  70. * @Min: 0
  71. * @Max: 1
  72. * @Default: 1
  73. *
  74. * This ini is used to enable or disable TWT support.
  75. *
  76. * Related: NA
  77. *
  78. * Supported Feature: 11AX
  79. *
  80. * Usage: External
  81. *
  82. * </ini>
  83. */
  84. #define CFG_ENABLE_TWT CFG_INI_BOOL( \
  85. "enable_twt", \
  86. 1, \
  87. "TWT support")
  88. /*
  89. * <ini>
  90. * twt_congestion_timeout - Target wake time congestion timeout.
  91. * @Min: 0
  92. * @Max: 10000
  93. * @Default: 100
  94. *
  95. * STA uses this timer to continuously monitor channel congestion levels to
  96. * decide whether to start or stop TWT. This ini is used to configure the
  97. * target wake time congestion timeout value in the units of milliseconds.
  98. * A value of Zero indicates that this is a host triggered TWT and all the
  99. * necessary configuration for TWT will be directed from the host.
  100. *
  101. * Related: NA
  102. *
  103. * Supported Feature: 11AX
  104. *
  105. * Usage: External
  106. *
  107. * </ini>
  108. */
  109. #define CFG_TWT_CONGESTION_TIMEOUT CFG_INI_UINT( \
  110. "twt_congestion_timeout", \
  111. 0, \
  112. 10000, \
  113. 100, \
  114. CFG_VALUE_OR_DEFAULT, \
  115. "twt congestion timeout")
  116. /*
  117. * <ini>
  118. * twt_bcast_req_resp_config - To enable broadcast twt requestor and responder.
  119. * @Min: 0 Disable the extended twt capability
  120. * @Max: 3
  121. * @Default: 1
  122. *
  123. * This cfg is used to configure the broadcast TWT requestor and responder.
  124. * Bitmap for enabling the broadcast twt requestor and responder.
  125. * BIT 0: Enable/Disable broadcast twt requestor.
  126. * BIT 1: Enable/Disable broadcast twt responder.
  127. * BIT 2-31: Reserved
  128. *
  129. * Related: CFG_ENABLE_TWT
  130. * Related: CFG_TWT_RESPONDER
  131. * Related: CFG_TWT_REQUESTOR
  132. *
  133. * Supported Feature: 11AX
  134. *
  135. * Usage: External
  136. *
  137. * </ini>
  138. */
  139. /* defines to extract the requestor/responder capabilities from cfg */
  140. #define TWT_BCAST_REQ_INDEX 0
  141. #define TWT_BCAST_REQ_BITS 1
  142. #define TWT_BCAST_RES_INDEX 1
  143. #define TWT_BCAST_RES_BITS 1
  144. #define CFG_BCAST_TWT_REQ_RESP CFG_INI_UINT( \
  145. "twt_bcast_req_resp_config", \
  146. 0, \
  147. 3, \
  148. 1, \
  149. CFG_VALUE_OR_DEFAULT, \
  150. "BROADCAST TWT CAPABILITY")
  151. #define CFG_TWT_GET_BCAST_REQ(_bcast_conf) \
  152. QDF_GET_BITS(_bcast_conf, \
  153. TWT_BCAST_REQ_INDEX, \
  154. TWT_BCAST_REQ_BITS)
  155. #define CFG_TWT_GET_BCAST_RES(_bcast_conf) \
  156. QDF_GET_BITS(_bcast_conf, \
  157. TWT_BCAST_RES_INDEX, \
  158. TWT_BCAST_RES_BITS)
  159. /*
  160. * <ini>
  161. * enable_twt_24ghz - Enable Target wake time when STA is connected on 2.4Ghz
  162. * band.
  163. * @Min: 0
  164. * @Max: 1
  165. * @Default: 1
  166. *
  167. * This ini is used to enable/disable the host TWT when STA is connected to AP
  168. * in 2.4Ghz band.
  169. *
  170. * Related: NA
  171. *
  172. * Supported Feature: 11AX
  173. *
  174. * Usage: External
  175. *
  176. * </ini>
  177. */
  178. #define CFG_ENABLE_TWT_24GHZ CFG_INI_BOOL( \
  179. "enable_twt_24ghz", \
  180. true, \
  181. "enable twt in 2.4Ghz band")
  182. #define CFG_TWT_ALL \
  183. CFG(CFG_ENABLE_TWT) \
  184. CFG(CFG_TWT_REQUESTOR) \
  185. CFG(CFG_TWT_RESPONDER) \
  186. CFG(CFG_TWT_CONGESTION_TIMEOUT) \
  187. CFG(CFG_BCAST_TWT_REQ_RESP) \
  188. CFG(CFG_ENABLE_TWT_24GHZ)
  189. #endif
  190. #endif /* __CFG_MLME_TWT_H */