[PATCH 12/18] bgscan_simple: Verify if notified signal is above or below threshold

andrei.otcheretianski at intel.com andrei.otcheretianski at intel.com
Mon Sep 5 07:33:05 PDT 2016


From: Avraham Stern <avraham.stern at intel.com>

When receiving signal change notification check if the reported
signal is above or below the signal threshold.
Although the event data includes this information, the threshold
configured to the driver might have changed.

Signed-off-by: Avraham Stern <avraham.stern at intel.com>
---
 wpa_supplicant/bgscan_simple.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/wpa_supplicant/bgscan_simple.c b/wpa_supplicant/bgscan_simple.c
index a467cc5..5fe566f 100644
--- a/wpa_supplicant/bgscan_simple.c
+++ b/wpa_supplicant/bgscan_simple.c
@@ -213,6 +213,14 @@ static void bgscan_simple_notify_signal_change(void *priv, int above,
 	int scan = 0;
 	struct os_reltime now;
 
+	if ((current_signal > data->signal_threshold && !above) ||
+	    (current_signal < data->signal_threshold && above)) {
+		wpa_printf(MSG_DEBUG,
+			   "bgscan simple: incorrect above value: above=%d current_signal=%d threshold=%d",
+			   above, current_signal, data->signal_threshold);
+		above = current_signal > data->signal_threshold;
+	}
+
 	if (data->short_interval == data->long_interval ||
 	    data->signal_threshold == 0)
 		return;
-- 
1.9.1




More information about the Hostap mailing list