Skip to content

Commit

Permalink
wl1271: wait for disconnect command complete event
Browse files Browse the repository at this point in the history
Wait for the DISCONNECT_EVENT_COMPLETE_ID event after sending a disconnect
command.

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>
  • Loading branch information
Luciano Coelho authored and John W. Linville committed Mar 31, 2010
1 parent 99d84c1 commit 2f826f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions drivers/net/wireless/wl12xx/wl1271_boot.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of wl1271
*
* Copyright (C) 2008-2009 Nokia Corporation
* Copyright (C) 2008-2010 Nokia Corporation
*
* Contact: Luciano Coelho <luciano.coelho@nokia.com>
*
Expand Down Expand Up @@ -411,7 +411,8 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl)
wl->event_mask = BSS_LOSE_EVENT_ID |
SCAN_COMPLETE_EVENT_ID |
PS_REPORT_EVENT_ID |
JOIN_EVENT_COMPLETE_ID;
JOIN_EVENT_COMPLETE_ID |
DISCONNECT_EVENT_COMPLETE_ID;

ret = wl1271_event_unmask(wl);
if (ret < 0) {
Expand Down
6 changes: 5 additions & 1 deletion drivers/net/wireless/wl12xx/wl1271_cmd.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of wl1271
*
* Copyright (C) 2009 Nokia Corporation
* Copyright (C) 2009-2010 Nokia Corporation
*
* Contact: Luciano Coelho <luciano.coelho@nokia.com>
*
Expand Down Expand Up @@ -942,6 +942,10 @@ int wl1271_cmd_disconnect(struct wl1271 *wl)
goto out_free;
}

ret = wl1271_cmd_wait_for_event(wl, DISCONNECT_EVENT_COMPLETE_ID);
if (ret < 0)
wl1271_error("cmd disconnect event completion error");

out_free:
kfree(cmd);

Expand Down

0 comments on commit 2f826f5

Please sign in to comment.