local_node: query client MBO support from hostapd
authorStijn Tintel <stijn@linux-ipv6.be>
Thu, 11 Aug 2022 09:53:01 +0000 (12:53 +0300)
committerStijn Tintel <stijn@linux-ipv6.be>
Tue, 16 Aug 2022 07:40:28 +0000 (10:40 +0300)
Query client MBO support from hostapd and display it in the output of
the connected_clients ubus method as "multi-band-operation".

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
local_node.c
ubus.c
usteer.h

index c79fd95b68281d7255e29a38d619052324a81b40..e74d945efa05c29b838fbcade49e7e9c3ba2d39e 100644 (file)
@@ -388,6 +388,10 @@ usteer_local_node_assoc_update(struct sta_info *si, struct blob_attr *data)
 static void
 usteer_local_node_update_sta_rrm_wnm(struct sta_info *si, struct blob_attr *client_attr)
 {
+       static const struct blobmsg_policy mbo_policy = {
+               .name = "mbo",
+               .type = BLOBMSG_TYPE_BOOL,
+       };
        static const struct blobmsg_policy rrm_policy = {
                .name = "rrm",
                .type = BLOBMSG_TYPE_ARRAY,
@@ -396,10 +400,18 @@ usteer_local_node_update_sta_rrm_wnm(struct sta_info *si, struct blob_attr *clie
                .name = "extended_capabilities",
                .type = BLOBMSG_TYPE_ARRAY,
        };
-       struct blob_attr *rrm_blob = NULL, *wnm_blob = NULL, *cur;
+       struct blob_attr *mbo_blob = NULL, *rrm_blob = NULL, *wnm_blob = NULL, *cur;
        int rem;
        int i = 0;
 
+       /* MBO */
+       blobmsg_parse(&mbo_policy, 1, &mbo_blob, blobmsg_data(client_attr), blobmsg_data_len(client_attr));
+
+       if (mbo_blob)
+               si->mbo = blobmsg_get_u8(mbo_blob);
+       else
+               si->mbo = false;
+
        /* RRM */
        blobmsg_parse(&rrm_policy, 1, &rrm_blob, blobmsg_data(client_attr), blobmsg_data_len(client_attr));
        if (!rrm_blob)
diff --git a/ubus.c b/ubus.c
index 557656e5994fac9db1907b8debcda82d324c4b13..c385870be0a73d42d190395df46e6cbc253d520f 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -442,6 +442,9 @@ usteer_ubus_get_connected_clients(struct ubus_context *ctx, struct ubus_object *
                        /* BSS-Transition support */
                        blobmsg_add_u8(&b, "bss-transition-management", si->bss_transition);
 
+                       /* MBO support */
+                       blobmsg_add_u8(&b, "multi-band-operation", si->mbo);
+
                        /* Measurements */
                        a = blobmsg_open_array(&b, "measurements");
                        list_for_each_entry(mr, &si->sta->measurements, sta_list) {
index 01c849e70435bbaa55cda1be5d596388e13e1453..bbb7ff14f58a611e6d5b82eb5c74902a9a48bd92 100644 (file)
--- a/usteer.h
+++ b/usteer.h
@@ -246,6 +246,7 @@ struct sta_info {
 
        uint8_t rrm;
        bool bss_transition;
+       bool mbo;
 
        enum roam_trigger_state roam_state;
        uint8_t roam_tries;