cfg_nan.h 7.0 KB

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