Module Name:    src
Committed By:   bouyer
Date:           Sat Jun 18 16:40:39 UTC 2011

Modified Files:
        src/sys/dev/ic [netbsd-5-1]: gem.c

Log Message:
Pull up following revision(s) (requested by jdc in ticket #1632):
        sys/dev/ic/gem.c: revision 1.97
Fix corrupted packet problem on 100Mb/s half duplex links.
We need to set "echo disable" on the internal phy too, not just on the
external phy.
Tested on:
SUNW,Sun-Blade-2000
gem0 at pci0 dev 5 function 1: Sun Microsystems ERI Ethernet (rev. 0x01)
ukphy0 at gem0 phy 1: OUI 0x0006b8, model 0x000c, rev. 1
Setting pointed out by bad@.


To generate a diff of this commit:
cvs rdiff -u -r1.78.4.1 -r1.78.4.1.2.1 src/sys/dev/ic/gem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/gem.c
diff -u src/sys/dev/ic/gem.c:1.78.4.1 src/sys/dev/ic/gem.c:1.78.4.1.2.1
--- src/sys/dev/ic/gem.c:1.78.4.1	Fri May  1 01:56:16 2009
+++ src/sys/dev/ic/gem.c	Sat Jun 18 16:40:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gem.c,v 1.78.4.1 2009/05/01 01:56:16 snj Exp $ */
+/*	$NetBSD: gem.c,v 1.78.4.1.2.1 2011/06/18 16:40:39 bouyer Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.78.4.1 2009/05/01 01:56:16 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.78.4.1.2.1 2011/06/18 16:40:39 bouyer Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -2385,14 +2385,6 @@
 	sc->sc_mif_config = bus_space_read_4(t, mac, GEM_MIF_CONFIG);
 	if ((sc->sc_flags &(GEM_SERDES | GEM_SERIAL)) == 0) {
 		if ((sc->sc_mif_config & GEM_MIF_CONFIG_MDI1) != 0) {
-			/* External MII needs echo disable if half duplex. */
-			if ((IFM_OPTIONS(sc->sc_mii.mii_media_active) &
-			    IFM_FDX) != 0)
-				/* turn on full duplex LED */
-				v |= GEM_MAC_XIF_FDPLX_LED;
-			else
-				/* half duplex -- disable echo */
-				v |= GEM_MAC_XIF_ECHO_DISABL;
 			if (gigabit)
 				v |= GEM_MAC_XIF_GMII_MODE;
 			else
@@ -2400,6 +2392,13 @@
 		} else
 			/* Internal MII needs buf enable */
 			v |= GEM_MAC_XIF_MII_BUF_ENA;
+		/* MII needs echo disable if half duplex. */
+		if ((IFM_OPTIONS(sc->sc_mii.mii_media_active) & IFM_FDX) != 0)
+			/* turn on full duplex LED */
+			v |= GEM_MAC_XIF_FDPLX_LED;
+		else
+			/* half duplex -- disable echo */
+			v |= GEM_MAC_XIF_ECHO_DISABL;
 	} else {
 		if ((IFM_OPTIONS(sc->sc_mii.mii_media_active) & IFM_FDX) != 0)
 			v |= GEM_MAC_XIF_FDPLX_LED;

Reply via email to