From bfcaa33d4f8adb963a91137dcaf88ee0c6515079 Mon Sep 17 00:00:00 2001
From: Bernie Innocenti <bernie@codewiz.org>
Date: Mon, 1 Feb 2010 15:56:08 -0300
Subject: [PATCH 3/3] libertas: Do not issue HOST_SLEEP_CFG on XO-1
Organization: Sugar Labs Foundation

Issuing the HOST_SLEEP_CFG command on suspend seems to kill libertas
on the XO-1. It's not clear if it's an 8388 issue, a firmware issue
or a board issue.

The present work-around lets us enable PM on the XO-1 without loosing
wifi shortly after.
---
 drivers/net/wireless/libertas/cmd.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 82d7509..16f3ab5 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -15,6 +15,11 @@
 #include "wext.h"
 #include "cmd.h"
 
+#ifdef CONFIG_OLPC
+#include <asm/olpc.h>
+#endif
+
+
 static struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv);
 
 
@@ -203,6 +208,13 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
 	struct cmd_ds_host_sleep cmd_config;
 	int ret;
 
+#ifdef CONFIG_OLPC
+	if (olpc_board_is_xo1()) {
+		lbs_pr_info("Not issuing HOST_SLEEP_CFG on XO-1\n");
+		return 0;
+	}
+#endif
+
 	cmd_config.hdr.size = cpu_to_le16(sizeof(cmd_config));
 	cmd_config.criteria = cpu_to_le32(criteria);
 	cmd_config.gpio = priv->wol_gpio;
-- 
1.6.6.1

