cfg_mlme_btm.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. /*
  2. * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022 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 MLME BTM related CFG/INI Items.
  21. */
  22. #ifndef CFG_MLME_BTM_H_
  23. #define CFG_MLME_BTM_H_
  24. /*
  25. * <ini>
  26. * prefer_btm_query - Prefer btm query over 11k neighbor report
  27. * @Min: 0
  28. * @Max: 1
  29. * @Default: 1
  30. *
  31. * This ini is used to enable the STA to send BTM query instead of
  32. * 11k neighbor report.
  33. *
  34. * Supported Feature: STA
  35. *
  36. * Usage: External
  37. *
  38. * </ini>
  39. */
  40. #define CFG_PREFER_BTM_QUERY CFG_INI_BOOL( \
  41. "prefer_btm_query", \
  42. 1, \
  43. "prefer btm query over 11k neighbor report")
  44. /*
  45. * <ini>
  46. * prefer_roam_score_for_candidate_selection - choose to sort the candidates on
  47. * roam score or preferred AP
  48. * @Min: 0
  49. * @Max: 1
  50. * @Default: 1
  51. *
  52. * This ini is used to enable the the firmware to sort the candidates
  53. * based on the roam score rather than selecting APs as per the order
  54. * of the APs sent by the connected AP.
  55. *
  56. * Supported Feature: Roaming
  57. *
  58. * Usage: External
  59. *
  60. * </ini>
  61. */
  62. #define CFG_ENABLE_BTM_ABRIDGE CFG_INI_BOOL( \
  63. "prefer_roam_score_for_candidate_selection", \
  64. 1, \
  65. "sort candidate based on roam score")
  66. /*
  67. * <ini>
  68. * btm_offload_config - Configure BTM
  69. * @Min: 0x00000000
  70. * @Max: 0xFFFFFFFF
  71. * @Default: 0x000001c1
  72. *
  73. * This ini is used to configure BTM
  74. *
  75. * Bit 0: Enable/Disable the BTM offload. Set this to 1 will
  76. * enable and 0 will disable BTM offload.
  77. *
  78. * BIT 2, 1: Action on non matching candidate with cache. If a BTM request
  79. * is received from AP then the candidate AP's may/may-not be present in
  80. * the firmware scan cache . Based on below config firmware will decide
  81. * whether to forward BTM frame to host or consume with firmware and proceed
  82. * with Roaming to candidate AP.
  83. * 00 scan and consume
  84. * 01 no scan and forward to host
  85. * 10, 11 reserved
  86. *
  87. * BIT 5, 4, 3: Roaming handoff decisions on multiple candidates match
  88. * for unsolicited BTM request.
  89. * 000 match if exact BSSIDs are found
  90. * 001 match if at least one top priority BSSID only
  91. * 010, 011, 100, 101, 110, 111 reserved
  92. * In case of solicited request intersection of Roam cache/candidates
  93. * with candidates in BTM request is taken into consideration.
  94. *
  95. * BIT 6: Set this to 1 will send BTM query frame and 0 not sent.
  96. *
  97. * BIT 7: Roam BTM candidates based on the roam score instead of BTM preferred
  98. * value
  99. *
  100. * BIT 8: BTM query preference over 11k neighbor report request
  101. *
  102. * BIT 9: BTM query with candidate list
  103. *
  104. * BIT 10: When this bit is set, Firmware will forward BTM Request Frame to
  105. * driver when the frame contains MBO assoc retry attribute. Driver will send
  106. * this frame to supplicant and supplicant will use the frame info for
  107. * denylisting the AP so for the next connection framework will avoid this AP.
  108. *
  109. * BIT 11-31: Reserved
  110. *
  111. * Supported Feature: STA
  112. *
  113. * Usage: External
  114. *
  115. * </ini>
  116. */
  117. #define CFG_BTM_ENABLE CFG_INI_UINT( \
  118. "btm_offload_config", \
  119. 0x00000000, \
  120. 0xffffffff, \
  121. 0x000001c1, \
  122. CFG_VALUE_OR_DEFAULT, \
  123. "configure btm offload")
  124. /*
  125. * <ini>
  126. * btm_solicited_timeout - timeout value for waiting BTM request
  127. * @Min: 1
  128. * @Max: 10000
  129. * @Default: 100
  130. *
  131. * This ini is used to configure timeout value for waiting BTM request.
  132. * Unit: millionsecond
  133. *
  134. * Supported Feature: STA
  135. *
  136. * Usage: External
  137. *
  138. * </ini>
  139. */
  140. #define CFG_BTM_SOLICITED_TIMEOUT CFG_INI_UINT( \
  141. "btm_solicited_timeout", \
  142. 1, \
  143. 10000, \
  144. 100, \
  145. CFG_VALUE_OR_DEFAULT, \
  146. "configure timeout value for waiting BTM request")
  147. /*
  148. * <ini>
  149. * btm_max_attempt_cnt - Maximum attempt for sending BTM query to ESS
  150. * @Min: 1
  151. * @Max: 0xFFFFFFFF
  152. * @Default: 3
  153. *
  154. * This ini is used to configure maximum attempt for sending BTM query to ESS.
  155. *
  156. * Supported Feature: STA
  157. *
  158. * Usage: External
  159. *
  160. * </ini>
  161. */
  162. #define CFG_BTM_MAX_ATTEMPT_CNT CFG_INI_UINT( \
  163. "btm_max_attempt_cnt", \
  164. 1, \
  165. 0xFFFFFFFF, \
  166. 3, \
  167. CFG_VALUE_OR_DEFAULT, \
  168. "configure maximum attempt for sending BTM query to ESS")
  169. /*
  170. * <ini>
  171. * btm_sticky_time - Stick time after roaming to new AP by BTM
  172. * @Min: 0
  173. * @Max: 0x0000FFFF
  174. * @Default: 0
  175. *
  176. * This ini is used to configure Stick time after roaming to new AP by BTM.
  177. * Unit: seconds
  178. *
  179. * Supported Feature: STA
  180. *
  181. * Usage: External
  182. *
  183. * </ini>
  184. */
  185. #define CFG_BTM_STICKY_TIME CFG_INI_UINT( \
  186. "btm_sticky_time", \
  187. 0, \
  188. 0x0000FFFF, \
  189. 0, \
  190. CFG_VALUE_OR_DEFAULT, \
  191. "configure Stick time after roaming to new AP by BTM")
  192. /*
  193. * <ini>
  194. * roam_candidate_validity_timer - roam cache entries validity timer
  195. * @Min: 0
  196. * @Max: 0xffffffff
  197. * @Default: 0xffffffff
  198. *
  199. * This value is the timeout values for the cached roam candidate
  200. * entries in firmware. If this value is 0, then that entry is not
  201. * valid
  202. *
  203. * Supported Feature: Roaming
  204. *
  205. * Usage: External
  206. *
  207. * </ini>
  208. */
  209. #define CFG_BTM_VALIDITY_TIMER CFG_INI_UINT( \
  210. "roam_candidate_validity_timer", \
  211. 0, \
  212. 0xffffffff, \
  213. 0xffffffff, \
  214. CFG_VALUE_OR_DEFAULT, \
  215. "BTM validity timer")
  216. /*
  217. * <ini>
  218. * btm_disassoc_timer_threshold - Disassociation timer threshold to wait
  219. * after which the full scan for roaming can be started after the AP has sent
  220. * the disassoc imminent
  221. * @Min: 0
  222. * @Max: 0xffffffff
  223. * @Default: 10000
  224. *
  225. * When AP sends, BTM request with disassoc imminent bit set, the STA should
  226. * roam to a new AP within the disassc timeout provided by the ap. If the Roam
  227. * scan period is less than the disassoc timeout value, then instead of
  228. * triggering the roam scan immediately, STA can wait for this
  229. * btm_disassoc_timer_threshold and then start roaming.
  230. *
  231. * Supported Feature: Roaming
  232. *
  233. * Usage: External
  234. *
  235. * </ini>
  236. */
  237. #define CFG_BTM_DISASSOC_TIMER_THRESHOLD CFG_INI_UINT( \
  238. "btm_disassoc_timer_threshold", \
  239. 0, \
  240. 0xffffffff, \
  241. 10000, \
  242. CFG_VALUE_OR_DEFAULT, \
  243. "BTM disassociation timer threshold")
  244. /*
  245. * <ini>
  246. * btm_query_bitmask - To send BTM query with candidate list on various roam
  247. * scans reasons
  248. * @Min: 0
  249. * @Max: 0xFFFFFFFF
  250. * @Default: 0x8
  251. *
  252. * This new ini is introduced to configure the bitmask for various roam scan
  253. * reasons. Fw sends "BTM query with preferred candidate list" only for those
  254. * roam scans which are enable through this bitmask.
  255. * For Example:
  256. * Bitmask : 0x8 (LOW_RSSI) refer enum WMI_ROAM_TRIGGER_REASON_ID
  257. * Bitmask : 0xDA (PER, LOW_RSSI, HIGH_RSSI, MAWC, DENSE)
  258. * refer enum WMI_ROAM_TRIGGER_REASON_ID
  259. *
  260. * Related: None
  261. *
  262. * Supported Feature: Roaming
  263. *
  264. * Usage: External
  265. *
  266. * </ini>
  267. */
  268. #define CFG_BTM_QUERY_BITMASK CFG_INI_UINT( \
  269. "btm_query_bitmask", \
  270. 0, \
  271. 0xFFFFFFFF, \
  272. 0x8, \
  273. CFG_VALUE_OR_DEFAULT, \
  274. "btm query with candidate list bitmask")
  275. /*
  276. * <ini>
  277. * minimum_btm_candidate_score - Consider the AP as roam candidate only if
  278. * its score is greater than minimum_btm_candidate_score.
  279. * @Min: 0
  280. * @Max: 10000
  281. * @Default: 2600
  282. *
  283. * This ini is applicable only for candidate selection during BTM roam trigger.
  284. * For this roam_score_delta_bitmap bit 10 should be set to 1.
  285. *
  286. * Related: None
  287. *
  288. * Supported Feature: Roaming
  289. *
  290. * Usage: External
  291. *
  292. * </ini>
  293. */
  294. #define CFG_MIN_BTM_CANDIDATE_SCORE CFG_INI_UINT( \
  295. "minimum_btm_candidate_score", \
  296. 0, \
  297. 10000, \
  298. 2600, \
  299. CFG_VALUE_OR_DEFAULT, \
  300. "Minimum BTM candidate score")
  301. #define CFG_BTM_ALL \
  302. CFG(CFG_PREFER_BTM_QUERY) \
  303. CFG(CFG_ENABLE_BTM_ABRIDGE) \
  304. CFG(CFG_BTM_ENABLE) \
  305. CFG(CFG_BTM_SOLICITED_TIMEOUT) \
  306. CFG(CFG_BTM_MAX_ATTEMPT_CNT) \
  307. CFG(CFG_BTM_STICKY_TIME) \
  308. CFG(CFG_BTM_VALIDITY_TIMER) \
  309. CFG(CFG_BTM_DISASSOC_TIMER_THRESHOLD) \
  310. CFG(CFG_BTM_QUERY_BITMASK) \
  311. CFG(CFG_MIN_BTM_CANDIDATE_SCORE)
  312. #endif /* CFG_MLME_BTM_H_ */