aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ctrl_iface.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-11-07 14:16:15 (GMT)
committerJouni Malinen <j@w1.fi>2013-11-22 18:23:08 (GMT)
commit5e2c3490d5a59b6a9aebb9a5d094318d6bc6b779 (patch)
treed5068b310b6baff100ceba9d8cc0a5de0477cbeb /wpa_supplicant/ctrl_iface.c
parent0de3803610f402d10d54f8bb7b5e77490485c009 (diff)
downloadhostap-5e2c3490d5a59b6a9aebb9a5d094318d6bc6b779.zip
hostap-5e2c3490d5a59b6a9aebb9a5d094318d6bc6b779.tar.gz
hostap-5e2c3490d5a59b6a9aebb9a5d094318d6bc6b779.tar.bz2
Android: Add driver_cmd for arbitrary driver commands
This is a mechanism used in Android to extend driver interface in vendor specific ways. This is included only for the purpose of Android compatibility. Proper interface commands should be used for any new functionality. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/ctrl_iface.c')
-rw-r--r--wpa_supplicant/ctrl_iface.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 6472f4f..d5a77b4 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -5158,6 +5158,20 @@ static int wpa_supplicant_pktcnt_poll(struct wpa_supplicant *wpa_s, char *buf,
}
+#ifdef ANDROID
+static int wpa_supplicant_driver_cmd(struct wpa_supplicant *wpa_s, char *cmd,
+ char *buf, size_t buflen)
+{
+ int ret;
+
+ ret = wpa_drv_driver_cmd(wpa_s, cmd, buf, buflen);
+ if (ret == 0)
+ ret = os_snprintf(buf, buflen, "%s\n", "OK");
+ return ret;
+}
+#endif /* ANDROID */
+
+
static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
{
wpa_dbg(wpa_s, MSG_DEBUG, "Flush all wpa_supplicant state");
@@ -5749,6 +5763,11 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
if (wpa_supplicant_ctrl_iface_autoscan(wpa_s, buf + 9))
reply_len = -1;
#endif /* CONFIG_AUTOSCAN */
+#ifdef ANDROID
+ } else if (os_strncmp(buf, "DRIVER ", 7) == 0) {
+ reply_len = wpa_supplicant_driver_cmd(wpa_s, buf + 7, reply,
+ reply_size);
+#endif /* ANDROID */
} else if (os_strcmp(buf, "REAUTHENTICATE") == 0) {
pmksa_cache_clear_current(wpa_s->wpa);
eapol_sm_request_reauth(wpa_s->eapol);