aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/stmmac
diff options
context:
space:
mode:
authorGiuseppe Cavallaro <peppe.cavallaro@st.com>2011-04-13 14:51:43 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-13 14:51:43 -0400
commit74ae2fd7d326750d973920c30d5269596724ca71 (patch)
treeac18819cbe8bf4bf356fd45816b6a6bea7cf2224 /drivers/net/stmmac
parentb19f7f71b6fa5e0c49f65082044b8a2ff1009f00 (diff)
stmmac: review Wol and enable the Unicast 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')
-rw-r--r--drivers/net/stmmac/dwmac1000_core.c5
-rw-r--r--drivers/net/stmmac/stmmac_ethtool.c4
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/stmmac/dwmac1000_core.c b/drivers/net/stmmac/dwmac1000_core.c
index 6ae4c3f4c63c..f20455cbfbbc 100644
--- a/drivers/net/stmmac/dwmac1000_core.c
+++ b/drivers/net/stmmac/dwmac1000_core.c
@@ -178,10 +178,11 @@ static void dwmac1000_pmt(void __iomem *ioaddr, unsigned long mode)
178{ 178{
179 unsigned int pmt = 0; 179 unsigned int pmt = 0;
180 180
181 if (mode == WAKE_MAGIC) { 181 if (mode & WAKE_MAGIC) {
182 CHIP_DBG(KERN_DEBUG "GMAC: WOL Magic frame\n"); 182 CHIP_DBG(KERN_DEBUG "GMAC: WOL Magic frame\n");
183 pmt |= power_down | magic_pkt_en; 183 pmt |= power_down | magic_pkt_en;
184 } else if (mode == WAKE_UCAST) { 184 }
185 if (mode & WAKE_UCAST) {
185 CHIP_DBG(KERN_DEBUG "GMAC: WOL on global unicast\n"); 186 CHIP_DBG(KERN_DEBUG "GMAC: WOL on global unicast\n");
186 pmt |= global_unicast; 187 pmt |= global_unicast;
187 } 188 }
diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c
index 156a805c6c23..0e61ac8707cb 100644
--- a/drivers/net/stmmac/stmmac_ethtool.c
+++ b/drivers/net/stmmac/stmmac_ethtool.c
@@ -308,7 +308,7 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
308 308
309 spin_lock_irq(&priv->lock); 309 spin_lock_irq(&priv->lock);
310 if (device_can_wakeup(priv->device)) { 310 if (device_can_wakeup(priv->device)) {
311 wol->supported = WAKE_MAGIC; 311 wol->supported = WAKE_MAGIC | WAKE_UCAST;
312 wol->wolopts = priv->wolopts; 312 wol->wolopts = priv->wolopts;
313 } 313 }
314 spin_unlock_irq(&priv->lock); 314 spin_unlock_irq(&priv->lock);
@@ -317,7 +317,7 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
317static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 317static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
318{ 318{
319 struct stmmac_priv *priv = netdev_priv(dev); 319 struct stmmac_priv *priv = netdev_priv(dev);
320 u32 support = WAKE_MAGIC; 320 u32 support = WAKE_MAGIC | WAKE_UCAST;
321 321
322 if (!device_can_wakeup(priv->device)) 322 if (!device_can_wakeup(priv->device))
323 return -EINVAL; 323 return -EINVAL;