Skip to content

Commit

Permalink
CRISv10: Don't autonegotiate if autonegotiation is off
Browse files Browse the repository at this point in the history
If autonegotiation was disabled, we still set the
BMCR_ANENABLE and BMCR_ANRESTART, which resulted in autonegotiation
never being disabled.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Reported-by: Julia Lawall <julia@diku.dk>
  • Loading branch information
Jesper Nilsson committed Aug 31, 2009
1 parent a090ca2 commit e6cd197
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions drivers/net/cris/eth_v10.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,24 @@ e100_negotiate(struct net_device* dev)

e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE, data);

/* Renegotiate with link partner */
data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR);
if (autoneg_normal) {
data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR);
data |= BMCR_ANENABLE | BMCR_ANRESTART;
/* Renegotiate with link partner */
data |= BMCR_ANENABLE | BMCR_ANRESTART;
} else {
/* Don't negotiate speed or duplex */
data &= ~(BMCR_ANENABLE | BMCR_ANRESTART);

/* Set speed and duplex static */
if (current_speed_selection == 10)
data &= ~BMCR_SPEED100;
else
data |= BMCR_SPEED100;

if (current_duplex != full)
data &= ~BMCR_FULLDPLX;
else
data |= BMCR_FULLDPLX;
}
e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR, data);
}
Expand Down

0 comments on commit e6cd197

Please sign in to comment.