scan: Add support for separate 6Ghz band modifier

This commit is contained in:
Marcel Holtmann 2022-11-13 15:07:35 +01:00 committed by Denis Kenzior
parent 644586e273
commit b4406cce82
2 changed files with 18 additions and 2 deletions

View File

@ -310,6 +310,13 @@ autoconnect purposes.
networks are highly RSSI sensitive, so it is still possible for IWD to
prefer 2.4Ghz APs in certain circumstances.
* - BandModifier6Ghz
- Values: floating point value (default: **1.0**)
Increase or decrease the preference for 6GHz access points by increasing
or decreasing the value of this modifier. Since 6GHz networks are highly
RSSI sensitive, this gives an option to prefer 6GHz APs over 5GHz APs.
Scan
----

View File

@ -54,6 +54,7 @@
/* User configurable options */
static double RANK_5G_FACTOR;
static double RANK_6G_FACTOR;
static uint32_t SCAN_MAX_INTERVAL;
static uint32_t SCAN_INIT_INTERVAL;
@ -1645,10 +1646,14 @@ static void scan_bss_compute_rank(struct scan_bss *bss)
rank = (double)bss->data_rate / max_rate * USHRT_MAX;
/* Prefer 5G/6G networks over 2.4G */
if (bss->frequency > 4000)
/* Prefer 5G networks over 2.4G and 6G */
if (bss->frequency >= 4900 && bss->frequency < 5900)
rank *= RANK_5G_FACTOR;
/* Prefer 6G networks over 2.4G and 5G */
if (bss->frequency >= 5900 && bss->frequency < 7200)
rank *= RANK_6G_FACTOR;
/* Rank loaded APs lower and lightly loaded APs higher */
if (bss->utilization >= 192)
rank *= RANK_HIGH_UTILIZATION_FACTOR;
@ -2343,6 +2348,10 @@ static int scan_init(void)
&RANK_5G_FACTOR))
RANK_5G_FACTOR = 1.0;
if (!l_settings_get_double(config, "Rank", "BandModifier6Ghz",
&RANK_6G_FACTOR))
RANK_6G_FACTOR = 1.0;
if (!l_settings_get_uint(config, "Scan", "InitialPeriodicScanInterval",
&SCAN_INIT_INTERVAL))
SCAN_INIT_INTERVAL = 10;