patch-2.4.21 linux-2.4.21/drivers/net/e100/e100_phy.c

Next file: linux-2.4.21/drivers/net/e100/e100_phy.h
Previous file: linux-2.4.21/drivers/net/e100/e100_main.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/drivers/net/e100/e100_phy.c linux-2.4.21/drivers/net/e100/e100_phy.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   
-  Copyright(c) 1999 - 2002 Intel Corporation. All rights reserved.
+  Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
   
   This program is free software; you can redistribute it and/or modify it 
   under the terms of the GNU General Public License as published by the Free 
@@ -636,7 +636,6 @@
 	control &= ~BMCR_ANENABLE;
 	control &= ~BMCR_LOOPBACK;
 
-	/* Check e100.c values */
 	switch (bdp->params.e100_speed_duplex) {
 	case E100_SPEED_10_HALF:
 		control &= ~BMCR_SPEED100;
@@ -682,6 +681,41 @@
 	} while (true);
 }
 
+void
+e100_force_speed_duplex_to_phy(struct e100_private *bdp)
+{
+	u16 control;
+
+	e100_mdi_read(bdp, MII_BMCR, bdp->phy_addr, &control);
+	control &= ~BMCR_ANENABLE;
+	control &= ~BMCR_LOOPBACK;
+
+	switch (bdp->params.e100_speed_duplex) {
+	case E100_SPEED_10_HALF:
+		control &= ~BMCR_SPEED100;
+		control &= ~BMCR_FULLDPLX;
+		break;
+
+	case E100_SPEED_10_FULL:
+		control &= ~BMCR_SPEED100;
+		control |= BMCR_FULLDPLX;
+		break;
+
+	case E100_SPEED_100_HALF:
+		control |= BMCR_SPEED100;
+		control &= ~BMCR_FULLDPLX;
+		break;
+
+	case E100_SPEED_100_FULL:
+		control |= BMCR_SPEED100;
+		control |= BMCR_FULLDPLX;
+		break;
+	}
+
+	/* Send speed/duplex command to PHY layer. */
+	e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr, control);
+}
+
 /* 
  * Procedure: e100_set_fc
  *

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)