From wkb@freebie.demon.nl  Mon May 28 14:45:40 2001
Return-Path: <wkb@freebie.demon.nl>
Received: from post.mail.nl.demon.net (post-10.mail.nl.demon.net [194.159.73.20])
	by hub.freebsd.org (Postfix) with ESMTP id 55FDB37B424
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 May 2001 14:45:39 -0700 (PDT)
	(envelope-from wkb@freebie.demon.nl)
Received: from [212.238.54.101] (helo=freebie.demon.nl)
	by post.mail.nl.demon.net with smtp (Exim 3.22 #1)
	id 154UpT-00037z-00
	for FreeBSD-gnats-submit@freebsd.org; Mon, 28 May 2001 21:45:35 +0000
Received: (from wkb@localhost)
	by freebie.demon.nl (8.11.3/8.11.2) id f4SLpDB00595;
	Mon, 28 May 2001 23:51:13 +0200 (CEST)
	(envelope-from wkb)
Message-Id: <200105282151.f4SLpDB00595@freebie.demon.nl>
Date: Mon, 28 May 2001 23:51:13 +0200 (CEST)
From: wilko@freebsd.org
Reply-To: wilko@freebsd.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: 3C905TX / xl driver broken by mii bug
X-Send-Pr-Version: 3.2

>Number:         27722
>Category:       kern
>Synopsis:       3C905TX / xl driver broken by mii bug
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    jlemon
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 28 14:50:01 PDT 2001
>Closed-Date:    Sun Jun 3 11:14:00 PDT 2001
>Last-Modified:  Sun Jun 03 11:16:36 PDT 2001
>Originator:     Wilko Bulte
>Release:        FreeBSD 4-STABLE i386
>Organization:
Private FreeBSD site - The Netherlands
>Environment:

	3Com 3c905-TX Fast Etherlink XL ethernet card is needed. 

	System / mainboard is not relevant, observed on both a 750Mc
	Abit Athlon and a Asus P75. Ethernet card is connected to a 
	Linksys 10/100 mbit hub. Lacking an ethernet switch I could not test
	that variation. This is not a hardware problem, it occurs on
	multiple cards in different systems.

May 28 22:21:59 freebie /kernel: xl0: <3Com 3c905-TX Fast Etherlink XL> port 0xe000-0xe03f irq 10 at device 13.0 on pci0
May 28 22:21:59 freebie /kernel: xl0: Ethernet address: 00:60:08:09:b7:41
May 28 22:21:59 freebie /kernel: miibus0: <MII bus> on xl0
May 28 22:21:59 freebie /kernel: nsphy0: <DP83840 10/100 media interface> on miibus0
May 28 22:21:59 freebie /kernel: nsphy0:  10baseT, 10baseT-FDX, 100baseTX,
100baseTX-FDX, auto

>Description:

	Given mii/nsphy.c V1.8 in the kernel the 3COM cards do not
	autonegotiate anymore. Rather, they report 'no carrier'. 
	Manually forcing media to 10baseT/UTP does work. Manually forcing
	100baseTX does not work. In autonegotiate no link LEDs on the hub
	or the 3C905 are lit.

>How-To-Repeat:

	See above        

>Fix:

	Revert to mii/nsphy.c V1.7 which does not 'enable some undocumented 
	bits' in the PHY chip. Apparantly this does work for fxp, but breaks
	xl on the 3C905-TX cards. 

	cvs log of mii/nsphy.c
	----------------------------
	revision 1.8
	date: 2001/03/16 14:17:02;  author: jlemon;  state: Exp;  lines: +9 -6
	Enable some undocumented bits in the DP83840 PHY, which is needed
	when using it with the Intel fxp driver.

	Tested by: peter, Ollivier Robert <roberto@eurocontrol.fr>,
	Peter Schultz <pete@jocose.org>
	----------------------------
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jlemon 
Responsible-Changed-By: wilko 
Responsible-Changed-When: Mon May 28 14:53:37 PDT 2001 
Responsible-Changed-Why:  
Jonathan made the V1.7->V1.8 commit to nsphy.c and I assume/hope he can 
help fixing this one. I, for one, am not a network guy. Tnx. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27722 

From: Matthias Schuendehuette <msch@snafu.de>
To: freebsd-gnats-submit@FreeBSD.org, wilko@freebsd.org
Cc:  
Subject: Re: kern/27722: 3C905TX / xl driver broken by mii bug
Date: Thu, 31 May 2001 21:38:06 +0200

 For 4.3-STABLE:
 
 nsphy.c Revision 1.2.2.3 (MFC on May 14th, 2001) is broken for 'xl'
 nsphy.c Revision 1.2.2.2 works.
 -- 
 ***************************************************************************
 * Matthias Schuendehuette   root@mscu.snafu.de  			  *
 * Solmsstrasse 44							  *
 * D-10961 Berlin	    Engineering Systems Support and Operation     *
 * Germany		    @ BahnEngineering SystemTechnik GmbH, Berlin  *
 ***************************************************************************
State-Changed-From-To: open->closed 
State-Changed-By: wilko 
State-Changed-When: Sun Jun 3 11:14:00 PDT 2001 
State-Changed-Why:  
Bug is fixed. 


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27722 
>Unformatted:

jlemon has contacted me via email, he is investigating  and providing me
test patches. Stay tuned & tnx to Jonathan.

Wilko

---

Problem looks fixed by the following commit to mii/nsphy.c:

----------------------------
revision 1.9
date: 2001/06/02 19:51:02;  author: jlemon;  state: Exp;  lines: +4 -2
Only touch the PCR register in order to set bits for the fxp driver.
The 3C509-TX card apparently had a slightly different version of the
chip, and has problems when this register is set.  The problem does
not appear on the 3C509{BC} cards, but since only the fxp driver needs
specific bits set, conditionalize on that.

Thanks to Jonathan for fixing this one.
