cfg_twt.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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: This file contains TWT config related definitions
  20. */
  21. #ifndef __CFG_TWT_H_
  22. #define __CFG_TWT_H_
  23. #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
  24. /*
  25. * <ini>
  26. * twt_requestor - twt requestor.
  27. * @Min: 0
  28. * @Max: 1
  29. * @Default: 1
  30. *
  31. * This cfg is used to store twt requestor config.
  32. *
  33. * Related: NA
  34. *
  35. * Supported Feature: 11AX
  36. *
  37. * Usage: Internal
  38. *
  39. * </ini>
  40. */
  41. #define CFG_TWT_REQUESTOR CFG_INI_BOOL( \
  42. "twt_requestor", \
  43. 1, \
  44. "TWT requestor")
  45. /*
  46. * <ini>
  47. * twt_responder - twt responder.
  48. * @Min: 0
  49. * @Max: 1
  50. * @Default: 1
  51. *
  52. * This cfg is used to store twt responder config.
  53. *
  54. * Related: NA
  55. *
  56. * Supported Feature: 11AX
  57. *
  58. * Usage: Internal
  59. *
  60. * </ini>
  61. */
  62. #define CFG_TWT_RESPONDER CFG_INI_BOOL( \
  63. "twt_responder", \
  64. 1, \
  65. "TWT responder")
  66. /*
  67. * <ini>
  68. * enable_twt - Enable Target Wake Time support.
  69. * @Min: 0
  70. * @Max: 1
  71. * @Default: 1
  72. *
  73. * This ini is used to enable or disable TWT support.
  74. *
  75. * Related: NA
  76. *
  77. * Supported Feature: 11AX
  78. *
  79. * Usage: External
  80. *
  81. * </ini>
  82. */
  83. #define CFG_ENABLE_TWT CFG_INI_BOOL( \
  84. "enable_twt", \
  85. 1, \
  86. "TWT support")
  87. /*
  88. * <ini>
  89. * twt_congestion_timeout - Target wake time congestion timeout.
  90. * @Min: 0
  91. * @Max: 10000
  92. * @Default: 100
  93. *
  94. * STA uses this timer to continuously monitor channel congestion levels to
  95. * decide whether to start or stop TWT. This ini is used to configure the
  96. * target wake time congestion timeout value in the units of milliseconds.
  97. * A value of Zero indicates that this is a host triggered TWT and all the
  98. * necessary configuration for TWT will be directed from the host.
  99. *
  100. * Related: NA
  101. *
  102. * Supported Feature: 11AX
  103. *
  104. * Usage: External
  105. *
  106. * </ini>
  107. */
  108. #define CFG_TWT_CONGESTION_TIMEOUT CFG_INI_UINT( \
  109. "twt_congestion_timeout", \
  110. 0, \
  111. 10000, \
  112. 100, \
  113. CFG_VALUE_OR_DEFAULT, \
  114. "twt congestion timeout")
  115. /*
  116. * <ini>
  117. * twt_bcast_req_resp_config - To enable broadcast twt requestor and responder.
  118. * @Min: 0 Disable the extended twt capability
  119. * @Max: 3
  120. * @Default: 1
  121. *
  122. * This cfg is used to configure the broadcast TWT requestor and responder.
  123. * Bitmap for enabling the broadcast twt requestor and responder.
  124. * BIT 0: Enable/Disable broadcast twt requestor.
  125. * BIT 1: Enable/Disable broadcast twt responder.
  126. * BIT 2-31: Reserved
  127. *
  128. * Related: CFG_ENABLE_TWT
  129. * Related: CFG_TWT_RESPONDER
  130. * Related: CFG_TWT_REQUESTOR
  131. *
  132. * Supported Feature: 11AX
  133. *
  134. * Usage: External
  135. *
  136. * </ini>
  137. */
  138. /* defines to extract the requestor/responder capabilities from cfg */
  139. #define TWT_BCAST_REQ_INDEX 0
  140. #define TWT_BCAST_REQ_BITS 1
  141. #define TWT_BCAST_RES_INDEX 1
  142. #define TWT_BCAST_RES_BITS 1
  143. #define CFG_BCAST_TWT_REQ_RESP CFG_INI_UINT( \
  144. "twt_bcast_req_resp_config", \
  145. 0, \
  146. 3, \
  147. 1, \
  148. CFG_VALUE_OR_DEFAULT, \
  149. "BROADCAST TWT CAPABILITY")
  150. #define CFG_TWT_GET_BCAST_REQ(_bcast_conf) \
  151. QDF_GET_BITS(_bcast_conf, \
  152. TWT_BCAST_REQ_INDEX, \
  153. TWT_BCAST_REQ_BITS)
  154. #define CFG_TWT_GET_BCAST_RES(_bcast_conf) \
  155. QDF_GET_BITS(_bcast_conf, \
  156. TWT_BCAST_RES_INDEX, \
  157. TWT_BCAST_RES_BITS)
  158. /*
  159. * <ini>
  160. * enable_twt_24ghz - Enable Target wake time when STA is connected on 2.4Ghz
  161. * band.
  162. * @Min: 0
  163. * @Max: 1
  164. * @Default: 1
  165. *
  166. * This ini is used to enable/disable the host TWT when STA is connected to AP
  167. * in 2.4Ghz band.
  168. *
  169. * Related: NA
  170. *
  171. * Supported Feature: 11AX
  172. *
  173. * Usage: External
  174. *
  175. * </ini>
  176. */
  177. #define CFG_ENABLE_TWT_24GHZ CFG_INI_BOOL( \
  178. "enable_twt_24ghz", \
  179. true, \
  180. "enable twt in 2.4Ghz band")
  181. #define CFG_HE_FLEX_TWT_SCHED CFG_BOOL( \
  182. "he_flex_twt_sched", \
  183. 0, \
  184. "HE Flex Twt Sched")
  185. /*
  186. * <ini>
  187. * enable_twt_in_11n - Enable TWT support in 11n mode
  188. * @MIN: 0
  189. * @MAX: 1
  190. * @Default: 0
  191. *
  192. * This ini is used to enable/disable TWT support 11n mode.
  193. * Generally by default TWT support present from HE capable
  194. * devices but if this ini is enabled then it will support
  195. * partially from 11n mode itself.
  196. *
  197. * Related: NA
  198. *
  199. * Usage: External
  200. *
  201. * </ini>
  202. */
  203. #define CFG_TWT_ENABLE_IN_11N CFG_INI_BOOL( \
  204. "enable_twt_in_11n", \
  205. false, \
  206. "enable twt support in 11n mode")
  207. #define CFG_TWT_ALL \
  208. CFG(CFG_ENABLE_TWT) \
  209. CFG(CFG_TWT_REQUESTOR) \
  210. CFG(CFG_TWT_RESPONDER) \
  211. CFG(CFG_TWT_CONGESTION_TIMEOUT) \
  212. CFG(CFG_BCAST_TWT_REQ_RESP) \
  213. CFG(CFG_ENABLE_TWT_24GHZ) \
  214. CFG(CFG_TWT_ENABLE_IN_11N)
  215. #elif !defined(WLAN_SUPPORT_TWT) && !defined(WLAN_TWT_CONV_SUPPORTED)
  216. #define CFG_TWT_ALL
  217. #endif
  218. #endif /* __CFG_TWT_H_ */