wimax/i2400m: fix incorrect return -ESHUTDOWN when there is no Tx buffer available
authorPrasanna S.Panchamukhi <prasannax.s.panchamukhi@intel.com>
Mon, 18 Jan 2010 22:28:23 +0000 (14:28 -0800)
committerInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Tue, 11 May 2010 21:03:32 +0000 (14:03 -0700)
i2400m_tx() routine was returning -ESHUTDOWN even when there was no Tx buffer
available. This patch fixes the i2400m_tx() to return -ESHUTDOWN only when
the device is down(i2400m->tx_buf is NULL) and also to return -ENOSPC
when there is no Tx buffer. Error seen in the kernel log.
kernel: i2400m_sdio mmc0:0001:1: can't send message 0x5606: -108
kernel: i2400m_sdio mmc0:0001:1: Failed to issue 'Enter power save'command: -108

Signed-off-by: Prasanna S.Panchamukhi <prasannax.s.panchamukhi@intel.com>
drivers/net/wimax/i2400m/tx.c

index 6db909ecf1c97548848efb1990a0ce3f7311705a..fab27e4a4cb3cff512cb6bfdf5936d854396bad9 100644 (file)
@@ -643,9 +643,11 @@ int i2400m_tx(struct i2400m *i2400m, const void *buf, size_t buf_len,
         * current one is out of payload slots or we have a singleton,
         * close it and start a new one */
        spin_lock_irqsave(&i2400m->tx_lock, flags);
-       result = -ESHUTDOWN;
-       if (i2400m->tx_buf == NULL)
+       /* If tx_buf is NULL, device is shutdown */
+       if (i2400m->tx_buf == NULL) {
+               result = -ESHUTDOWN;
                goto error_tx_new;
+       }
 try_new:
        if (unlikely(i2400m->tx_msg == NULL))
                i2400m_tx_new(i2400m);