Bug 15986

Summary: xl ethernet interface hanging
Product: Base System Reporter: Arjan.deVet <Arjan.deVet>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   

Description Arjan.deVet 2000-01-08 13:10:00 UTC
I noticed that my xl0 ethernet interface didn't work anymore (or with
enormous delays) and I traced it back to revision 1.69 in if_xl.c:

Index: if_xl.c
===================================================================
RCS file: /home/freebsd/CVS/src/sys/pci/if_xl.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -u -5 -w -r1.68 -r1.69
--- if_xl.c	1999/10/14 21:49:17	1.68
+++ if_xl.c	1999/10/25 20:52:32	1.69
@@ -2389,13 +2389,13 @@
 	/*
 	 * Cancel pending I/O and free all RX/TX buffers.
 	 */
 	xl_stop(sc);
 
-	xl_reset(sc);
+	CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_TX_RESET);
 	xl_wait(sc);
-	DELAY(1000);
+	DELAY(10000);
 
 	if (sc->xl_miibus != NULL)
 		mii = device_get_softc(sc->xl_miibus);
 
 	/* Init our MAC address */

dmesg output:

xl0: <3Com 3c900B-TPO Etherlink XL> irq 12 at device 11.0 on pci0
xl0: Ethernet address: 00:50:04:ea:f9:c0
xl0: media options word: 8
xl0: guessing 10BaseT transceiver
xl0: found 10baseT
xl0: selecting 10baseT transceiver, half duplex
bpf: xl0 attached

Fix: Because the comment talks about RX/TX buffers I tried this fix:



and then my xl0 interface worked again. Is this a correct solution?--jSxZqPHvHJEuu4aP7Wjucqb8FMKDTur2dH2oV4iS2z7kMysw
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

Index: if_xl.c
===================================================================
RCS file: /home/freebsd/CVS/src/sys/pci/if_xl.c,v
retrieving revision 1.71
diff -u -r1.71 if_xl.c
--- if_xl.c	2000/01/03 15:28:47	1.71
+++ if_xl.c	2000/01/08 12:30:48
@@ -2426,6 +2426,8 @@
 	 */
 	xl_stop(sc);
 
+	CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_RESET);
+	xl_wait(sc);
 	CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_TX_RESET);
 	xl_wait(sc);
 	DELAY(10000);
Comment 1 Bill Paul freebsd_committer freebsd_triage 2000-01-09 21:17:17 UTC
State Changed
From-To: open->closed


Fix applied, though with a test to insure that the RX reset is only done 
on cards that don't use miibus support, since doing an RX reset on them 
can retrigger NWAY autonegotiation, which is what I was trying to avoid 
in the first place.