summaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2009-02-01 09:52:34 +0100
committerDavid S. Miller <davem@davemloft.net>2009-02-01 09:52:34 +0100
commit2884e5cc9283d541977bdf5dc344849af94cd639 (patch)
tree937a66410637f6298ad038d173316edf27def66b /drivers/net/gianfar.c
parentnet: replace uses of __constant_{endian} (diff)
downloadlinux-2884e5cc9283d541977bdf5dc344849af94cd639.tar.xz
linux-2884e5cc9283d541977bdf5dc344849af94cd639.zip
gianfar: Implement proper, per netdevice wakeup management
This patch implements wakeup management for the gianfar driver. The driver should set wakeup enable if WOL is enabled, so that phylib won't power off an attached PHY. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index f5e6068f9b07..4d2ca490d76c 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -463,6 +463,9 @@ static int gfar_probe(struct of_device *ofdev,
goto register_fail;
}
+ device_init_wakeup(&dev->dev,
+ priv->device_flags & FSL_GIANFAR_DEV_HAS_MAGIC_PACKET);
+
/* fill out IRQ number and name fields */
len_devname = strlen(dev->name);
strncpy(&priv->int_name_tx[0], dev->name, len_devname);
@@ -1200,6 +1203,8 @@ static int gfar_enet_open(struct net_device *dev)
netif_start_queue(dev);
+ device_set_wakeup_enable(&dev->dev, priv->wol_en);
+
return err;
}