3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2025-06-08 23:17:25 +02:00

blacklist: rename ROAM_REQUESTED to AP_BUSY

The initial pass of this feature only envisioned BSS transition
management frames as the trigger to "roam blacklist" a BSS, hence
the original name. But some APs actually utilize status codes that
also indicate to the stations that they are busy, or not able to
handle more connections. This directly aligns with the original
motivation of the "roam blacklist" series and these events should
also trigger this type of blacklist.

First, since we will be applying this blacklist to cases other
than being told to roam, rename this reason code internally to
BLACKLIST_REASON_AP_BUSY. The config option is also being renamed
to [Blacklist].InitialAccessPointBusyTimeout while also supporting
the old config option, but warning that it is deprecated.
This commit is contained in:
James Prestwood 2025-05-19 09:36:21 -07:00 committed by Denis Kenzior
parent 93eef7b02d
commit 9f98c6c3c8
3 changed files with 23 additions and 14 deletions

View File

@ -45,7 +45,7 @@
static uint64_t blacklist_multiplier; static uint64_t blacklist_multiplier;
static uint64_t blacklist_initial_timeout; static uint64_t blacklist_initial_timeout;
static uint64_t blacklist_roam_initial_timeout; static uint64_t blacklist_ap_busy_initial_timeout;
static uint64_t blacklist_max_timeout; static uint64_t blacklist_max_timeout;
struct blacklist_entry { struct blacklist_entry {
@ -67,8 +67,8 @@ static uint64_t get_reason_timeout(enum blacklist_reason reason)
switch (reason) { switch (reason) {
case BLACKLIST_REASON_CONNECT_FAILED: case BLACKLIST_REASON_CONNECT_FAILED:
return blacklist_initial_timeout; return blacklist_initial_timeout;
case BLACKLIST_REASON_ROAM_REQUESTED: case BLACKLIST_REASON_AP_BUSY:
return blacklist_roam_initial_timeout; return blacklist_ap_busy_initial_timeout;
default: default:
l_warn("Unhandled blacklist reason: %u", reason); l_warn("Unhandled blacklist reason: %u", reason);
return 0; return 0;
@ -218,11 +218,19 @@ static int blacklist_init(void)
if (!l_settings_get_uint64(config, "Blacklist", if (!l_settings_get_uint64(config, "Blacklist",
"InitialRoamRequestedTimeout", "InitialRoamRequestedTimeout",
&blacklist_roam_initial_timeout)) &blacklist_ap_busy_initial_timeout))
blacklist_roam_initial_timeout = BLACKLIST_DEFAULT_TIMEOUT; blacklist_ap_busy_initial_timeout = BLACKLIST_DEFAULT_TIMEOUT;
else
l_warn("[Blacklist].InitialRoamRequestedTimeout is deprecated, "
"use [Blacklist].InitialAccessPointBusyTimeout");
if (!l_settings_get_uint64(config, "Blacklist",
"InitialAccessPointBusyTimeout",
&blacklist_ap_busy_initial_timeout))
blacklist_ap_busy_initial_timeout = BLACKLIST_DEFAULT_TIMEOUT;
/* For easier user configuration the timeout values are in seconds */ /* For easier user configuration the timeout values are in seconds */
blacklist_roam_initial_timeout *= L_USEC_PER_SEC; blacklist_ap_busy_initial_timeout *= L_USEC_PER_SEC;
if (!l_settings_get_uint64(config, "Blacklist", if (!l_settings_get_uint64(config, "Blacklist",
"Multiplier", "Multiplier",

View File

@ -27,12 +27,14 @@ enum blacklist_reason {
*/ */
BLACKLIST_REASON_CONNECT_FAILED, BLACKLIST_REASON_CONNECT_FAILED,
/* /*
* This type of blacklist is added when a BSS requests IWD roams * This type of blacklist is added when an AP indicates that its unable
* elsewhere. This is to aid in preventing IWD from roaming/connecting * to handle more connections. This is done via BSS-TM requests or
* back to that BSS in the future unless there are no other "good" * denied authentications/associations with certain status codes.
* candidates to connect to. *
* Once this type of blacklist is applied to a BSS IWD will attempt to
* avoid roaming to it for a configured period of time.
*/ */
BLACKLIST_REASON_ROAM_REQUESTED, BLACKLIST_REASON_AP_BUSY,
}; };
void blacklist_add_bss(const uint8_t *addr, enum blacklist_reason reason); void blacklist_add_bss(const uint8_t *addr, enum blacklist_reason reason);

View File

@ -191,8 +191,7 @@ static uint32_t evaluate_bss_group_rank(const uint8_t *addr, uint32_t freq,
if (blacklist_contains_bss(addr, BLACKLIST_REASON_CONNECT_FAILED)) if (blacklist_contains_bss(addr, BLACKLIST_REASON_CONNECT_FAILED))
return 0; return 0;
roam_blacklist = blacklist_contains_bss(addr, roam_blacklist = blacklist_contains_bss(addr, BLACKLIST_REASON_AP_BUSY);
BLACKLIST_REASON_ROAM_REQUESTED);
good_signal = signal >= netdev_get_low_signal_threshold(freq); good_signal = signal >= netdev_get_low_signal_threshold(freq);
if (good_signal) if (good_signal)
@ -3326,7 +3325,7 @@ static void station_ap_directed_roam(struct station *station,
} }
blacklist_add_bss(station->connected_bss->addr, blacklist_add_bss(station->connected_bss->addr,
BLACKLIST_REASON_ROAM_REQUESTED); BLACKLIST_REASON_AP_BUSY);
station_debug_event(station, "ap-roam-blacklist-added"); station_debug_event(station, "ap-roam-blacklist-added");
/* /*