aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cris/eth_v10.c
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2009-08-31 12:28:26 -0400
committerJesper Nilsson <jesper.nilsson@axis.com>2009-08-31 12:38:17 -0400
commite6cd19743bfc76ca81804c2a259e3a0d7b03fd73 (patch)
tree31c2212d3dbfcae281daae5f33a6e14b72cbb154 /drivers/net/cris/eth_v10.c
parenta090ca2c840a3459642971f26bdbad96d2482e32 (diff)
CRISv10: Don't autonegotiate if autonegotiation is off
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>
Diffstat (limited to 'drivers/net/cris/eth_v10.c')
-rw-r--r--drivers/net/cris/eth_v10.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 7a18dc7e5c7f..d70d2039bc46 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -768,10 +768,24 @@ e100_negotiate(struct net_device* dev)
768 768
769 e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE, data); 769 e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE, data);
770 770
771 /* Renegotiate with link partner */ 771 data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR);
772 if (autoneg_normal) { 772 if (autoneg_normal) {
773 data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR); 773 /* Renegotiate with link partner */
774 data |= BMCR_ANENABLE | BMCR_ANRESTART; 774 data |= BMCR_ANENABLE | BMCR_ANRESTART;
775 } else {
776 /* Don't negotiate speed or duplex */
777 data &= ~(BMCR_ANENABLE | BMCR_ANRESTART);
778
779 /* Set speed and duplex static */
780 if (current_speed_selection == 10)
781 data &= ~BMCR_SPEED100;
782 else
783 data |= BMCR_SPEED100;
784
785 if (current_duplex != full)
786 data &= ~BMCR_FULLDPLX;
787 else
788 data |= BMCR_FULLDPLX;
775 } 789 }
776 e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR, data); 790 e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR, data);
777} 791}