From c8ef465e10f46fd017cc9c3e455cc368a2b9da2b Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Fri, 6 Dec 2019 18:17:06 +0100 Subject: hostapd: expose beacon reports through ubus Subscribe to beacon reports through ubus. Can be used for hearing map and client steering purposes. First enable rrm: ubus call hostapd.wlan0 bss_mgmt_enable '{"beacon_report":True}' Subscribe to the hostapd notifications via ubus. Request beacon report: ubus call hostapd.wlan0 rrm_beacon_req '{"addr":"00:xx:xx:xx:xx:xx", "op_class":0, "channel":1, "duration":1,"mode":2,"bssid":"ff:ff:ff:ff:ff:ff", "ssid":""}' Signed-off-by: Nick Hainke [rework identation] Signed-off-by: David Bauer --- .../network/services/hostapd/patches/600-ubus_support.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'package/network/services/hostapd/patches') diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 6842c0e63e..b2860780eb 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -458,3 +458,15 @@ case 'o': params.override_driver = optarg; break; +--- a/src/ap/rrm.c ++++ b/src/ap/rrm.c +@@ -89,6 +89,9 @@ static void hostapd_handle_beacon_report + return; + wpa_msg(hapd->msg_ctx, MSG_INFO, BEACON_RESP_RX MACSTR " %u %02x %s", + MAC2STR(addr), token, rep_mode, report); ++ if (len < sizeof(struct rrm_measurement_beacon_report)) ++ return; ++ hostapd_ubus_notify_beacon_report(hapd, addr, token, rep_mode, (struct rrm_measurement_beacon_report*) pos, len); + } + + -- cgit v1.2.3