Commit 74ae2fd7 authored by Giuseppe Cavallaro's avatar Giuseppe Cavallaro Committed by David S. Miller

stmmac: review Wol and enable the Unicast support

Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b19f7f71
...@@ -178,10 +178,11 @@ static void dwmac1000_pmt(void __iomem *ioaddr, unsigned long mode) ...@@ -178,10 +178,11 @@ static void dwmac1000_pmt(void __iomem *ioaddr, unsigned long mode)
{ {
unsigned int pmt = 0; unsigned int pmt = 0;
if (mode == WAKE_MAGIC) { if (mode & WAKE_MAGIC) {
CHIP_DBG(KERN_DEBUG "GMAC: WOL Magic frame\n"); CHIP_DBG(KERN_DEBUG "GMAC: WOL Magic frame\n");
pmt |= power_down | magic_pkt_en; pmt |= power_down | magic_pkt_en;
} else if (mode == WAKE_UCAST) { }
if (mode & WAKE_UCAST) {
CHIP_DBG(KERN_DEBUG "GMAC: WOL on global unicast\n"); CHIP_DBG(KERN_DEBUG "GMAC: WOL on global unicast\n");
pmt |= global_unicast; pmt |= global_unicast;
} }
......
...@@ -308,7 +308,7 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) ...@@ -308,7 +308,7 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
spin_lock_irq(&priv->lock); spin_lock_irq(&priv->lock);
if (device_can_wakeup(priv->device)) { if (device_can_wakeup(priv->device)) {
wol->supported = WAKE_MAGIC; wol->supported = WAKE_MAGIC | WAKE_UCAST;
wol->wolopts = priv->wolopts; wol->wolopts = priv->wolopts;
} }
spin_unlock_irq(&priv->lock); spin_unlock_irq(&priv->lock);
...@@ -317,7 +317,7 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) ...@@ -317,7 +317,7 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{ {
struct stmmac_priv *priv = netdev_priv(dev); struct stmmac_priv *priv = netdev_priv(dev);
u32 support = WAKE_MAGIC; u32 support = WAKE_MAGIC | WAKE_UCAST;
if (!device_can_wakeup(priv->device)) if (!device_can_wakeup(priv->device))
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment