From patchwork Wed Jul 27 16:19:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 1012152 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6RGJ9OW015990 for ; Wed, 27 Jul 2011 16:19:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754780Ab1G0QTH (ORCPT ); Wed, 27 Jul 2011 12:19:07 -0400 Received: from mtaout02-winn.ispmail.ntl.com ([81.103.221.48]:61361 "EHLO mtaout02-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754528Ab1G0QTG (ORCPT ); Wed, 27 Jul 2011 12:19:06 -0400 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20110727161903.NQGE3933.mtaout02-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Wed, 27 Jul 2011 17:19:03 +0100 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20110727161903.MAAF20122.aamtaout01-winn.ispmail.ntl.com@zog.reactivated.net>; Wed, 27 Jul 2011 17:19:03 +0100 Received: by zog.reactivated.net (Postfix, from userid 1000) id DE2109D401C; Wed, 27 Jul 2011 17:19:00 +0100 (BST) From: Daniel Drake To: linville@tuxdriver.com To: dcbw@redhat.com Cc: linux-wireless@vger.kernel.org Cc: libertas-dev@lists.infradead.org Subject: [PATCH] libertas_usb: program OLPC EC wakeup mask for wake-on-WLAN Message-Id: <20110727161900.DE2109D401C@zog.reactivated.net> Date: Wed, 27 Jul 2011 17:19:00 +0100 (BST) X-Cloudmark-Analysis: v=1.1 cv=R50lirqlHffDPPkwUlkuVa99MrvKdVWo//yz83qex8g= c=1 sm=0 a=JCXzHlZ-56EA:10 a=vJ1w_8FsMGIA:10 a=Op-mwl0xAAAA:8 a=yJ38rZrCyrcL7QdnBFkA:9 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 27 Jul 2011 16:19:09 +0000 (UTC) OLPC power management code has recently gone upstream. This piece completes the puzzle for libertas_usb, which now programs the OLPC EC for wlan wakeups when they have been requested. Signed-off-by: Daniel Drake Acked-by: Dan Williams --- drivers/net/wireless/libertas/if_usb.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) Depends on some patches that were into Linus's tree yesterday. diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index b5acc39..8f73e80 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c @@ -1112,6 +1112,15 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) if (priv->psstate != PS_STATE_FULL_POWER) return -1; +#ifdef CONFIG_OLPC + if (machine_is_olpc()) { + if (priv->wol_criteria == EHS_REMOVE_WAKEUP) + olpc_ec_wakeup_clear(EC_SCI_SRC_WLAN); + else + olpc_ec_wakeup_set(EC_SCI_SRC_WLAN); + } +#endif + ret = lbs_suspend(priv); if (ret) goto out;