]> git.karo-electronics.de Git - linux-beck.git/commitdiff
libertas: don't run thread while firmware not yet ready
authorDavid Woodhouse <dwmw2@infradead.org>
Tue, 11 Dec 2007 16:55:37 +0000 (11:55 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:06:40 +0000 (15:06 -0800)
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/main.c

index 88664024bf8057a02b48b2dc409c801baf987225..9a231099212f8a9e734de31a2dea8b8c96e47094 100644 (file)
@@ -671,6 +671,8 @@ static int lbs_thread(void *data)
                        shouldsleep = 1;        /* Sleep mode. Nothing we can do till it wakes */
                else if (priv->intcounter)
                        shouldsleep = 0;        /* Interrupt pending. Deal with it now */
+               else if (!priv->fw_ready)
+                       shouldsleep = 1;        /* Firmware not ready. We're waiting for it */
                else if (priv->dnld_sent)
                        shouldsleep = 1;        /* Something is en route to the device already */
                else if (priv->tx_pending_len > 0)
@@ -753,6 +755,9 @@ static int lbs_thread(void *data)
                } else
                        spin_unlock_irq(&priv->driver_lock);
 
+               if (!priv->fw_ready)
+                       continue;
+
                /* Check if we need to confirm Sleep Request received previously */
                if (priv->psstate == PS_STATE_PRE_SLEEP &&
                    !priv->dnld_sent && !priv->cur_cmd) {