xref: /wlan-dirver/qca-wifi-host-cmn/umac/dcs/dispatcher/inc/cfg_dcs.h (revision 2f4b444fb7e689b83a4ab0e7b3b38f0bf4def8e0)
1 /*
2  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /**
18  * DOC: This file contains centralized definitions of DCS component
19  */
20 #ifndef __CONFIG_DCS_H
21 #define __CONFIG_DCS_H
22 
23 #include "cfg_define.h"
24 
25 /*
26  * <ini>
27  * gEnableDcs - Enable/Disable DCS
28  * @Min: 0
29  * @Max: 3
30  * @Default: 0
31  *
32  * This ini is used to enable/disable DCS. Configurations are as follows:
33  * 0 - Disable DCS.
34  * 1 - Enable DCS for CW interference mitigation(CW_IM).
35  * 2 - Enable DCS for WLAN interference mitigation(WLAN_IM).
36  * 3 - Enable both DCS for CW_IM and DCS for WLAN_IM.
37  *
38  * Related: None
39  *
40  * Supported Feature: DCS
41  *
42  * Usage: External
43  *
44  * </ini>
45  */
46 #define CFG_DCS_ENABLE CFG_INI_UINT(\
47 		"gEnableDcs",\
48 		0, 3, 0,\
49 		CFG_VALUE_OR_DEFAULT, "Enable DCS")
50 
51 /*
52  * <ini>
53  * dcs_debug - Configure dcs debug trace level for debug purpose
54  * @Min: 0
55  * @Max: 2
56  * @Default: 0
57  *
58  * This ini is used to configure dcs debug trace level for debug purpose
59  *
60  *
61  * Related: None
62  *
63  * Usage: External
64  *
65  * </ini>
66  */
67 #define CFG_DCS_DEBUG CFG_INI_UINT(\
68 		"dcs_debug",\
69 		0, 2, 0,\
70 		CFG_VALUE_OR_DEFAULT,\
71 		"dcs debug trace level")
72 
73 /*
74  * <ini>
75  * dcs_coch_intfr_threshold - Configure co-channel interference threshold
76  * @Min: 0
77  * @Max: 0xFFFFFFFF
78  * @Default: 30
79  *
80  * This ini is used to configure co-channel interference threshold
81  *
82  *
83  * Related: None
84  *
85  * Usage: External
86  *
87  * </ini>
88  */
89 #define CFG_DCS_COCH_INTFR_THRESHOLD CFG_INI_UINT(\
90 		"dcs_coch_intfr_threshold",\
91 		0, 0xFFFFFFFF, 30,\
92 		CFG_VALUE_OR_DEFAULT,\
93 		"dcs co-channel interference threshold level")
94 
95 /*
96  * <ini>
97  * dcs_tx_err_threshold - Configure transmission failure rate threshold
98  * @Min: 0
99  * @Max: 0xFFFFFFFF
100  * @Default: 30
101  *
102  * This ini is used to configure transmission failure rate threshold
103  *
104  *
105  * Related: None
106  *
107  * Usage: External
108  *
109  * </ini>
110  */
111 #define CFG_DCS_TX_ERR_THRESHOLD CFG_INI_UINT(\
112 		"dcs_tx_err_threshold",\
113 		0, 0xFFFFFFFF, 30,\
114 		CFG_VALUE_OR_DEFAULT,\
115 		"dcs transmission failure rate threshold")
116 
117 /*
118  * <ini>
119  * dcs_phy_err_penalty - Configure channel time wasted due to each Phy
120  * error(phy error penalty)
121  * @Min: 0
122  * @Max: 0xFFFFFFFF
123  * @Default: 500
124  *
125  * This ini is used to configure phy error penalty
126  *
127  *
128  * Related: None
129  *
130  * Usage: External
131  *
132  * </ini>
133  */
134 #define CFG_DCS_PHY_ERR_PENALTY CFG_INI_UINT(\
135 		"dcs_phy_err_penalty",\
136 		0, 0xFFFFFFFF, 500,\
137 		CFG_VALUE_OR_DEFAULT,\
138 		"dcs phy error penalty")
139 
140 /*
141  * <ini>
142  * dcs_phy_err_threshold - Configure phy err threshold
143  * @Min: 0
144  * @Max: 0xFFFFFFFF
145  * @Default: 300
146  *
147  * This ini is used to configure phy error threshold
148  *
149  *
150  * Related: None
151  *
152  * Usage: External
153  *
154  * </ini>
155  */
156 #define CFG_DCS_PHY_ERR_THRESHOLD CFG_INI_UINT(\
157 		"dcs_phy_err_threshold",\
158 		0, 0xFFFFFFFF, 300,\
159 		CFG_VALUE_OR_DEFAULT,\
160 		"dcs phy error threshold")
161 
162 /*
163  * <ini>
164  * dcs_user_max_cu - Configure tx channel utilization due to AP's tx and rx
165  * @Min: 0
166  * @Max: 0xFFFFFFFF
167  * @Default: 50
168  *
169  * This ini is used to configure tx channel utilization due to AP's tx and rx
170  *
171  *
172  * Related: None
173  *
174  * Usage: External
175  *
176  * </ini>
177  */
178 #define CFG_DCS_USER_MAX_CU CFG_INI_UINT(\
179 		"user_max_cu",\
180 		0, 0xFFFFFFFF, 50,\
181 		CFG_VALUE_OR_DEFAULT,\
182 		"dcs tx channel utilization")
183 
184 /*
185  * <ini>
186  * dcs_radar_err_threshold - Configure radar error threshold
187  * @Min: 0
188  * @Max: 0xFFFFFFFF
189  * @Default: 1000
190  *
191  * This ini is used to configure radar error threshold
192  *
193  *
194  * Related: None
195  *
196  * Usage: External
197  *
198  * </ini>
199  */
200 #define CFG_DCS_RADAR_ERR_THRESHOLD CFG_INI_UINT(\
201 		"dcs_radar_err_threshold",\
202 		0, 0xFFFFFFFF, 1000,\
203 		CFG_VALUE_OR_DEFAULT,\
204 		"dcs radar error threshold")
205 
206 /*
207  * <ini>
208  * dcs_intfr_detection_threshold - Configure interference detection threshold
209  * @Min: 0
210  * @Max: 0xFFFFFFFF
211  * @Default: 6
212  *
213  * This ini is used to configure interference detection threshold
214  *
215  *
216  * Related: None
217  *
218  * Usage: External
219  *
220  * </ini>
221  */
222 #define CFG_DCS_INTFR_DETECTION_THRESHOLD CFG_INI_UINT(\
223 		"dcs_intfr_detection_threshold",\
224 		0, 0xFFFFFFFF, 6,\
225 		CFG_VALUE_OR_DEFAULT,\
226 		"dcs interference detection threshold")
227 
228 /*
229  * <ini>
230  * dcs_intfr_detection_window - Configure interference sampling window
231  * @Min: 0
232  * @Max: 0xFFFFFFFF
233  * @Default: 10
234  *
235  * This ini is used to configure interference sampling window
236  *
237  *
238  * Related: None
239  *
240  * Usage: External
241  *
242  * </ini>
243  */
244 #define CFG_DCS_INTFR_DETECTION_WINDOW CFG_INI_UINT(\
245 		"dcs_intfr_detection_window",\
246 		0, 0xFFFFFFFF, 10,\
247 		CFG_VALUE_OR_DEFAULT,\
248 		"dcs interference sampling window")
249 
250 /*
251  * <ini>
252  * dcs_disable_threshold_per_5mins - In five minutes, if dcs happen
253  * more than threshold, then disable dcs for some time
254  * @Min: 0
255  * @Max: 10
256  * @Default: 3
257  *
258  * This ini is used to dcs happen times threshold in five minutes
259  *
260  *
261  * Related: None
262  *
263  * Usage: External
264  *
265  * </ini>
266  */
267 #define CFG_DCS_DISABLE_THRESHOLD_PER_5MINS CFG_INI_UINT(\
268 		"dcs_disable_thresh_per_5mins",\
269 		0, 10, 3,\
270 		CFG_VALUE_OR_DEFAULT,\
271 		"dcs happen times threshold in five minutes")
272 
273 /*
274  * <ini>
275  * dcs_restart_delay - When dcs happen more than threshold in five minutes,
276  * then start to disable dcs for some minutes, then enable dcs again.
277  * @Min: 0
278  * @Max: 0xFFFFFFFF
279  * @Default: 30
280  *
281  * This ini is used to configure dcs disable time length in minute unit
282  *
283  *
284  * Related: None
285  *
286  * Usage: External
287  *
288  * </ini>
289  */
290 #define CFG_DCS_RESTART_DELAY CFG_INI_UINT(\
291 		"dcs_restart_delay",\
292 		0, 0xFFFFFFFF, 30,\
293 		CFG_VALUE_OR_DEFAULT, "dcs restart delay")
294 
295 #define CFG_DCS_ALL \
296 	CFG(CFG_DCS_ENABLE) \
297 	CFG(CFG_DCS_DEBUG) \
298 	CFG(CFG_DCS_COCH_INTFR_THRESHOLD) \
299 	CFG(CFG_DCS_TX_ERR_THRESHOLD) \
300 	CFG(CFG_DCS_PHY_ERR_PENALTY) \
301 	CFG(CFG_DCS_PHY_ERR_THRESHOLD) \
302 	CFG(CFG_DCS_USER_MAX_CU) \
303 	CFG(CFG_DCS_RADAR_ERR_THRESHOLD) \
304 	CFG(CFG_DCS_INTFR_DETECTION_THRESHOLD) \
305 	CFG(CFG_DCS_INTFR_DETECTION_WINDOW) \
306 	CFG(CFG_DCS_DISABLE_THRESHOLD_PER_5MINS) \
307 	CFG(CFG_DCS_RESTART_DELAY)
308 
309 #endif /* __CONFIG_DCS_H */
310