libertas: convert INACTIVITY_TIMEOUT to a direct command
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
David S. Miller
parent
a7c4589065
commit
6e5cc4fb35
@@ -171,27 +171,30 @@ static int lbs_cmd_802_11_ps_mode(struct lbs_private *priv,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lbs_cmd_802_11_inactivity_timeout(struct lbs_private *priv,
|
int lbs_cmd_802_11_inactivity_timeout(struct lbs_private *priv,
|
||||||
struct cmd_ds_command *cmd,
|
uint16_t cmd_action, uint16_t *timeout)
|
||||||
u16 cmd_action, void *pdata_buf)
|
|
||||||
{
|
{
|
||||||
u16 *timeout = pdata_buf;
|
struct cmd_ds_802_11_inactivity_timeout cmd;
|
||||||
|
int ret;
|
||||||
|
|
||||||
lbs_deb_enter(LBS_DEB_CMD);
|
lbs_deb_enter(LBS_DEB_CMD);
|
||||||
|
|
||||||
cmd->command = cpu_to_le16(CMD_802_11_INACTIVITY_TIMEOUT);
|
cmd.hdr.command = cpu_to_le16(CMD_802_11_INACTIVITY_TIMEOUT);
|
||||||
cmd->size =
|
cmd.hdr.size = cpu_to_le16(sizeof(cmd));
|
||||||
cpu_to_le16(sizeof(struct cmd_ds_802_11_inactivity_timeout)
|
|
||||||
+ S_DS_GEN);
|
|
||||||
|
|
||||||
cmd->params.inactivity_timeout.action = cpu_to_le16(cmd_action);
|
cmd.action = cpu_to_le16(cmd_action);
|
||||||
|
|
||||||
if (cmd_action)
|
if (cmd_action == CMD_ACT_SET)
|
||||||
cmd->params.inactivity_timeout.timeout = cpu_to_le16(*timeout);
|
cmd.timeout = cpu_to_le16(*timeout);
|
||||||
else
|
else
|
||||||
cmd->params.inactivity_timeout.timeout = 0;
|
cmd.timeout = 0;
|
||||||
|
|
||||||
lbs_deb_leave(LBS_DEB_CMD);
|
ret = lbs_cmd_with_response(priv, CMD_802_11_INACTIVITY_TIMEOUT, &cmd);
|
||||||
|
|
||||||
|
if (!ret)
|
||||||
|
*timeout = le16_to_cpu(cmd.timeout);
|
||||||
|
|
||||||
|
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1520,11 +1523,6 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
|
|||||||
case CMD_802_11_SLEEP_PARAMS:
|
case CMD_802_11_SLEEP_PARAMS:
|
||||||
ret = lbs_cmd_802_11_sleep_params(priv, cmdptr, cmd_action);
|
ret = lbs_cmd_802_11_sleep_params(priv, cmdptr, cmd_action);
|
||||||
break;
|
break;
|
||||||
case CMD_802_11_INACTIVITY_TIMEOUT:
|
|
||||||
ret = lbs_cmd_802_11_inactivity_timeout(priv, cmdptr,
|
|
||||||
cmd_action, pdata_buf);
|
|
||||||
lbs_set_cmd_ctrl_node(priv, cmdnode, pdata_buf);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CMD_802_11_TPC_CFG:
|
case CMD_802_11_TPC_CFG:
|
||||||
cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG);
|
cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG);
|
||||||
|
@@ -47,4 +47,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria);
|
|||||||
int lbs_suspend(struct lbs_private *priv);
|
int lbs_suspend(struct lbs_private *priv);
|
||||||
int lbs_resume(struct lbs_private *priv);
|
int lbs_resume(struct lbs_private *priv);
|
||||||
|
|
||||||
|
int lbs_cmd_802_11_inactivity_timeout(struct lbs_private *priv,
|
||||||
|
uint16_t cmd_action, uint16_t *timeout);
|
||||||
|
|
||||||
#endif /* _LBS_CMD_H */
|
#endif /* _LBS_CMD_H */
|
||||||
|
@@ -554,13 +554,6 @@ static inline int handle_cmd_response(struct lbs_private *priv,
|
|||||||
case CMD_RET(CMD_802_11_SLEEP_PARAMS):
|
case CMD_RET(CMD_802_11_SLEEP_PARAMS):
|
||||||
ret = lbs_ret_802_11_sleep_params(priv, resp);
|
ret = lbs_ret_802_11_sleep_params(priv, resp);
|
||||||
break;
|
break;
|
||||||
case CMD_RET(CMD_802_11_INACTIVITY_TIMEOUT):
|
|
||||||
spin_lock_irqsave(&priv->driver_lock, flags);
|
|
||||||
*((uint16_t *) priv->cur_cmd->callback_arg) =
|
|
||||||
le16_to_cpu(resp->params.inactivity_timeout.timeout);
|
|
||||||
spin_unlock_irqrestore(&priv->driver_lock, flags);
|
|
||||||
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((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
|
memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
|
||||||
|
@@ -378,6 +378,8 @@ struct cmd_ds_802_11_sleep_params {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct cmd_ds_802_11_inactivity_timeout {
|
struct cmd_ds_802_11_inactivity_timeout {
|
||||||
|
struct cmd_header hdr;
|
||||||
|
|
||||||
/* ACT_GET/ACT_SET */
|
/* ACT_GET/ACT_SET */
|
||||||
__le16 action;
|
__le16 action;
|
||||||
|
|
||||||
@@ -714,7 +716,6 @@ struct cmd_ds_command {
|
|||||||
struct cmd_ds_802_11d_domain_info domaininforesp;
|
struct cmd_ds_802_11d_domain_info domaininforesp;
|
||||||
|
|
||||||
struct cmd_ds_802_11_sleep_params sleep_params;
|
struct cmd_ds_802_11_sleep_params sleep_params;
|
||||||
struct cmd_ds_802_11_inactivity_timeout inactivity_timeout;
|
|
||||||
struct cmd_ds_802_11_tpc_cfg tpccfg;
|
struct cmd_ds_802_11_tpc_cfg tpccfg;
|
||||||
struct cmd_ds_802_11_pwr_cfg pwrcfg;
|
struct cmd_ds_802_11_pwr_cfg pwrcfg;
|
||||||
struct cmd_ds_802_11_afc afc;
|
struct cmd_ds_802_11_afc afc;
|
||||||
|
Reference in New Issue
Block a user