mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-06-08 14:57: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:
parent
93eef7b02d
commit
9f98c6c3c8
@ -45,7 +45,7 @@
|
||||
|
||||
static uint64_t blacklist_multiplier;
|
||||
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;
|
||||
|
||||
struct blacklist_entry {
|
||||
@ -67,8 +67,8 @@ static uint64_t get_reason_timeout(enum blacklist_reason reason)
|
||||
switch (reason) {
|
||||
case BLACKLIST_REASON_CONNECT_FAILED:
|
||||
return blacklist_initial_timeout;
|
||||
case BLACKLIST_REASON_ROAM_REQUESTED:
|
||||
return blacklist_roam_initial_timeout;
|
||||
case BLACKLIST_REASON_AP_BUSY:
|
||||
return blacklist_ap_busy_initial_timeout;
|
||||
default:
|
||||
l_warn("Unhandled blacklist reason: %u", reason);
|
||||
return 0;
|
||||
@ -218,11 +218,19 @@ static int blacklist_init(void)
|
||||
|
||||
if (!l_settings_get_uint64(config, "Blacklist",
|
||||
"InitialRoamRequestedTimeout",
|
||||
&blacklist_roam_initial_timeout))
|
||||
blacklist_roam_initial_timeout = BLACKLIST_DEFAULT_TIMEOUT;
|
||||
&blacklist_ap_busy_initial_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 */
|
||||
blacklist_roam_initial_timeout *= L_USEC_PER_SEC;
|
||||
blacklist_ap_busy_initial_timeout *= L_USEC_PER_SEC;
|
||||
|
||||
if (!l_settings_get_uint64(config, "Blacklist",
|
||||
"Multiplier",
|
||||
|
@ -27,12 +27,14 @@ enum blacklist_reason {
|
||||
*/
|
||||
BLACKLIST_REASON_CONNECT_FAILED,
|
||||
/*
|
||||
* This type of blacklist is added when a BSS requests IWD roams
|
||||
* elsewhere. This is to aid in preventing IWD from roaming/connecting
|
||||
* back to that BSS in the future unless there are no other "good"
|
||||
* candidates to connect to.
|
||||
* This type of blacklist is added when an AP indicates that its unable
|
||||
* to handle more connections. This is done via BSS-TM requests or
|
||||
* denied authentications/associations with certain status codes.
|
||||
*
|
||||
* 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);
|
||||
|
@ -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))
|
||||
return 0;
|
||||
|
||||
roam_blacklist = blacklist_contains_bss(addr,
|
||||
BLACKLIST_REASON_ROAM_REQUESTED);
|
||||
roam_blacklist = blacklist_contains_bss(addr, BLACKLIST_REASON_AP_BUSY);
|
||||
good_signal = signal >= netdev_get_low_signal_threshold(freq);
|
||||
|
||||
if (good_signal)
|
||||
@ -3326,7 +3325,7 @@ static void station_ap_directed_roam(struct station *station,
|
||||
}
|
||||
|
||||
blacklist_add_bss(station->connected_bss->addr,
|
||||
BLACKLIST_REASON_ROAM_REQUESTED);
|
||||
BLACKLIST_REASON_AP_BUSY);
|
||||
station_debug_event(station, "ap-roam-blacklist-added");
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user