policy: export below_max_assoc

Export and rename below_max_assoc in preperation to use with
band-steering.

Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
David Bauer
2022-03-16 23:08:03 +01:00
parent 33a5acdee5
commit 86e72970e8
2 changed files with 5 additions and 3 deletions

View File

@@ -64,8 +64,8 @@ has_better_load(struct usteer_node *node_cur, struct usteer_node *node_new)
return !below_load_threshold(node_cur) && below_load_threshold(node_new);
}
static bool
below_max_assoc(struct usteer_node *node)
bool
usteer_policy_node_below_max_assoc(struct usteer_node *node)
{
return !node->max_assoc || node->n_assoc < node->max_assoc;
}
@@ -91,7 +91,7 @@ is_better_candidate(struct sta_info *si_cur, struct sta_info *si_new)
int new_signal = si_new->signal;
uint32_t reasons = 0;
if (!below_max_assoc(new_node))
if (!usteer_policy_node_below_max_assoc(new_node))
return 0;
if (!over_min_signal(new_node, new_signal))

View File

@@ -315,6 +315,8 @@ 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);
void usteer_ubus_init(struct ubus_context *ctx);
void usteer_ubus_kick_client(struct sta_info *si);
int usteer_ubus_trigger_client_scan(struct sta_info *si);