Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179816
b: refs/heads/master
c: 2ca4231
h: refs/heads/master
v: v3
  • Loading branch information
Mike McCormack authored and David S. Miller committed Jan 23, 2010
1 parent ad098a4 commit ee6252c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8e1e8a4779cb23c1d9f51e9223795e07ec54d77a
refs/heads/master: 2ca4231de7f7a5fd7137bac152030ba71f15e8c3
29 changes: 22 additions & 7 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3228,6 +3228,27 @@ static inline u8 sky2_wol_supported(const struct sky2_hw *hw)
return sky2_is_copper(hw) ? (WAKE_PHY | WAKE_MAGIC) : 0;
}

static void sky2_hw_set_wol(struct sky2_hw *hw)
{
int wol = 0;
int i;

for (i = 0; i < hw->ports; i++) {
struct net_device *dev = hw->dev[i];
struct sky2_port *sky2 = netdev_priv(dev);

if (sky2->wol)
wol = 1;
}

if (hw->chip_id == CHIP_ID_YUKON_EC_U ||
hw->chip_id == CHIP_ID_YUKON_EX ||
hw->chip_id == CHIP_ID_YUKON_FE_P)
sky2_write32(hw, B0_CTST, wol ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);

device_set_wakeup_enable(&hw->pdev->dev, wol);
}

static void sky2_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
const struct sky2_port *sky2 = netdev_priv(dev);
Expand All @@ -3247,13 +3268,7 @@ static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)

sky2->wol = wol->wolopts;

if (hw->chip_id == CHIP_ID_YUKON_EC_U ||
hw->chip_id == CHIP_ID_YUKON_EX ||
hw->chip_id == CHIP_ID_YUKON_FE_P)
sky2_write32(hw, B0_CTST, sky2->wol
? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);

device_set_wakeup_enable(&hw->pdev->dev, sky2->wol);
sky2_hw_set_wol(hw);

if (!netif_running(dev))
sky2_wol_init(sky2);
Expand Down

0 comments on commit ee6252c

Please sign in to comment.