hostapd: add support for enabling link measurements
authorDavid Bauer <mail@david-bauer.net>
Thu, 31 Mar 2022 16:06:02 +0000 (18:06 +0200)
committerDavid Bauer <mail@david-bauer.net>
Sun, 24 Apr 2022 21:26:04 +0000 (23:26 +0200)
Allow external processes to enable advertisement of link-measurement RRM
capability.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 2ca5c3da04c3f05a7477ae484768e03d4ca30711)

package/network/services/hostapd/src/src/ap/ubus.c

index 6edafa538d29fcde39f0f520f45f66dad09d6c00..e9764e057321fcb5147c71b7121973b0b4fe85a8 100644 (file)
@@ -896,6 +896,7 @@ hostapd_rrm_print_nr(struct hostapd_neighbor_entry *nr)
 enum {
        BSS_MGMT_EN_NEIGHBOR,
        BSS_MGMT_EN_BEACON,
+       BSS_MGMT_EN_LINK_MEASUREMENT,
 #ifdef CONFIG_WNM_AP
        BSS_MGMT_EN_BSS_TRANSITION,
 #endif
@@ -923,6 +924,14 @@ __hostapd_bss_mgmt_enable_f(struct hostapd_data *hapd, int flag)
                        WLAN_RRM_CAPS_BEACON_REPORT_ACTIVE |
                        WLAN_RRM_CAPS_BEACON_REPORT_TABLE;
 
+               if (bss->radio_measurements[0] & flags == flags)
+                       return false;
+
+               bss->radio_measurements[0] |= (u8) flags;
+               return true;
+       case BSS_MGMT_EN_LINK_MEASUREMENT:
+               flags = WLAN_RRM_CAPS_LINK_MEASUREMENT;
+
                if (bss->radio_measurements[0] & flags == flags)
                        return false;
 
@@ -960,6 +969,7 @@ __hostapd_bss_mgmt_enable(struct hostapd_data *hapd, uint32_t flags)
 static const struct blobmsg_policy bss_mgmt_enable_policy[__BSS_MGMT_EN_MAX] = {
        [BSS_MGMT_EN_NEIGHBOR] = { "neighbor_report", BLOBMSG_TYPE_BOOL },
        [BSS_MGMT_EN_BEACON] = { "beacon_report", BLOBMSG_TYPE_BOOL },
+       [BSS_MGMT_EN_LINK_MEASUREMENT] = { "link_measurement", BLOBMSG_TYPE_BOOL },
 #ifdef CONFIG_WNM_AP
        [BSS_MGMT_EN_BSS_TRANSITION] = { "bss_transition", BLOBMSG_TYPE_BOOL },
 #endif