summaryrefslogtreecommitdiffstats
path: root/sys/conf
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1999-08-21 17:40:53 +0000
committerwpaul <wpaul@FreeBSD.org>1999-08-21 17:40:53 +0000
commitcdea47dc6eedf22eb73e5b4675affbc31669814e (patch)
tree52556fc37b962523cea5a60841a8698aa96054e7 /sys/conf
parent2cf7e92c711cd5cfa74fa596ee64157497f96bf3 (diff)
downloadFreeBSD-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/conf')
-rw-r--r--sys/conf/NOTES12
-rw-r--r--sys/conf/files20
2 files changed, 31 insertions, 1 deletions
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index d9235f6..5acf2c6 100644
--- a/sys/conf/NOTES
+++ b/sys/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
diff --git a/sys/conf/files b/sys/conf/files
index 7bb2733..a00156d 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -121,6 +121,26 @@ dev/ida/ida.c optional ida
dev/ida/ida_disk.c optional id
dev/isp/isp_freebsd.c optional isp
dev/isp/isp.c optional isp
+dev/mii/mii.c optional miibus
+dev/mii/mii_physubr.c optional miibus
+dev/mii/ukphy.c optional miibus
+dev/mii/ukphy_subr.c optional miibus
+dev/mii/exphy.c optional miibus
+dev/mii/nsphy.c optional miibus
+miibus_if.o optional miibus \
+ dependency "miibus_if.c miibus_if.h" \
+ compile-with "${NORMAL_C}" \
+ no-implicit-rule local
+miibus_if.c optional miibus \
+ dependency "$S/kern/makedevops.pl $S/dev/mii/miibus_if.m" \
+ compile-with "perl5 $S/kern/makedevops.pl -c $S/dev/mii/miibus_if.m" \
+ no-obj no-implicit-rule before-depend local \
+ clean "miibus_if.c"
+miibus_if.h optional miibus \
+ dependency "$S/kern/makedevops.pl $S/dev/mii/miibus_if.m" \
+ compile-with "perl5 $S/kern/makedevops.pl -h $S/dev/mii/miibus_if.m" \
+ no-obj no-implicit-rule before-depend \
+ clean "miibus_if.h"
dev/pdq/pdq.c optional fea
dev/pdq/pdq_ifsubr.c optional fea
dev/pdq/pdq.c optional fpa
OpenPOWER on IntegriCloud