cfg_mlme_acs.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. /*
  2. * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022-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. /**
  20. * DOC: This file contains centralized definitions of converged configuration.
  21. */
  22. #ifndef __CFG_MLME_ACS_H
  23. #define __CFG_MLME_ACS_H
  24. /*
  25. * <ini>
  26. * acs_with_more_param- Enable acs calculation with more param.
  27. * @Min: 0
  28. * @Max: 1
  29. * @Default: 1
  30. *
  31. * This ini is used to enable acs calculation with more param.
  32. *
  33. * Related: NA
  34. *
  35. * Supported Feature: ACS
  36. *
  37. * Usage: External
  38. *
  39. * </ini>
  40. */
  41. #define CFG_ACS_WITH_MORE_PARAM CFG_INI_BOOL( \
  42. "acs_with_more_param", \
  43. 1, \
  44. "Enable ACS with more param")
  45. /*
  46. * <ini>
  47. * AutoChannelSelectWeight - ACS channel weight
  48. * @Min: 0
  49. * @Max: 0xFFFFFFFF
  50. * @Default: 0x00fafafa
  51. *
  52. * This ini is used to adjust weight of factors in
  53. * acs algorithm.
  54. *
  55. * Supported Feature: ACS
  56. *
  57. * Usage: External
  58. *
  59. * bits 0-3: rssi weight
  60. * bits 4-7: bss count weight
  61. * bits 8-11: noise floor weight
  62. * bits 12-15: channel free weight
  63. * bits 16-19: tx power range weight
  64. * bits 20-23: tx power throughput weight
  65. * bits 24-31: reserved
  66. *
  67. * </ini>
  68. */
  69. #define CFG_AUTO_CHANNEL_SELECT_WEIGHT CFG_INI_UINT( \
  70. "AutoChannelSelectWeight", \
  71. 0, \
  72. 0xFFFFFFFF, \
  73. 0x00fafafa, \
  74. CFG_VALUE_OR_DEFAULT, \
  75. "Adjust weight factor in ACS")
  76. /*
  77. * <ini>
  78. * gvendor_acs_support - vendor based channel selection manager
  79. * @Min: 0
  80. * @Max: 1
  81. * @Default: 0
  82. *
  83. * Enabling this parameter will force driver to use user application based
  84. * channel selection algo instead of driver based auto channel selection
  85. * logic.
  86. *
  87. * Supported Feature: ACS
  88. *
  89. * Usage: External
  90. *
  91. * </ini>
  92. */
  93. #define CFG_USER_AUTO_CHANNEL_SELECTION CFG_INI_BOOL( \
  94. "gvendor_acs_support", \
  95. 0, \
  96. "Vendor channel selection manager")
  97. /*
  98. * <ini>
  99. * gacs_support_for_dfs_lte_coex - acs support for lte coex and dfs event
  100. * @Min: 0
  101. * @Max: 1
  102. * @Default: 0
  103. *
  104. * Enabling this parameter will force driver to use user application based
  105. * channel selection algo for channel selection in case of dfs and lte
  106. * coex event.
  107. *
  108. * Supported Feature: ACS
  109. *
  110. * Usage: Internal
  111. *
  112. * </ini>
  113. */
  114. #define CFG_USER_ACS_DFS_LTE CFG_INI_BOOL( \
  115. "gacs_support_for_dfs_lte_coex", \
  116. 0, \
  117. "Acs support for lte coex and dfs")
  118. /*
  119. * <ini>
  120. * acs_policy - External ACS policy control
  121. * @Min: 0
  122. * @Max: 1
  123. * @Default: 1
  124. *
  125. * Values are per enum hdd_external_acs_policy.
  126. *
  127. * This ini is used to control the external ACS policy.
  128. *
  129. * 0 -Preferable for ACS to select a
  130. * channel with non-zero pcl weight.
  131. * 1 -Mandatory for ACS to select a
  132. * channel with non-zero pcl weight.
  133. *
  134. * Related: None
  135. *
  136. * Supported Feature: ACS
  137. *
  138. * Usage: External
  139. *
  140. * </ini>
  141. */
  142. #define CFG_EXTERNAL_ACS_POLICY CFG_INI_BOOL( \
  143. "acs_policy", \
  144. 1, \
  145. "External ACS Policy Control")
  146. #define ACS_WEIGHT_MAX_STR_LEN 500
  147. /*
  148. * <ini>
  149. * normalize_acs_weight - Used to control the ACS channel weightage.
  150. *
  151. * This ini is used to specify the weight percentage of the channel. Channel
  152. * weights can be controlled by user to prioritize or de-prioritize channels.
  153. *
  154. * Related: ACS
  155. *
  156. * Supported Feature: ACS
  157. *
  158. * Usage: External
  159. *
  160. * </ini>
  161. */
  162. #define CFG_NORMALIZE_ACS_WEIGHT CFG_INI_STRING( \
  163. "normalize_acs_weight", \
  164. 0, \
  165. ACS_WEIGHT_MAX_STR_LEN, \
  166. "2407-5875=40, 5945-7125=90, 5975=100, 6055=100, 6135=100, 6215=100, 6295=100, 6375=100, 6615=100, 6695=100, 6775=100, 6855=100", \
  167. "Used to specify the channel weights")
  168. /*
  169. * <ini>
  170. * force_start_sap- Enable the SAP even if no channel is suitable for SAP
  171. * @Min: 0
  172. * @Max: 1
  173. * @Default: 0
  174. *
  175. * This ini is used to enable the SAP even if no channel is found suitable
  176. * for SAP by ACS.
  177. *
  178. * Related: NA
  179. *
  180. * Supported Feature: ACS
  181. *
  182. * Usage: Internal
  183. *
  184. * </ini>
  185. */
  186. #define CFG_ACS_FORCE_START_SAP CFG_INI_BOOL( \
  187. "force_start_sap", \
  188. 0, \
  189. "Force start SAP")
  190. /*
  191. * <ini>
  192. * acs_prefer_6ghz_psc - Select 6 GHz PSC channel as priority
  193. * @Min: 0
  194. * @Max: 1
  195. * @Default: 1
  196. *
  197. * This config is used to configure ACS logic to select PSC channel as
  198. * perefered result. "normalize_acs_weight" INI can make the PSC
  199. * channel priority higher than NON PSC, but it is for a single channel's
  200. * weight, for bw 160 or bw 80 combined channel weight, it has less
  201. * help.
  202. *
  203. * Related: None
  204. *
  205. * Supported Feature: ACS
  206. *
  207. * Usage: Internal
  208. *
  209. * </ini>
  210. */
  211. #define CFG_ACS_PREFER_6GHZ_PSC CFG_BOOL( \
  212. "acs_prefer_6ghz_psc", \
  213. 1, \
  214. "Select 6 GHz PSC channel as priority")
  215. /*
  216. * <ini>
  217. * np_chan_weight - chan weightage for non preferred channels
  218. * @Min: 0x00000000
  219. * @Max: 0x64646464
  220. * @Default: 0x00000000
  221. *
  222. * This INI give percentage value of weights to be considered in the ACS algo
  223. * for the non preferred channels. the distribution of the channel type is:-
  224. * Example:- If the percentage of lets say DFS channels is set to 50%, and
  225. * the weight comes out to be x, then we would increase the weight of DFS
  226. * channels by 50% ( 100 - y% set in INI), so that it gets de-prioritized in
  227. * the ACS sorted channel list, the lesser the weight, the better the channel.
  228. * So the channel with more weight is less likely to be selected. So by default
  229. * the np chan weightage for DFS is set to 0, that is it will be assigned max
  230. * weightage, so no probality of getting selected, as for standlaone, DFS is not
  231. * recommended (it takes 60 sec/10min to start depending upon channel type).
  232. *
  233. * Indexes are defined in this way.
  234. * 0 Index (BITS 0-7): DFS - Def 1%
  235. * 1 Index (BITS 8-15): Reserved
  236. * 2 Index (BITS 16-23): Reserved
  237. * 3 Index (BITS 24-31): Reserved
  238. * These percentage values are stored in HEX. Max can be 0x64
  239. * Supported Feature: ACS
  240. *
  241. * Usage: External
  242. *
  243. * </ini>
  244. */
  245. #define CFG_ACS_NP_CHAN_WEIGHT CFG_INI_UINT( \
  246. "np_chan_weight", \
  247. 0x00000000, \
  248. 0x64646464, \
  249. 0x00000001, \
  250. CFG_VALUE_OR_DEFAULT, \
  251. "np chan weight")
  252. #define CFG_ACS_ALL \
  253. CFG(CFG_ACS_WITH_MORE_PARAM) \
  254. CFG(CFG_AUTO_CHANNEL_SELECT_WEIGHT) \
  255. CFG(CFG_USER_AUTO_CHANNEL_SELECTION) \
  256. CFG(CFG_USER_ACS_DFS_LTE) \
  257. CFG(CFG_EXTERNAL_ACS_POLICY) \
  258. CFG(CFG_NORMALIZE_ACS_WEIGHT) \
  259. CFG(CFG_ACS_PREFER_6GHZ_PSC) \
  260. CFG(CFG_ACS_FORCE_START_SAP) \
  261. CFG(CFG_ACS_NP_CHAN_WEIGHT)
  262. #endif /* __CFG_MLME_ACS_H */