diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-15 04:22:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:07:35 -0500 |
commit | ae125bf8278249b8c44168c5183f551c3ed28b84 (patch) | |
tree | 5f86f802b140620f6b01bc7f94702c8dc024e4f8 | |
parent | 75567670c66329a111c2b4f12d6c1fc02b3b14d2 (diff) |
libertas: store command result in cmdnode instead of priv->cur_cmd_retcode
... at least for users of __lbs_cmd().
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/hostcmd.h | 1 | ||||
-rw-r--r-- | 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 f2e027b58101..c8f1bd583594 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, | |||
1173 | lbs_deb_host("DNLD_CMD: cmd size is zero\n"); | 1173 | lbs_deb_host("DNLD_CMD: cmd size is zero\n"); |
1174 | goto done; | 1174 | goto done; |
1175 | } | 1175 | } |
1176 | cmdnode->result = 0; | ||
1176 | 1177 | ||
1177 | /* Exit_PS command needs to be queued in the header always. */ | 1178 | /* Exit_PS command needs to be queued in the header always. */ |
1178 | if (le16_to_cpu(cmdnode->cmdbuf->command) == CMD_802_11_PS_MODE) { | 1179 | 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, | |||
1306 | if (cmd == priv->cur_cmd) | 1307 | if (cmd == priv->cur_cmd) |
1307 | priv->cur_cmd_retcode = result; | 1308 | priv->cur_cmd_retcode = result; |
1308 | 1309 | ||
1310 | cmd->result = result; | ||
1309 | cmd->cmdwaitqwoken = 1; | 1311 | cmd->cmdwaitqwoken = 1; |
1310 | wake_up_interruptible(&cmd->cmdwait_q); | 1312 | wake_up_interruptible(&cmd->cmdwait_q); |
1311 | 1313 | ||
@@ -2212,12 +2214,10 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command, | |||
2212 | wait_event_interruptible(cmdnode->cmdwait_q, cmdnode->cmdwaitqwoken); | 2214 | wait_event_interruptible(cmdnode->cmdwait_q, cmdnode->cmdwaitqwoken); |
2213 | 2215 | ||
2214 | spin_lock_irqsave(&priv->driver_lock, flags); | 2216 | spin_lock_irqsave(&priv->driver_lock, flags); |
2215 | if (priv->cur_cmd_retcode) { | 2217 | ret = cmdnode->result; |
2216 | lbs_deb_host("PREP_CMD: command failed with return code %d\n", | 2218 | if (ret) |
2217 | priv->cur_cmd_retcode); | 2219 | lbs_pr_info("PREP_CMD: command 0x%04x failed: %d\n", |
2218 | priv->cur_cmd_retcode = 0; | 2220 | command, ret); |
2219 | ret = -1; | ||
2220 | } | ||
2221 | __lbs_cleanup_and_insert_cmd(priv, cmdnode); | 2221 | __lbs_cleanup_and_insert_cmd(priv, cmdnode); |
2222 | spin_unlock_irqrestore(&priv->driver_lock, flags); | 2222 | spin_unlock_irqrestore(&priv->driver_lock, flags); |
2223 | 2223 | ||
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h index 719da737aaf0..ea4d484b2ba1 100644 --- a/drivers/net/wireless/libertas/hostcmd.h +++ b/drivers/net/wireless/libertas/hostcmd.h | |||
@@ -74,6 +74,7 @@ struct cmd_header { | |||
74 | 74 | ||
75 | struct cmd_ctrl_node { | 75 | struct cmd_ctrl_node { |
76 | struct list_head list; | 76 | struct list_head list; |
77 | int result; | ||
77 | /* command response */ | 78 | /* command response */ |
78 | int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *); | 79 | int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *); |
79 | unsigned long callback_arg; | 80 | unsigned long callback_arg; |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 0dc7de6a067b..839ffe818c18 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) | |||
1237 | /* Flush pending command nodes */ | 1237 | /* Flush pending command nodes */ |
1238 | spin_lock_irqsave(&priv->driver_lock, flags); | 1238 | spin_lock_irqsave(&priv->driver_lock, flags); |
1239 | list_for_each_entry(cmdnode, &priv->cmdpendingq, list) { | 1239 | list_for_each_entry(cmdnode, &priv->cmdpendingq, list) { |
1240 | cmdnode->result = -ENOENT; | ||
1240 | cmdnode->cmdwaitqwoken = 1; | 1241 | cmdnode->cmdwaitqwoken = 1; |
1241 | wake_up_interruptible(&cmdnode->cmdwait_q); | 1242 | wake_up_interruptible(&cmdnode->cmdwait_q); |
1242 | } | 1243 | } |