xref: /wlan-driver/qcacld-3.0/components/mlme/dispatcher/inc/cfg_mlme_roam_scoring.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 /**
19  * DOC: This file contains roam specific SCORING related CFG/INI Items.
20  */
21 
22 #ifndef __CFG_MLME_ROAM_SCORING_H
23 #define __CFG_MLME_ROAM_SCORING_H
24 
25 #ifdef CONNECTION_ROAMING_CFG
26 #define RoamCommon_Delta_min 0
27 #define RoamCommon_Delta_max 30
28 #define RoamCommon_Delta_default 20
29 #define RoamIdle_Delta_min 0
30 #define RoamIdle_Delta_max 20
31 #define RoamIdle_Delta_default 0
32 #define RoamBeaconLoss_TargetMinRSSI_min -127
33 #define RoamBeaconLoss_TargetMinRSSI_max -70
34 #define RoamBeaconLoss_TargetMinRSSI_default -75
35 #define RoamBTM_Delta_min 0
36 #define RoamBTM_Delta_max 20
37 #define RoamBTM_Delta_default 0
38 #define RoamEmergency_TargetMinRSSI_min -127
39 #define RoamEmergency_TargetMinRSSI_max 0
40 #define RoamEmergency_TargetMinRSSI_default -70
41 #else
42 #define RoamCommon_Delta_min 0
43 #define RoamCommon_Delta_max 100
44 #define RoamCommon_Delta_default 0
45 #define RoamIdle_Delta_min 0
46 #define RoamIdle_Delta_max 100
47 #define RoamIdle_Delta_default 0
48 #define RoamBeaconLoss_TargetMinRSSI_min -120
49 #define RoamBeaconLoss_TargetMinRSSI_max 0
50 #define RoamBeaconLoss_TargetMinRSSI_default -75
51 #define RoamBTM_Delta_min 0
52 #define RoamBTM_Delta_max 100
53 #define RoamBTM_Delta_default 0
54 #define RoamEmergency_TargetMinRSSI_min -120
55 #define RoamEmergency_TargetMinRSSI_max 0
56 #define RoamEmergency_TargetMinRSSI_default -75
57 #endif
58 /*
59  * <ini>
60  * roam_score_delta_bitmap - bitmap to enable roam triggers on
61  * which roam score delta is to be applied during roam candidate
62  * selection
63  * @Min: 0
64  * @Max: 0xffffffff
65  * @Default: 0xffffffff
66  *
67  * Bitmap value of the following roam triggers:
68  * ROAM_TRIGGER_REASON_NONE       - B0,
69  * ROAM_TRIGGER_REASON_PER        - B1,
70  * ROAM_TRIGGER_REASON_BMISS      - B2,
71  * ROAM_TRIGGER_REASON_LOW_RSSI   - B3,
72  * ROAM_TRIGGER_REASON_HIGH_RSSI  - B4,
73  * ROAM_TRIGGER_REASON_PERIODIC   - B5,
74  * ROAM_TRIGGER_REASON_MAWC       - B6,
75  * ROAM_TRIGGER_REASON_DENSE      - B7,
76  * ROAM_TRIGGER_REASON_BACKGROUND - B8,
77  * ROAM_TRIGGER_REASON_FORCED     - B9,
78  * ROAM_TRIGGER_REASON_BTM        - B10,
79  * ROAM_TRIGGER_REASON_UNIT_TEST  - B11,
80  * ROAM_TRIGGER_REASON_BSS_LOAD   - B12
81  * ROAM_TRIGGER_REASON_DISASSOC   - B13
82  * ROAM_TRIGGER_REASON_IDLE_ROAM  - B14
83  *
84  * When the bit corresponding to a particular roam trigger reason
85  * is set, the value of "roam_score_delta" is expected over the
86  * roam score of the current connected AP, for that triggered roam
87  *
88  * Related: None
89  *
90  * Supported Feature: Roaming
91  *
92  * Usage: External
93  *
94  * </ini>
95  */
96 #define CFG_ROAM_SCORE_DELTA_TRIGGER_BITMAP CFG_INI_UINT( \
97 			"roam_score_delta_bitmap", \
98 			0, \
99 			0xFFFFFFFF, \
100 			0xFFFFFFFF, \
101 			CFG_VALUE_OR_DEFAULT, \
102 			"Bitmap for various roam triggers")
103 
104 /*
105  * <ini>
106  * roam_score_delta/RoamCommon_Delta - Percentage increment in roam score value
107  * that is expected from a roaming candidate AP.
108  * @Min: 0
109  * @Max: 100
110  * @Default: 0
111  *
112  * This ini is used to provide the percentage increment value over roam
113  * score for the candidate APs so that they can be preferred over current
114  * AP for roaming.
115  *
116  * Related: None
117  *
118  * Supported Feature: Roaming
119  *
120  * Usage: External
121  *
122  * </ini>
123  */
124 #define CFG_ROAM_SCORE_DELTA CFG_INI_UINT( \
125 			"roam_score_delta RoamCommon_Delta", \
126 			RoamCommon_Delta_min,\
127 			RoamCommon_Delta_max, \
128 			RoamCommon_Delta_default, \
129 			CFG_VALUE_OR_DEFAULT, \
130 			"candidate AP's percentage roam score delta")
131 
132 /*
133  * <ini>
134  * min_roam_score_delta - Difference of roam score values between connected
135  * AP and roam candidate AP.
136  * @Min: 0
137  * @Max: 10000
138  * @Default: 0
139  *
140  * This ini is used during CU and low rssi based roam triggers, consider
141  * AP as roam candidate only if its roam score is better than connected
142  * AP score by at least min_roam_score_delta.
143  * If user configured "roam_score_delta" and "min_roam_score_delta" both,
144  * then firmware selects roam candidate AP by considering values of both
145  * INIs.
146  * Example: If DUT is connected with AP1 and roam candidate AP2 has roam
147  * score greater than roam_score_delta and min_roam_score_delta then only
148  * firmware will trigger roaming to AP2.
149  *
150  * Related: roam_score_delta
151  *
152  * Supported Feature: Roaming
153  *
154  * Usage: Internal
155  *
156  * </ini>
157  */
158 #define CFG_CAND_MIN_ROAM_SCORE_DELTA CFG_INI_UINT( \
159 			"min_roam_score_delta", \
160 			0, \
161 			10000, \
162 			0, \
163 			CFG_VALUE_OR_DEFAULT, \
164 			"Diff between connected AP's and candidate AP's roam score")
165 
166 /*
167  * <ini>
168  * RoamCommon_MinRoamDelta - Difference of roam score values between connected
169  * AP and roam candidate AP.
170  * @Min: 0
171  * @Max: 100
172  * @Default: 15
173  *
174  * This ini is used during CU and low rssi based roam triggers, consider
175  * AP as roam candidate only if its roam score is better than connected
176  * AP score by at least RoamCommon_MinRoamDelta.
177  * If user configured "RoamCommon_Delta" and "RoamCommon_MinRoamDelta" both,
178  * then firmware selects roam candidate AP by considering values of both
179  * INIs.
180  * Example: If DUT is connected with AP1 and roam candidate AP2 has roam
181  * score greater than RoamCommon_Delta and RoamCommon_MinRoamDelta then only
182  * firmware will trigger roaming to AP2.
183  * This value needs to be given in percentage
184  *
185  * Related: RoamCommon_Delta
186  *
187  * Supported Feature: Roaming
188  *
189  * Usage: Internal
190  *
191  * </ini>
192  */
193 #define CFG_ROAM_COMMON_MIN_ROAM_DELTA CFG_INI_UINT( \
194 			"RoamCommon_MinRoamDelta", \
195 			0, \
196 			100, \
197 			15, \
198 			CFG_VALUE_OR_DEFAULT, \
199 			"Diff bet connected AP's and candidate AP's roam score")
200 
201 /*
202  * <ini>
203  * enable_scoring_for_roam - enable/disable scoring logic in FW for candidate
204  * selection during roaming
205  *
206  * @Min: 0
207  * @Max: 1
208  * @Default: 1
209  *
210  * This ini is used to enable/disable scoring logic in FW for candidate
211  * selection during roaming.
212  *
213  * Supported Feature: STA Candidate selection by FW during roaming based on
214  * scoring logic.
215  *
216  * Usage: External
217  *
218  * </ini>
219  */
220 #define CFG_ENABLE_SCORING_FOR_ROAM CFG_INI_BOOL( \
221 		"enable_scoring_for_roam", \
222 		1, \
223 		"Enable Scoring for Roam")
224 
225 /*
226  * <cfg>
227  * apsd_enabled - Enable automatic power save delivery
228  * @Min: 0
229  * @Max: 1
230  * @Default: 0
231  *
232  * Supported Feature: Power save
233  *
234  * Usage: Internal
235  *
236  * </cfg>
237  */
238 #define CFG_APSD_ENABLED CFG_BOOL( \
239 		"apsd_enabled", \
240 		0, \
241 		"Enable APSD")
242 
243 /*
244  * <ini>
245  * candidate_min_rssi_for_disconnect/RoamEmergency_TargetMinRSSI -
246  * Candidate AP minimum RSSI in idle roam trigger(in dBm).
247  * @Min: -120
248  * @Max: 0
249  * @Default: -75
250  *
251  * Minimum RSSI value of the candidate AP to consider it as candidate for
252  * roaming when roam trigger is Deauthentication/Disconnection from current
253  * AP. This value will be sent to firmware over the WMI_ROAM_AP_PROFILE
254  * wmi command in the roam_min_rssi_param_list tlv.
255  *
256  * Related: enable_idle_roam.
257  *
258  * Supported Feature: Roaming
259  *
260  * Usage: Internal/External
261  *
262  * </ini>
263  */
264 #define CFG_DISCONNECT_ROAM_TRIGGER_MIN_RSSI CFG_INI_INT( \
265 		"candidate_min_rssi_for_disconnect RoamEmergency_TargetMinRSSI", \
266 		RoamEmergency_TargetMinRSSI_min, \
267 		RoamEmergency_TargetMinRSSI_max, \
268 		RoamEmergency_TargetMinRSSI_default, \
269 		CFG_VALUE_OR_DEFAULT, \
270 		"Minimum RSSI of candidate AP for Disconnect roam trigger")
271 
272 /*
273  * <ini>
274  * candidate_min_rssi_for_beacon_miss/RoamBeaconLoss_TargetMinRSSI -
275  * Candidate AP minimum RSSI for beacon miss roam trigger (in dBm)
276  * @Min: -120
277  * @Max: 0
278  * @Default: -75
279  *
280  * Minimum RSSI value of the candidate AP to consider it as candidate for
281  * roaming when roam trigger is disconnection from current AP due to beacon
282  * miss. This value will be sent to firmware over the WMI_ROAM_AP_PROFILE
283  * wmi command in the roam_min_rssi_param_list tlv.
284  *
285  * Related: None
286  *
287  * Supported Feature: Roaming
288  *
289  * Usage: Internal/External
290  *
291  * </ini>
292  */
293 #define CFG_BMISS_ROAM_MIN_RSSI CFG_INI_INT( \
294 	"candidate_min_rssi_for_beacon_miss RoamBeaconLoss_TargetMinRSSI", \
295 	RoamBeaconLoss_TargetMinRSSI_min, \
296 	RoamBeaconLoss_TargetMinRSSI_max, \
297 	RoamBeaconLoss_TargetMinRSSI_default, \
298 	CFG_VALUE_OR_DEFAULT, \
299 	"Minimum RSSI of candidate AP for Bmiss roam trigger")
300 
301 /*
302  * <ini>
303  * min_rssi_for_2g_to_5g_roam - Candidate AP minimum RSSI for
304  * 2G to 5G roam trigger (in dBm)
305  * @Min: -120
306  * @Max: 0
307  * @Default: -70
308  *
309  * Minimum RSSI value of the candidate AP to consider it as candidate
310  * for 2G to 5G roam.
311  *
312  * Related: None
313  *
314  * Supported Feature: Roaming
315  *
316  * Usage: Internal/External
317  *
318  * </ini>
319  */
320 #define CFG_2G_TO_5G_ROAM_MIN_RSSI CFG_INI_INT( \
321 	"min_rssi_for_2g_to_5g_roam", \
322 	-120, \
323 	0, \
324 	-70, \
325 	CFG_VALUE_OR_DEFAULT, \
326 	"Minimum RSSI of candidate AP for 2G to 5G roam trigger")
327 
328 /*
329  * <ini>
330  * idle_roam_score_delta/RoamIdle_Delta - Roam score delta value in
331  * percentage for idle roam.
332  * @Min: 0
333  * @Max: 100
334  * @Default: 0
335  *
336  * This ini is used to configure the minimum change in roam score
337  * value of the AP to consider it as candidate for
338  * roaming when roam trigger is due to idle state of sta.
339  * This value will be sent to firmware over the WMI_ROAM_AP_PROFILE wmi
340  * command in the roam_score_delta_param_list tlv.
341  * Related: None
342  *
343  * Supported Feature: Roaming
344  *
345  * Usage: External
346  *
347  * </ini>
348  */
349 #define CFG_IDLE_ROAM_SCORE_DELTA CFG_INI_UINT( \
350 		"idle_roam_score_delta RoamIdle_Delta", \
351 		RoamIdle_Delta_min, \
352 		RoamIdle_Delta_max, \
353 		RoamIdle_Delta_default, \
354 		CFG_VALUE_OR_DEFAULT, \
355 		"Roam score delta for Idle roam trigger")
356 
357 /*
358  * <ini>
359  * btm_roam_score_delta/RoamBTM_Delta - Roam score delta value in percentage for
360  * BTM triggered roaming.
361  * @Min: 0
362  * @Max: 100
363  * @Default: 0
364  *
365  * This ini is used to configure the minimum change in roam score
366  * value of the AP to consider it as candidate when the sta is disconnected
367  * from the current AP due to BTM kickout.
368  * This value will be sent to firmware over the WMI_ROAM_AP_PROFILE wmi
369  * command in the roam_score_delta_param_list tlv.
370  *
371  * Related: None
372  *
373  * Supported Feature: Roaming
374  *
375  * Usage: External
376  *
377  * </ini>
378  */
379 #define CFG_BTM_ROAM_SCORE_DELTA CFG_INI_UINT( \
380 	"btm_roam_score_delta RoamBTM_Delta", \
381 	RoamBTM_Delta_min, \
382 	RoamBTM_Delta_max, \
383 	RoamBTM_Delta_default, \
384 	CFG_VALUE_OR_DEFAULT, \
385 	"Roam score delta for BTM roam trigger")
386 
387 #define CFG_ROAM_SCORING_ALL \
388 	CFG(CFG_ROAM_SCORE_DELTA_TRIGGER_BITMAP) \
389 	CFG(CFG_ROAM_SCORE_DELTA) \
390 	CFG(CFG_CAND_MIN_ROAM_SCORE_DELTA) \
391 	CFG(CFG_ROAM_COMMON_MIN_ROAM_DELTA) \
392 	CFG(CFG_ENABLE_SCORING_FOR_ROAM) \
393 	CFG(CFG_APSD_ENABLED) \
394 	CFG(CFG_DISCONNECT_ROAM_TRIGGER_MIN_RSSI) \
395 	CFG(CFG_BMISS_ROAM_MIN_RSSI) \
396 	CFG(CFG_2G_TO_5G_ROAM_MIN_RSSI) \
397 	CFG(CFG_IDLE_ROAM_SCORE_DELTA) \
398 	CFG(CFG_BTM_ROAM_SCORE_DELTA)
399 
400 #endif /* __CFG_MLME_ROAM_SCORING_H */
401