wlan_scan_cfg.h 28 KB

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