diff options
author | Giuseppe Cavallaro <peppe.cavallaro@st.com> | 2010-09-25 06:27:41 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-25 06:27:41 +0200 |
commit | 543876c92837a8b208b5c99ec225c1f5a581900e (patch) | |
tree | 7a183a1bc3e8974b994e4bad1861ddd0f33ac7e7 /drivers/net/stmmac/stmmac_ethtool.c | |
parent | net: Add Gigabit Ethernet driver of Topcliff PCH (diff) | |
download | linux-543876c92837a8b208b5c99ec225c1f5a581900e.tar.xz linux-543876c92837a8b208b5c99ec225c1f5a581900e.zip |
stmmac: review the wake-up support
If the PM support is available this is passed
through the platform instead to be hard-coded
in the core files.
WoL on Magic Frame can be enabled by using
the ethtool support.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/stmmac/stmmac_ethtool.c')
-rw-r--r-- | drivers/net/stmmac/stmmac_ethtool.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c index b32c16ae55c6..25a7e385f8ec 100644 --- a/drivers/net/stmmac/stmmac_ethtool.c +++ b/drivers/net/stmmac/stmmac_ethtool.c @@ -322,7 +322,7 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) struct stmmac_priv *priv = netdev_priv(dev); spin_lock_irq(&priv->lock); - if (priv->wolenabled == PMT_SUPPORTED) { + if (device_can_wakeup(priv->device)) { wol->supported = WAKE_MAGIC; wol->wolopts = priv->wolopts; } @@ -334,16 +334,20 @@ static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) struct stmmac_priv *priv = netdev_priv(dev); u32 support = WAKE_MAGIC; - if (priv->wolenabled == PMT_NOT_SUPPORTED) + if (!device_can_wakeup(priv->device)) return -EINVAL; if (wol->wolopts & ~support) return -EINVAL; - if (wol->wolopts == 0) - device_set_wakeup_enable(priv->device, 0); - else + if (wol->wolopts) { + pr_info("stmmac: wakeup enable\n"); device_set_wakeup_enable(priv->device, 1); + enable_irq_wake(dev->irq); + } else { + device_set_wakeup_enable(priv->device, 0); + disable_irq_wake(dev->irq); + } spin_lock_irq(&priv->lock); priv->wolopts = wol->wolopts; |