freebsd-nq/sys
Bill Paul d00275330d This commit adds support for the NetBSD MII abstraction layer and
MII-compliant PHY drivers. Many 10/100 ethernet NICs available today
either use an MII transceiver or have built-in transceivers that can
be programmed using an MII interface. It makes sense then to separate
this support out into common code instead of duplicating it in all
of the NIC drivers. The mii code also handles all of the media
detection, selection and reporting via the ifmedia interface.

This is basically the same code from NetBSD's /sys/dev/mii, except
it's been adapted to FreeBSD's bus architecture. The advantage to this
is that it automatically allows everything to be turned into a
loadable module. There are some common functions for use in drivers
once an miibus has been attached (mii_mediachg(), mii_pollstat(),
mii_tick()) as well as individual PHY drivers. There is also a
generic driver for all PHYs that aren't handled by a specific driver.
It's possible to do this because all 10/100 PHYs implement the same
general register set in addition to their vendor-specific register
sets, so for the most part you can use one driver for pretty much
any PHY. There are a couple of oddball exceptions though, hence
the need to have specific drivers.

There are two layers: the generic "miibus" layer and the PHY driver
layer. The drivers are child devices of "miibus" and the "miibus" is
a child of a given NIC driver. The "miibus" code and the PHY drivers
can actually be compiled and kldoaded as completely separate modules
or compiled together into one module. For the moment I'm using the
latter approach since the code is relatively small.

Currently there are only three PHY drivers here: the generic driver,
the built-in 3Com XL driver and the NS DP83840 driver. I'll be adding
others later as I convert various NIC drivers to use this code.

I realize that I'm cvs adding this stuff instead of importing it
onto a separate vendor branch, but in my opinion the import approach
doesn't really offer any significant advantage: I'm going to be
maintaining this stuff and writing my own PHY drivers one way or
the other.
1999-08-21 17:40:53 +00:00
..
alpha Fix a nasty kld bug where modules with objects of type GLOB_DAT which had 1999-08-20 14:21:35 +00:00
amd64 Loosen up the constructed argument segment generation slightly; rather than 1999-08-20 21:08:41 +00:00
boot Fix a bunch of broken cross-references 1999-08-18 05:55:22 +00:00
cam Implement a new generic mechanism for attaching handler functions to 1999-08-21 06:24:40 +00:00
coda Don't examine vp->v_tag (see comment in vnode.h) 1999-08-13 13:05:08 +00:00
compat Fix a bug in debug-printfs of struct linux_termios fields, where I forgot to 1999-08-17 10:27:55 +00:00
compile
conf This commit adds support for the NetBSD MII abstraction layer and 1999-08-21 17:40:53 +00:00
contrib SMP: Release the giant lock while we work the flash array 1999-08-15 14:30:09 +00:00
ddb Merge the cons.c and cons.h to the best of my ability. alpha may or 1999-08-09 10:35:05 +00:00
dev This commit adds support for the NetBSD MII abstraction layer and 1999-08-21 17:40:53 +00:00
fs Let processes retrieve their argv through procfs. Revert to the original 1999-08-19 19:41:08 +00:00
geom Spring cleaning around strategy and disklabels/slices: 1999-08-14 11:40:51 +00:00
gnu The bdevsw() and cdevsw() are now identical, so kill the former. 1999-08-13 10:29:38 +00:00
i4b Avoid symbol clash in LINT. 1999-08-08 18:17:40 +00:00
i386 This commit adds support for the NetBSD MII abstraction layer and 1999-08-21 17:40:53 +00:00
isa Recognize Interlink VersaPad. `Tap' action will be recognized 1999-08-17 12:14:13 +00:00
isofs/cd9660 The bdevsw() and cdevsw() are now identical, so kill the former. 1999-08-13 10:29:38 +00:00
kern Detect if the the offset used to read from a raw device loose bits 1999-08-21 06:48:16 +00:00
libkern Use the latest version of these files from OpenBSD. 1999-08-10 05:58:58 +00:00
miscfs Let processes retrieve their argv through procfs. Revert to the original 1999-08-19 19:41:08 +00:00
modules This commit adds support for the NetBSD MII abstraction layer and 1999-08-21 17:40:53 +00:00
msdosfs The bdevsw() and cdevsw() are now identical, so kill the former. 1999-08-13 10:29:38 +00:00
net Hopefully make IFMEDIA_DEBUG compile. if_xname[] is a NetBSD addition, 1999-08-18 13:13:01 +00:00
netatalk Change suser_xxx() to suser() where it applies. 1999-04-27 12:21:16 +00:00
netatm Allow configuration of up to 256 network interfaces per physical interface - 1999-05-10 23:02:29 +00:00
netinet Fix breakage if blackhole=1 and tiflags & TH_SYN, plus 1999-08-19 05:22:12 +00:00
netipx Suser() simplification: 1999-04-27 11:18:52 +00:00
netkey Fix a printf(3) formatter to match its variable. 1999-08-17 22:11:02 +00:00
netnatm
netns
nfs Convert all the nfs macros to do { blah } while (0) to ensure it 1999-08-19 14:50:12 +00:00
nfsclient Convert all the nfs macros to do { blah } while (0) to ensure it 1999-08-19 14:50:12 +00:00
nfsserver Convert all the nfs macros to do { blah } while (0) to ensure it 1999-08-19 14:50:12 +00:00
ntfs The bdevsw() and cdevsw() are now identical, so kill the former. 1999-08-13 10:29:38 +00:00
pc98 Merge from sys/i386/isa/spkr.c revision 1.38. 1999-08-18 08:24:35 +00:00
pccard (1) Fix a spelling mistake in a comment. 1999-08-17 22:13:06 +00:00
pci Implement a new generic mechanism for attaching handler functions to 1999-08-21 06:24:40 +00:00
posix4 Well folks, this is it - The second stage of the removal for build support 1999-04-17 08:36:07 +00:00
powerpc Fix a nasty kld bug where modules with objects of type GLOB_DAT which had 1999-08-20 14:21:35 +00:00
rpc
svr4 Avoid possible panic by checking for EFAULT from copyinstr() during 1999-08-14 10:52:33 +00:00
sys Implement a new generic mechanism for attaching handler functions to 1999-08-21 06:24:40 +00:00
tools This commit adds support for the NetBSD MII abstraction layer and 1999-08-21 17:40:53 +00:00
ufs Add the (inline) function vm_page_undirty for clearing the dirty bitmask 1999-08-17 04:02:34 +00:00
vm vm_page_alloc and contigmalloc1: 1999-08-20 06:32:00 +00:00
Makefile Use MACHINE_ARCH instead of MACHINE to check x86 architecture. 1999-06-03 10:38:07 +00:00