Patchwork tdls: teardown TDLS using wpas_drv_tlds_oper() if not external

login
register
mail settings
Submitter Arend van Spriel
Date July 10, 2013, 5:48 p.m.
Message ID <1373478498-3721-1-git-send-email-arend@broadcom.com>
Download mbox | patch
Permalink /patch/258178/
State Superseded
Headers show

Comments

Arend van Spriel - July 10, 2013, 5:48 p.m.
When the device indicates to take care of TDLS operations the TDLS
setup is done calling wpas_drv_tdls_oper(). This patch does a similar
thing for the teardown. This fixes failure of teardown:

"TDLS: Could not find peer <mac> for link Teardown"

Signed-hostap: Arend van Spriel <arend@broadcom.com>
---
Hi Jouni,

While adding TDLS support to brcmfmac I got FAIL on teardown and
the mentioned message in the log. As the peer is not stored upon
the setup, I call the teardown directly and have the device figure
it out. Are there other operations from enum tdls_oper needed?

Regards,
Arend
---
 wpa_supplicant/ctrl_iface.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index a9c7715..081786e 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -587,8 +587,13 @@  static int wpa_supplicant_ctrl_iface_tdls_teardown(
 	wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_TEARDOWN " MACSTR,
 		   MAC2STR(peer));
 
-	return wpa_tdls_teardown_link(wpa_s->wpa, peer,
-				      WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED);
+	if (wpa_tdls_is_external_setup(wpa_s->wpa))
+		ret = wpa_tdls_teardown_link(wpa_s->wpa, peer,
+			WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED);
+	else
+		ret = wpa_drv_tdls_oper(wpa_s, TDLS_TEARDOWN, peer);
+
+	return ret;
 }
 
 #endif /* CONFIG_TDLS */