From f539f2efe9fdf9e7db2022a757190858576d34fd Mon Sep 17 00:00:00 2001 From: Holger Schurig Date: Wed, 26 Mar 2008 13:22:11 +0100 Subject: libertas: convert sleep/wake config direct commands Confirm sleep event: they come very regularly, eventually several times per second. Therefore we want to send the config command as fast as possible. The old code pre-set the command in priv->lbs_ps_confirm_sleep. However, the byte sequence to be sent to the hardware is the same for all interfaces. So this patch make this an extern structure, initialized at module load time. Config wake event: normal conversion to a direct command. However, I don't know how to trigger a "HOST AWAKE" event from the firmware, so this part is untested. Signed-off-by: Holger Schurig Acked-by: Dan Williams Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/cmdresp.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'drivers/net/wireless/libertas/cmdresp.c') diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index 8b5d1a5..e60d03b 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c @@ -548,21 +548,20 @@ done: static int lbs_send_confirmwake(struct lbs_private *priv) { - struct cmd_header *cmd = &priv->lbs_ps_confirm_wake; + struct cmd_header cmd; int ret = 0; lbs_deb_enter(LBS_DEB_HOST); - cmd->command = cpu_to_le16(CMD_802_11_WAKEUP_CONFIRM); - cmd->size = cpu_to_le16(sizeof(*cmd)); - cmd->seqnum = cpu_to_le16(++priv->seqnum); - cmd->result = 0; + cmd.command = cpu_to_le16(CMD_802_11_WAKEUP_CONFIRM); + cmd.size = cpu_to_le16(sizeof(cmd)); + cmd.seqnum = cpu_to_le16(++priv->seqnum); + cmd.result = 0; - lbs_deb_host("SEND_WAKEC_CMD: before download\n"); + lbs_deb_hex(LBS_DEB_HOST, "wake confirm", (u8 *) &cmd, + sizeof(cmd)); - lbs_deb_hex(LBS_DEB_HOST, "wake confirm command", (void *)cmd, sizeof(*cmd)); - - ret = priv->hw_host_to_card(priv, MVMS_CMD, (void *)cmd, sizeof(*cmd)); + ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &cmd, sizeof(cmd)); if (ret) lbs_pr_alert("SEND_WAKEC_CMD: Host to Card failed for Confirm Wake\n"); -- cgit v1.1