summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/libertas/cmd.h
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2011-07-09 14:41:25 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2011-07-11 19:02:19 (GMT)
commitdf90d84382b03faf81637db31b6be14f477482c7 (patch)
tree343229cb6b303b4e21aa37bd936ae822b94d0528 /drivers/net/wireless/libertas/cmd.h
parent55d990592f83cbfabfefde6e32bf27d4e7493d0c (diff)
downloadlinux-fsl-qoriq-df90d84382b03faf81637db31b6be14f477482c7.tar.xz
libertas: fix handling of command timeout, completion and interruption
When commands time out, corruption ensues. As lbs_complete_command() is called without locking, the command node is mistakenly freed twice. Also fixed up locking here in a few other places. The nature of command timeout may be that the card didn't even acknowledge receipt of the request. Detect this case and reset dnld_sent so that other commands don't hang forever. When cmdnodes are moved between the free list and the pending list, their list heads should be reinitialized. Fixed this. Sometimes commands are completed without actually submitting them or removing them from cmdpendingq. We must remember to remove them from cmdpendingq in these cases, so handle this in lbs_complete_command(). Harmless signals generated during suspend/resume were interrupting lbs_cmd. Convert to an uninterruptible sleep to avoid this. lbs_thread must be woken up every time there is some new work to do. I found that when 2 commands are queued, ther completion of the first command would not wake up lbs_thread to submit the second. Poke lbs_thread at the end of lbs_complete_command() to fix this. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.h')
-rw-r--r--drivers/net/wireless/libertas/cmd.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/cmd.h b/drivers/net/wireless/libertas/cmd.h
index 7109d6b..b280ef7 100644
--- a/drivers/net/wireless/libertas/cmd.h
+++ b/drivers/net/wireless/libertas/cmd.h
@@ -59,6 +59,8 @@ int lbs_allocate_cmd_buffer(struct lbs_private *priv);
int lbs_free_cmd_buffer(struct lbs_private *priv);
int lbs_execute_next_command(struct lbs_private *priv);
+void __lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd,
+ int result);
void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd,
int result);
int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len);