diff mbox

NET / skge: Enable WoL by default if supported

Message ID 200907221458.55616.rjw@sisk.pl
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Rafael J. Wysocki July 22, 2009, 12:58 p.m. UTC
From: Rafael J. Wysocki <rjw@sisk.pl>

If skge hardware is capable of waking up the system from sleep,
enable magic packet WoL during driver initialisation.

This makes WoL work without calling 'ethtool -s ethX wol g'
for each adapter.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: Michael Guntsche <mike@it-loops.com>
---
 drivers/net/skge.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

stephen hemminger July 22, 2009, 4:59 p.m. UTC | #1
On Wed, 22 Jul 2009 14:58:55 +0200
"Rafael J. Wysocki" <rjw@sisk.pl> wrote:

> From: Rafael J. Wysocki <rjw@sisk.pl>
> 
> If skge hardware is capable of waking up the system from sleep,
> enable magic packet WoL during driver initialisation.
> 
> This makes WoL work without calling 'ethtool -s ethX wol g'
> for each adapter.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> Tested-by: Michael Guntsche <mike@it-loops.com>
> ---
>  drivers/net/skge.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> Index: linux-2.6/drivers/net/skge.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/skge.c
> +++ linux-2.6/drivers/net/skge.c
> @@ -3856,8 +3856,10 @@ static struct net_device *skge_devinit(s
>  	skge->speed = -1;
>  	skge->advertising = skge_supported_modes(hw);
>  
> -	if (device_may_wakeup(&hw->pdev->dev))
> +	if (device_can_wakeup(&hw->pdev->dev)) {
>  		skge->wol = wol_supported(hw) & WAKE_MAGIC;
> +		device_set_wakeup_enable(&hw->pdev->dev, skge->wol);
> +	}
>  
>  	hw->dev[port] = dev;
>  

Acked-by: Stephen Hemminger <shemminger@vyatta.com>
David Miller July 22, 2009, 6:25 p.m. UTC | #2
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 22 Jul 2009 09:59:53 -0700

> On Wed, 22 Jul 2009 14:58:55 +0200
> "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> 
>> From: Rafael J. Wysocki <rjw@sisk.pl>
>> 
>> If skge hardware is capable of waking up the system from sleep,
>> enable magic packet WoL during driver initialisation.
>> 
>> This makes WoL work without calling 'ethtool -s ethX wol g'
>> for each adapter.
>> 
>> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
>> Tested-by: Michael Guntsche <mike@it-loops.com>
>> ---
>>  drivers/net/skge.c |    4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> Index: linux-2.6/drivers/net/skge.c
>> ===================================================================
>> --- linux-2.6.orig/drivers/net/skge.c
>> +++ linux-2.6/drivers/net/skge.c
>> @@ -3856,8 +3856,10 @@ static struct net_device *skge_devinit(s
>>  	skge->speed = -1;
>>  	skge->advertising = skge_supported_modes(hw);
>>  
>> -	if (device_may_wakeup(&hw->pdev->dev))
>> +	if (device_can_wakeup(&hw->pdev->dev)) {
>>  		skge->wol = wol_supported(hw) & WAKE_MAGIC;
>> +		device_set_wakeup_enable(&hw->pdev->dev, skge->wol);
>> +	}
>>  
>>  	hw->dev[port] = dev;
>>  
> 
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: linux-2.6/drivers/net/skge.c
===================================================================
--- linux-2.6.orig/drivers/net/skge.c
+++ linux-2.6/drivers/net/skge.c
@@ -3856,8 +3856,10 @@  static struct net_device *skge_devinit(s
 	skge->speed = -1;
 	skge->advertising = skge_supported_modes(hw);
 
-	if (device_may_wakeup(&hw->pdev->dev))
+	if (device_can_wakeup(&hw->pdev->dev)) {
 		skge->wol = wol_supported(hw) & WAKE_MAGIC;
+		device_set_wakeup_enable(&hw->pdev->dev, skge->wol);
+	}
 
 	hw->dev[port] = dev;