Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79248
b: refs/heads/master
c: 18c52e7
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse authored and David S. Miller committed Jan 28, 2008
1 parent 2f4ab4e commit 9463c69
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8538823f7c692c98e8b7e19cb580faa56e25e89f
refs/heads/master: 18c52e7c3e3d0e7fbddd0334b58030bb89554cb9
42 changes: 20 additions & 22 deletions trunk/drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,14 +1199,15 @@ static void lbs_queue_cmd(struct lbs_private *priv,
lbs_deb_leave(LBS_DEB_HOST);
}

static int lbs_submit_command(struct lbs_private *priv,
struct cmd_ctrl_node *cmdnode)
static void lbs_submit_command(struct lbs_private *priv,
struct cmd_ctrl_node *cmdnode)
{
unsigned long flags;
struct cmd_header *cmd;
int ret = -1;
u16 cmdsize;
u16 command;
uint16_t cmdsize;
uint16_t command;
int timeo = 5 * HZ;
int ret;

lbs_deb_enter(LBS_DEB_HOST);

Expand All @@ -1220,33 +1221,30 @@ static int lbs_submit_command(struct lbs_private *priv,
cmdsize = le16_to_cpu(cmd->size);
command = le16_to_cpu(cmd->command);

/* These commands take longer */
if (command == CMD_802_11_SCAN || command == CMD_802_11_ASSOCIATE ||
command == CMD_802_11_AUTHENTICATE)
timeo = 10 * HZ;

lbs_deb_host("DNLD_CMD: command 0x%04x, seq %d, size %d, jiffies %lu\n",
command, le16_to_cpu(cmd->seqnum), cmdsize, jiffies);
lbs_deb_hex(LBS_DEB_HOST, "DNLD_CMD", (void *) cmdnode->cmdbuf, cmdsize);

ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize);

if (ret) {
lbs_pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret);
spin_lock_irqsave(&priv->driver_lock, flags);
lbs_complete_command(priv, priv->cur_cmd, ret);
spin_unlock_irqrestore(&priv->driver_lock, flags);
goto done;
}

lbs_deb_cmd("DNLD_CMD: sent command 0x%04x, jiffies %lu\n", command, jiffies);
/* Let the timer kick in and retry, and potentially reset
the whole thing if the condition persists */
timeo = HZ;
} else
lbs_deb_cmd("DNLD_CMD: sent command 0x%04x, jiffies %lu\n",
command, jiffies);

/* Setup the timer after transmit command */
if (command == CMD_802_11_SCAN || command == CMD_802_11_AUTHENTICATE
|| command == CMD_802_11_ASSOCIATE)
mod_timer(&priv->command_timer, jiffies + (10*HZ));
else
mod_timer(&priv->command_timer, jiffies + (5*HZ));

ret = 0;
mod_timer(&priv->command_timer, jiffies + timeo);

done:
lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret);
return ret;
lbs_deb_leave(LBS_DEB_HOST);
}

static int lbs_cmd_mac_control(struct lbs_private *priv,
Expand Down

0 comments on commit 9463c69

Please sign in to comment.