xref: /wlan-driver/qcacld-3.0/components/fw_offload/dispatcher/inc/cfg_adaptive_dwelltime.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name /**
21*5113495bSYour Name  * DOC: This file contains adaptive dwell components.
22*5113495bSYour Name  */
23*5113495bSYour Name 
24*5113495bSYour Name #ifndef __CFG_ADAPTIVE_DWELLTIME_H
25*5113495bSYour Name #define __CFG_ADAPTIVE_DWELLTIME_H
26*5113495bSYour Name 
27*5113495bSYour Name /*
28*5113495bSYour Name  * <ini>
29*5113495bSYour Name  * adaptive_dwell_mode_enabled - enable/disable the adaptive dwell config.
30*5113495bSYour Name  * @Min: 0
31*5113495bSYour Name  * @Max: 1
32*5113495bSYour Name  * @Default: 1
33*5113495bSYour Name  *
34*5113495bSYour Name  *
35*5113495bSYour Name  * This ini will globally disable/enable the adaptive dwell config.
36*5113495bSYour Name  * Following parameters will set different values of attributes for dwell
37*5113495bSYour Name  * time optimization thus reducing total scan time.
38*5113495bSYour Name  * Acceptable values for this:
39*5113495bSYour Name  * 0: Config is disabled
40*5113495bSYour Name  * 1: Config is enabled
41*5113495bSYour Name  *
42*5113495bSYour Name  * Related: None.
43*5113495bSYour Name  *
44*5113495bSYour Name  * Supported Feature: Scan
45*5113495bSYour Name  *
46*5113495bSYour Name  * Usage: External
47*5113495bSYour Name  *
48*5113495bSYour Name  * </ini>
49*5113495bSYour Name  */
50*5113495bSYour Name #define CFG_ADAPTIVE_DWELL_MODE_ENABLED CFG_INI_BOOL(\
51*5113495bSYour Name 				"adaptive_dwell_mode_enabled",\
52*5113495bSYour Name 				1, \
53*5113495bSYour Name 				"enable the adaptive dwell config")
54*5113495bSYour Name 
55*5113495bSYour Name /*
56*5113495bSYour Name  * <ini>
57*5113495bSYour Name  * global_adapt_dwelltime_mode - set default adaptive mode.
58*5113495bSYour Name  * @Min: 0
59*5113495bSYour Name  * @Max: 4
60*5113495bSYour Name  * @Default: 0
61*5113495bSYour Name  *
62*5113495bSYour Name  * This ini will set default adaptive mode, will be used if any of the
63*5113495bSYour Name  * scan dwell mode is set to default.
64*5113495bSYour Name  * For uses : see enum scan_dwelltime_adaptive_mode
65*5113495bSYour Name  *
66*5113495bSYour Name  * Related: None.
67*5113495bSYour Name  *
68*5113495bSYour Name  * Supported Feature: Scan
69*5113495bSYour Name  *
70*5113495bSYour Name  * Usage: External
71*5113495bSYour Name  *
72*5113495bSYour Name  * </ini>
73*5113495bSYour Name  */
74*5113495bSYour Name #define CFG_GLOBAL_ADAPTIVE_DWELL_MODE CFG_INI_UINT(\
75*5113495bSYour Name 				"global_adapt_dwelltime_mode",\
76*5113495bSYour Name 				0, 4, 0,\
77*5113495bSYour Name 				CFG_VALUE_OR_DEFAULT, \
78*5113495bSYour Name 				"set default adaptive mode")
79*5113495bSYour Name 
80*5113495bSYour Name /*
81*5113495bSYour Name  * <ini>
82*5113495bSYour Name  * adapt_dwell_lpf_weight - weight to calculate avg low pass filter.
83*5113495bSYour Name  * @Min: 0
84*5113495bSYour Name  * @Max: 100
85*5113495bSYour Name  * @Default: 80
86*5113495bSYour Name  *
87*5113495bSYour Name  * This ini is used to set the weight to calculate
88*5113495bSYour Name  * the average low pass filter for channel congestion.
89*5113495bSYour Name  * Acceptable values for this: 0-100 (In %)
90*5113495bSYour Name  *
91*5113495bSYour Name  * Related: None.
92*5113495bSYour Name  *
93*5113495bSYour Name  * Supported Feature: Scan
94*5113495bSYour Name  *
95*5113495bSYour Name  * Usage: External
96*5113495bSYour Name  *
97*5113495bSYour Name  * </ini>
98*5113495bSYour Name  */
99*5113495bSYour Name #define CFG_ADAPT_DWELL_LPF_WEIGHT CFG_INI_UINT(\
100*5113495bSYour Name 				"adapt_dwell_lpf_weight",\
101*5113495bSYour Name 				0, 100, 80,\
102*5113495bSYour Name 				CFG_VALUE_OR_DEFAULT, \
103*5113495bSYour Name 				"weight to calc avg low pass filter")
104*5113495bSYour Name 
105*5113495bSYour Name /*
106*5113495bSYour Name  * <ini>
107*5113495bSYour Name  * adapt_dwell_passive_mon_intval - Interval to monitor passive scan in msec.
108*5113495bSYour Name  * @Min: 0
109*5113495bSYour Name  * @Max: 25
110*5113495bSYour Name  * @Default: 10
111*5113495bSYour Name  *
112*5113495bSYour Name  * This ini is used to set interval to monitor wifi
113*5113495bSYour Name  * activity in passive scan in milliseconds.
114*5113495bSYour Name  *
115*5113495bSYour Name  * Related: None.
116*5113495bSYour Name  *
117*5113495bSYour Name  * Supported Feature: Scan
118*5113495bSYour Name  *
119*5113495bSYour Name  * Usage: External
120*5113495bSYour Name  *
121*5113495bSYour Name  * </ini>
122*5113495bSYour Name  */
123*5113495bSYour Name #define CFG_ADAPT_DWELL_PASMON_INTVAL CFG_INI_UINT(\
124*5113495bSYour Name 				"adapt_dwell_passive_mon_intval",\
125*5113495bSYour Name 				0, 25, 10,\
126*5113495bSYour Name 				CFG_VALUE_OR_DEFAULT, \
127*5113495bSYour Name 				"interval to monitor passive scan")
128*5113495bSYour Name 
129*5113495bSYour Name /*
130*5113495bSYour Name  * <ini>
131*5113495bSYour Name  * adapt_dwell_wifi_act_threshold - % of wifi activity used in passive scan
132*5113495bSYour Name  * @Min: 0
133*5113495bSYour Name  * @Max: 100
134*5113495bSYour Name  * @Default: 10
135*5113495bSYour Name  *
136*5113495bSYour Name  * This ini is used to set % of wifi activity used in passive scan
137*5113495bSYour Name  * Acceptable values for this: 0-100 (in %)
138*5113495bSYour Name  *
139*5113495bSYour Name  * Related: None.
140*5113495bSYour Name  *
141*5113495bSYour Name  * Supported Feature: Scan
142*5113495bSYour Name  *
143*5113495bSYour Name  * Usage: External
144*5113495bSYour Name  *
145*5113495bSYour Name  * </ini>
146*5113495bSYour Name  */
147*5113495bSYour Name #define CFG_ADAPT_DWELL_WIFI_THRESH CFG_INI_UINT(\
148*5113495bSYour Name 				"adapt_dwell_wifi_act_threshold",\
149*5113495bSYour Name 				0, 100, 10,\
150*5113495bSYour Name 				CFG_VALUE_OR_DEFAULT, \
151*5113495bSYour Name 				"percent of wifi activity in pas scan")
152*5113495bSYour Name 
153*5113495bSYour Name #define CFG_ADAPTIVE_DWELLTIME_ALL \
154*5113495bSYour Name 	CFG(CFG_ADAPTIVE_DWELL_MODE_ENABLED) \
155*5113495bSYour Name 	CFG(CFG_GLOBAL_ADAPTIVE_DWELL_MODE) \
156*5113495bSYour Name 	CFG(CFG_ADAPT_DWELL_LPF_WEIGHT) \
157*5113495bSYour Name 	CFG(CFG_ADAPT_DWELL_PASMON_INTVAL) \
158*5113495bSYour Name 	CFG(CFG_ADAPT_DWELL_WIFI_THRESH)
159*5113495bSYour Name 
160*5113495bSYour Name #endif
161*5113495bSYour Name 
162