wlan_scan_cfg.h 27 KB

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