Skip to content

Commit

Permalink
[PATCH] sky2: nway reset (BONUS FEATURE)
Browse files Browse the repository at this point in the history
Here is support for ethtool controlled renegotiation.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Sep 28, 2005
1 parent 724bca3 commit 9a7ae0a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2300,6 +2300,24 @@ static u32 sky2_get_msglevel(struct net_device *netdev)
return sky2->msg_enable;
}

static int sky2_nway_reset(struct net_device *dev)
{
struct sky2_port *sky2 = netdev_priv(dev);
struct sky2_hw *hw = sky2->hw;

if (sky2->autoneg != AUTONEG_ENABLE)
return -EINVAL;

netif_stop_queue(dev);

spin_lock_irq(&hw->phy_lock);
sky2_phy_reset(hw, sky2->port);
sky2_phy_init(hw, sky2->port);
spin_unlock_irq(&hw->phy_lock);

return 0;
}

static void sky2_phy_stats(struct sky2_port *sky2, u64 * data, unsigned count)
{
struct sky2_hw *hw = sky2->hw;
Expand Down Expand Up @@ -2656,6 +2674,7 @@ static struct ethtool_ops sky2_ethtool_ops = {
.get_drvinfo = sky2_get_drvinfo,
.get_msglevel = sky2_get_msglevel,
.set_msglevel = sky2_set_msglevel,
.nway_reset = sky2_nway_reset,
.get_regs_len = sky2_get_regs_len,
.get_regs = sky2_get_regs,
.get_link = ethtool_op_get_link,
Expand Down

0 comments on commit 9a7ae0a

Please sign in to comment.