public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] libertas_tf: clear current command on remove
@ 2008-09-08 20:34 Dan Williams
  2008-09-11 22:35 ` Andrey Yurovsky
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Williams @ 2008-09-08 20:34 UTC (permalink / raw)
  To: Luis Carlos Cobo; +Cc: linux-wireless

Ensure that the current command is torn down when cleaning up.

Signed-off-by: Dan Williams <dcbw@redhat.com>
---

Completely untested but based on the libertas patch for the same
problem.  Luis, can you give it a shot and make sure there aren't any
regressions when pulling the card or rmmod-ing the driver?

diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index c948021..5f7bf04 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -296,8 +296,8 @@ static void lbtf_op_stop(struct ieee80211_hw *hw)
 	struct lbtf_private *priv = hw->priv;
 	unsigned long flags;
 	struct sk_buff *skb;
-
 	struct cmd_ctrl_node *cmdnode;
+
 	/* Flush pending command nodes */
 	spin_lock_irqsave(&priv->driver_lock, flags);
 	list_for_each_entry(cmdnode, &priv->cmdpendingq, list) {
@@ -306,7 +306,14 @@ static void lbtf_op_stop(struct ieee80211_hw *hw)
 		wake_up_interruptible(&cmdnode->cmdwait_q);
 	}
 
+	/* Flush the command the card is currently processing */
+	if (priv->cur_cmd) {
+		priv->cur_cmd->result = -ENOENT;
+		priv->cur_cmd->cmdwaitqwoken = 1;
+		wake_up_interruptible(&priv->cur_cmd->cmdwait_q);
+	}
 	spin_unlock_irqrestore(&priv->driver_lock, flags);
+
 	cancel_work_sync(&priv->cmd_work);
 	cancel_work_sync(&priv->tx_work);
 	while ((skb = skb_dequeue(&priv->bc_ps_buf)))



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-15 19:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-08 20:34 [RFC PATCH] libertas_tf: clear current command on remove Dan Williams
2008-09-11 22:35 ` Andrey Yurovsky
2008-09-15  7:21   ` Dan Williams
2008-09-15 19:44     ` Andrey Yurovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox