Subject: Re: qec, qe0<->qe1 freezes the system
To: None <port-sparc@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc
Date: 08/15/2002 21:41:57
>> try changing the mac addresses of the ports so that they are
>> different.

> qe is so old that setting local-mac-address? to true doesn't help.

Is it the age of the card that matters, or that NetBSD's driver ignores
the setting?  I see qe.c calling myetheraddr() to get the MAC address
and myetheraddr() just fetches the machine's MAC address from the
idprom struct.

> NetBSD's ifconfig can't change the MAC addresses (Solaris' can, but
> they won't be permanent of course).  So... I cannot do nothing.

You could hack on qe.c, if you really wanted to bother.  Search for the
call to myetheraddr() and change it.  As a quick gross hack, you could
change

	myetheraddr(sc->sc_enaddr);

to something like

	{ static int n = 0;
	  sc->sc_enaddr[0] = 0;
	  sc->sc_enaddr[1] = 0;
	  sc->sc_enaddr[2] = 0;
	  sc->sc_enaddr[3] = 0;
	  sc->sc_enaddr[4] = 0;
	  sc->sc_enaddr[5] = n++;
	}

which should (it's untested) make your qe interfaces show up with MAC
addresses 0:0:0:0:0:0, 0;0:0:0:0:1, 0:0:0:0:0:2, etc, as many as you
have qe interfaces.  This is a wrong thing to do in general; among
other things, it can collide if you have a card on your LAN from
whoever has manufacturer prefix 0:0:0.  (You may have to initialize n
to something else in that case, or change some of the constant 0
values, to avoid addresses that collide.)  But it should allow you to
determine whether having all interfaces at the same MAC address is
actually what's causing your trouble.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B