aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ctrl_iface.c
diff options
context:
space:
mode:
authorvamsi krishna <vamsin@qti.qualcomm.com>2016-11-15 09:42:44 (GMT)
committerJouni Malinen <j@w1.fi>2017-02-10 17:48:12 (GMT)
commit57c3a605cefbfe49339b2c4593006cc9119baf2d (patch)
tree779be70aa8f4af967495eeb93bc809831c858377 /wpa_supplicant/ctrl_iface.c
parent20c846d9ee25ac14d0a9ca414a6816deab7e921f (diff)
downloadhostap-57c3a605cefbfe49339b2c4593006cc9119baf2d.zip
hostap-57c3a605cefbfe49339b2c4593006cc9119baf2d.tar.gz
hostap-57c3a605cefbfe49339b2c4593006cc9119baf2d.tar.bz2
Add support to sched scan to report relatively better BSSs
Add support to set sched scan relative RSSI parameters so that the drivers can report BSSs after relative comparision with the current connected BSS. This feature is applicable only when in connected mode. The below commands can be used to configure relative RSSI parameters SET relative_rssi <disable|rssi_value> disable - to disable the feature rssi_value - amount of relative RSSI in dB SET relative_band_adjust <band:adjust_value> band - "2G" or "5G" for 2.4 GHz or 5 GHz respectively adjust_value - amount of RSSI to be adjusted in dB Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/ctrl_iface.c')
-rw-r--r--wpa_supplicant/ctrl_iface.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index fc5955b..295e50f 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -339,6 +339,53 @@ static int wpas_ctrl_iface_set_lci(struct wpa_supplicant *wpa_s,
}
+static int
+wpas_ctrl_set_relative_rssi(struct wpa_supplicant *wpa_s, const char *cmd)
+{
+ int relative_rssi;
+
+ if (os_strcmp(cmd, "disable") == 0) {
+ wpa_s->srp.relative_rssi_set = 0;
+ return 0;
+ }
+
+ relative_rssi = atoi(cmd);
+ if (relative_rssi < 0 || relative_rssi > 100)
+ return -1;
+ wpa_s->srp.relative_rssi = relative_rssi;
+ wpa_s->srp.relative_rssi_set = 1;
+ return 0;
+}
+
+
+static int wpas_ctrl_set_relative_band_adjust(struct wpa_supplicant *wpa_s,
+ const char *cmd)
+{
+ char *pos;
+ int adjust_rssi;
+
+ /* <band>:adjust_value */
+ pos = os_strchr(cmd, ':');
+ if (!pos)
+ return -1;
+ pos++;
+ adjust_rssi = atoi(pos);
+ if (adjust_rssi < -100 || adjust_rssi > 100)
+ return -1;
+
+ if (os_strncmp(cmd, "2G", 2) == 0)
+ wpa_s->srp.relative_adjust_band = WPA_SETBAND_2G;
+ else if (os_strncmp(cmd, "5G", 2) == 0)
+ wpa_s->srp.relative_adjust_band = WPA_SETBAND_5G;
+ else
+ return -1;
+
+ wpa_s->srp.relative_adjust_rssi = adjust_rssi;
+
+ return 0;
+}
+
+
static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
char *cmd)
{
@@ -551,6 +598,10 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
ret = wpas_ctrl_iface_set_lci(wpa_s, value);
} else if (os_strcasecmp(cmd, "tdls_trigger_control") == 0) {
ret = wpa_drv_set_tdls_mode(wpa_s, atoi(value));
+ } else if (os_strcasecmp(cmd, "relative_rssi") == 0) {
+ ret = wpas_ctrl_set_relative_rssi(wpa_s, value);
+ } else if (os_strcasecmp(cmd, "relative_band_adjust") == 0) {
+ ret = wpas_ctrl_set_relative_band_adjust(wpa_s, value);
} else {
value[-1] = '=';
ret = wpa_config_process_global(wpa_s->conf, cmd, -1);