From: David Bauer Date: Wed, 17 Aug 2022 20:18:55 +0000 (+0200) Subject: policy: make steering ability evaluation uniform X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=aadc562dcb623ec51bffc319e3f214e011cf85a5;p=project%2Fusteer.git policy: make steering ability evaluation uniform Usteer imposes minimum intervals for steering actions in order to avoid creating endless roam-kick loops due to the decentral aspect of usteer. Make these basic limits to roamsteering usable across band-steering and signal-based roam-steering. Signed-off-by: David Bauer --- diff --git a/band_steering.c b/band_steering.c index fb4a3f1..7fce1df 100644 --- a/band_steering.c +++ b/band_steering.c @@ -81,7 +81,8 @@ void usteer_band_steering_perform_steer(struct usteer_local_node *ln) ln->band_steering_interval = 0; list_for_each_entry(si, &ln->node.sta_info, node_list) { - if (si->connected != STA_CONNECTED) + /* Check if client is eligable to be steerd */ + if (!usteer_policy_can_perform_roam(si)) continue; /* Skip clients with insufficient SNR-state */ diff --git a/policy.c b/policy.c index 90a12a0..bb10be5 100644 --- a/policy.c +++ b/policy.c @@ -378,17 +378,12 @@ usteer_roam_trigger_sm(struct usteer_local_node *ln, struct sta_info *si) return false; } -static bool -usteer_local_node_roam_sm_active(struct sta_info *si, int min_signal) +bool usteer_policy_can_perform_roam(struct sta_info *si) { /* Only trigger for connected STAs */ if (si->connected != STA_CONNECTED) return false; - /* Signal has to be below scan / roam threshold */ - if (si->signal >= min_signal) - return false; - /* Skip on pending kick */ if (si->kick_time) return false; @@ -408,6 +403,19 @@ usteer_local_node_roam_sm_active(struct sta_info *si, int min_signal) return true; } +static bool +usteer_local_node_roam_sm_active(struct sta_info *si, int min_signal) +{ + if (!usteer_policy_can_perform_roam(si)) + return false; + + /* Signal has to be below scan / roam threshold */ + if (si->signal >= min_signal) + return false; + + return true; +} + static void usteer_local_node_roam_check(struct usteer_local_node *ln, struct uevent *ev) { diff --git a/usteer.h b/usteer.h index 4f5aa1b..f692fb8 100644 --- a/usteer.h +++ b/usteer.h @@ -327,6 +327,7 @@ void usteer_local_node_kick(struct usteer_local_node *ln); int usteer_local_node_get_beacon_interval(struct usteer_local_node *ln); bool usteer_policy_node_below_max_assoc(struct usteer_node *node); +bool usteer_policy_can_perform_roam(struct sta_info *si); void usteer_band_steering_perform_steer(struct usteer_local_node *ln); void usteer_band_steering_sta_update(struct sta_info *si);