band-steering: add band-steering component

This adds a new band-steering component to usteer.

With band-steering enabled, usteer will attempt to move clients with a
consistently good SNR / signal from 2.4 GHz to the 5 GHz band.

In contrast to existing policies usteer tracks, band-steering is
non-invasive and will not lead to forceful connection termination.

Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
David Bauer
2022-03-15 22:56:14 +01:00
parent 439acc5d2b
commit f4e120c9a3
10 changed files with 156 additions and 2 deletions

27
ubus.c
View File

@@ -181,6 +181,8 @@ struct cfg_item {
_cfg(U32, load_kick_delay), \
_cfg(U32, load_kick_min_clients), \
_cfg(U32, load_kick_reason_code), \
_cfg(U32, band_steering_interval), \
_cfg(I32, band_steering_min_snr), \
_cfg(ARRAY_CB, interfaces), \
_cfg(STRING_CB, node_up_script), \
_cfg(ARRAY_CB, event_log_types), \
@@ -654,6 +656,31 @@ int usteer_ubus_bss_transition_request(struct sta_info *si,
return ubus_invoke(ubus_ctx, ln->obj_id, "bss_transition_request", b.head, NULL, 0, 100);
}
int usteer_ubus_band_steering_request(struct sta_info *si)
{
struct usteer_local_node *ln = container_of(si->node, struct usteer_local_node, node);
struct usteer_node *node;
void *c;
blob_buf_init(&b, 0);
blobmsg_printf(&b, "addr", MAC_ADDR_FMT, MAC_ADDR_DATA(si->sta->addr));
blobmsg_add_u32(&b, "dialog_token", 0);
blobmsg_add_u8(&b, "disassociation_imminent", false);
blobmsg_add_u8(&b, "abridged", false);
blobmsg_add_u32(&b, "validity_period", 100);
c = blobmsg_open_array(&b, "neighbors");
for_each_local_node(node) {
if (!usteer_band_steering_is_target(ln, node))
continue;
usteer_add_nr_entry(si->node, node);
}
blobmsg_close_array(&b, c);
return ubus_invoke(ubus_ctx, ln->obj_id, "bss_transition_request", b.head, NULL, 0, 100);
}
int usteer_ubus_notify_client_disassoc(struct sta_info *si)
{
struct usteer_local_node *ln = container_of(si->node, struct usteer_local_node, node);