hostapd: ubus: add bss-color to get_status
authorDavid Bauer <mail@david-bauer.net>
Sat, 14 May 2022 19:50:51 +0000 (21:50 +0200)
committerDavid Bauer <mail@david-bauer.net>
Wed, 8 Jun 2022 21:16:20 +0000 (23:16 +0200)
Add the current BSS color to hostapd get_status method. This field is
set to -1 in case BSS color is not active for the BSS.

Signed-off-by: David Bauer <mail@david-bauer.net>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
package/network/services/hostapd/src/src/ap/ubus.c

index 5f598d1c2c033ce2d42859df77bff6e60847b2ef..1199098b1efd574ffc6f9a0ee8f0340ffb044c5b 100644 (file)
@@ -445,6 +445,12 @@ hostapd_bss_get_status(struct ubus_context *ctx, struct ubus_object *obj,
        blobmsg_add_u32(&b, "channel", channel);
        blobmsg_add_u32(&b, "op_class", op_class);
        blobmsg_add_u32(&b, "beacon_interval", hapd->iconf->beacon_int);
+#ifdef CONFIG_IEEE80211AX
+       blobmsg_add_u32(&b, "bss_color", hapd->iface->conf->he_op.he_bss_color_disabled ? -1 :
+                                        hapd->iface->conf->he_op.he_bss_color);
+#else
+       blobmsg_add_u32(&b, "bss_color", -1);
+#endif
 
        snprintf(phy_name, 17, "%s", hapd->iface->phy);
        blobmsg_add_string(&b, "phy", phy_name);