wlan-ap-Telecominfraproject/feeds/wifi-ax/hostapd/patches/b00-011-hostapd-add-signal-monitor-command.patch
John Crispin 04f6078da6 ipq807x: update AX support
Signed-off-by: John Crispin <john@phrozen.org>
2020-10-04 14:28:57 +02:00

63 lines
2.2 KiB
Diff

--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -3125,6 +3125,26 @@ static int hostapd_ctrl_iface_remove_nei
return hostapd_neighbor_remove(hapd, bssid, ssidp);
}
+static int hostapd_ctrl_iface_signal_monitor(struct hostapd_data *hapd,
+ char *cmd)
+{
+ const char *pos;
+ int threshold = 0, hysteresis = 0;
+
+ pos = os_strstr(cmd, "THRESHOLD=");
+ if (pos)
+ threshold = atoi(pos + 10);
+ pos = os_strstr(cmd, "HYSTERESIS=");
+ if (pos)
+ hysteresis = atoi(pos + 11);
+
+ if (hapd->driver->signal_monitor)
+ return hapd->driver->signal_monitor(hapd->drv_priv,
+ threshold, hysteresis);
+
+ return -1;
+}
+
static int hostapd_ctrl_driver_flags(struct hostapd_iface *iface, char *buf,
size_t buflen)
@@ -3768,6 +3788,9 @@ static int hostapd_ctrl_iface_receive_pr
if (radius_server_dac_request(hapd->radius_srv, buf + 12) < 0)
reply_len = -1;
#endif /* RADIUS_SERVER */
+ } else if (os_strncmp(buf, "SIGNAL_MONITOR", 14) == 0) {
+ if (hostapd_ctrl_iface_signal_monitor(hapd, buf + 14))
+ reply_len = -1;
} else if (os_strncmp(buf, "GET_CAPABILITY ", 15) == 0) {
reply_len = hostapd_ctrl_iface_get_capability(
hapd, buf + 15, reply, reply_size);
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -1478,6 +1478,11 @@ static int hostapd_cli_cmd_deny_macacl(s
return hostapd_cli_cmd(ctrl, "DENY_ACL", 1, argc, argv);
}
+static int hostapd_cli_cmd_signal_monitor(struct wpa_ctrl *ctrl, int argc,
+ char *argv[])
+{
+ return hostapd_cli_cmd(ctrl, "SIGNAL_MONITOR", 0, argc, argv);
+}
static int hostapd_cli_cmd_poll_sta(struct wpa_ctrl *ctrl, int argc,
char *argv[])
@@ -1673,6 +1678,8 @@ static const struct hostapd_cli_cmd host
"=Add/Delete/Show/Clear deny MAC ACL" },
{ "poll_sta", hostapd_cli_cmd_poll_sta, hostapd_complete_stations,
"<addr> = poll a STA to check connectivity with a QoS null frame" },
+ { "signal_monitor", hostapd_cli_cmd_signal_monitor, NULL,
+ "= set signal monitor parameters" },
{ "req_beacon", hostapd_cli_cmd_req_beacon, NULL,
"<addr> [req_mode=] <measurement request hexdump> = send a Beacon report request to a station" },
{ "reload_wpa_psk", hostapd_cli_cmd_reload_wpa_psk, NULL,