cfg_twt.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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: 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: false
  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. false, \
  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. * rtwt_req_resp_config - To enable restricted twt requestor and responder.
  161. * @Min: 0 Disable the extended twt capability
  162. * @Max: 3
  163. * @Default: 0
  164. *
  165. * This cfg is used to configure the restricted TWT requestor and responder.
  166. * Bitmap for enabling the restricted twt requestor and responder.
  167. * BIT 0: Enable/Disable restricted twt requestor.
  168. * BIT 1: Enable/Disable restricted twt responder.
  169. * BIT 2-31: Reserved
  170. *
  171. * Related: CFG_ENABLE_TWT
  172. * Related: CFG_TWT_RESPONDER
  173. * Related: CFG_TWT_REQUESTOR
  174. *
  175. * Supported Feature: 11AX
  176. *
  177. * Usage: External
  178. *
  179. * </ini>
  180. */
  181. /* defines to extract the requestor/responder capabilities from cfg */
  182. #define RTWT_REQ_INDEX 0
  183. #define RTWT_REQ_BITS 1
  184. #define RTWT_RES_INDEX 1
  185. #define RTWT_RES_BITS 1
  186. #define CFG_RTWT_REQ_RESP CFG_INI_UINT( \
  187. "rtwt_req_resp_config", \
  188. 0, \
  189. 3, \
  190. 0, \
  191. CFG_VALUE_OR_DEFAULT, \
  192. "RESTRICTED TWT CAPABILITY")
  193. #define CFG_GET_RTWT_REQ(_rtwt_conf) \
  194. QDF_GET_BITS(_rtwt_conf, \
  195. RTWT_REQ_INDEX, \
  196. RTWT_REQ_BITS)
  197. #define CFG_GET_RTWT_RES(_rtwt_conf) \
  198. QDF_GET_BITS(_rtwt_conf, \
  199. RTWT_RES_INDEX, \
  200. RTWT_RES_BITS)
  201. /*
  202. * <ini>
  203. * enable_twt_24ghz - Enable Target wake time when STA is connected on 2.4Ghz
  204. * band.
  205. * @Min: 0
  206. * @Max: 1
  207. * @Default: 1
  208. *
  209. * This ini is used to enable/disable the host TWT when STA is connected to AP
  210. * in 2.4Ghz band.
  211. *
  212. * Related: NA
  213. *
  214. * Supported Feature: 11AX
  215. *
  216. * Usage: External
  217. *
  218. * </ini>
  219. */
  220. #define CFG_ENABLE_TWT_24GHZ CFG_INI_BOOL( \
  221. "enable_twt_24ghz", \
  222. true, \
  223. "enable twt in 2.4Ghz band")
  224. /*
  225. * <ini>
  226. * twt_disable_info - Enable/Disable TWT info frame.
  227. * @Min: 0
  228. * @Max: 1
  229. * @Default: 0
  230. *
  231. * This ini is used to enable/disable TWT Info frame
  232. *
  233. * Related: NA
  234. *
  235. * Supported Feature: 11AX
  236. *
  237. * Usage: External
  238. *
  239. * </ini>
  240. */
  241. #define CFG_DISABLE_TWT_INFO_FRAME CFG_INI_BOOL( \
  242. "twt_disable_info", \
  243. false, \
  244. "disable twt info frame")
  245. #define CFG_HE_FLEX_TWT_SCHED CFG_BOOL( \
  246. "he_flex_twt_sched", \
  247. 0, \
  248. "HE Flex Twt Sched")
  249. /*
  250. * <ini>
  251. * enable_twt_in_11n - Enable TWT support in 11n mode
  252. * @MIN: 0
  253. * @MAX: 1
  254. * @Default: 0
  255. *
  256. * This ini is used to enable/disable TWT support 11n mode.
  257. * Generally by default TWT support present from HE capable
  258. * devices but if this ini is enabled then it will support
  259. * partially from 11n mode itself.
  260. *
  261. * Related: NA
  262. *
  263. * Usage: External
  264. *
  265. * </ini>
  266. */
  267. #define CFG_TWT_ENABLE_IN_11N CFG_INI_BOOL( \
  268. "enable_twt_in_11n", \
  269. false, \
  270. "enable twt support in 11n mode")
  271. #define CFG_TWT_ALL \
  272. CFG(CFG_ENABLE_TWT) \
  273. CFG(CFG_TWT_REQUESTOR) \
  274. CFG(CFG_TWT_RESPONDER) \
  275. CFG(CFG_TWT_CONGESTION_TIMEOUT) \
  276. CFG(CFG_BCAST_TWT_REQ_RESP) \
  277. CFG(CFG_ENABLE_TWT_24GHZ) \
  278. CFG(CFG_DISABLE_TWT_INFO_FRAME) \
  279. CFG(CFG_TWT_ENABLE_IN_11N) \
  280. CFG(CFG_RTWT_REQ_RESP)
  281. #elif !defined(WLAN_SUPPORT_TWT) && !defined(WLAN_TWT_CONV_SUPPORTED)
  282. #define CFG_TWT_ALL
  283. #endif
  284. #endif /* __CFG_TWT_H_ */