diff options
-rw-r--r-- | drivers/net/3c59x.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index c44d599cc5ef..c754d88e5ec9 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -2918,6 +2918,36 @@ static void vortex_get_drvinfo(struct net_device *dev, | |||
2918 | } | 2918 | } |
2919 | } | 2919 | } |
2920 | 2920 | ||
2921 | static void vortex_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | ||
2922 | { | ||
2923 | struct vortex_private *vp = netdev_priv(dev); | ||
2924 | |||
2925 | spin_lock_irq(&vp->lock); | ||
2926 | wol->supported = WAKE_MAGIC; | ||
2927 | |||
2928 | wol->wolopts = 0; | ||
2929 | if (vp->enable_wol) | ||
2930 | wol->wolopts |= WAKE_MAGIC; | ||
2931 | spin_unlock_irq(&vp->lock); | ||
2932 | } | ||
2933 | |||
2934 | static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | ||
2935 | { | ||
2936 | struct vortex_private *vp = netdev_priv(dev); | ||
2937 | if (wol->wolopts & ~WAKE_MAGIC) | ||
2938 | return -EINVAL; | ||
2939 | |||
2940 | spin_lock_irq(&vp->lock); | ||
2941 | if (wol->wolopts & WAKE_MAGIC) | ||
2942 | vp->enable_wol = 1; | ||
2943 | else | ||
2944 | vp->enable_wol = 0; | ||
2945 | acpi_set_WOL(dev); | ||
2946 | spin_unlock_irq(&vp->lock); | ||
2947 | |||
2948 | return 0; | ||
2949 | } | ||
2950 | |||
2921 | static const struct ethtool_ops vortex_ethtool_ops = { | 2951 | static const struct ethtool_ops vortex_ethtool_ops = { |
2922 | .get_drvinfo = vortex_get_drvinfo, | 2952 | .get_drvinfo = vortex_get_drvinfo, |
2923 | .get_strings = vortex_get_strings, | 2953 | .get_strings = vortex_get_strings, |
@@ -2929,6 +2959,8 @@ static const struct ethtool_ops vortex_ethtool_ops = { | |||
2929 | .set_settings = vortex_set_settings, | 2959 | .set_settings = vortex_set_settings, |
2930 | .get_link = ethtool_op_get_link, | 2960 | .get_link = ethtool_op_get_link, |
2931 | .nway_reset = vortex_nway_reset, | 2961 | .nway_reset = vortex_nway_reset, |
2962 | .get_wol = vortex_get_wol, | ||
2963 | .set_wol = vortex_set_wol, | ||
2932 | }; | 2964 | }; |
2933 | 2965 | ||
2934 | #ifdef CONFIG_PCI | 2966 | #ifdef CONFIG_PCI |