Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79230
b: refs/heads/master
c: 5ba2f8a
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse authored and David S. Miller committed Jan 28, 2008
1 parent 2b03fc4 commit df744ea
Show file tree
Hide file tree
Showing 2 changed files with 18 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: ecfe9b487c0d3f6b7ad58006888a56f01ae52b58
refs/heads/master: 5ba2f8a0217cd6116fcbac056b360bb0db045379
39 changes: 17 additions & 22 deletions trunk/drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "wext.h"
#include "cmd.h"

static void cleanup_cmdnode(struct cmd_ctrl_node *ptempnode);
static struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv);
static void lbs_set_cmd_ctrl_node(struct lbs_private *priv,
struct cmd_ctrl_node *ptempnode,
Expand Down Expand Up @@ -1274,14 +1273,22 @@ static int lbs_cmd_mac_control(struct lbs_private *priv,
* after cleans it. Requires priv->driver_lock held.
*/
static void __lbs_cleanup_and_insert_cmd(struct lbs_private *priv,
struct cmd_ctrl_node *ptempcmd)
struct cmd_ctrl_node *cmdnode)
{
lbs_deb_enter(LBS_DEB_HOST);

if (!ptempcmd)
return;
if (!cmdnode)
goto out;

cleanup_cmdnode(ptempcmd);
list_add_tail(&ptempcmd->list, &priv->cmdfreeq);
cmdnode->pdata_buf = NULL;
cmdnode->callback = NULL;
cmdnode->callback_arg = 0;

memset(cmdnode->cmdbuf, 0, LBS_CMD_BUFFER_SIZE);

list_add_tail(&cmdnode->list, &priv->cmdfreeq);
out:
lbs_deb_leave(LBS_DEB_HOST);
}

static void lbs_cleanup_and_insert_cmd(struct lbs_private *priv,
Expand All @@ -1299,6 +1306,10 @@ void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd,
{
if (cmd == priv->cur_cmd)
priv->cur_cmd_retcode = result;

cmd->cmdwaitqwoken = 1;
wake_up_interruptible(&cmd->cmdwait_q);

__lbs_cleanup_and_insert_cmd(priv, cmd);
priv->cur_cmd = NULL;
}
Expand Down Expand Up @@ -1771,22 +1782,6 @@ static struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv)
* @param ptempnode A pointer to cmdCtrlNode structure
* @return n/a
*/
static void cleanup_cmdnode(struct cmd_ctrl_node *cmdnode)
{
lbs_deb_enter(LBS_DEB_HOST);

if (!cmdnode)
return;
cmdnode->cmdwaitqwoken = 1;
wake_up_interruptible(&cmdnode->cmdwait_q);
cmdnode->pdata_buf = NULL;
cmdnode->callback = NULL;
cmdnode->callback_arg = 0;

memset(cmdnode->cmdbuf, 0, LBS_CMD_BUFFER_SIZE);

lbs_deb_leave(LBS_DEB_HOST);
}

/**
* @brief This function initializes the command node.
Expand Down

0 comments on commit df744ea

Please sign in to comment.