aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/common/privsep_commands.h1
-rw-r--r--src/drivers/driver_privsep.c13
-rw-r--r--wpa_supplicant/wpa_priv.c14
3 files changed, 27 insertions, 1 deletions
diff --git a/src/common/privsep_commands.h b/src/common/privsep_commands.h
index 6f02ed8..be94fb8 100644
--- a/src/common/privsep_commands.h
+++ b/src/common/privsep_commands.h
@@ -30,6 +30,7 @@ enum privsep_cmd {
PRIVSEP_CMD_L2_UNREGISTER,
PRIVSEP_CMD_L2_NOTIFY_AUTH_START,
PRIVSEP_CMD_L2_SEND,
+ PRIVSEP_CMD_SET_MODE,
};
struct privsep_cmd_associate
diff --git a/src/drivers/driver_privsep.c b/src/drivers/driver_privsep.c
index a441e6a..4e0a36f 100644
--- a/src/drivers/driver_privsep.c
+++ b/src/drivers/driver_privsep.c
@@ -726,6 +726,15 @@ static const u8 * wpa_driver_privsep_get_mac_addr(void *priv)
}
+static int wpa_driver_privsep_set_mode(void *priv, int mode)
+{
+ struct wpa_driver_privsep_data *drv = priv;
+ wpa_printf(MSG_DEBUG, "%s mode=%d", __func__, mode);
+ return wpa_priv_cmd(drv, PRIVSEP_CMD_SET_MODE, &mode, sizeof(mode),
+ NULL, NULL);
+}
+
+
struct wpa_driver_ops wpa_driver_privsep_ops = {
"privsep",
"wpa_supplicant privilege separated driver",
@@ -763,7 +772,9 @@ struct wpa_driver_ops wpa_driver_privsep_ops = {
NULL /* mlme_remove_sta */,
NULL /* update_ft_ies */,
NULL /* send_ft_action */,
- wpa_driver_privsep_get_scan_results2
+ wpa_driver_privsep_get_scan_results2,
+ NULL /* set_probe_req_ie */,
+ wpa_driver_privsep_set_mode
};
diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c
index 4a8d363..231b962 100644
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
@@ -564,6 +564,17 @@ static void wpa_priv_cmd_l2_send(struct wpa_priv_interface *iface,
}
+static void wpa_priv_cmd_set_mode(struct wpa_priv_interface *iface,
+ void *buf, size_t len)
+{
+ if (iface->drv_priv == NULL || iface->driver->set_mode == NULL ||
+ len != sizeof(int))
+ return;
+
+ iface->driver->set_mode(iface->drv_priv, *((int *) buf));
+}
+
+
static void wpa_priv_receive(int sock, void *eloop_ctx, void *sock_ctx)
{
struct wpa_priv_interface *iface = eloop_ctx;
@@ -635,6 +646,9 @@ static void wpa_priv_receive(int sock, void *eloop_ctx, void *sock_ctx)
case PRIVSEP_CMD_L2_SEND:
wpa_priv_cmd_l2_send(iface, &from, cmd_buf, cmd_len);
break;
+ case PRIVSEP_CMD_SET_MODE:
+ wpa_priv_cmd_set_mode(iface, cmd_buf, cmd_len);
+ break;
}
}