Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ae125bf8278249b8c44168c5183f551c3ed28b84
Commit:     ae125bf8278249b8c44168c5183f551c3ed28b84
Parent:     75567670c66329a111c2b4f12d6c1fc02b3b14d2
Author:     David Woodhouse <[EMAIL PROTECTED]>
AuthorDate: Sat Dec 15 04:22:52 2007 -0500
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:07:35 2008 -0800

    libertas: store command result in cmdnode instead of priv->cur_cmd_retcode
    
    ... at least for users of __lbs_cmd().
    
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/libertas/cmd.c     |   12 ++++++------
 drivers/net/wireless/libertas/hostcmd.h |    1 +
 drivers/net/wireless/libertas/main.c    |    1 +
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index f2e027b..c8f1bd5 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1173,6 +1173,7 @@ void lbs_queue_cmd(struct lbs_private *priv,
                lbs_deb_host("DNLD_CMD: cmd size is zero\n");
                goto done;
        }
+       cmdnode->result = 0;
 
        /* Exit_PS command needs to be queued in the header always. */
        if (le16_to_cpu(cmdnode->cmdbuf->command) == CMD_802_11_PS_MODE) {
@@ -1306,6 +1307,7 @@ void lbs_complete_command(struct lbs_private *priv, 
struct cmd_ctrl_node *cmd,
        if (cmd == priv->cur_cmd)
                priv->cur_cmd_retcode = result;
 
+       cmd->result = result;
        cmd->cmdwaitqwoken = 1;
        wake_up_interruptible(&cmd->cmdwait_q);
 
@@ -2212,12 +2214,10 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t 
command,
        wait_event_interruptible(cmdnode->cmdwait_q, cmdnode->cmdwaitqwoken);
 
        spin_lock_irqsave(&priv->driver_lock, flags);
-       if (priv->cur_cmd_retcode) {
-               lbs_deb_host("PREP_CMD: command failed with return code %d\n",
-                      priv->cur_cmd_retcode);
-               priv->cur_cmd_retcode = 0;
-               ret = -1;
-       }
+       ret = cmdnode->result;
+       if (ret)
+               lbs_pr_info("PREP_CMD: command 0x%04x failed: %d\n",
+                           command, ret);
        __lbs_cleanup_and_insert_cmd(priv, cmdnode);
        spin_unlock_irqrestore(&priv->driver_lock, flags);
 
diff --git a/drivers/net/wireless/libertas/hostcmd.h 
b/drivers/net/wireless/libertas/hostcmd.h
index 719da73..ea4d484 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -74,6 +74,7 @@ struct cmd_header {
 
 struct cmd_ctrl_node {
        struct list_head list;
+       int result;
        /* command response */
        int (*callback)(struct lbs_private *, unsigned long, struct cmd_header 
*);
        unsigned long callback_arg;
diff --git a/drivers/net/wireless/libertas/main.c 
b/drivers/net/wireless/libertas/main.c
index 0dc7de6..839ffe8 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1237,6 +1237,7 @@ int lbs_stop_card(struct lbs_private *priv)
        /* Flush pending command nodes */
        spin_lock_irqsave(&priv->driver_lock, flags);
        list_for_each_entry(cmdnode, &priv->cmdpendingq, list) {
+               cmdnode->result = -ENOENT;
                cmdnode->cmdwaitqwoken = 1;
                wake_up_interruptible(&cmdnode->cmdwait_q);
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to