aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-12-03 16:27:16 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-03 16:27:16 (GMT)
commit865081c307a20a156f26a2162cff2bfb4685c942 (patch)
treea9ced632e3285f69490c2d4b717ec5db706d1fa6
parentda818ee5e981fcb9048ef1467c9a66e937eabd38 (diff)
downloadhostap-865081c307a20a156f26a2162cff2bfb4685c942.zip
hostap-865081c307a20a156f26a2162cff2bfb4685c942.tar.gz
hostap-865081c307a20a156f26a2162cff2bfb4685c942.tar.bz2
privsep: Support frequency list for scan requests
Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--src/common/privsep_commands.h4
-rw-r--r--src/drivers/driver_privsep.c5
-rw-r--r--wpa_supplicant/wpa_priv.c12
3 files changed, 21 insertions, 0 deletions
diff --git a/src/common/privsep_commands.h b/src/common/privsep_commands.h
index fa350cb..0f47518 100644
--- a/src/common/privsep_commands.h
+++ b/src/common/privsep_commands.h
@@ -30,10 +30,14 @@ enum privsep_cmd {
PRIVSEP_CMD_AUTHENTICATE,
};
+#define PRIVSEP_MAX_SCAN_FREQS 50
+
struct privsep_cmd_scan {
unsigned int num_ssids;
u8 ssids[WPAS_MAX_SCAN_SSIDS][32];
u8 ssid_lens[WPAS_MAX_SCAN_SSIDS];
+ unsigned int num_freqs;
+ u16 freqs[PRIVSEP_MAX_SCAN_FREQS];
};
struct privsep_cmd_authenticate {
diff --git a/src/drivers/driver_privsep.c b/src/drivers/driver_privsep.c
index 5a22a14..8c93d26 100644
--- a/src/drivers/driver_privsep.c
+++ b/src/drivers/driver_privsep.c
@@ -116,6 +116,11 @@ static int wpa_driver_privsep_scan(void *priv,
scan.ssid_lens[i]);
}
+ for (i = 0; i < PRIVSEP_MAX_SCAN_FREQS &&
+ params->freqs && params->freqs[i]; i++)
+ scan.freqs[i] = params->freqs[i];
+ scan.num_freqs = i;
+
return wpa_priv_cmd(drv, PRIVSEP_CMD_SCAN, &scan, sizeof(scan),
NULL, NULL);
}
diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c
index 61d43a6..9b81fc1 100644
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
@@ -139,6 +139,7 @@ static void wpa_priv_cmd_scan(struct wpa_priv_interface *iface,
struct wpa_driver_scan_params params;
struct privsep_cmd_scan *scan;
unsigned int i;
+ int freqs[PRIVSEP_MAX_SCAN_FREQS + 1];
if (iface->drv_priv == NULL)
return;
@@ -161,6 +162,17 @@ static void wpa_priv_cmd_scan(struct wpa_priv_interface *iface,
params.ssids[i].ssid_len = scan->ssid_lens[i];
}
+ if (scan->num_freqs > PRIVSEP_MAX_SCAN_FREQS) {
+ wpa_printf(MSG_DEBUG, "Invalid scan request (num_freqs)");
+ return;
+ }
+ if (scan->num_freqs) {
+ for (i = 0; i < scan->num_freqs; i++)
+ freqs[i] = scan->freqs[i];
+ freqs[i] = 0;
+ params.freqs = freqs;
+ }
+
if (iface->driver->scan2)
iface->driver->scan2(iface->drv_priv, &params);
}