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