wlan_scan_cfg.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. /*
  2. * Copyright (c) 2012-2018 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 SCAN component
  20. */
  21. #ifndef __CONFIG_SCAN_H
  22. #define __CONFIG_SCAN_H
  23. #include "cfg_define.h"
  24. /*
  25. * <ini>
  26. * drop_bcn_on_chan_mismatch - drop the beacon for chan mismatch
  27. * @Min: 0
  28. * @Max: 1
  29. * @Default: 1
  30. *
  31. * This ini is used to decide drop the beacon or not if channel received
  32. * in metadata doesn't match the one in beacon.
  33. *
  34. * Related: None
  35. *
  36. * Usage: External
  37. *
  38. * </ini>
  39. */
  40. #define CFG_DROP_BCN_ON_CHANNEL_MISMATCH CFG_INI_BOOL(\
  41. "drop_bcn_on_chan_mismatch",\
  42. true,\
  43. "drop bcn on channel mismatch")
  44. /*
  45. * <ini>
  46. * gActiveMaxChannelTime - Set max channel time for active scan
  47. * @Min: 0
  48. * @Max: 10000
  49. * @Default: 40
  50. *
  51. * This ini is used to set maximum channel time in msecs spent in
  52. * active scan
  53. *
  54. * Related: None
  55. *
  56. * Usage: External
  57. *
  58. * </ini>
  59. */
  60. #define CFG_ACTIVE_MAX_CHANNEL_TIME CFG_INI_UINT(\
  61. "gActiveMaxChannelTime",\
  62. 0, 10000, MCL_OR_WIN_VALUE(40, 105),\
  63. CFG_VALUE_OR_DEFAULT, "active dwell time")
  64. /*
  65. * <ini>
  66. * active_max_channel_time_2g - Set max time for active 2G channel scan
  67. * @Min: 0
  68. * @Max: 10000
  69. * @Default: 80
  70. *
  71. * This ini is used to set maximum time in msecs spent in active 2G channel scan
  72. * if it's not zero, in case of zero, CFG_ACTIVE_MAX_CHANNEL_TIME is used for 2G
  73. * channels also.
  74. *
  75. * Related: None
  76. *
  77. * Usage: External
  78. *
  79. * </ini>
  80. */
  81. #define CFG_ACTIVE_MAX_2G_CHANNEL_TIME CFG_INI_UINT(\
  82. "active_max_channel_time_2g",\
  83. 0, 10000, MCL_OR_WIN_VALUE(80, 0),\
  84. CFG_VALUE_OR_DEFAULT, "active dwell time for 2G channels")
  85. /*
  86. * <ini>
  87. * gPassiveMaxChannelTime - Set max channel time for passive scan
  88. * @Min: 0
  89. * @Max: 10000
  90. * @Default: 110
  91. *
  92. * This ini is used to set maximum channel time in msecs spent in
  93. * passive scan
  94. *
  95. * Related: None
  96. *
  97. * Usage: External
  98. *
  99. * </ini>
  100. */
  101. #define CFG_PASSIVE_MAX_CHANNEL_TIME CFG_INI_UINT(\
  102. "gPassiveMaxChannelTime",\
  103. 0, 10000, MCL_OR_WIN_VALUE(100, 300),\
  104. CFG_VALUE_OR_DEFAULT, "passive dwell time")
  105. /*
  106. * <ini>
  107. * gScanNumProbes - Set the number of probes on each channel for active scan
  108. * @Min: 0
  109. * @Max: 20
  110. * @Default: 0
  111. *
  112. * This ini is used to set number of probes on each channel for
  113. * active scan
  114. */
  115. #define CFG_SCAN_NUM_PROBES CFG_INI_UINT(\
  116. "gScanNumProbes",\
  117. 0, 20, MCL_OR_WIN_VALUE(0, 2),\
  118. CFG_VALUE_OR_DEFAULT,\
  119. "number of probes on each channel")
  120. /*
  121. * <ini>
  122. * gScanProbeRepeatTime - Set the probe repeat time on each channel
  123. * @Min: 0
  124. * @Max: 30
  125. * @Default: 0
  126. *
  127. * This ini is used to set probe repeat time on each channel for
  128. * active scan
  129. *
  130. * Related: None
  131. *
  132. * Supported Feature: Scan
  133. *
  134. * Usage: External
  135. *
  136. * </ini>
  137. */
  138. #define CFG_SCAN_PROBE_REPEAT_TIME CFG_INI_UINT(\
  139. "gScanProbeRepeatTime",\
  140. 0, 30, MCL_OR_WIN_VALUE(20, 50),\
  141. CFG_VALUE_OR_DEFAULT,\
  142. "probe repeat time on each channel")
  143. /*
  144. * <ini>
  145. * hostscan_adaptive_dwell_mode - Enable adaptive dwell mode
  146. * during host scan with conneciton
  147. * @Min: 0
  148. * @Max: 4
  149. * @Default: 2
  150. *
  151. * This ini will set the algo used in dwell time optimization
  152. * during host scan with connection.
  153. * See enum wmi_dwelltime_adaptive_mode.
  154. * Acceptable values for this:
  155. * 0: Default (Use firmware default mode)
  156. * 1: Conservative optimization
  157. * 2: Moderate optimization
  158. * 3: Aggressive optimization
  159. * 4: Static
  160. *
  161. * Related: None
  162. *
  163. * Supported Feature: Scan
  164. *
  165. * Usage: External
  166. *
  167. * </ini>
  168. */
  169. #define CFG_ADAPTIVE_SCAN_DWELL_MODE CFG_INI_UINT(\
  170. "hostscan_adaptive_dwell_mode",\
  171. 0, 4, MCL_OR_WIN_VALUE(2, 0),\
  172. CFG_VALUE_OR_DEFAULT,\
  173. "Enable adaptive dwell mode")
  174. /*
  175. * <ini>
  176. * is_bssid_hint_priority - Set priority for connection with bssid_hint
  177. * BSSID.
  178. * @Min: 0
  179. * @Max: 1
  180. * @Default: 1
  181. *
  182. * This ini is used to give priority to BSS for connection which comes
  183. * as part of bssid_hint
  184. *
  185. * Related: None
  186. *
  187. * Supported Feature: STA
  188. *
  189. * Usage: External
  190. *
  191. * </ini>
  192. */
  193. #define CFG_IS_BSSID_HINT_PRIORITY CFG_INI_UINT(\
  194. "is_bssid_hint_priority",\
  195. 0, 1, 0,\
  196. CFG_VALUE_OR_DEFAULT, \
  197. "Set priority for connection with bssid_hint")
  198. #ifdef FEATURE_WLAN_SCAN_PNO
  199. /*
  200. * These scan PNO ini params are used only once by HDD to store the
  201. * values in wiphy structure
  202. */
  203. /*
  204. * <ini>
  205. * g_max_sched_scan_plan_iterations - pno sched max scan plan iterations.
  206. * @Min: 1
  207. * @Max: 100
  208. * @Default: 10
  209. *
  210. * This ini is used to set max sched scan plan iterations for pno scan
  211. * (value in seconds).
  212. *
  213. * Related: gPNOScanSupport
  214. *
  215. * Supported Feature: PNO scan
  216. *
  217. * Usage: External
  218. *
  219. * </ini>
  220. */
  221. #define CFG_MAX_SCHED_SCAN_PLAN_ITERATIONS CFG_INI_UINT( \
  222. "g_max_sched_scan_plan_iterations", \
  223. 1, 100, 10, \
  224. CFG_VALUE_OR_DEFAULT, \
  225. "Max sched scan plan iterations")
  226. /*
  227. * <ini>
  228. * g_max_sched_scan_plan_int - pno sched max scan plan interval.
  229. * @Min: 1
  230. * @Max: 7200
  231. * @Default: 3600
  232. *
  233. * This ini is used to set max sched scan plan interval for pno scan
  234. * (value in seconds).
  235. *
  236. * Related: gPNOScanSupport
  237. *
  238. * Supported Feature: PNO scan
  239. *
  240. * Usage: External
  241. *
  242. * </ini>
  243. */
  244. #define CFG_MAX_SCHED_SCAN_PLAN_INTERVAL CFG_INI_UINT( \
  245. "g_max_sched_scan_plan_int", \
  246. 1, 7200, 3600, \
  247. CFG_VALUE_OR_DEFAULT, \
  248. "Max sched scan plan interval")
  249. #define CFG_SCAN_PNO \
  250. CFG(CFG_MAX_SCHED_SCAN_PLAN_ITERATIONS) \
  251. CFG(CFG_MAX_SCHED_SCAN_PLAN_INTERVAL)
  252. #else
  253. #define CFG_SCAN_PNO
  254. #endif
  255. /*
  256. * <ini>
  257. * gActiveMaxChannelTimeConc - Maximum active scan time in milliseconds.
  258. * @Min: 0
  259. * @Max: 10000
  260. * @Default: 40
  261. *
  262. * This ini is used to set maximum active scan time in STA+SAP concurrent
  263. * mode.
  264. *
  265. * Related: None.
  266. *
  267. * Supported Feature: Concurrency
  268. *
  269. * Usage: Internal/External
  270. *
  271. * </ini>
  272. */
  273. #define CFG_ACTIVE_MAX_CHANNEL_TIME_CONC CFG_INI_UINT(\
  274. "gActiveMaxChannelTimeConc",\
  275. 0, 10000, MCL_OR_WIN_VALUE(40, 0),\
  276. CFG_VALUE_OR_DEFAULT, \
  277. "active scan time in STA+SAP concurrent")
  278. /*
  279. * <ini>
  280. * gPassiveMaxChannelTimeConc - Maximum passive scan time in milliseconds.
  281. * @Min: 0
  282. * @Max: 10000
  283. * @Default: 110
  284. *
  285. * This ini is used to set maximum passive scan time in STA+SAP concurrent
  286. * mode.
  287. *
  288. * Related: None.
  289. *
  290. * Supported Feature: Concurrency
  291. *
  292. * Usage: Internal/External
  293. *
  294. * </ini>
  295. */
  296. #define CFG_PASSIVE_MAX_CHANNEL_TIME_CONC CFG_INI_UINT(\
  297. "gPassiveMaxChannelTimeConc",\
  298. 0, 10000, MCL_OR_WIN_VALUE(110, 0),\
  299. CFG_VALUE_OR_DEFAULT, \
  300. "Set priority for connection with bssid_hint")
  301. /*
  302. * <ini>
  303. * gRestTimeConc - Rest time before moving to a new channel to scan.
  304. * @Min: 0
  305. * @Max: 10000
  306. * @Default: 100
  307. *
  308. * This ini is used to configure rest time.
  309. *
  310. * Related: None.
  311. *
  312. * Supported Feature: Concurrency
  313. *
  314. * Usage: Internal/External
  315. *
  316. * </ini>
  317. */
  318. #define CFG_MAX_REST_TIME_CONC CFG_INI_UINT(\
  319. "nRestTimeConc",\
  320. 0, 10000, MCL_OR_WIN_VALUE(100, 0),\
  321. CFG_VALUE_OR_DEFAULT, \
  322. "Rest time before moving to a new channel")
  323. /*
  324. * <ini>
  325. * min_rest_time_conc - Mininum time spent on home channel before moving to a
  326. * new channel to scan.
  327. * @Min: 0
  328. * @Max: 50
  329. * @Default: 50
  330. *
  331. * This ini is used to configure minimum time spent on home channel before
  332. * moving to a new channel to scan.
  333. *
  334. * Related: None.
  335. *
  336. * Supported Feature: Concurrency
  337. *
  338. * Usage: Internal/External
  339. *
  340. * </ini>
  341. */
  342. #define CFG_MIN_REST_TIME_CONC CFG_INI_UINT(\
  343. "min_rest_time_conc",\
  344. 0, 50, MCL_OR_WIN_VALUE(50, 0),\
  345. CFG_VALUE_OR_DEFAULT, \
  346. "minimum time spent on home channel")
  347. /*
  348. * <ini>
  349. * gIdleTimeConc - Data inactivity time in msec.
  350. * @Min: 0
  351. * @Max: 25
  352. * @Default: 25
  353. *
  354. * This ini is used to configure data inactivity time in msec on bss channel
  355. * that will be used by scan engine in firmware.
  356. * For example if this value is 25ms then firmware will check for data
  357. * inactivity every 25ms till gRestTimeConc is reached.
  358. * If inactive then scan engine will move from home channel to scan the next
  359. * frequency.
  360. *
  361. * Related: None.
  362. *
  363. * Supported Feature: Concurrency
  364. *
  365. * Usage: Internal/External
  366. *
  367. * </ini>
  368. */
  369. #define CFG_IDLE_TIME_CONC CFG_INI_UINT(\
  370. "gIdleTimeConc",\
  371. 0, 25, MCL_OR_WIN_VALUE(25, 0),\
  372. CFG_VALUE_OR_DEFAULT, \
  373. "data inactivity time on bss channel")
  374. #define CFG_SCAN_ALL \
  375. CFG(CFG_DROP_BCN_ON_CHANNEL_MISMATCH) \
  376. CFG(CFG_ACTIVE_MAX_CHANNEL_TIME) \
  377. CFG(CFG_ACTIVE_MAX_2G_CHANNEL_TIME) \
  378. CFG(CFG_PASSIVE_MAX_CHANNEL_TIME) \
  379. CFG(CFG_SCAN_NUM_PROBES) \
  380. CFG(CFG_SCAN_PROBE_REPEAT_TIME) \
  381. CFG(CFG_ADAPTIVE_SCAN_DWELL_MODE) \
  382. CFG(CFG_IS_BSSID_HINT_PRIORITY) \
  383. CFG_SCAN_PNO \
  384. CFG(CFG_PASSIVE_MAX_CHANNEL_TIME_CONC) \
  385. CFG(CFG_ACTIVE_MAX_CHANNEL_TIME_CONC) \
  386. CFG(CFG_MAX_REST_TIME_CONC) \
  387. CFG(CFG_MIN_REST_TIME_CONC) \
  388. CFG(CFG_IDLE_TIME_CONC)
  389. #endif