cfg_mlme_acs.h 6.1 KB

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