cfg_nan.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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: 0
  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. 0, \
  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: 0
  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. 0, \
  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: 20
  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. 20, \
  158. CFG_VALUE_OR_DEFAULT, \
  159. "Keep alive timeout of a peer")
  160. /*
  161. * <ini>
  162. * gSupportMp0Discovery - To support discovery of NAN cluster with
  163. * Master Preference (MP) as 0 when a new device is enabling NAN.
  164. *
  165. * @Min: 0
  166. * @Max: 1
  167. * @Default: 0
  168. *
  169. * Related: None
  170. *
  171. * Supported Feature: NAN
  172. *
  173. * Usage: External
  174. *
  175. * </ini>
  176. */
  177. #define CFG_SUPPORT_MP0_DISCOVERY CFG_INI_BOOL( \
  178. "gSupportMp0Discovery", \
  179. 1, \
  180. "Enable/Disable discovery of NAN cluster with Master Preference (MP) as 0")
  181. #ifdef WLAN_FEATURE_NAN
  182. #define CFG_NAN_DISC CFG(CFG_NAN_ENABLE) \
  183. CFG(CFG_NDP_KEEP_ALIVE_PERIOD) \
  184. CFG(CFG_SUPPORT_MP0_DISCOVERY)
  185. #define CFG_NAN_DP CFG(CFG_NAN_DATAPATH_ENABLE) \
  186. CFG(CFG_NAN_RANDOMIZE_NDI_MAC) \
  187. CFG(CFG_NAN_NDP_INACTIVITY_TIMEOUT) \
  188. CFG(CFG_NAN_SEPARATE_IFACE_SUPP)
  189. #else
  190. #define CFG_NAN_DISC
  191. #define CFG_NAN_DP
  192. #endif
  193. #define CFG_NAN_ALL CFG_NAN_DISC \
  194. CFG_NAN_DP
  195. #endif