aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/sky2.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 37f486b65f63..02d0b42e436c 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3228,6 +3228,27 @@ static inline u8 sky2_wol_supported(const struct sky2_hw *hw)
3228 return sky2_is_copper(hw) ? (WAKE_PHY | WAKE_MAGIC) : 0; 3228 return sky2_is_copper(hw) ? (WAKE_PHY | WAKE_MAGIC) : 0;
3229} 3229}
3230 3230
3231static void sky2_hw_set_wol(struct sky2_hw *hw)
3232{
3233 int wol = 0;
3234 int i;
3235
3236 for (i = 0; i < hw->ports; i++) {
3237 struct net_device *dev = hw->dev[i];
3238 struct sky2_port *sky2 = netdev_priv(dev);
3239
3240 if (sky2->wol)
3241 wol = 1;
3242 }
3243
3244 if (hw->chip_id == CHIP_ID_YUKON_EC_U ||
3245 hw->chip_id == CHIP_ID_YUKON_EX ||
3246 hw->chip_id == CHIP_ID_YUKON_FE_P)
3247 sky2_write32(hw, B0_CTST, wol ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);
3248
3249 device_set_wakeup_enable(&hw->pdev->dev, wol);
3250}
3251
3231static void sky2_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 3252static void sky2_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
3232{ 3253{
3233 const struct sky2_port *sky2 = netdev_priv(dev); 3254 const struct sky2_port *sky2 = netdev_priv(dev);
@@ -3247,13 +3268,7 @@ static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
3247 3268
3248 sky2->wol = wol->wolopts; 3269 sky2->wol = wol->wolopts;
3249 3270
3250 if (hw->chip_id == CHIP_ID_YUKON_EC_U || 3271 sky2_hw_set_wol(hw);
3251 hw->chip_id == CHIP_ID_YUKON_EX ||
3252 hw->chip_id == CHIP_ID_YUKON_FE_P)
3253 sky2_write32(hw, B0_CTST, sky2->wol
3254 ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);
3255
3256 device_set_wakeup_enable(&hw->pdev->dev, sky2->wol);
3257 3272
3258 if (!netif_running(dev)) 3273 if (!netif_running(dev))
3259 sky2_wol_init(sky2); 3274 sky2_wol_init(sky2);