diff options
author | wpaul <wpaul@FreeBSD.org> | 1999-08-21 17:40:53 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1999-08-21 17:40:53 +0000 |
commit | cdea47dc6eedf22eb73e5b4675affbc31669814e (patch) | |
tree | 52556fc37b962523cea5a60841a8698aa96054e7 /sys/i386/conf | |
parent | 2cf7e92c711cd5cfa74fa596ee64157497f96bf3 (diff) | |
download | FreeBSD-src-cdea47dc6eedf22eb73e5b4675affbc31669814e.zip FreeBSD-src-cdea47dc6eedf22eb73e5b4675affbc31669814e.tar.gz |
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.
Diffstat (limited to 'sys/i386/conf')
-rw-r--r-- | sys/i386/conf/LINT | 12 | ||||
-rw-r--r-- | sys/i386/conf/NOTES | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT index d9235f6..5acf2c6 100644 --- a/sys/i386/conf/LINT +++ b/sys/i386/conf/LINT @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.627 1999/08/15 09:54:56 phk Exp $ +# $Id: LINT,v 1.628 1999/08/20 03:48:02 ken Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -1518,6 +1518,16 @@ options AHC_ALLOW_MEMIO options EISA_SLOTS=12 # +# MII bus support is required for some PCI 10/100 ethernet NICs, +# namely those which use MII-compliant transceivers or implement +# tranceiver control interfaces that operate like an MII. Adding +# "controller miibus0" to the kernel config pulls in support for +# the generic miibus API and all of the PHY drivers, including a +# generic one for PHYs that aren't specifically handled by an +# individual driver. +controller miibus0 + +# # PCI devices & PCI options: # # The main PCI bus device is `pci'. It provides auto-detection and diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index d9235f6..5acf2c6 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.627 1999/08/15 09:54:56 phk Exp $ +# $Id: LINT,v 1.628 1999/08/20 03:48:02 ken Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -1518,6 +1518,16 @@ options AHC_ALLOW_MEMIO options EISA_SLOTS=12 # +# MII bus support is required for some PCI 10/100 ethernet NICs, +# namely those which use MII-compliant transceivers or implement +# tranceiver control interfaces that operate like an MII. Adding +# "controller miibus0" to the kernel config pulls in support for +# the generic miibus API and all of the PHY drivers, including a +# generic one for PHYs that aren't specifically handled by an +# individual driver. +controller miibus0 + +# # PCI devices & PCI options: # # The main PCI bus device is `pci'. It provides auto-detection and |