[PATCH] libertas: add reset_card() callback to hardware driver

David Woodhouse dwmw2 at infradead.org
Tue May 20 11:47:33 EDT 2008


Signed-off-by: David Woodhouse <dwmw2 at infradead.org>

diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index e12ce65..0a9fc51 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -153,6 +153,7 @@ struct lbs_private {
 
 	/** Hardware access */
 	int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb);
+	void (*reset_card) (struct lbs_private *priv);
 
 	/* Wake On LAN */
 	uint32_t wol_criteria;
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 8c7ede9..6dfb438 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -787,6 +787,11 @@ static int lbs_thread(void *data)
 					    le16_to_cpu(cmdnode->cmdbuf->command));
 				lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
 				priv->nr_retries = 0;
+				if (priv->reset_card) {
+					spin_unlock_irq(&priv->driver_lock);
+					priv->reset_card(priv);
+					spin_lock_irq(&priv->driver_lock);
+				}
 			} else {
 				priv->cur_cmd = NULL;
 				priv->dnld_sent = DNLD_RES_RECEIVED;
-- 
1.5.4.5


-- 
dwmw2




More information about the libertas-dev mailing list