wlan_scan_cfg.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266
  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 SCAN component
  20. */
  21. #ifndef __CONFIG_SCAN_H
  22. #define __CONFIG_SCAN_H
  23. #include "cfg_define.h"
  24. /**
  25. * enum scan_mode_6ghz - scan mode for 6GHz
  26. * @SCAN_MODE_6G_NO_CHANNEL: Remove 6GHz channels in the scan request
  27. * @SCAN_MODE_6G_PSC_CHANNEL: Allow/Add 6Ghz PSC channels to scan request
  28. * @SCAN_MODE_6G_ALL_CHANNEL: Allow all the 6Ghz channels
  29. */
  30. enum scan_mode_6ghz {
  31. SCAN_MODE_6G_NO_CHANNEL,
  32. SCAN_MODE_6G_PSC_CHANNEL,
  33. SCAN_MODE_6G_ALL_CHANNEL,
  34. SCAN_MODE_6G_MAX = SCAN_MODE_6G_ALL_CHANNEL,
  35. };
  36. /*
  37. * <ini>
  38. * drop_bcn_on_chan_mismatch - drop the beacon for chan mismatch
  39. * @Min: 0
  40. * @Max: 1
  41. * @Default: 1
  42. *
  43. * This ini is used to decide drop the beacon or not if channel received
  44. * in metadata doesn't match the one in beacon.
  45. *
  46. * Related: None
  47. *
  48. * Usage: External
  49. *
  50. * </ini>
  51. */
  52. #define CFG_DROP_BCN_ON_CHANNEL_MISMATCH CFG_INI_BOOL(\
  53. "drop_bcn_on_chan_mismatch",\
  54. true,\
  55. "drop bcn on channel mismatch")
  56. /*
  57. * <ini>
  58. * gActiveMaxChannelTime - Set max channel time for active scan
  59. * @Min: 0
  60. * @Max: 10000
  61. * @Default: 40
  62. *
  63. * This ini is used to set maximum channel time in msecs spent in
  64. * active scan
  65. *
  66. * Related: None
  67. *
  68. * Usage: External
  69. *
  70. * </ini>
  71. */
  72. #define CFG_ACTIVE_MAX_CHANNEL_TIME CFG_INI_UINT(\
  73. "gActiveMaxChannelTime",\
  74. 0, 10000, PLATFORM_VALUE(40, 105),\
  75. CFG_VALUE_OR_DEFAULT, "active dwell time")
  76. /*
  77. * <ini>
  78. * gEnableDFSChnlScan - Enable/Disable scan on DFS channels
  79. * @Min: 0
  80. * @Max: 1
  81. * @Default: 1
  82. *
  83. * This ini is used to enable/disable scan on DFS channels.
  84. *
  85. * Related: Scan
  86. *
  87. * Usage: External
  88. *
  89. * </ini>
  90. */
  91. #define CFG_ENABLE_DFS_SCAN CFG_INI_BOOL( \
  92. "gEnableDFSChnlScan", \
  93. true, \
  94. "enable dfs scan")
  95. /*
  96. * <ini>
  97. * gInitialScanNoDFSChnl - Exclude DFS channels in first scan
  98. * @Min: 0
  99. * @Max: 1
  100. * @Default: 0
  101. *
  102. * This ini is used to enable/disable scan on DFS channels, in first scan only
  103. *
  104. * Related: Scan
  105. *
  106. * Usage: External
  107. *
  108. * </ini>
  109. */
  110. #define CFG_INITIAL_NO_DFS_SCAN CFG_INI_BOOL( \
  111. "gInitialScanNoDFSChnl", \
  112. false, \
  113. "disable initial dfs scan")
  114. /*
  115. * <ini>
  116. * active_max_channel_time_2g - Set max time for active 2G channel scan
  117. * @Min: 0
  118. * @Max: 10000
  119. * @Default: 80
  120. *
  121. * This ini is used to set maximum time in msecs spent in active 2G channel scan
  122. * if it's not zero, in case of zero, CFG_ACTIVE_MAX_CHANNEL_TIME is used for 2G
  123. * channels also.
  124. *
  125. * Related: None
  126. *
  127. * Usage: External
  128. *
  129. * </ini>
  130. */
  131. #define CFG_ACTIVE_MAX_2G_CHANNEL_TIME CFG_INI_UINT(\
  132. "active_max_channel_time_2g",\
  133. 0, 10000, PLATFORM_VALUE(80, 0),\
  134. CFG_VALUE_OR_DEFAULT, "active dwell time for 2G channels")
  135. /*
  136. * <ini>
  137. * active_max_channel_time_6g - Set max time for active 6G channel scan
  138. * @Min: 0
  139. * @Max: 10000
  140. * @Default: 40
  141. *
  142. * This ini is used to set maximum time in msecs spent in active 6G channel scan
  143. *
  144. *
  145. * Related: None
  146. *
  147. * Usage: External
  148. *
  149. * </ini>
  150. */
  151. #define CFG_ACTIVE_MAX_6G_CHANNEL_TIME CFG_INI_UINT(\
  152. "active_max_channel_time_6g",\
  153. 0, 10000, 40,\
  154. CFG_VALUE_OR_DEFAULT, "active dwell time for 6G channels")
  155. /*
  156. * <ini>
  157. * passive_max_channel_time_6g - Set max time for passive 6G channel scan
  158. * @Min: 0
  159. * @Max: 10000
  160. * @Default: 30
  161. *
  162. * This ini is used to set maximum time in msecs spent in passive 6G chan scan
  163. *
  164. *
  165. * Related: None
  166. *
  167. * Usage: External
  168. *
  169. * </ini>
  170. */
  171. #define CFG_PASSIVE_MAX_6G_CHANNEL_TIME CFG_INI_UINT(\
  172. "passive_max_channel_time_6g",\
  173. 0, 10000, 30,\
  174. CFG_VALUE_OR_DEFAULT, "passive dwell time for 6G channels")
  175. /*
  176. * <ini>
  177. * gPassiveMaxChannelTime - Set max channel time for passive scan
  178. * @Min: 0
  179. * @Max: 10000
  180. * @Default: 110
  181. *
  182. * This ini is used to set maximum channel time in msecs spent in
  183. * passive scan
  184. *
  185. * Related: None
  186. *
  187. * Usage: External
  188. *
  189. * </ini>
  190. */
  191. #define CFG_PASSIVE_MAX_CHANNEL_TIME CFG_INI_UINT(\
  192. "gPassiveMaxChannelTime",\
  193. 0, 10000, PLATFORM_VALUE(110, 300),\
  194. CFG_VALUE_OR_DEFAULT, "passive dwell time")
  195. /*
  196. * <ini>
  197. * gScanNumProbes - Set the number of probes on each channel for active scan
  198. * @Min: 0
  199. * @Max: 20
  200. * @Default: 0
  201. *
  202. * This ini is used to set number of probes on each channel for
  203. * active scan
  204. */
  205. #define CFG_SCAN_NUM_PROBES CFG_INI_UINT(\
  206. "gScanNumProbes",\
  207. 0, 20, PLATFORM_VALUE(0, 2),\
  208. CFG_VALUE_OR_DEFAULT,\
  209. "number of probes on each channel")
  210. /*
  211. * <ini>
  212. * gScanProbeRepeatTime - Set the probe repeat time on each channel
  213. * @Min: 0
  214. * @Max: 30
  215. * @Default: 0
  216. *
  217. * This ini is used to set probe repeat time on each channel for
  218. * active scan
  219. *
  220. * Related: None
  221. *
  222. * Supported Feature: Scan
  223. *
  224. * Usage: External
  225. *
  226. * </ini>
  227. */
  228. #define CFG_SCAN_PROBE_REPEAT_TIME CFG_INI_UINT(\
  229. "gScanProbeRepeatTime",\
  230. 0, 50, PLATFORM_VALUE(20, 50),\
  231. CFG_VALUE_OR_DEFAULT,\
  232. "probe repeat time on each channel")
  233. /*
  234. * <ini>
  235. * hostscan_adaptive_dwell_mode - Enable adaptive dwell mode
  236. * during host scan with conneciton
  237. * @Min: 0
  238. * @Max: 4
  239. * @Default: 2
  240. *
  241. * This ini will set the algo used in dwell time optimization
  242. * during host scan with connection.
  243. * See enum wmi_dwelltime_adaptive_mode.
  244. * Acceptable values for this:
  245. * 0: Default (Use firmware default mode)
  246. * 1: Conservative optimization
  247. * 2: Moderate optimization
  248. * 3: Aggressive optimization
  249. * 4: Static
  250. *
  251. * Related: None
  252. *
  253. * Supported Feature: Scan
  254. *
  255. * Usage: External
  256. *
  257. * </ini>
  258. */
  259. #define CFG_ADAPTIVE_SCAN_DWELL_MODE CFG_INI_UINT(\
  260. "hostscan_adaptive_dwell_mode",\
  261. 0, 4, PLATFORM_VALUE(2, 0),\
  262. CFG_VALUE_OR_DEFAULT,\
  263. "Enable adaptive dwell mode")
  264. /*
  265. * <ini>
  266. * hostscan_adaptive_dwell_mode_no_conn - Enable adaptive dwell mode
  267. * during host scan without conneciton
  268. * @Min: 0
  269. * @Max: 4
  270. * @Default: 4
  271. *
  272. * This ini will set the algo used in dwell time optimization
  273. * during host scan with connection.
  274. * See enum wmi_dwelltime_adaptive_mode.
  275. * Acceptable values for this:
  276. * 0: Default (Use firmware default mode)
  277. * 1: Conservative optimization
  278. * 2: Moderate optimization
  279. * 3: Aggressive optimization
  280. * 4: Static
  281. *
  282. * Related: None
  283. *
  284. * Supported Feature: Scan
  285. *
  286. * Usage: External
  287. *
  288. * </ini>
  289. */
  290. #define CFG_ADAPTIVE_SCAN_DWELL_MODE_NC CFG_INI_UINT(\
  291. "hostscan_adaptive_dwell_mode_no_conn",\
  292. 0, 4, PLATFORM_VALUE(4, 0),\
  293. CFG_VALUE_OR_DEFAULT,\
  294. "Enable adaptive dwell mode without connection")
  295. /*
  296. * <ini>
  297. * honour_nl_scan_policy_flags - This ini will decide whether to honour
  298. * NL80211 scan policy flags
  299. * @Min: 0
  300. * @Max: 1
  301. * @Default: 1
  302. *
  303. * This parameter will decide whether to honour scan flags such as
  304. * NL80211_SCAN_FLAG_HIGH_ACCURACY , NL80211_SCAN_FLAG_LOW_SPAN,
  305. * NL80211_SCAN_FLAG_LOW_POWER.
  306. * Acceptable values for this:
  307. * 0: Config is disabled
  308. * 1: Config is enabled
  309. *
  310. * Related: None
  311. *
  312. * Supported Feature: Scan
  313. *
  314. * Usage: Internal
  315. *
  316. * </ini>
  317. */
  318. #define CFG_HONOUR_NL_SCAN_POLICY_FLAGS CFG_INI_BOOL(\
  319. "honour_nl_scan_policy_flags",\
  320. true, \
  321. "honour NL80211 scan policy flags")
  322. /*
  323. * <ini>
  324. * is_bssid_hint_priority - Set priority for connection with bssid_hint
  325. * BSSID.
  326. * @Min: 0
  327. * @Max: 1
  328. * @Default: 1
  329. *
  330. * This ini is used to give priority to BSS for connection which comes
  331. * as part of bssid_hint
  332. *
  333. * Related: None
  334. *
  335. * Supported Feature: STA
  336. *
  337. * Usage: External
  338. *
  339. * </ini>
  340. */
  341. #define CFG_IS_BSSID_HINT_PRIORITY CFG_INI_UINT(\
  342. "is_bssid_hint_priority",\
  343. 0, 1, 0,\
  344. CFG_VALUE_OR_DEFAULT, \
  345. "Set priority for connection with bssid_hint")
  346. #ifdef FEATURE_WLAN_SCAN_PNO
  347. /*
  348. * <ini>
  349. * g_max_sched_scan_plan_iterations - pno sched max scan plan iterations.
  350. * @Min: 1
  351. * @Max: 100
  352. * @Default: 10
  353. *
  354. * This ini is used to set max sched scan plan iterations for pno scan
  355. * (value in seconds).
  356. *
  357. * Related: gPNOScanSupport
  358. *
  359. * Supported Feature: PNO scan
  360. *
  361. * Usage: External
  362. *
  363. * </ini>
  364. */
  365. #define CFG_MAX_SCHED_SCAN_PLAN_ITERATIONS CFG_INI_UINT( \
  366. "g_max_sched_scan_plan_iterations", \
  367. 1, 100, 10, \
  368. CFG_VALUE_OR_DEFAULT, \
  369. "Max sched scan plan iterations")
  370. /*
  371. * <ini>
  372. * g_max_sched_scan_plan_int - pno sched max scan plan interval.
  373. * @Min: 1
  374. * @Max: 7200
  375. * @Default: 3600
  376. *
  377. * This ini is used to set max sched scan plan interval for pno scan
  378. * (value in seconds).
  379. *
  380. * Related: gPNOScanSupport
  381. *
  382. * Supported Feature: PNO scan
  383. *
  384. * Usage: External
  385. *
  386. * </ini>
  387. */
  388. #define CFG_MAX_SCHED_SCAN_PLAN_INTERVAL CFG_INI_UINT( \
  389. "g_max_sched_scan_plan_int", \
  390. 1, 7200, 3600, \
  391. CFG_VALUE_OR_DEFAULT, \
  392. "Max sched scan plan interval")
  393. /*
  394. * <ini>
  395. * gEnableDFSPnoChnlScan - enable dfs channels in PNO scan
  396. * @Min: 0
  397. * @Max: 1
  398. * @Default: 1
  399. *
  400. * This ini is used to enable/disable dfs channels in PNO scan request,
  401. * enabling this ini enables driver to include dfs channels in its
  402. * PNO scan request
  403. * Related: NA
  404. *
  405. * Supported Feature: DFS, PNO
  406. *
  407. * Usage: Internal/External
  408. *
  409. * </ini>
  410. */
  411. #define CFG_ENABLE_DFS_PNO_CHNL_SCAN CFG_INI_BOOL( \
  412. "gEnableDFSPnoChnlScan", \
  413. true, \
  414. "Enable dfs channels in PNO Scan")
  415. /*
  416. * <ini>
  417. * gPNOScanSupport - Enable or Disable PNO scan
  418. * @Min: 0
  419. * @Max: 1
  420. * @Default: 1
  421. *
  422. * This ini is used to Enable or Disable PNO scan
  423. *
  424. * Related: None
  425. *
  426. * Supported Feature: Scan
  427. *
  428. * Usage: External
  429. *
  430. * </ini>
  431. */
  432. #define CFG_PNO_SCAN_SUPPORT CFG_INI_BOOL( \
  433. "gPNOScanSupport", \
  434. true, \
  435. "Enable/Disable PNO scan")
  436. /*
  437. * <ini>
  438. * gPNOScanTimerRepeatValue - Set PNO scan timer repeat value
  439. * @Min: 0
  440. * @Max: 0xffffffff
  441. * @Default: 30
  442. *
  443. * This ini is used by firmware to set fast scan max cycles
  444. * equal to gPNOScanTimerRepeatValue. Taking power consumption
  445. * into account firmware after gPNOScanTimerRepeatValue times
  446. * fast_scan_period switches to slow_scan_period.
  447. *
  448. * Usage: External
  449. *
  450. * </ini>
  451. */
  452. #define CFG_PNO_SCAN_TIMER_REPEAT_VALUE CFG_INI_UINT( \
  453. "gPNOScanTimerRepeatValue", \
  454. 0, \
  455. 0xffffffff, \
  456. 30, \
  457. CFG_VALUE_OR_DEFAULT, \
  458. "PNO scan timer repeat value")
  459. /*
  460. * <ini>
  461. * gPNOSlowScanMultiplier - Set PNO slow scan multiplier
  462. * @Min: 0
  463. * @Max: 30
  464. * @Default: 6
  465. *
  466. * This ini is used by firmware to set slow scan period
  467. * as gPNOSlowScanMultiplier times fast_scan_period.
  468. *
  469. * Related: None
  470. *
  471. * Supported Feature: Scan
  472. *
  473. * Usage: External
  474. *
  475. * </ini>
  476. */
  477. #define CFG_PNO_SLOW_SCAN_MULTIPLIER CFG_INI_UINT( \
  478. "gPNOSlowScanMultiplier", \
  479. 0, \
  480. 30, \
  481. 6, \
  482. CFG_VALUE_OR_DEFAULT, \
  483. "PNO slow scan multiplier")
  484. /*
  485. * <ini>
  486. * gPNOChannelPrediction - Enable/disable the PNO channel
  487. * prediction feature.
  488. * @Min: 0
  489. * @Max: 1
  490. * @Default: 0
  491. *
  492. * In current PNO implementation, scan is always done until all configured
  493. * channels are scanned. If we can determine DUT is stationary based on
  494. * scanning a subset of channels, we may cancel the remaining channels.
  495. * Hence, we can save additional power consumption.
  496. *
  497. * Related: None
  498. *
  499. * Supported Feature: Scan
  500. *
  501. * Usage: External
  502. *
  503. * </ini>
  504. */
  505. #define CFG_PNO_CHANNEL_PREDICTION CFG_INI_BOOL( \
  506. "gPNOChannelPrediction", \
  507. false, \
  508. "enable/disable PNO channel prediction feature")
  509. /*
  510. * <ini>
  511. * gTopKNumOfChannels - top K number of channels are used for tanimoto distance
  512. * @Min: 1
  513. * @Max: 5
  514. * @Default: 3
  515. *
  516. * These are the top channels on which the probability of finding the AP's is
  517. * extremely high. This number is intended for tweaking the internal algorithm
  518. * for experiments. This should not be changed externally.
  519. *
  520. * Related: None
  521. *
  522. * Supported Feature: Scan
  523. *
  524. * Usage: External
  525. *
  526. * </ini>
  527. */
  528. #define CFG_TOP_K_NUM_OF_CHANNELS CFG_INI_UINT( \
  529. "gTopKNumOfChannels", \
  530. 1, \
  531. 5, \
  532. 3, \
  533. CFG_VALUE_OR_DEFAULT, \
  534. "Top K number of channels")
  535. /*
  536. * <ini>
  537. * gStationaryThreshold - STA threshold value to determine if it is stationary
  538. * @Min: 0
  539. * @Max: 100
  540. * @Default: 10
  541. *
  542. * This is the threshold value to determine that the STA is
  543. * stationary. If the tanimoto distance is less than this
  544. * value, then the device is considered to be stationary.
  545. * This parameter is intended to tweak the internal algorithm
  546. * for experiments. This should not be changed externally.
  547. *
  548. *
  549. * Related: None
  550. *
  551. * Supported Feature: Scan
  552. *
  553. * Usage: External
  554. *
  555. * </ini>
  556. */
  557. #define CFG_STATIONARY_THRESHOLD CFG_INI_UINT( \
  558. "gStationaryThreshold", \
  559. 0, \
  560. 100, \
  561. 10, \
  562. CFG_VALUE_OR_DEFAULT, \
  563. "Threshold to determine if sta is stationary")
  564. /*
  565. * <ini>
  566. * gChPredictionFullScanMs - Set periodic timer for channel prediction
  567. * @Min: 3000
  568. * @Max: 0x7fffffff
  569. * @Default: 60000
  570. *
  571. * This ini is used to set the periodic timer upon which
  572. * a full scan needs to be triggered when PNO channel
  573. * prediction feature is enabled. This parameter is intended
  574. * to tweak the internal algortihm for experiments.
  575. *
  576. * Related: None
  577. *
  578. * Supported Feature: Scan
  579. *
  580. * Usage: Internal
  581. *
  582. * </ini>
  583. */
  584. #define CFG_CHANNEL_PREDICTION_SCAN_TIMER CFG_INI_UINT( \
  585. "gChPredictionFullScanMs", \
  586. 3000, \
  587. 0x7fffffff, \
  588. 60000, \
  589. CFG_VALUE_OR_DEFAULT, \
  590. "Timer value for channel prediction")
  591. /*
  592. * <ini>
  593. * pnoscan_adaptive_dwell_mode - Enable adaptive dwell mode
  594. * during pno scan
  595. * @Min: 0
  596. * @Max: 4
  597. * @Default: 1
  598. *
  599. * This ini will set the algo used in dwell time optimization
  600. * during pno scan. see enum scan_dwelltime_adaptive_mode.
  601. * Acceptable values for this:
  602. * 0: Default (Use firmware default mode)
  603. * 1: Conservative optimization
  604. * 2: Moderate optimization
  605. * 3: Aggressive optimization
  606. * 4: Static
  607. *
  608. * Related: None
  609. *
  610. * Supported Feature: Scan
  611. *
  612. * Usage: External
  613. *
  614. * </ini>
  615. */
  616. #define CFG_ADAPTIVE_PNOSCAN_DWELL_MODE CFG_INI_UINT( \
  617. "pnoscan_adaptive_dwell_mode", \
  618. 0, \
  619. 4, \
  620. 1, \
  621. CFG_VALUE_OR_DEFAULT, \
  622. "Algorithm used in dwell time optimization")
  623. /*
  624. * <ini>
  625. * gScanBackoffMultiplier - For NLO/PNO, multiply fast scan period by this every
  626. * max cycles
  627. * @Min: 0
  628. * @Max: 255
  629. * @Default: 0
  630. *
  631. * For Network Listen Offload and Perfered Network Offload, multiply the fast
  632. * scan period by this value after max cycles have occurred. Setting this to 0
  633. * disables the feature.
  634. *
  635. * @E.g.
  636. * # Disable scan backoff multiplier
  637. * gScanBackoffMultiplier=0
  638. * # Effectively the same
  639. * gScanBackoffMultiplier=1
  640. * # Double the scan period after each max cycles have occurred
  641. * gScanBackoffMultiplier=2
  642. *
  643. * Related: NLO, PNO
  644. *
  645. * Usage: Internal/External
  646. *
  647. * </ini>
  648. */
  649. #define CFG_SCAN_BACKOFF_MULTIPLIER CFG_INI_UINT( \
  650. "gScanBackoffMultiplier", \
  651. 0, \
  652. 255, \
  653. 0, \
  654. CFG_VALUE_OR_DEFAULT, \
  655. "Scan backoff multiplier")
  656. /*
  657. * <ini>
  658. * mawc_nlo_enabled - For NLO/PNO, enable MAWC based scan
  659. * @Min: 0
  660. * @Max: 1
  661. * @Default: 1
  662. *
  663. * Enable/Disable the Motion Aided Wireless Connectivity
  664. * based NLO using this parameter
  665. *
  666. * Related: NLO, PNO
  667. *
  668. * Usage: Internal/External
  669. *
  670. * </ini>
  671. */
  672. #define CFG_MAWC_NLO_ENABLED CFG_INI_BOOL( \
  673. "mawc_nlo_enabled", \
  674. 1, \
  675. "Enable MAWC based scan")
  676. /*
  677. * <ini>
  678. * mawc_nlo_exp_backoff_ratio - Exponential back off ratio
  679. * @Min: 0
  680. * @Max: 300
  681. * @Default: 3
  682. *
  683. * Configure the exponential back off ratio using this
  684. * parameter for MAWC based NLO
  685. * ratio of exponential backoff, next = current + current*ratio/100
  686. *
  687. * Related: NLO, PNO
  688. *
  689. * Usage: Internal/External
  690. *
  691. * </ini>
  692. */
  693. #define CFG_MAWC_NLO_EXP_BACKOFF_RATIO CFG_INI_UINT( \
  694. "mawc_nlo_exp_backoff_ratio", \
  695. 0, \
  696. 300, \
  697. 3, \
  698. CFG_VALUE_OR_DEFAULT, \
  699. "MWAC based NLO exponential ratio")
  700. /*
  701. * <ini>
  702. * mawc_nlo_init_scan_interval - Initial Scan Interval
  703. * @Min: 1000
  704. * @Max: 0xFFFFFFFF
  705. * @Default: 10000
  706. *
  707. * Configure the initial scan interval using this
  708. * parameter for MAWC based NLO (Units in Milliseconds)
  709. *
  710. * Related: NLO, PNO
  711. *
  712. * Usage: Internal/External
  713. *
  714. * </ini>
  715. */
  716. #define CFG_MAWC_NLO_INIT_SCAN_INTERVAL CFG_INI_UINT( \
  717. "mawc_nlo_init_scan_interval", \
  718. 1000, \
  719. 0xFFFFFFFF, \
  720. 10000, \
  721. CFG_VALUE_OR_DEFAULT, \
  722. "Initial Scan Interval")
  723. /*
  724. * <ini>
  725. * mawc_nlo_max_scan_interval - Maximum Scan Interval
  726. * @Min: 1000
  727. * @Max: 0xFFFFFFFF
  728. * @Default: 60000
  729. *
  730. * Configure the maximum scan interval using this
  731. * parameter for MAWC based NLO (Units in Milliseconds)
  732. *
  733. * Related: NLO, PNO
  734. *
  735. * Usage: Internal/External
  736. *
  737. * </ini>
  738. */
  739. #define CFG_MAWC_NLO_MAX_SCAN_INTERVAL CFG_INI_UINT( \
  740. "mawc_nlo_max_scan_interval", \
  741. 1000, \
  742. 0xFFFFFFFF, \
  743. 60000, \
  744. CFG_VALUE_OR_DEFAULT, \
  745. "Maximum Scan Interval")
  746. #define CFG_SCAN_PNO \
  747. CFG(CFG_MAX_SCHED_SCAN_PLAN_ITERATIONS) \
  748. CFG(CFG_MAX_SCHED_SCAN_PLAN_INTERVAL) \
  749. CFG(CFG_PNO_SCAN_SUPPORT) \
  750. CFG(CFG_ENABLE_DFS_PNO_CHNL_SCAN) \
  751. CFG(CFG_PNO_SCAN_TIMER_REPEAT_VALUE) \
  752. CFG(CFG_PNO_SLOW_SCAN_MULTIPLIER) \
  753. CFG(CFG_PNO_CHANNEL_PREDICTION) \
  754. CFG(CFG_TOP_K_NUM_OF_CHANNELS) \
  755. CFG(CFG_STATIONARY_THRESHOLD) \
  756. CFG(CFG_CHANNEL_PREDICTION_SCAN_TIMER) \
  757. CFG(CFG_ADAPTIVE_PNOSCAN_DWELL_MODE) \
  758. CFG(CFG_SCAN_BACKOFF_MULTIPLIER) \
  759. CFG(CFG_MAWC_NLO_ENABLED) \
  760. CFG(CFG_MAWC_NLO_EXP_BACKOFF_RATIO) \
  761. CFG(CFG_MAWC_NLO_INIT_SCAN_INTERVAL) \
  762. CFG(CFG_MAWC_NLO_MAX_SCAN_INTERVAL)
  763. #else
  764. #define CFG_SCAN_PNO
  765. #endif /* FEATURE_WLAN_SCAN_PNO */
  766. /*
  767. * <ini>
  768. * gActiveMaxChannelTimeConc - Maximum active scan time in milliseconds.
  769. * @Min: 0
  770. * @Max: 10000
  771. * @Default: 40
  772. *
  773. * This ini is used to set maximum active scan time in STA+SAP concurrent
  774. * mode.
  775. *
  776. * Related: None.
  777. *
  778. * Supported Feature: Concurrency
  779. *
  780. * Usage: Internal/External
  781. *
  782. * </ini>
  783. */
  784. #define CFG_ACTIVE_MAX_CHANNEL_TIME_CONC CFG_INI_UINT(\
  785. "gActiveMaxChannelTimeConc",\
  786. 0, 10000, PLATFORM_VALUE(40, 0),\
  787. CFG_VALUE_OR_DEFAULT, \
  788. "active scan time in STA+SAP concurrent")
  789. /*
  790. * <ini>
  791. * gPassiveMaxChannelTimeConc - Maximum passive scan time in milliseconds.
  792. * @Min: 0
  793. * @Max: 10000
  794. * @Default: 110
  795. *
  796. * This ini is used to set maximum passive scan time in STA+SAP concurrent
  797. * mode.
  798. *
  799. * Related: None.
  800. *
  801. * Supported Feature: Concurrency
  802. *
  803. * Usage: Internal/External
  804. *
  805. * </ini>
  806. */
  807. #define CFG_PASSIVE_MAX_CHANNEL_TIME_CONC CFG_INI_UINT(\
  808. "gPassiveMaxChannelTimeConc",\
  809. 0, 10000, PLATFORM_VALUE(110, 0),\
  810. CFG_VALUE_OR_DEFAULT, \
  811. "Set priority for connection with bssid_hint")
  812. /*
  813. * <ini>
  814. * gRestTimeConc - Rest time before moving to a new channel to scan.
  815. * @Min: 0
  816. * @Max: 10000
  817. * @Default: 100
  818. *
  819. * This ini is used to configure rest time.
  820. *
  821. * Related: None.
  822. *
  823. * Supported Feature: Concurrency
  824. *
  825. * Usage: Internal/External
  826. *
  827. * </ini>
  828. */
  829. #define CFG_MAX_REST_TIME_CONC CFG_INI_UINT(\
  830. "nRestTimeConc",\
  831. 0, 10000, PLATFORM_VALUE(100, 0),\
  832. CFG_VALUE_OR_DEFAULT, \
  833. "Rest time before moving to a new channel")
  834. /*
  835. * <ini>
  836. * min_rest_time_conc - Mininum time spent on home channel before moving to a
  837. * new channel to scan.
  838. * @Min: 0
  839. * @Max: 50
  840. * @Default: 50
  841. *
  842. * This ini is used to configure minimum time spent on home channel before
  843. * moving to a new channel to scan.
  844. *
  845. * Related: None.
  846. *
  847. * Supported Feature: Concurrency
  848. *
  849. * Usage: Internal/External
  850. *
  851. * </ini>
  852. */
  853. #define CFG_MIN_REST_TIME_CONC CFG_INI_UINT(\
  854. "min_rest_time_conc",\
  855. 0, 50, PLATFORM_VALUE(50, 0),\
  856. CFG_VALUE_OR_DEFAULT, \
  857. "minimum time spent on home channel")
  858. /*
  859. * <ini>
  860. * wake_lock_in_user_scan - use to acquire wake lock during user scan
  861. * @Min: 0
  862. * @Max: 1
  863. * @Default: 0
  864. *
  865. * This INI is added for a specific OEM on their request, who don’t want to
  866. * use PNO offload scan (sched scans). This is useful only if PNO scan offload
  867. * is disabled. If PNO scan is enabled this INI should be disabled and its
  868. * by default disabled intentionally.
  869. * This is used to acquire wake lock to handle the case where PNO scan offload
  870. * is disabled so that wlan is not suspended during scan before connect and
  871. * thus scan is not aborted in between. In case PNO scan is offloaded, the FW
  872. * will take care of connect scans and will wake up host when candidate is found
  873. *
  874. * Related: Scan
  875. *
  876. * Usage: Internal/External
  877. *
  878. * </ini>
  879. */
  880. #define CFG_ENABLE_WAKE_LOCK_IN_SCAN CFG_INI_BOOL( \
  881. "wake_lock_in_user_scan", \
  882. false, \
  883. "use wake lock during scan")
  884. /*
  885. * <ini>
  886. * gIdleTimeConc - Data inactivity time in msec.
  887. * @Min: 0
  888. * @Max: 25
  889. * @Default: 25
  890. *
  891. * This ini is used to configure data inactivity time in msec on bss channel
  892. * that will be used by scan engine in firmware.
  893. * For example if this value is 25ms then firmware will check for data
  894. * inactivity every 25ms till gRestTimeConc is reached.
  895. * If inactive then scan engine will move from home channel to scan the next
  896. * frequency.
  897. *
  898. * Related: None.
  899. *
  900. * Supported Feature: Concurrency
  901. *
  902. * Usage: Internal/External
  903. *
  904. * </ini>
  905. */
  906. #define CFG_IDLE_TIME_CONC CFG_INI_UINT(\
  907. "gIdleTimeConc",\
  908. 0, 25, PLATFORM_VALUE(25, 0),\
  909. CFG_VALUE_OR_DEFAULT, \
  910. "data inactivity time on bss channel")
  911. /*
  912. * <ini>
  913. * gEnableMacAddrSpoof - Enable mac address randomization feature.
  914. * @Min: 0
  915. * @Max: 1
  916. * @Default: 1
  917. *
  918. * This ini is used to enable/disable mac address randomization for scan.
  919. *
  920. * Supported Feature: SCAN
  921. *
  922. *
  923. * Usage: Internal/External
  924. *
  925. * </ini>
  926. */
  927. #define CFG_ENABLE_MAC_ADDR_SPOOFING CFG_INI_BOOL( \
  928. "gEnableMacAddrSpoof", \
  929. true, \
  930. "Enable mac spoofing")
  931. /*
  932. * <ini>
  933. * gScanAgingTime - Set scan aging time
  934. * @Min: 0
  935. * @Max: 200
  936. * @Default: 30
  937. *
  938. * This ini is used to set scan aging timeout value
  939. * in secs. For example after 30 secs the bss results
  940. * greater than 30secs age will be flushed.
  941. *
  942. * Related: None
  943. *
  944. * Supported Feature: Scan
  945. *
  946. * Usage: External
  947. *
  948. * </ini>
  949. */
  950. #ifdef QCA_WIFI_NAPIER_EMULATION
  951. #define CFG_SCAN_AGING_TIME_DEFAULT (90)
  952. #else
  953. #define CFG_SCAN_AGING_TIME_DEFAULT (30)
  954. #endif
  955. #define CFG_SCAN_AGING_TIME CFG_INI_UINT( \
  956. "gScanAgingTime", \
  957. 0, \
  958. 200, \
  959. CFG_SCAN_AGING_TIME_DEFAULT, \
  960. CFG_VALUE_OR_DEFAULT, \
  961. "scan aging time")
  962. /*
  963. * <ini>
  964. * extscan_adaptive_dwell_mode Enable adaptive dwell mode
  965. * during ext scan
  966. * @Min: 0
  967. * @Max: 4
  968. * @Default: 1
  969. *
  970. * This ini will set the algo used in dwell time optimization
  971. * during ext scan. see enum scan_dwelltime_adaptive_mode.
  972. * Acceptable values for this:
  973. * 0: Default (Use firmware default mode)
  974. * 1: Conservative optimization
  975. * 2: Moderate optimization
  976. * 3: Aggressive optimization
  977. * 4: Static
  978. *
  979. * Related: None
  980. *
  981. * Supported Feature: Scan
  982. *
  983. * Usage: External
  984. *
  985. * </ini>
  986. */
  987. #define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE CFG_INI_UINT( \
  988. "extscan_adaptive_dwell_mode", \
  989. 0, \
  990. 4, \
  991. 1, \
  992. CFG_VALUE_OR_DEFAULT, \
  993. "ext scan adaptive dwell mode")
  994. /*
  995. * <ini>
  996. * sta_scan_burst_duration - Burst duration in case of split scan.
  997. * @Min: 0
  998. * @Max: 180
  999. * @Default: 0
  1000. *
  1001. * This ini is used to set burst duration of sta scan requests.
  1002. *
  1003. * Related: None.
  1004. *
  1005. * Supported Feature: Concurrency
  1006. *
  1007. * Usage: External
  1008. *
  1009. * </ini>
  1010. */
  1011. #define CFG_STA_SCAN_BURST_DURATION CFG_INI_UINT( \
  1012. "sta_scan_burst_duration", \
  1013. 0, \
  1014. 180, \
  1015. 0, \
  1016. CFG_VALUE_OR_DEFAULT, \
  1017. "sta scan burst duration")
  1018. /*
  1019. * <ini>
  1020. * p2p_scan_burst_duration - Burst duration in case of split scan for p2p scan.
  1021. * @Min: 0
  1022. * @Max: 180
  1023. * @Default: 0
  1024. *
  1025. * This ini is used to set burst duration of scan for p2p scan requests.
  1026. *
  1027. * Related: None.
  1028. *
  1029. * Supported Feature: Concurrency
  1030. *
  1031. * Usage: External
  1032. *
  1033. * </ini>
  1034. */
  1035. #define CFG_P2P_SCAN_BURST_DURATION CFG_INI_UINT( \
  1036. "p2p_scan_burst_duration", \
  1037. 0, \
  1038. 180, \
  1039. 0, \
  1040. CFG_VALUE_OR_DEFAULT, \
  1041. "p2p scan burst duration")
  1042. /*
  1043. * <ini>
  1044. * go_scan_burst_duration - Burst duration in case of split scan when GO is
  1045. * active.
  1046. * @Min: 0
  1047. * @Max: 180
  1048. * @Default: 0
  1049. *
  1050. * This ini is used to set burst duration of scan when GO is active.
  1051. *
  1052. * Related: None.
  1053. *
  1054. * Supported Feature: Concurrency
  1055. *
  1056. * Usage: External
  1057. *
  1058. * </ini>
  1059. */
  1060. #define CFG_GO_SCAN_BURST_DURATION CFG_INI_UINT( \
  1061. "go_scan_burst_duration", \
  1062. 0, \
  1063. 180, \
  1064. 0, \
  1065. CFG_VALUE_OR_DEFAULT, \
  1066. "go scan burst duration")
  1067. /*
  1068. * <ini>
  1069. * ap_scan_burst_duration - Burst duration in case of split scan when ap
  1070. * is active.
  1071. * @Min: 0
  1072. * @Max: 32
  1073. * @Default: 0
  1074. *
  1075. * This ini is used to set burst duration of scan when SAP is active.
  1076. *
  1077. * Related: None.
  1078. *
  1079. * Supported Feature: Concurrency
  1080. *
  1081. * Usage: External
  1082. *
  1083. * </ini>
  1084. */
  1085. #define CFG_AP_SCAN_BURST_DURATION CFG_INI_UINT( \
  1086. "ap_scan_burst_duration", \
  1087. 0, \
  1088. 32, \
  1089. 0, \
  1090. CFG_VALUE_OR_DEFAULT, \
  1091. "ap scan burst duration")
  1092. /*
  1093. * <ini>
  1094. * gSkipDfsChannelInP2pSearch - Skip DFS Channel in case of P2P Search
  1095. * @Min: 0
  1096. * @Max: 1
  1097. * @Default: 1
  1098. *
  1099. * This ini is used to disable(skip) dfs channel in p2p search.
  1100. * Related: None.
  1101. *
  1102. * Supported Feature: DFS P2P
  1103. *
  1104. * Usage: External
  1105. *
  1106. * <ini>
  1107. */
  1108. #define CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH CFG_INI_BOOL( \
  1109. "gSkipDfsChannelInP2pSearch", \
  1110. 1, \
  1111. "skip dfs channel in p2p search")
  1112. /*
  1113. * <ini>
  1114. * gEnableConnectedScan - Will enable or disable scan in connected state
  1115. * This ini is used to enable or disable the scanning in
  1116. * Connected state
  1117. * @Min: 0
  1118. * @Max: 1
  1119. * @Default: 1
  1120. *
  1121. * Related: None
  1122. *
  1123. * Supported Feature: STA
  1124. *
  1125. * Usage: External
  1126. *
  1127. * <ini>
  1128. */
  1129. #define CFG_ENABLE_CONNECTED_SCAN CFG_INI_BOOL( \
  1130. "gEnableConnectedScan", \
  1131. true, \
  1132. "Enable/disable scan in connected state")
  1133. /*
  1134. * <ini>
  1135. * gEnableSNRMonitoring - Enables SNR Monitoring
  1136. * @Min: 0
  1137. * @Max: 1
  1138. * @Default: 0
  1139. *
  1140. * This ini is used to set default snr monitor
  1141. *
  1142. * Related: None
  1143. *
  1144. * Supported Feature: STA
  1145. *
  1146. * Usage: Internal/External
  1147. *
  1148. * </ini>
  1149. */
  1150. #define CFG_ENABLE_SNR_MONITORING CFG_INI_BOOL(\
  1151. "gEnableSNRMonitoring",\
  1152. false,\
  1153. "Enable/Disable SNR Monitoring")
  1154. /*
  1155. * <ini>
  1156. * scan_mode_6ghz - 6ghz Scan mode
  1157. * @Min: 0
  1158. * @Max: 2
  1159. * @Default: 2
  1160. *
  1161. * Configure the 6Ghz scan mode
  1162. * 0 - Remove 6GHz channels in the scan request
  1163. * 1 - Allow/Add 6Ghz PSC channels to scan request
  1164. * 2 - Allow all the 6Ghz channels
  1165. *
  1166. * Related: SCAN
  1167. *
  1168. * Usage: Internal/External
  1169. *
  1170. * </ini>
  1171. */
  1172. #define CFG_6GHZ_SCAN_MODE CFG_INI_UINT( \
  1173. "scan_mode_6ghz", \
  1174. SCAN_MODE_6G_NO_CHANNEL, \
  1175. SCAN_MODE_6G_MAX, \
  1176. PLATFORM_VALUE(SCAN_MODE_6G_PSC_CHANNEL, \
  1177. SCAN_MODE_6G_ALL_CHANNEL), \
  1178. CFG_VALUE_OR_DEFAULT, \
  1179. "6ghz scan mode")
  1180. #define CFG_SCAN_ALL \
  1181. CFG(CFG_DROP_BCN_ON_CHANNEL_MISMATCH) \
  1182. CFG(CFG_ENABLE_WAKE_LOCK_IN_SCAN) \
  1183. CFG(CFG_ACTIVE_MAX_CHANNEL_TIME) \
  1184. CFG(CFG_ENABLE_DFS_SCAN) \
  1185. CFG(CFG_ENABLE_CONNECTED_SCAN) \
  1186. CFG(CFG_INITIAL_NO_DFS_SCAN) \
  1187. CFG(CFG_ACTIVE_MAX_2G_CHANNEL_TIME) \
  1188. CFG(CFG_PASSIVE_MAX_CHANNEL_TIME) \
  1189. CFG(CFG_ACTIVE_MAX_6G_CHANNEL_TIME) \
  1190. CFG(CFG_PASSIVE_MAX_6G_CHANNEL_TIME) \
  1191. CFG(CFG_SCAN_NUM_PROBES) \
  1192. CFG(CFG_SCAN_PROBE_REPEAT_TIME) \
  1193. CFG(CFG_ADAPTIVE_SCAN_DWELL_MODE) \
  1194. CFG(CFG_ADAPTIVE_SCAN_DWELL_MODE_NC) \
  1195. CFG(CFG_HONOUR_NL_SCAN_POLICY_FLAGS) \
  1196. CFG(CFG_IS_BSSID_HINT_PRIORITY) \
  1197. CFG(CFG_PASSIVE_MAX_CHANNEL_TIME_CONC) \
  1198. CFG(CFG_ACTIVE_MAX_CHANNEL_TIME_CONC) \
  1199. CFG(CFG_MAX_REST_TIME_CONC) \
  1200. CFG(CFG_MIN_REST_TIME_CONC) \
  1201. CFG(CFG_IDLE_TIME_CONC) \
  1202. CFG(CFG_ENABLE_MAC_ADDR_SPOOFING) \
  1203. CFG(CFG_SCAN_AGING_TIME) \
  1204. CFG(CFG_ADAPTIVE_EXTSCAN_DWELL_MODE) \
  1205. CFG(CFG_STA_SCAN_BURST_DURATION) \
  1206. CFG(CFG_P2P_SCAN_BURST_DURATION) \
  1207. CFG(CFG_GO_SCAN_BURST_DURATION) \
  1208. CFG(CFG_ENABLE_SNR_MONITORING) \
  1209. CFG(CFG_AP_SCAN_BURST_DURATION) \
  1210. CFG(CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH) \
  1211. CFG(CFG_6GHZ_SCAN_MODE) \
  1212. CFG_SCAN_PNO
  1213. #endif /* __CONFIG_SCAN_H */