diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-09-26 14:57:37 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-27 17:56:31 -0400 |
commit | e0ed5459030a8c9ddde44ef49bcb63aa6db425e1 (patch) | |
tree | 891a90b0c112422800bac597fa269b07165eca1a | |
parent | 0ba8821b12231386c8c1d506c682061f7225ae49 (diff) |
[PATCH] sky2: gigabit full duplex negotiation
Look at the registers correctly, when doing gigabit full duplex.
Need to look for link partner result.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/sky2.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 7eeefa2d6c89..3ff2f426fd63 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1624,22 +1624,33 @@ static int sky2_autoneg_done(struct sky2_port *sky2, u16 aux) | |||
1624 | return -1; | 1624 | return -1; |
1625 | } | 1625 | } |
1626 | 1626 | ||
1627 | if (hw->chip_id != CHIP_ID_YUKON_FE && | ||
1628 | gm_phy_read(hw, port, PHY_MARV_1000T_STAT) & PHY_B_1000S_MSF) { | ||
1629 | printk(KERN_ERR PFX "%s: master/slave fault", | ||
1630 | sky2->netdev->name); | ||
1631 | return -1; | ||
1632 | } | ||
1633 | |||
1634 | if (!(aux & PHY_M_PS_SPDUP_RES)) { | 1627 | if (!(aux & PHY_M_PS_SPDUP_RES)) { |
1635 | printk(KERN_ERR PFX "%s: speed/duplex mismatch", | 1628 | printk(KERN_ERR PFX "%s: speed/duplex mismatch", |
1636 | sky2->netdev->name); | 1629 | sky2->netdev->name); |
1637 | return -1; | 1630 | return -1; |
1638 | } | 1631 | } |
1639 | 1632 | ||
1640 | sky2->duplex = (aux & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF; | ||
1641 | |||
1642 | sky2->speed = sky2_phy_speed(hw, aux); | 1633 | sky2->speed = sky2_phy_speed(hw, aux); |
1634 | if (sky2->speed == SPEED_1000) { | ||
1635 | u16 ctl2 = gm_phy_read(hw, port, PHY_MARV_1000T_CTRL); | ||
1636 | u16 lpa2 = gm_phy_read(hw, port, PHY_MARV_1000T_STAT); | ||
1637 | if (lpa2 & PHY_B_1000S_MSF) { | ||
1638 | printk(KERN_ERR PFX "%s: master/slave fault", | ||
1639 | sky2->netdev->name); | ||
1640 | return -1; | ||
1641 | } | ||
1642 | |||
1643 | if ((ctl2 & PHY_M_1000C_AFD) && (lpa2 & PHY_B_1000S_LP_FD)) | ||
1644 | sky2->duplex = DUPLEX_FULL; | ||
1645 | else | ||
1646 | sky2->duplex = DUPLEX_HALF; | ||
1647 | } else { | ||
1648 | u16 adv = gm_phy_read(hw, port, PHY_MARV_AUNE_ADV); | ||
1649 | if ((aux & adv) & PHY_AN_FULL) | ||
1650 | sky2->duplex = DUPLEX_FULL; | ||
1651 | else | ||
1652 | sky2->duplex = DUPLEX_HALF; | ||
1653 | } | ||
1643 | 1654 | ||
1644 | /* Pause bits are offset (9..8) */ | 1655 | /* Pause bits are offset (9..8) */ |
1645 | if (hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U) | 1656 | if (hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U) |