aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/wl1271_cmd.c
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@nokia.com>2009-10-12 15:08:43 +0300
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:02 -0400
commitd6e19d135dadb1895296668914d0a15bc3cafcbf (patch)
treea661ff6aaba4de765be8140bcc4da47ccadd85ff /drivers/net/wireless/wl12xx/wl1271_cmd.c
parent25a7dc6d22adda590be4932ebc772ea35914880c (diff)
wl1271: workaround to send a disconnect before rejoining
We don't get any indication from the stack when we have disassociated. In wl1271, it is important to send a CMD_DISCONNECT before joining again, because the firmware cleans some things up. So we check if we're already joined and disconnect if that's the case. Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_cmd.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index d09ad121197..ef92834e0e8 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -191,6 +191,19 @@ int wl1271_cmd_join(struct wl1271 *wl)
do_cal = false;
}
+ /* FIXME: This is a workaround, because with the current stack, we
+ * cannot know when we have disassociated. So, if we have already
+ * joined, we disconnect before joining again. */
+ if (wl->joined) {
+ ret = wl1271_cmd_disconnect(wl);
+ if (ret < 0) {
+ wl1271_error("failed to disconnect before rejoining");
+ goto out;
+ }
+
+ wl->joined = false;
+ }
+
join = kzalloc(sizeof(*join), GFP_KERNEL);
if (!join) {
ret = -ENOMEM;
@@ -245,6 +258,8 @@ int wl1271_cmd_join(struct wl1271 *wl)
goto out_free;
}
+ wl->joined = true;
+
/*
* ugly hack: we should wait for JOIN_EVENT_COMPLETE_ID but to
* simplify locking we just sleep instead, for now