aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpas_glue.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2011-09-26 10:55:25 (GMT)
committerJouni Malinen <j@w1.fi>2011-10-23 19:15:15 (GMT)
commitc58ab8f2494fdf09a3b18c8a2c1013c9baadcd2c (patch)
tree23cce012498b3acc0ac6e0af836ce2aedd11f7a9 /wpa_supplicant/wpas_glue.c
parent03ea178603bbfacaf83860d8993ae58a3df30d6b (diff)
downloadhostap-c58ab8f2494fdf09a3b18c8a2c1013c9baadcd2c.zip
hostap-c58ab8f2494fdf09a3b18c8a2c1013c9baadcd2c.tar.gz
hostap-c58ab8f2494fdf09a3b18c8a2c1013c9baadcd2c.tar.bz2
TDLS: Get TDLS related capabilities from driver
Put glue code in place to propagate TDLS related driver capabilities to the TDLS state machine. If the driver doesn't support capabilities, assume TDLS is supported internally. When TDLS is explicitly not supported, disable all user facing TDLS operations. Signed-off-by: Arik Nemtsov <arik@wizery.com> Cc: Kalyan C Gaddam <chakkal@iit.edu>
Diffstat (limited to 'wpa_supplicant/wpas_glue.c')
-rw-r--r--wpa_supplicant/wpas_glue.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index de09f81..94948c6 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -525,6 +525,27 @@ static int wpa_supplicant_mark_authenticated(void *ctx, const u8 *target_ap)
#ifdef CONFIG_TDLS
+static int wpa_supplicant_tdls_get_capa(void *ctx, int *tdls_supported,
+ int *tdls_ext_setup)
+{
+ struct wpa_supplicant *wpa_s = ctx;
+
+ *tdls_supported = 0;
+ *tdls_ext_setup = 0;
+
+ if (!wpa_s->drv_capa_known)
+ return -1;
+
+ if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_TDLS_SUPPORT)
+ *tdls_supported = 1;
+
+ if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP)
+ *tdls_ext_setup = 1;
+
+ return 0;
+}
+
+
static int wpa_supplicant_send_tdls_mgmt(void *ctx, const u8 *dst,
u8 action_code, u8 dialog_token,
u16 status_code, const u8 *buf,
@@ -700,6 +721,7 @@ int wpa_supplicant_init_wpa(struct wpa_supplicant *wpa_s)
ctx->mark_authenticated = wpa_supplicant_mark_authenticated;
#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_TDLS
+ ctx->tdls_get_capa = wpa_supplicant_tdls_get_capa;
ctx->send_tdls_mgmt = wpa_supplicant_send_tdls_mgmt;
ctx->tdls_oper = wpa_supplicant_tdls_oper;
#endif /* CONFIG_TDLS */