cfg_nan.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. /*
  2. * Copyright (c) 2018-2020 The Linux Foundation. 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. #if !defined(__NAN_CFG_H__)
  19. #define __NAN_CFG_H__
  20. /**
  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. "Seperate 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. /*
  161. * <ini>
  162. * ndp_max_sessions - To configure max ndp sessions
  163. * supported by host.
  164. *
  165. * @Min: 1
  166. * @Max: 8
  167. * @Default: 8
  168. *
  169. * Related: None
  170. *
  171. * Supported Feature: NAN
  172. *
  173. * Usage: Internal
  174. *
  175. * </ini>
  176. */
  177. #define CFG_NDP_MAX_SESSIONS CFG_INI_UINT( \
  178. "ndp_max_sessions", \
  179. 1, \
  180. 8, \
  181. 8, \
  182. CFG_VALUE_OR_DEFAULT, \
  183. "max ndp sessions host supports")
  184. /*
  185. * <ini>
  186. * gSupportMp0Discovery - To support discovery of NAN cluster with
  187. * Master Preference (MP) as 0 when a new device is enabling NAN.
  188. *
  189. * @Min: 0
  190. * @Max: 1
  191. * @Default: 0
  192. *
  193. * Related: None
  194. *
  195. * Supported Feature: NAN
  196. *
  197. * Usage: External
  198. *
  199. * </ini>
  200. */
  201. #define CFG_SUPPORT_MP0_DISCOVERY CFG_INI_BOOL( \
  202. "gSupportMp0Discovery", \
  203. 1, \
  204. "Enable/Disable discovery of NAN cluster with Master Preference (MP) as 0")
  205. /*
  206. * <ini>
  207. * ndi_max_support - To configure max number of ndi host supports
  208. *
  209. * @Min: 1
  210. * @Max: 2
  211. * @Default: 1
  212. *
  213. * Related: None
  214. *
  215. * Supported Feature: NAN
  216. *
  217. * Usage: Internal
  218. *
  219. * </ini>
  220. */
  221. #define CFG_NDI_MAX_SUPPORT CFG_INI_UINT( \
  222. "ndi_max_support", \
  223. 1, \
  224. 2, \
  225. 1, \
  226. CFG_VALUE_OR_DEFAULT, \
  227. "Max number of NDI host supports")
  228. /*
  229. * <ini>
  230. * nan_feature_config - Bitmap to enable/disable a particular NAN/NDP feature
  231. *
  232. * @Min: 0
  233. * @Max: 0xFFFF
  234. * @Default: 0
  235. *
  236. * This parameter helps to enable/disable a particular feature config by setting
  237. * corresponding bit and send to firmware through the VDEV param
  238. * WMI_VDEV_PARAM_ENABLE_DISABLE_NAN_CONFIG_FEATURES
  239. * Acceptable values for this:
  240. * BIT(0): Allow DW configuration from framework in sync role.
  241. * If this is not set, firmware shall follow the spec/default behavior.
  242. * BIT(1) to BIT(31): Reserved
  243. *
  244. * Related: None
  245. *
  246. * Supported Feature: NAN
  247. *
  248. * Usage: External
  249. *
  250. * </ini>
  251. */
  252. #define CFG_NAN_FEATURE_CONFIG CFG_INI_UINT( \
  253. "nan_feature_config", \
  254. 0, \
  255. 0xFFFF, \
  256. 0, \
  257. CFG_VALUE_OR_DEFAULT, \
  258. "Enable the specified NAN features in firmware")
  259. #ifdef WLAN_FEATURE_NAN
  260. #define CFG_NAN_DISC CFG(CFG_NAN_ENABLE) \
  261. CFG(CFG_NDP_KEEP_ALIVE_PERIOD) \
  262. CFG(CFG_SUPPORT_MP0_DISCOVERY)
  263. #define CFG_NAN_DP CFG(CFG_NAN_DATAPATH_ENABLE) \
  264. CFG(CFG_NAN_RANDOMIZE_NDI_MAC) \
  265. CFG(CFG_NAN_NDP_INACTIVITY_TIMEOUT) \
  266. CFG(CFG_NAN_SEPARATE_IFACE_SUPP)
  267. #else
  268. #define CFG_NAN_DISC
  269. #define CFG_NAN_DP
  270. #endif
  271. #define CFG_NAN_ALL CFG_NAN_DISC \
  272. CFG_NAN_DP \
  273. CFG(CFG_NDP_MAX_SESSIONS) \
  274. CFG(CFG_NDI_MAX_SUPPORT) \
  275. CFG(CFG_NAN_FEATURE_CONFIG)
  276. #endif