diff options
author | wpaul <wpaul@FreeBSD.org> | 1999-12-28 02:01:18 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1999-12-28 02:01:18 +0000 |
commit | b39a79861ddfb250e941d89c255bcb8cda9481dc (patch) | |
tree | aef1cc68bd5dbcc4e16d18beae0a106b6535f3da /sys/modules | |
parent | 293c4f50f0f5561061a3452727209e02d889e8f9 (diff) | |
download | FreeBSD-src-b39a79861ddfb250e941d89c255bcb8cda9481dc.zip FreeBSD-src-b39a79861ddfb250e941d89c255bcb8cda9481dc.tar.gz |
This commit adds device driver support for the ADMtek AN986 Pegasus
USB ethernet chip. Adapters that use this chip include the LinkSys
USB100TX. There are a few others, but I'm not certain of their
availability in the U.S. I used an ADMtek eval board for development.
Note that while the ADMtek chip is a 100Mbps device, you can't really
get 100Mbps speeds over USB. Regardless, this driver uses miibus to
allow speed and duplex mode selection as well as autonegotiation.
Building and kldloading the driver as a module is also supported.
Note that in order to make this driver work, I had to make what some
may consider an ugly hack to sys/dev/usb/usbdi.c. The usbd_transfer()
function will use tsleep() for synchronous transfers that don't complete
right away. This is a problem since there are times when we need to
do sync transfers from an interrupt context (i.e. when reading registers
from the MAC via the control endpoint), where tsleep() us a no-no.
My hack allows the driver to have the code poll for transfer completion
subject to the xfer->timeout timeout rather that calling tsleep().
This hack is controlled by a quirk entry and is only enabled for the
ADMtek device.
Now, I'm sure there are a few of you out there ready to jump on me
and suggest some other approach that doesn't involve a busy wait. The
only solution that might work is to handle the interrupts in a kernel
thread, where you may have something resembling a process context that
makes it okay to tsleep(). This is lovely, except we don't have any
mechanism like that now, and I'm not about to implement such a thing
myself since it's beyond the scope of driver development. (Translation:
I'll be damned if I know how to do it.) If FreeBSD ever aquires such
a mechanism, I'll be glad to revisit the driver to take advantage of
it. In the meantime, I settled for what I perceived to be the solution
that involved the least amount of code changes. In general, the hit
is pretty light.
Also note that my only USB test box has a UHCI controller: I haven't
I don't have a machine with an OHCI controller available.
Highlights:
- Updated usb_quirks.* to add UQ_NO_TSLEEP quirk for ADMtek part.
- Updated usbdevs and regenerated generated files
- Updated HARDWARE.TXT and RELNOTES.TXT files
- Updated sysinstall/device.c and userconfig.c
- Updated kernel configs -- device aue0 is commented out by default
- Updated /sys/conf/files
- Added new kld module directory
Diffstat (limited to 'sys/modules')
-rw-r--r-- | sys/modules/Makefile | 4 | ||||
-rw-r--r-- | sys/modules/aue/Makefile | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 8593fab..357f098 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -2,8 +2,8 @@ # XXX present but broken: ip_mroute_mod pcic -SUBDIR= aha amr ccd cd9660 coda dc fdesc fxp if_disc if_ef if_ppp if_sl \ - if_tun ipfilter ipfw joy kernfs md mfs mii mlx msdos \ +SUBDIR= aha amr aue ccd cd9660 coda dc fdesc fxp if_disc if_ef if_ppp \ + if_sl if_tun ipfilter ipfw joy kernfs md mfs mii mlx msdos \ ncp netgraph nfs ntfs nullfs \ nwfs portal procfs rl sf sis sk ste ti tl \ ugen uhid ukbd ulpt umapfs umass umodem ums union usb vn vr wb xl diff --git a/sys/modules/aue/Makefile b/sys/modules/aue/Makefile new file mode 100644 index 0000000..f478794 --- /dev/null +++ b/sys/modules/aue/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +S = ${.CURDIR}/../.. +.PATH: $S/dev/usb +KMOD = if_aue +SRCS = if_aue.c opt_bdg.h opt_usb.h device_if.h bus_if.h +SRCS += miibus_if.h +CFLAGS += ${DEBUG_FLAGS} +KMODDEPS = miibus + +.include <bsd.kmod.mk> |