From: David Bauer Date: Mon, 25 Oct 2021 13:09:52 +0000 (+0200) Subject: local-node: update STA RRM capabilites X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=abc6fe047f0ed0d1bc7d2e177072e0b28dd0b7c6;p=project%2Fusteer.git local-node: update STA RRM capabilites Save the RRM capabilities of STAs when updating clients from hostapd. This is required to determine which measurement modes a STA supports. Signed-off-by: David Bauer --- diff --git a/local_node.c b/local_node.c index c237b2f..3a6b631 100644 --- a/local_node.c +++ b/local_node.c @@ -180,6 +180,31 @@ usteer_local_node_assoc_update(struct sta_info *si, struct blob_attr *data) si->sta->seen_5ghz = 1; } +static void +usteer_local_node_update_sta_rrm(const uint8_t *addr, struct blob_attr *client_attr) +{ + static const struct blobmsg_policy rrm_policy = { + .name = "rrm", + .type = BLOBMSG_TYPE_ARRAY, + }; + struct blob_attr *sta_blob = NULL; + struct sta *sta; + + if (!addr) + return; + + /* Don't create the STA */ + sta = usteer_sta_get(addr, false); + if (!sta) + return; + + blobmsg_parse(&rrm_policy, 1, &sta_blob, blobmsg_data(client_attr), blobmsg_data_len(client_attr)); + if (!sta_blob) + return; + + sta->rrm = blobmsg_get_u32(blobmsg_data(sta_blob)); +} + static void usteer_local_node_set_assoc(struct usteer_local_node *ln, struct blob_attr *cl) { @@ -218,6 +243,9 @@ usteer_local_node_set_assoc(struct usteer_local_node *ln, struct blob_attr *cl) si->last_connected = current_time; n_assoc++; } + + /* Read RRM information */ + usteer_local_node_update_sta_rrm(addr, cur); } node->n_assoc = n_assoc; diff --git a/usteer.h b/usteer.h index cd83c78..694e492 100644 --- a/usteer.h +++ b/usteer.h @@ -242,6 +242,8 @@ struct sta { uint8_t seen_5ghz : 1; uint8_t addr[6]; + + uint8_t rrm; }; extern struct ubus_context *ubus_ctx;