summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-09-26 11:57:37 -0700
committerJeff Garzik <jeff@garzik.org>2006-09-27 17:56:31 -0400
commite0ed5459030a8c9ddde44ef49bcb63aa6db425e1 (patch)
tree891a90b0c112422800bac597fa269b07165eca1a
parent0ba8821b12231386c8c1d506c682061f7225ae49 (diff)
downloadop-kernel-dev-e0ed5459030a8c9ddde44ef49bcb63aa6db425e1.zip
op-kernel-dev-e0ed5459030a8c9ddde44ef49bcb63aa6db425e1.tar.gz
[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.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 7eeefa2..3ff2f42 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)
return -1;
}
- if (hw->chip_id != CHIP_ID_YUKON_FE &&
- gm_phy_read(hw, port, PHY_MARV_1000T_STAT) & PHY_B_1000S_MSF) {
- printk(KERN_ERR PFX "%s: master/slave fault",
- sky2->netdev->name);
- return -1;
- }
-
if (!(aux & PHY_M_PS_SPDUP_RES)) {
printk(KERN_ERR PFX "%s: speed/duplex mismatch",
sky2->netdev->name);
return -1;
}
- sky2->duplex = (aux & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF;
-
sky2->speed = sky2_phy_speed(hw, aux);
+ if (sky2->speed == SPEED_1000) {
+ u16 ctl2 = gm_phy_read(hw, port, PHY_MARV_1000T_CTRL);
+ u16 lpa2 = gm_phy_read(hw, port, PHY_MARV_1000T_STAT);
+ if (lpa2 & PHY_B_1000S_MSF) {
+ printk(KERN_ERR PFX "%s: master/slave fault",
+ sky2->netdev->name);
+ return -1;
+ }
+
+ if ((ctl2 & PHY_M_1000C_AFD) && (lpa2 & PHY_B_1000S_LP_FD))
+ sky2->duplex = DUPLEX_FULL;
+ else
+ sky2->duplex = DUPLEX_HALF;
+ } else {
+ u16 adv = gm_phy_read(hw, port, PHY_MARV_AUNE_ADV);
+ if ((aux & adv) & PHY_AN_FULL)
+ sky2->duplex = DUPLEX_FULL;
+ else
+ sky2->duplex = DUPLEX_HALF;
+ }
/* Pause bits are offset (9..8) */
if (hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U)
OpenPOWER on IntegriCloud