Skip to contentSkip to conversation

NET / skge: Enable WoL by default if supported

PATCH Applied Rafael J. Wysocki 3 participants 5 messages Jul 22, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NET / skge: Enable WoL by default if supported

From: Rafael J. Wysocki <[email protected]>

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.

---
 drivers/net/skge.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/skge.c +3 -1
Index: 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 on v1 1/1
#1 lore raw
Quoted 20 lines · On Wed, 22 Jul 2009 14:58:55 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

From: Rafael J. Wysocki <[email protected]>

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.

---
 drivers/net/skge.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/net/skge.c
===================================================================

drivers/net/skge.c +0 -0
@@ -3856,8 +3856,10 @@ static struct net_device *skge_devinit(s
 	skge->speed = -1;

drivers/net/skge.c static struct net_device *skge_devinit(s · line 3865

Quoted 10 lines
drivers/net/skge.c +3 -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;
 
maintainer Applied
#2 lore raw

From: Stephen Hemminger <[email protected]>
Date: Wed, 22 Jul 2009 09:59:53 -0700

Quoted 31 lines
Quoted 28 lines · On Wed, 22 Jul 2009 14:58:55 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

From: Rafael J. Wysocki <[email protected]>

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.

---
 drivers/net/skge.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/net/skge.c
===================================================================

drivers/net/skge.c +3 -1
@@ -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);
+	}
 
Quoted 4 lines

drivers/net/skge.c static struct net_device *skge_devinit(s · line 3865

Quoted 2 lines
drivers/net/skge.c +0 -0
 	hw->dev[port] = dev;
 

Applied, thanks.

maintainer Applied
#3 lore raw
In reply to Stephen Hemminger

From: Stephen Hemminger <[email protected]>
Date: Wed, 22 Jul 2009 09:59:53 -0700

Quoted 31 lines
Quoted 28 lines · On Wed, 22 Jul 2009 14:58:55 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

From: Rafael J. Wysocki <[email protected]>

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.

---
 drivers/net/skge.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/net/skge.c
===================================================================

drivers/net/skge.c +3 -1
@@ -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);
+	}
 
Quoted 4 lines

drivers/net/skge.c static struct net_device *skge_devinit(s · line 3865

Quoted 2 lines
drivers/net/skge.c +0 -0
 	hw->dev[port] = dev;
 

Applied, thanks.

Acked-by on v1 1/1
#4 lore raw
In reply to Rafael J. Wysocki
Quoted 20 lines · On Wed, 22 Jul 2009 14:58:55 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

From: Rafael J. Wysocki <[email protected]>

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.

---
 drivers/net/skge.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/net/skge.c
===================================================================

drivers/net/skge.c +0 -0
@@ -3856,8 +3856,10 @@ static struct net_device *skge_devinit(s
 	skge->speed = -1;

drivers/net/skge.c static struct net_device *skge_devinit(s · line 3865

Quoted 10 lines
drivers/net/skge.c +3 -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;