libertas: discard DEFER responses to commands; let the timeout trigger
authorDavid Woodhouse <dwmw2@infradead.org>
Mon, 17 Dec 2007 20:41:30 +0000 (15:41 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:07:45 +0000 (15:07 -0800)
When the firmware returns 0x0004, it wants us to try again later. We can
achieve that simply by throwing out the response and letting the command
timeout code kick in.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/cmdresp.c

index 4d384612afa787b42ebc5ca0b0555e6595843f01..0cd96628293ac14d33c58fd22f7313ee3c20cf50 100644 (file)
@@ -665,6 +665,16 @@ int lbs_process_rx_command(struct lbs_private *priv)
                goto done;
        }
 
+       if (resp->result == cpu_to_le16(0x0004)) {
+               /* 0x0004 means -EAGAIN. Drop the response, let it time out
+                  and be resubmitted */
+               lbs_pr_info("Firmware returns DEFER to command %x. Will let it time out...\n",
+                           le16_to_cpu(resp->command));
+               spin_unlock_irqrestore(&priv->driver_lock, flags);
+               ret = -1;
+               goto done;
+       }
+
        /* Now we got response from FW, cancel the command timer */
        del_timer(&priv->command_timer);
        priv->cmd_timed_out = 0;