Subject: Macronix MX98715AEC network adapter [deadlock]
To: None <port-macppc@netbsd.org>
From: Daniel Lamblin <daniell@trillian.beachbash.net>
List: port-macppc
Date: 04/22/2003 04:14:04
Being a bit fed up with the buffer underruns and occasional bad packet
lengths that I got with my power mac 8600's internal network adapter, I
got a PCI based one.

The SOHOware Fast, the one based on Macronix MX98715AEC which is a DEC
Tulip clone [I had read this was a good clone, and that tulip in general
was a good chip (man tlp)] [BTW what's up with the reference to de, which
there's a man page for, but doesn't seem to be the recommended way to
support tulips any longer]

Well, Having built it [1.6] and all I was dissapointed to see the
following behavior:

ifconfig tlp0 media 10baseT		Works
ifconfig tlp0 media 10baseT-FDX		Works but is not Full-Duplex
ifconfig tlp0 media 100baseTX		Broken
ifconfig tlp0 media 100baseTX-FDX	As above but is not Full-Duplex
ifconfig tlp0 media Auto		Doesn't work
The thing to note is that you can't just switch to 100baseTX*
from 10baseT*, you must first switch to Auto, and then to 100baseTX*
or you will detect no carrier (no link light).

My Full-Duplex switch has a full-duplex light to tell me that the FDX
modes arn't full-duplex.

Also, the Auto mode spends 1 second off, 1/10th second in 100baseTX-FDX,
1 second off, 1/10th second in 100baseTX and loops.  Generally it
doesn't work.

EVEN more importantly, the 100baseTX modes are slower than the 10baseT
modes.
This would be explained by spending times of up to 5 seconds in the
kernel I.E. ping pauses in bursts and doesn't respond to ^C

compare this ping to google.com:
		   min		  avg		   max		 std-dev
10baseT		  94.754	  96.706	  99.362	   1.137
100baseTX	2161.854	5964.677	12091.925	2515.757

I tried to mail the original poster (current-users 1999/09/29)
who mentioned he added MX98715 support, but it bounced.

Anyway, I've got a 3C905B I found in the trash... I might try that, though
I don't know if it does full-duplex. [I tried it, it does, but strangely I
can't select the mode/media at all lots of SCIO some errs (yes I was root)]

for the MX98715 There's aparently some bug that makes it tricky in
our-endian machines.  But then I came accross the post in 1999 by the guy
who made the chip work that said he was using an Alpha, which is
same-endian as a macppc (right?)

oh.  I'm searching for more info to post, and I get this bug-report:
http://mail-index.netbsd.org/netbsd-bugs/2002/06/28/0007.html

You know, before rc.conf actually initializes my card, the card
does autonegotiate to the best setting (100baseTX-FDX)

Undoubtably this all has to do with the driver thinking the MicroWire
interface is broken:

tlp0 at pci0 dev 13 function 0: Macronix MX98715AEC-x Ethernet, pass 2.5
tlp0: broken MicroWire interface detected; setting SROM size to 1Kb
tlp0: interrupting at irq 23
tlp0: Ethernet address 00:80:c6:ec:d2:c8
tlp0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto

actually it may be... it may not be using MII at all but some other
interface to a PHY

anyway, I've now used a 3C905B (I wrote this over 2 days), I didn't try
the regression patch in the old bug filed (I figured it wouldn't be the
same initial file anyway), and the latter works well though I can't choose
media (or even auto)...

MX98715 has some deadlock issue:

The final straw was when I put my machine into a lock (probably an enless
Kernel loop somewhere).  To be all cautious I'd set up cron to reset the
network every 3 minutes (only while I was trying some settings), and that
didn't kick in, nor did the local console.
All I did was issue:
/sbin/ifconfig tlp0 media auto 2>&1 >/dev/null; sleep 2;/sbin/ifconfig
tlp0 media 100baseTX-FDX 2>&1 >/dev/null; sleep 10;/sbin/ifconfig tlp0
media 10baseT 2&>1 >/dev/null

It did the autosensing loop for 2 seconds, then actually got into a
100baseTX-FDX (actually working duplex) mode for all of 3 prompts (enter
enter enter (in another window)) and then never came out of it; no
10baseT, no cron, no local console could save it.

-Daniel