cfg_mlme_btm.h 8.1 KB

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