summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-03-28 16:21:12 -0700
committerJohn W. Linville <linville@tuxdriver.com>2008-04-01 17:13:19 -0400
commite5472978ef16051337913f57b2f22982f3e9e4c2 (patch)
tree9ae5dd96bfe7bf2fbc989dd4429b08d879f294ef /drivers/net/wireless/iwlwifi/iwl3945-base.c
parenta571ea4eb34adbf33bbaf4bdc6db6037b1a93e0f (diff)
iwlwifi: Fix synchronous host command
This patch replaces static variable from send_cmd_sync with flag in priv->status. It was used for reentrance protection but clearly made it impossible to stuck more cards into the same machine In addition it force check of return values of synchronous commands commands that doesn't requires return value async commands have to be used Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Yi Zhu <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 8c2036850c8..51480a4920e 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -733,17 +733,17 @@ static int iwl3945_send_cmd_sync(struct iwl3945_priv *priv, struct iwl3945_host_
{
int cmd_idx;
int ret;
- static atomic_t entry = ATOMIC_INIT(0); /* reentrance protection */
BUG_ON(cmd->meta.flags & CMD_ASYNC);
/* A synchronous command can not have a callback set. */
BUG_ON(cmd->meta.u.callback != NULL);
- if (atomic_xchg(&entry, 1)) {
+ if (test_and_set_bit(STATUS_HCMD_SYNC_ACTIVE, &priv->status)) {
IWL_ERROR("Error sending %s: Already sending a host command\n",
get_cmd_string(cmd->id));
- return -EBUSY;
+ ret = -EBUSY;
+ goto out;
}
set_bit(STATUS_HCMD_ACTIVE, &priv->status);
@@ -813,7 +813,7 @@ fail:
cmd->meta.u.skb = NULL;
}
out:
- atomic_set(&entry, 0);
+ clear_bit(STATUS_HCMD_SYNC_ACTIVE, &priv->status);
return ret;
}