cfg_nan.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. /*
  2. * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021 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. #if !defined(__NAN_CFG_H__)
  20. #define __NAN_CFG_H__
  21. /**
  22. *
  23. * DOC: nan_cfg.h
  24. *
  25. * NAN feature INI configuration parameter definitions
  26. */
  27. #include "cfg_define.h"
  28. #include "cfg_converged.h"
  29. #include "qdf_types.h"
  30. /*
  31. * <ini>
  32. * gEnableNanSupport - NAN feature support configuration
  33. * @Min: 0
  34. * @Max: 1
  35. * @Default: 1
  36. *
  37. * When set to 1 NAN feature will be enabled.
  38. *
  39. * Related: None
  40. *
  41. * Supported Feature: NAN
  42. *
  43. * Usage: External
  44. *
  45. * </ini>
  46. */
  47. #define CFG_NAN_ENABLE CFG_INI_BOOL("gEnableNanSupport", \
  48. 1, \
  49. "Enable NAN Support")
  50. /*
  51. * <ini>
  52. * nan_separate_iface_support: Separate iface creation for NAN
  53. * @Min: 0
  54. * @Max: 1
  55. * @Default: 1
  56. *
  57. * Value is 1 when Host HDD supports separate iface creation
  58. * for NAN.
  59. *
  60. * Related: None
  61. *
  62. * Supported Feature: NAN
  63. *
  64. * Usage: External
  65. *
  66. * </ini>
  67. */
  68. #define CFG_NAN_SEPARATE_IFACE_SUPP CFG_INI_BOOL("nan_separate_iface_support", \
  69. 1, \
  70. "Seperate iface for NAN")
  71. /*
  72. * <ini>
  73. * genable_nan_datapath - Enable NaN data path feature. NaN data path
  74. * enables NAN supported devices to exchange
  75. * data over TCP/UDP network stack.
  76. * @Min: 0
  77. * @Max: 1
  78. * @Default: 1
  79. *
  80. * When set to 1 NAN Datapath feature will be enabled.
  81. *
  82. * Related: gEnableNanSupport
  83. *
  84. * Supported Feature: NAN
  85. *
  86. * Usage: External
  87. *
  88. * </ini>
  89. */
  90. #define CFG_NAN_DATAPATH_ENABLE CFG_INI_BOOL("genable_nan_datapath", \
  91. 1, \
  92. "Enable NAN Datapath support")
  93. /*
  94. * <ini>
  95. * gEnableNDIMacRandomization - When enabled this will randomize NDI Mac
  96. * @Min: 0
  97. * @Max: 1
  98. * @Default: 1
  99. *
  100. * When enabled this will randomize NDI Mac
  101. *
  102. * Related: gEnableNanSupport
  103. *
  104. * Supported Feature: NAN
  105. *
  106. * Usage: External
  107. *
  108. * </ini>
  109. */
  110. #define CFG_NAN_RANDOMIZE_NDI_MAC CFG_INI_BOOL("gEnableNDIMacRandomization", \
  111. 1, \
  112. "Enable NAN MAC Randomization")
  113. /*
  114. * <ini>
  115. * ndp_inactivity_timeout - To configure duration of how many seconds
  116. * without TX/RX data traffic, NDI vdev can kickout the connected
  117. * peer(i.e. NDP Termination).
  118. *
  119. * @Min: 0
  120. * @Max: 1800
  121. * @Default: 60
  122. *
  123. * Related: None
  124. *
  125. * Supported Feature: NAN
  126. *
  127. * Usage: External
  128. *
  129. * </ini>
  130. */
  131. #define CFG_NAN_NDP_INACTIVITY_TIMEOUT CFG_INI_UINT("ndp_inactivity_timeout", \
  132. 0, \
  133. 1800, \
  134. 60, \
  135. CFG_VALUE_OR_DEFAULT, \
  136. "NDP Auto Terminate time")
  137. /*
  138. * <ini>
  139. * gNdpKeepAlivePeriod - To configure duration of how many seconds
  140. * to wait to kickout peer if peer is not reachable.
  141. *
  142. * @Min: 10
  143. * @Max: 30
  144. * @Default: 14
  145. *
  146. * Related: None
  147. *
  148. * Supported Feature: NAN
  149. *
  150. * Usage: External
  151. *
  152. * </ini>
  153. */
  154. #define CFG_NDP_KEEP_ALIVE_PERIOD CFG_INI_UINT( \
  155. "gNdpKeepAlivePeriod", \
  156. 10, \
  157. 30, \
  158. 14, \
  159. CFG_VALUE_OR_DEFAULT, \
  160. "Keep alive timeout of a peer")
  161. /* MAX NDP sessions supported */
  162. #define MAX_NDP_SESSIONS 8
  163. /*
  164. * <ini>
  165. * ndp_max_sessions - To configure max ndp sessions
  166. * supported by host.
  167. *
  168. * @Min: 1
  169. * @Max: 8
  170. * @Default: 8
  171. *
  172. * Related: None
  173. *
  174. * Supported Feature: NAN
  175. *
  176. * Usage: Internal
  177. *
  178. * </ini>
  179. */
  180. #define CFG_NDP_MAX_SESSIONS CFG_INI_UINT( \
  181. "ndp_max_sessions", \
  182. 1, \
  183. MAX_NDP_SESSIONS, \
  184. 8, \
  185. CFG_VALUE_OR_DEFAULT, \
  186. "max ndp sessions host supports")
  187. /*
  188. * <ini>
  189. * gSupportMp0Discovery - To support discovery of NAN cluster with
  190. * Master Preference (MP) as 0 when a new device is enabling NAN.
  191. *
  192. * @Min: 0
  193. * @Max: 1
  194. * @Default: 0
  195. *
  196. * Related: None
  197. *
  198. * Supported Feature: NAN
  199. *
  200. * Usage: External
  201. *
  202. * </ini>
  203. */
  204. #define CFG_SUPPORT_MP0_DISCOVERY CFG_INI_BOOL( \
  205. "gSupportMp0Discovery", \
  206. 1, \
  207. "Enable/Disable discovery of NAN cluster with Master Preference (MP) as 0")
  208. /*
  209. * <ini>
  210. * ndi_max_support - To configure max number of ndi host supports
  211. *
  212. * @Min: 1
  213. * @Max: 2
  214. * @Default: 1
  215. *
  216. * Related: None
  217. *
  218. * Supported Feature: NAN
  219. *
  220. * Usage: Internal
  221. *
  222. * </ini>
  223. */
  224. #define CFG_NDI_MAX_SUPPORT CFG_INI_UINT( \
  225. "ndi_max_support", \
  226. 1, \
  227. 2, \
  228. 1, \
  229. CFG_VALUE_OR_DEFAULT, \
  230. "Max number of NDI host supports")
  231. /*
  232. * <ini>
  233. * nan_feature_config - Bitmap to enable/disable a particular NAN/NDP feature
  234. *
  235. * @Min: 0
  236. * @Max: 0xFFFF
  237. * @Default: 0
  238. *
  239. * This parameter helps to enable/disable a particular feature config by setting
  240. * corresponding bit and send to firmware through the VDEV param
  241. * WMI_VDEV_PARAM_ENABLE_DISABLE_NAN_CONFIG_FEATURES
  242. * Acceptable values for this:
  243. * BIT(0): Allow DW configuration from framework in sync role.
  244. * If this is not set, firmware shall follow the spec/default behavior.
  245. * BIT(1) to BIT(31): Reserved
  246. *
  247. * Related: None
  248. *
  249. * Supported Feature: NAN
  250. *
  251. * Usage: External
  252. *
  253. * </ini>
  254. */
  255. #define CFG_NAN_FEATURE_CONFIG CFG_INI_UINT( \
  256. "nan_feature_config", \
  257. 0, \
  258. 0xFFFF, \
  259. 0, \
  260. CFG_VALUE_OR_DEFAULT, \
  261. "Enable the specified NAN features in firmware")
  262. /*
  263. * <ini>
  264. * disable_6g_nan - Disable NAN feature support in 6GHz
  265. * @Min: 0
  266. * @Max: 1
  267. * @Default: 0
  268. *
  269. * When set to 1 NAN feature will be disabled in 6GHz.
  270. *
  271. * Related: None
  272. *
  273. * Supported Feature: NAN
  274. *
  275. * Usage: External
  276. *
  277. * </ini>
  278. */
  279. #define CFG_DISABLE_6G_NAN CFG_INI_BOOL("disable_6g_nan", \
  280. 0, \
  281. "Disable NAN Support in 6GHz")
  282. #ifdef WLAN_FEATURE_NAN
  283. #define CFG_NAN_DISC CFG(CFG_NAN_ENABLE) \
  284. CFG(CFG_DISABLE_6G_NAN) \
  285. CFG(CFG_NDP_KEEP_ALIVE_PERIOD) \
  286. CFG(CFG_SUPPORT_MP0_DISCOVERY)
  287. #define CFG_NAN_DP CFG(CFG_NAN_DATAPATH_ENABLE) \
  288. CFG(CFG_NAN_RANDOMIZE_NDI_MAC) \
  289. CFG(CFG_NAN_NDP_INACTIVITY_TIMEOUT) \
  290. CFG(CFG_NAN_SEPARATE_IFACE_SUPP)
  291. #else
  292. #define CFG_NAN_DISC
  293. #define CFG_NAN_DP
  294. #endif
  295. #define CFG_NAN_ALL CFG_NAN_DISC \
  296. CFG_NAN_DP \
  297. CFG(CFG_NDP_MAX_SESSIONS) \
  298. CFG(CFG_NDI_MAX_SUPPORT) \
  299. CFG(CFG_NAN_FEATURE_CONFIG)
  300. #endif