wlcore: wait for command completion event when sending CMD_ROLE_STOP
authorLuciano Coelho <coelho@ti.com>
Wed, 18 Jul 2012 11:58:59 +0000 (14:58 +0300)
committerLuciano Coelho <coelho@ti.com>
Wed, 18 Jul 2012 12:08:22 +0000 (15:08 +0300)
commit5285eb5442fe530d407dead812bcfbd8f2af0f46
tree7715b2951a718929ba0c944dd6d5b7875e49021a
parentcc31a3c9aeedcb1330f34dbfccf6a979919d81f2
wlcore: wait for command completion event when sending CMD_ROLE_STOP

We need to wait for the command completion event when we send the
CMD_ROLE_STOP event otherwise we may try to send CMD_ROLE_START too
soon and get out-of-sync with the firmware.

In some cases, the firmware may not send the event, so we wait for the
event or for the timeout, whichever comes first.

This patch is based on an earlier version by Eliad.

Cc: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/ti/wlcore/cmd.c