cfg_dcs.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. /*
  2. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /**
  17. * DOC: This file contains centralized definitions of DCS component
  18. */
  19. #ifndef __CONFIG_DCS_H
  20. #define __CONFIG_DCS_H
  21. #include "cfg_define.h"
  22. /*
  23. * <ini>
  24. * gEnableDcs - Enable/Disable DCS
  25. * @Min: 0
  26. * @Max: 3
  27. * @Default: 0
  28. *
  29. * This ini is used to enable/disable DCS. Configurations are as follows:
  30. * 0 - Disable DCS.
  31. * 1 - Enable DCS for CW interference mitigation(CW_IM).
  32. * 2 - Enable DCS for WLAN interference mitigation(WLAN_IM).
  33. * 3 - Enable both DCS for CW_IM and DCS for WLAN_IM.
  34. *
  35. * Related: None
  36. *
  37. * Supported Feature: DCS
  38. *
  39. * Usage: External
  40. *
  41. * </ini>
  42. */
  43. #define CFG_DCS_ENABLE CFG_INI_UINT(\
  44. "gEnableDcs",\
  45. 0, 3, 0,\
  46. CFG_VALUE_OR_DEFAULT, "Enable DCS")
  47. /*
  48. * <ini>
  49. * dcs_debug - Configure dcs debug trace level for debug purpose
  50. * @Min: 0
  51. * @Max: 2
  52. * @Default: 0
  53. *
  54. * This ini is used to configure dcs debug trace level for debug purpose
  55. *
  56. *
  57. * Related: None
  58. *
  59. * Usage: External
  60. *
  61. * </ini>
  62. */
  63. #define CFG_DCS_DEBUG CFG_INI_UINT(\
  64. "dcs_debug",\
  65. 0, 2, 0,\
  66. CFG_VALUE_OR_DEFAULT,\
  67. "dcs debug trace level")
  68. /*
  69. * <ini>
  70. * dcs_coch_intfr_threshold - Configure co-channel interference threshold
  71. * @Min: 0
  72. * @Max: 0xFFFFFFFF
  73. * @Default: 30
  74. *
  75. * This ini is used to configure co-channel interference threshold
  76. *
  77. *
  78. * Related: None
  79. *
  80. * Usage: External
  81. *
  82. * </ini>
  83. */
  84. #define CFG_DCS_COCH_INTFR_THRESHOLD CFG_INI_UINT(\
  85. "dcs_coch_intfr_threshold",\
  86. 0, 0xFFFFFFFF, 30,\
  87. CFG_VALUE_OR_DEFAULT,\
  88. "dcs co-channel interference threshold level")
  89. /*
  90. * <ini>
  91. * dcs_tx_err_threshold - Configure transmission failure rate threshold
  92. * @Min: 0
  93. * @Max: 0xFFFFFFFF
  94. * @Default: 30
  95. *
  96. * This ini is used to configure transmission failure rate threshold
  97. *
  98. *
  99. * Related: None
  100. *
  101. * Usage: External
  102. *
  103. * </ini>
  104. */
  105. #define CFG_DCS_TX_ERR_THRESHOLD CFG_INI_UINT(\
  106. "dcs_tx_err_threshold",\
  107. 0, 0xFFFFFFFF, 30,\
  108. CFG_VALUE_OR_DEFAULT,\
  109. "dcs transmission failure rate threshold")
  110. /*
  111. * <ini>
  112. * dcs_phy_err_penalty - Configure channel time wasted due to each Phy
  113. * error(phy error penalty)
  114. * @Min: 0
  115. * @Max: 0xFFFFFFFF
  116. * @Default: 500
  117. *
  118. * This ini is used to configure phy error penalty
  119. *
  120. *
  121. * Related: None
  122. *
  123. * Usage: External
  124. *
  125. * </ini>
  126. */
  127. #define CFG_DCS_PHY_ERR_PENALTY CFG_INI_UINT(\
  128. "dcs_phy_err_penalty",\
  129. 0, 0xFFFFFFFF, 500,\
  130. CFG_VALUE_OR_DEFAULT,\
  131. "dcs phy error penalty")
  132. /*
  133. * <ini>
  134. * dcs_phy_err_threshold - Configure phy err threshold
  135. * @Min: 0
  136. * @Max: 0xFFFFFFFF
  137. * @Default: 300
  138. *
  139. * This ini is used to configure phy error threshold
  140. *
  141. *
  142. * Related: None
  143. *
  144. * Usage: External
  145. *
  146. * </ini>
  147. */
  148. #define CFG_DCS_PHY_ERR_THRESHOLD CFG_INI_UINT(\
  149. "dcs_phy_err_threshold",\
  150. 0, 0xFFFFFFFF, 300,\
  151. CFG_VALUE_OR_DEFAULT,\
  152. "dcs phy error threshold")
  153. /*
  154. * <ini>
  155. * dcs_user_max_cu - Configure tx channel utilization due to AP's tx and rx
  156. * @Min: 0
  157. * @Max: 0xFFFFFFFF
  158. * @Default: 50
  159. *
  160. * This ini is used to configure tx channel utilization due to AP's tx and rx
  161. *
  162. *
  163. * Related: None
  164. *
  165. * Usage: External
  166. *
  167. * </ini>
  168. */
  169. #define CFG_DCS_USER_MAX_CU CFG_INI_UINT(\
  170. "user_max_cu",\
  171. 0, 0xFFFFFFFF, 50,\
  172. CFG_VALUE_OR_DEFAULT,\
  173. "dcs tx channel utilization")
  174. /*
  175. * <ini>
  176. * dcs_radar_err_threshold - Configure radar error threshold
  177. * @Min: 0
  178. * @Max: 0xFFFFFFFF
  179. * @Default: 1000
  180. *
  181. * This ini is used to configure radar error threshold
  182. *
  183. *
  184. * Related: None
  185. *
  186. * Usage: External
  187. *
  188. * </ini>
  189. */
  190. #define CFG_DCS_RADAR_ERR_THRESHOLD CFG_INI_UINT(\
  191. "dcs_radar_err_threshold",\
  192. 0, 0xFFFFFFFF, 1000,\
  193. CFG_VALUE_OR_DEFAULT,\
  194. "dcs radar error threshold")
  195. /*
  196. * <ini>
  197. * dcs_intfr_detection_threshold - Configure interference detection threshold
  198. * @Min: 0
  199. * @Max: 0xFFFFFFFF
  200. * @Default: 6
  201. *
  202. * This ini is used to configure interference detection threshold
  203. *
  204. *
  205. * Related: None
  206. *
  207. * Usage: External
  208. *
  209. * </ini>
  210. */
  211. #define CFG_DCS_INTFR_DETECTION_THRESHOLD CFG_INI_UINT(\
  212. "dcs_intfr_detection_threshold",\
  213. 0, 0xFFFFFFFF, 6,\
  214. CFG_VALUE_OR_DEFAULT,\
  215. "dcs interference detection threshold")
  216. /*
  217. * <ini>
  218. * dcs_intfr_detection_window - Configure interference sampling window
  219. * @Min: 0
  220. * @Max: 0xFFFFFFFF
  221. * @Default: 10
  222. *
  223. * This ini is used to configure interference sampling window
  224. *
  225. *
  226. * Related: None
  227. *
  228. * Usage: External
  229. *
  230. * </ini>
  231. */
  232. #define CFG_DCS_INTFR_DETECTION_WINDOW CFG_INI_UINT(\
  233. "dcs_intfr_detection_window",\
  234. 0, 0xFFFFFFFF, 10,\
  235. CFG_VALUE_OR_DEFAULT,\
  236. "dcs interference sampling window")
  237. /*
  238. * <ini>
  239. * dcs_disable_threshold_per_5mins - In five minutes, if dcs happen
  240. * more than threshold, then disable dcs for some time
  241. * @Min: 0
  242. * @Max: 10
  243. * @Default: 3
  244. *
  245. * This ini is used to dcs happen times threshold in five minutes
  246. *
  247. *
  248. * Related: None
  249. *
  250. * Usage: External
  251. *
  252. * </ini>
  253. */
  254. #define CFG_DCS_DISABLE_THRESHOLD_PER_5MINS CFG_INI_UINT(\
  255. "dcs_disable_thresh_per_5mins",\
  256. 0, 10, 3,\
  257. CFG_VALUE_OR_DEFAULT,\
  258. "dcs happen times threshold in five minutes")
  259. /*
  260. * <ini>
  261. * dcs_restart_delay - When dcs happen more than threshold in five minutes,
  262. * then start to disable dcs for some minutes, then enable dcs again.
  263. * @Min: 0
  264. * @Max: 0xFFFFFFFF
  265. * @Default: 30
  266. *
  267. * This ini is used to configure dcs disable time length in minute unit
  268. *
  269. *
  270. * Related: None
  271. *
  272. * Usage: External
  273. *
  274. * </ini>
  275. */
  276. #define CFG_DCS_RESTART_DELAY CFG_INI_UINT(\
  277. "dcs_restart_delay",\
  278. 0, 0xFFFFFFFF, 30,\
  279. CFG_VALUE_OR_DEFAULT, "dcs restart delay")
  280. /*
  281. * <ini>
  282. * dcs_disable_algorithm - Some feature like SON only need dcs stats,
  283. * then disable dcs algorithm for SON.
  284. * @Min: 0
  285. * @Max: 1
  286. * @Default: 0
  287. *
  288. * This ini is used to disable dcs algorithm
  289. *
  290. *
  291. * Related: None
  292. *
  293. * Usage: External
  294. *
  295. * </ini>
  296. */
  297. #define CFG_DCS_DISABLE_ALGORITHM CFG_INI_BOOL(\
  298. "dcs_disable_algorithm", false,\
  299. "dcs disable algorithm")
  300. #define CFG_DCS_ALL \
  301. CFG(CFG_DCS_ENABLE) \
  302. CFG(CFG_DCS_DEBUG) \
  303. CFG(CFG_DCS_COCH_INTFR_THRESHOLD) \
  304. CFG(CFG_DCS_TX_ERR_THRESHOLD) \
  305. CFG(CFG_DCS_PHY_ERR_PENALTY) \
  306. CFG(CFG_DCS_PHY_ERR_THRESHOLD) \
  307. CFG(CFG_DCS_USER_MAX_CU) \
  308. CFG(CFG_DCS_RADAR_ERR_THRESHOLD) \
  309. CFG(CFG_DCS_INTFR_DETECTION_THRESHOLD) \
  310. CFG(CFG_DCS_INTFR_DETECTION_WINDOW) \
  311. CFG(CFG_DCS_DISABLE_THRESHOLD_PER_5MINS) \
  312. CFG(CFG_DCS_RESTART_DELAY) \
  313. CFG(CFG_DCS_DISABLE_ALGORITHM)
  314. #endif /* __CONFIG_DCS_H */