libertas: convert DEEP_SLEEP timer to a direct command
authorDan Williams <dcbw@redhat.com>
Tue, 27 Jul 2010 20:15:01 +0000 (13:15 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Jul 2010 19:14:12 +0000 (15:14 -0400)
Other uses were already used direct command paths.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/cmd.c
drivers/net/wireless/libertas/main.c

index 5c7bb35..f19a36f 100644 (file)
@@ -1208,10 +1208,6 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
        cmdptr->result = 0;
 
        switch (cmd_no) {
-       case CMD_802_11_DEEP_SLEEP:
-               cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP);
-               cmdptr->size = cpu_to_le16(sizeof(struct cmd_header));
-               break;
        default:
                lbs_pr_err("PREP_CMD: unknown command 0x%04x\n", cmd_no);
                ret = -1;
index 6c0e814..2398fc5 100644 (file)
@@ -658,7 +658,6 @@ out:
 static void auto_deepsleep_timer_fn(unsigned long data)
 {
        struct lbs_private *priv = (struct lbs_private *)data;
-       int ret;
 
        lbs_deb_enter(LBS_DEB_CMD);
 
@@ -666,14 +665,15 @@ static void auto_deepsleep_timer_fn(unsigned long data)
                priv->is_activity_detected = 0;
        } else {
                if (priv->is_auto_deep_sleep_enabled &&
-                               (!priv->wakeup_dev_required) &&
-                               (priv->connect_status != LBS_CONNECTED)) {
+                   (!priv->wakeup_dev_required) &&
+                   (priv->connect_status != LBS_CONNECTED)) {
+                       struct cmd_header cmd;
+
                        lbs_deb_main("Entering auto deep sleep mode...\n");
-                       ret = lbs_prepare_and_send_command(priv,
-                                       CMD_802_11_DEEP_SLEEP, 0,
-                                       0, 0, NULL);
-                       if (ret)
-                               lbs_pr_err("Enter Deep Sleep command failed\n");
+                       memset(&cmd, 0, sizeof(cmd));
+                       cmd.size = cpu_to_le16(sizeof(cmd));
+                       lbs_cmd_async(priv, CMD_802_11_DEEP_SLEEP, &cmd,
+                                       sizeof(cmd));
                }
        }
        mod_timer(&priv->auto_deepsleep_timer , jiffies +