From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754716AbYLGXsC (ORCPT ); Sun, 7 Dec 2008 18:48:02 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751027AbYLGXru (ORCPT ); Sun, 7 Dec 2008 18:47:50 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:35348 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750919AbYLGXrt (ORCPT ); Sun, 7 Dec 2008 18:47:49 -0500 From: "Rafael J. Wysocki" To: Michael Chan Subject: net (tg3): Fix failure to enable WoL by default when possible Date: Mon, 8 Dec 2008 00:46:55 +0100 User-Agent: KMail/1.9.9 Cc: netdev@vger.kernel.org, Jeff Garzik , LKML MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812080046.56119.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Subject: net (tg3): Fix failure to enable WoL by default when possible tg3 is supposed to enable WoL by default on adapters which support that, but it fails to do so unless the adapter's /sys/devices/.../power/wakeup file contains 'enabled' during the initialization of the adapter. Fix that by making tg3 update the device's 'should_wakeup' bit automatically whenever WoL should be enabled by default. Signed-off-by: Rafael J. Wysocki --- drivers/net/tg3.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Index: linux-2.6/drivers/net/tg3.c =================================================================== --- linux-2.6.orig/drivers/net/tg3.c +++ linux-2.6/drivers/net/tg3.c @@ -11296,9 +11296,10 @@ static void __devinit tg3_get_eeprom_hw_ if (val & VCPU_CFGSHDW_ASPM_DBNC) tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND; if ((val & VCPU_CFGSHDW_WOL_ENABLE) && - (val & VCPU_CFGSHDW_WOL_MAGPKT) && - device_may_wakeup(&tp->pdev->dev)) + (val & VCPU_CFGSHDW_WOL_MAGPKT)) { tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; + device_set_wakeup_enable(&tp->pdev->dev, true); + } return; }