libertas: handle HOST_AWAKE event by sending WAKEUP_CONFIRM command
authorDavid Woodhouse <dwmw2@infradead.org>
Mon, 17 Dec 2007 18:26:42 +0000 (13:26 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:07:42 +0000 (15:07 -0800)
lbs_send_confirmwake() is a bit ugly but matches the way we confirm
sleep. We'll deal with that whole thing later.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/cmdresp.c
drivers/net/wireless/libertas/dev.h
drivers/net/wireless/libertas/host.h

index c05fef04c4324c96df041d6c0087889fa4b1b680..8f9eda4d1be10f366c41440cb1a0c930f07ee2ef 100644 (file)
@@ -773,6 +773,30 @@ done:
        return ret;
 }
 
+static int lbs_send_confirmwake(struct lbs_private *priv)
+{
+       struct cmd_header *cmd = &priv->lbs_ps_confirm_wake;
+       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;
+
+       lbs_deb_host("SEND_WAKEC_CMD: before download\n");
+
+       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));
+       if (ret)
+               lbs_pr_alert("SEND_WAKEC_CMD: Host to Card failed for Confirm Wake\n");
+
+       lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret);
+       return ret;
+}
+
 int lbs_process_event(struct lbs_private *priv)
 {
        int ret = 0;
@@ -821,9 +845,13 @@ int lbs_process_event(struct lbs_private *priv)
 
                break;
 
+       case MACREG_INT_CODE_HOST_AWAKE:
+               lbs_deb_cmd("EVENT: HOST_AWAKE\n");
+               lbs_send_confirmwake(priv);
+               break;
+
        case MACREG_INT_CODE_PS_AWAKE:
                lbs_deb_cmd("EVENT: awake\n");
-
                /* handle unexpected PS AWAKE event */
                if (priv->psstate == PS_STATE_FULL_POWER) {
                        lbs_deb_cmd(
index 465080fd0607ccc532cfc76953f24bacddb3e3fc..fe5045757356af1b2ba4f3287ab4dfe0c5fadab9 100644 (file)
@@ -263,6 +263,7 @@ struct lbs_private {
        u8 needtowakeup;
 
        struct PS_CMD_ConfirmSleep lbs_ps_confirm_sleep;
+       struct cmd_header lbs_ps_confirm_wake;
 
        struct assoc_request * pending_assoc_req;
        struct assoc_request * in_progress_assoc_req;
index bdf9017a173a8e387f27a2a228a8cb42da59f16b..4c03e12fd6a3415318ad160bea0aad2d0ce55bba 100644 (file)
@@ -74,6 +74,7 @@
 #define CMD_802_11_GET_AFC                     0x003d
 #define CMD_802_11_AD_HOC_STOP                 0x0040
 #define CMD_802_11_HOST_SLEEP_CFG              0x0043
+#define CMD_802_11_WAKEUP_CONFIRM              0x0044
 #define CMD_802_11_HOST_SLEEP_ACTIVATE         0x0045
 #define CMD_802_11_BEACON_STOP                 0x0049
 #define CMD_802_11_MAC_ADDRESS                 0x004d