aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-17 23:04:37 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:48 -0500
commit6e5cc4fb35c45a8f8478d25c4e89e8d9c543056e (patch)
tree79b7c15a84df50b8dd19e5a9af873fd947fc7006 /drivers
parenta7c458906542aacdda7289bb21f527a2dc4097ca (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/libertas/cmd.c34
-rw-r--r--drivers/net/wireless/libertas/cmd.h3
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c7
-rw-r--r--drivers/net/wireless/libertas/hostcmd.h3
4 files changed, 21 insertions, 26 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 3a7b82f99cb3..57d17077a6d8 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -171,27 +171,30 @@ static int lbs_cmd_802_11_ps_mode(struct lbs_private *priv,
171 return 0; 171 return 0;
172} 172}
173 173
174static int lbs_cmd_802_11_inactivity_timeout(struct lbs_private *priv, 174int lbs_cmd_802_11_inactivity_timeout(struct lbs_private *priv,
175 struct cmd_ds_command *cmd, 175 uint16_t cmd_action, uint16_t *timeout)
176 u16 cmd_action, void *pdata_buf)
177{ 176{
178 u16 *timeout = pdata_buf; 177 struct cmd_ds_802_11_inactivity_timeout cmd;
178 int ret;
179 179
180 lbs_deb_enter(LBS_DEB_CMD); 180 lbs_deb_enter(LBS_DEB_CMD);
181 181
182 cmd->command = cpu_to_le16(CMD_802_11_INACTIVITY_TIMEOUT); 182 cmd.hdr.command = cpu_to_le16(CMD_802_11_INACTIVITY_TIMEOUT);
183 cmd->size = 183 cmd.hdr.size = cpu_to_le16(sizeof(cmd));
184 cpu_to_le16(sizeof(struct cmd_ds_802_11_inactivity_timeout)
185 + S_DS_GEN);
186 184
187 cmd->params.inactivity_timeout.action = cpu_to_le16(cmd_action); 185 cmd.action = cpu_to_le16(cmd_action);
188 186
189 if (cmd_action) 187 if (cmd_action == CMD_ACT_SET)
190 cmd->params.inactivity_timeout.timeout = cpu_to_le16(*timeout); 188 cmd.timeout = cpu_to_le16(*timeout);
191 else 189 else
192 cmd->params.inactivity_timeout.timeout = 0; 190 cmd.timeout = 0;
193 191
194 lbs_deb_leave(LBS_DEB_CMD); 192 ret = lbs_cmd_with_response(priv, CMD_802_11_INACTIVITY_TIMEOUT, &cmd);
193
194 if (!ret)
195 *timeout = le16_to_cpu(cmd.timeout);
196
197 lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
195 return 0; 198 return 0;
196} 199}
197 200
@@ -1520,11 +1523,6 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1520 case CMD_802_11_SLEEP_PARAMS: 1523 case CMD_802_11_SLEEP_PARAMS:
1521 ret = lbs_cmd_802_11_sleep_params(priv, cmdptr, cmd_action); 1524 ret = lbs_cmd_802_11_sleep_params(priv, cmdptr, cmd_action);
1522 break; 1525 break;
1523 case CMD_802_11_INACTIVITY_TIMEOUT:
1524 ret = lbs_cmd_802_11_inactivity_timeout(priv, cmdptr,
1525 cmd_action, pdata_buf);
1526 lbs_set_cmd_ctrl_node(priv, cmdnode, pdata_buf);
1527 break;
1528 1526
1529 case CMD_802_11_TPC_CFG: 1527 case CMD_802_11_TPC_CFG:
1530 cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG); 1528 cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG);
diff --git a/drivers/net/wireless/libertas/cmd.h b/drivers/net/wireless/libertas/cmd.h
index e334f0e623af..50821e76a883 100644
--- a/drivers/net/wireless/libertas/cmd.h
+++ b/drivers/net/wireless/libertas/cmd.h
@@ -47,4 +47,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria);
47int lbs_suspend(struct lbs_private *priv); 47int lbs_suspend(struct lbs_private *priv);
48int lbs_resume(struct lbs_private *priv); 48int lbs_resume(struct lbs_private *priv);
49 49
50int lbs_cmd_802_11_inactivity_timeout(struct lbs_private *priv,
51 uint16_t cmd_action, uint16_t *timeout);
52
50#endif /* _LBS_CMD_H */ 53#endif /* _LBS_CMD_H */
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 7c9ffc511b58..f7fb8c74014a 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -554,13 +554,6 @@ static inline int handle_cmd_response(struct lbs_private *priv,
554 case CMD_RET(CMD_802_11_SLEEP_PARAMS): 554 case CMD_RET(CMD_802_11_SLEEP_PARAMS):
555 ret = lbs_ret_802_11_sleep_params(priv, resp); 555 ret = lbs_ret_802_11_sleep_params(priv, resp);
556 break; 556 break;
557 case CMD_RET(CMD_802_11_INACTIVITY_TIMEOUT):
558 spin_lock_irqsave(&priv->driver_lock, flags);
559 *((uint16_t *) priv->cur_cmd->callback_arg) =
560 le16_to_cpu(resp->params.inactivity_timeout.timeout);
561 spin_unlock_irqrestore(&priv->driver_lock, flags);
562 break;
563
564 case CMD_RET(CMD_802_11_TPC_CFG): 557 case CMD_RET(CMD_802_11_TPC_CFG):
565 spin_lock_irqsave(&priv->driver_lock, flags); 558 spin_lock_irqsave(&priv->driver_lock, flags);
566 memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg, 559 memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h
index 8cc4d778e46a..2ad32bc2cf24 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -378,6 +378,8 @@ struct cmd_ds_802_11_sleep_params {
378}; 378};
379 379
380struct cmd_ds_802_11_inactivity_timeout { 380struct cmd_ds_802_11_inactivity_timeout {
381 struct cmd_header hdr;
382
381 /* ACT_GET/ACT_SET */ 383 /* ACT_GET/ACT_SET */
382 __le16 action; 384 __le16 action;
383 385
@@ -714,7 +716,6 @@ struct cmd_ds_command {
714 struct cmd_ds_802_11d_domain_info domaininforesp; 716 struct cmd_ds_802_11d_domain_info domaininforesp;
715 717
716 struct cmd_ds_802_11_sleep_params sleep_params; 718 struct cmd_ds_802_11_sleep_params sleep_params;
717 struct cmd_ds_802_11_inactivity_timeout inactivity_timeout;
718 struct cmd_ds_802_11_tpc_cfg tpccfg; 719 struct cmd_ds_802_11_tpc_cfg tpccfg;
719 struct cmd_ds_802_11_pwr_cfg pwrcfg; 720 struct cmd_ds_802_11_pwr_cfg pwrcfg;
720 struct cmd_ds_802_11_afc afc; 721 struct cmd_ds_802_11_afc afc;