Skip to content

Commit

Permalink
hostapd: add support for enabling link measurements
Browse files Browse the repository at this point in the history
Allow external processes to enable advertisement of link-measurement RRM
capability.

Signed-off-by: David Bauer <mail@david-bauer.net>
  • Loading branch information
blocktrron committed Apr 7, 2022
1 parent f6d5663 commit 2ca5c3d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions package/network/services/hostapd/src/src/ap/ubus.c
Expand Up @@ -995,6 +995,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
Expand Down Expand Up @@ -1022,6 +1023,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;

Expand Down Expand Up @@ -1059,6 +1068,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
Expand Down

0 comments on commit 2ca5c3d

Please sign in to comment.