aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/scan.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/scan.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/scan.c')
-rw-r--r--wpa_supplicant/scan.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 6eb5e05..6099a36 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1249,6 +1249,26 @@ int wpa_supplicant_delayed_sched_scan(struct wpa_supplicant *wpa_s,
}
+static void
+wpa_scan_set_relative_rssi_params(struct wpa_supplicant *wpa_s,
+ struct wpa_driver_scan_params *params)
+{
+ if (wpa_s->wpa_state != WPA_COMPLETED ||
+ !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI) ||
+ wpa_s->srp.relative_rssi_set == 0)
+ return;
+
+ params->relative_rssi_set = 1;
+ params->relative_rssi = wpa_s->srp.relative_rssi;
+
+ if (wpa_s->srp.relative_adjust_rssi == 0)
+ return;
+
+ params->relative_adjust_band = wpa_s->srp.relative_adjust_band;
+ params->relative_adjust_rssi = wpa_s->srp.relative_adjust_rssi;
+}
+
+
/**
* wpa_supplicant_req_sched_scan - Start a periodic scheduled scan
* @wpa_s: Pointer to wpa_supplicant data
@@ -1503,6 +1523,8 @@ scan:
}
}
+ wpa_scan_set_relative_rssi_params(wpa_s, scan_params);
+
ret = wpa_supplicant_start_sched_scan(wpa_s, scan_params);
wpabuf_free(extra_ie);
os_free(params.filter_ssids);
@@ -2392,6 +2414,10 @@ wpa_scan_clone_params(const struct wpa_driver_scan_params *src)
params->bssid = bssid;
}
+ params->relative_rssi_set = src->relative_rssi_set;
+ params->relative_rssi = src->relative_rssi;
+ params->relative_adjust_band = src->relative_adjust_band;
+ params->relative_adjust_rssi = src->relative_adjust_rssi;
return params;
failed:
@@ -2570,6 +2596,8 @@ int wpas_start_pno(struct wpa_supplicant *wpa_s)
}
}
+ wpa_scan_set_relative_rssi_params(wpa_s, &params);
+
ret = wpa_supplicant_start_sched_scan(wpa_s, &params);
os_free(params.filter_ssids);
if (ret == 0)