Commit 75567670 authored by David Woodhouse's avatar David Woodhouse Committed by David S. Miller

libertas: kill pdata_buf member of struct cmd_ctrl_node

We can use the callback_arg for it; that's the way we're heading anyway...
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ad12d0f4
...@@ -1280,7 +1280,6 @@ static void __lbs_cleanup_and_insert_cmd(struct lbs_private *priv, ...@@ -1280,7 +1280,6 @@ static void __lbs_cleanup_and_insert_cmd(struct lbs_private *priv,
if (!cmdnode) if (!cmdnode)
goto out; goto out;
cmdnode->pdata_buf = NULL;
cmdnode->callback = NULL; cmdnode->callback = NULL;
cmdnode->callback_arg = 0; cmdnode->callback_arg = 0;
...@@ -1801,9 +1800,8 @@ static void lbs_set_cmd_ctrl_node(struct lbs_private *priv, ...@@ -1801,9 +1800,8 @@ static void lbs_set_cmd_ctrl_node(struct lbs_private *priv,
if (!ptempnode) if (!ptempnode)
return; return;
ptempnode->pdata_buf = pdata_buf;
ptempnode->callback = NULL; ptempnode->callback = NULL;
ptempnode->callback_arg = 0; ptempnode->callback_arg = (unsigned long)pdata_buf;
lbs_deb_leave(LBS_DEB_HOST); lbs_deb_leave(LBS_DEB_HOST);
} }
......
...@@ -399,13 +399,13 @@ static int lbs_ret_802_11_enable_rsn(struct lbs_private *priv, ...@@ -399,13 +399,13 @@ static int lbs_ret_802_11_enable_rsn(struct lbs_private *priv,
struct cmd_ds_command *resp) struct cmd_ds_command *resp)
{ {
struct cmd_ds_802_11_enable_rsn *enable_rsn = &resp->params.enbrsn; struct cmd_ds_802_11_enable_rsn *enable_rsn = &resp->params.enbrsn;
u32 * pdata_buf = priv->cur_cmd->pdata_buf; uint32_t * pdata_buf = (uint32_t *)priv->cur_cmd->callback_arg;
lbs_deb_enter(LBS_DEB_CMD); lbs_deb_enter(LBS_DEB_CMD);
if (enable_rsn->action == cpu_to_le16(CMD_ACT_GET)) { if (enable_rsn->action == cpu_to_le16(CMD_ACT_GET)) {
if (pdata_buf) if (pdata_buf)
*pdata_buf = (u32) le16_to_cpu(enable_rsn->enable); *pdata_buf = (uint32_t) le16_to_cpu(enable_rsn->enable);
} }
lbs_deb_leave(LBS_DEB_CMD); lbs_deb_leave(LBS_DEB_CMD);
...@@ -435,7 +435,7 @@ static int lbs_ret_802_11_subscribe_event(struct lbs_private *priv, ...@@ -435,7 +435,7 @@ static int lbs_ret_802_11_subscribe_event(struct lbs_private *priv,
struct cmd_ds_802_11_subscribe_event *cmd_event = struct cmd_ds_802_11_subscribe_event *cmd_event =
&resp->params.subscribe_event; &resp->params.subscribe_event;
struct cmd_ds_802_11_subscribe_event *dst_event = struct cmd_ds_802_11_subscribe_event *dst_event =
priv->cur_cmd->pdata_buf; (void *)priv->cur_cmd->callback_arg;
lbs_deb_enter(LBS_DEB_CMD); lbs_deb_enter(LBS_DEB_CMD);
...@@ -505,7 +505,7 @@ static inline int handle_cmd_response(struct lbs_private *priv, ...@@ -505,7 +505,7 @@ static inline int handle_cmd_response(struct lbs_private *priv,
case CMD_RET(CMD_802_11_SET_AFC): case CMD_RET(CMD_802_11_SET_AFC):
case CMD_RET(CMD_802_11_GET_AFC): case CMD_RET(CMD_802_11_GET_AFC):
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
memmove(priv->cur_cmd->pdata_buf, &resp->params.afc, memmove((void *)priv->cur_cmd->callback_arg, &resp->params.afc,
sizeof(struct cmd_ds_802_11_afc)); sizeof(struct cmd_ds_802_11_afc));
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
...@@ -557,20 +557,20 @@ static inline int handle_cmd_response(struct lbs_private *priv, ...@@ -557,20 +557,20 @@ static inline int handle_cmd_response(struct lbs_private *priv,
break; break;
case CMD_RET(CMD_802_11_INACTIVITY_TIMEOUT): case CMD_RET(CMD_802_11_INACTIVITY_TIMEOUT):
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
*((u16 *) priv->cur_cmd->pdata_buf) = *((uint16_t *) priv->cur_cmd->callback_arg) =
le16_to_cpu(resp->params.inactivity_timeout.timeout); le16_to_cpu(resp->params.inactivity_timeout.timeout);
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
break; break;
case CMD_RET(CMD_802_11_TPC_CFG): case CMD_RET(CMD_802_11_TPC_CFG):
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
memmove(priv->cur_cmd->pdata_buf, &resp->params.tpccfg, memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
sizeof(struct cmd_ds_802_11_tpc_cfg)); sizeof(struct cmd_ds_802_11_tpc_cfg));
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
break; break;
case CMD_RET(CMD_802_11_LED_GPIO_CTRL): case CMD_RET(CMD_802_11_LED_GPIO_CTRL):
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
memmove(priv->cur_cmd->pdata_buf, &resp->params.ledgpio, memmove((void *)priv->cur_cmd->callback_arg, &resp->params.ledgpio,
sizeof(struct cmd_ds_802_11_led_ctrl)); sizeof(struct cmd_ds_802_11_led_ctrl));
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
break; break;
...@@ -580,7 +580,7 @@ static inline int handle_cmd_response(struct lbs_private *priv, ...@@ -580,7 +580,7 @@ static inline int handle_cmd_response(struct lbs_private *priv,
case CMD_RET(CMD_802_11_PWR_CFG): case CMD_RET(CMD_802_11_PWR_CFG):
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
memmove(priv->cur_cmd->pdata_buf, &resp->params.pwrcfg, memmove((void *)priv->cur_cmd->callback_arg, &resp->params.pwrcfg,
sizeof(struct cmd_ds_802_11_pwr_cfg)); sizeof(struct cmd_ds_802_11_pwr_cfg));
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
...@@ -588,21 +588,21 @@ static inline int handle_cmd_response(struct lbs_private *priv, ...@@ -588,21 +588,21 @@ static inline int handle_cmd_response(struct lbs_private *priv,
case CMD_RET(CMD_GET_TSF): case CMD_RET(CMD_GET_TSF):
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
memcpy(priv->cur_cmd->pdata_buf, memcpy((void *)priv->cur_cmd->callback_arg,
&resp->params.gettsf.tsfvalue, sizeof(u64)); &resp->params.gettsf.tsfvalue, sizeof(u64));
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
break; break;
case CMD_RET(CMD_BT_ACCESS): case CMD_RET(CMD_BT_ACCESS):
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
if (priv->cur_cmd->pdata_buf) if (priv->cur_cmd->callback_arg)
memcpy(priv->cur_cmd->pdata_buf, memcpy((void *)priv->cur_cmd->callback_arg,
&resp->params.bt.addr1, 2 * ETH_ALEN); &resp->params.bt.addr1, 2 * ETH_ALEN);
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
break; break;
case CMD_RET(CMD_FWT_ACCESS): case CMD_RET(CMD_FWT_ACCESS):
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
if (priv->cur_cmd->pdata_buf) if (priv->cur_cmd->callback_arg)
memcpy(priv->cur_cmd->pdata_buf, &resp->params.fwt, memcpy((void *)priv->cur_cmd->callback_arg, &resp->params.fwt,
sizeof(resp->params.fwt)); sizeof(resp->params.fwt));
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
break; break;
......
...@@ -75,7 +75,6 @@ struct cmd_header { ...@@ -75,7 +75,6 @@ struct cmd_header {
struct cmd_ctrl_node { struct cmd_ctrl_node {
struct list_head list; struct list_head list;
/* command response */ /* command response */
void *pdata_buf;
int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *); int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *);
unsigned long callback_arg; unsigned long callback_arg;
/* command data */ /* command data */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment