Search Linux Wireless

[RFC PATCH] libertas_tf: clear current command on remove

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Dan Williams <dcbw@xxxxxxxxxx>
---

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)))


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux