usteer: expose STA link measurement capability
authorDavid Bauer <mail@david-bauer.net>
Wed, 30 Mar 2022 22:45:08 +0000 (00:45 +0200)
committerDavid Bauer <mail@david-bauer.net>
Thu, 31 Mar 2022 21:57:55 +0000 (23:57 +0200)
Indicate STA capability for handling link-measurement requests in
connected_clients output.

Signed-off-by: David Bauer <mail@david-bauer.net>
sta.c
ubus.c
usteer.h

diff --git a/sta.c b/sta.c
index 9c11bc3938e17fab312c8224fac5b4cac36784ba..740463dd2efe6c04f7874300ea1aed33967dfc18 100644 (file)
--- a/sta.c
+++ b/sta.c
@@ -227,6 +227,12 @@ usteer_sta_supports_beacon_measurement_mode(struct sta_info *si, enum usteer_bea
        return false;
 }
 
+bool
+usteer_sta_supports_link_measurement(struct sta_info *si)
+{
+       return si->rrm & (1 << 0);
+}
+
 static void __usteer_init usteer_sta_init(void)
 {
        usteer_timeout_init(&tq);
diff --git a/ubus.c b/ubus.c
index 672c9900c586e4882a0f43ff7ef9935549a6d5b1..95614b94ef1f24003b0bcf39b0afa7f268834784 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -435,6 +435,9 @@ usteer_ubus_get_connected_clients(struct ubus_context *ctx, struct ubus_object *
                                blobmsg_add_string(&b, "", "TABLE");
                        blobmsg_close_array(&b, a);
 
+                       /* Link-Measurement support */
+                       blobmsg_add_u8(&b, "link-measurement", usteer_sta_supports_link_measurement(si));
+
                        /* BSS-Transition support */
                        blobmsg_add_u8(&b, "bss-transition-management", si->bss_transition);
 
index 9d9693f14f06d04a1f7a97896b7e1888a653fa2a..70663552888699a7eecba566847857234e62d86e 100644 (file)
--- a/usteer.h
+++ b/usteer.h
@@ -344,6 +344,7 @@ struct sta *usteer_sta_get(const uint8_t *addr, bool create);
 struct sta_info *usteer_sta_info_get(struct sta *sta, struct usteer_node *node, bool *create);
 
 bool usteer_sta_supports_beacon_measurement_mode(struct sta_info *si, enum usteer_beacon_measurement_mode mode);
+bool usteer_sta_supports_link_measurement(struct sta_info *si);
 
 void usteer_sta_disconnected(struct sta_info *si);
 void usteer_sta_info_update_timeout(struct sta_info *si, int timeout);