Subject: Re: 3C905
To: Patrick Welche <prlw1@newn.cam.ac.uk>
From: Michael C. Richardson <mcr@sandelman.ottawa.on.ca>
List: current-users
Date: 11/16/1998 16:50:33
>>>>> "Patrick" == Patrick Welche <prlw1@newn.cam.ac.uk> writes:
    Patrick> The following works:

NetBSD 1.3.2 (GENERIC) #0: Sun May 24 19:45:48 EDT 1998
    perry@frankenstein.piermont.com:/usr/src/sys/arch/i386/compile/GENERIC
ep1 at pci0 dev 18 function 0: 3Com 3C905 Ethernet
ep1: MAC address 00:60:08:10:10:75
ep1: 8KB word-wide FIFO, (undefined) Rx:Tx split, mii default mii, autoselect
ep1: interrupting at irq 11

    Patrick> but a current kernel finds a ?different? card:

NetBSD 1.3H (LUGDUNUM) #1: Mon Nov 16 17:35:17 GMT 1998
    prlw1@quartz.newn.cam.ac.uk:/usr/src/sys/arch/i386/compile/LUGDUNUM
ep0 at pci0 dev 18 function 0: 3Com 3c905-TX Ethernet
ep0: interrupting at irq 11
ep0: address 00:60:08:10:10:75, 8KB word-wide FIFO, 3:5 Rx:Tx split
OUI 0x080017 model 0x0000 rev 1 at ep0 phy 24 not configured

    Patrick> Any ideas?

  Well, the card isn't different, it is just more precise.  Why it is ep0
instead of ep1, must be due to your kernel config.
  The card worked before because it was autoselecting the interface. The
-current driver has support for talking to some PHY (physical interface)
chips.  

  AFAIK, the MII bus is pretty standard, rather like PCI in some
ways. Although most PHY's have some value added, one *can* select a given PHY
without knowing anything about the media behind it (the AMD 79971 can
actually do this itself, and I suspect the 3c509 in autoselect mode can do
this as well), or about its specific programming. So, I think we that we
should have some kind of generic MII target to attach to PHYs that don't
(yet) have drivers.  

  I might write some generic MII code, since I wandered through that code
last week and made my AMD eval card know how to do media selection. My major
question would be: how can I tell my driver which PHY to use. Should one
do something like:
	"ifconfig ep0 media mii -mediaopt 24"

  (i.e. select the PHY at address 24.)
  Will this even work? The options to "media" are hard coded AFAIK, and I
don't think the mediaopt's are any less so. Is there no way to get a 
string or integer down to the driver? Yes, this goes back to the bad days
of "link0/link1/link2". Can't use link? since we need 5 bits for the PHY
address.

  Patrick, what does ifconfig ep0 show? 
  Can you get your network working by doing "ifconfig ep0 media auto", or has
your network even stopped? 

   :!mcr!:            |  Network and security consulting/contract programming
   Michael Richardson |         Firewalls, TCP/IP and Unix administration
 Personal: http://www.sandelman.ottawa.on.ca/People/Michael_Richardson/Bio.html
 Corporate: http://www.sandelman.ottawa.on.ca/SSW/
	ON HUMILITY: To err is human, to moo bovine.