MCT USB<->RS232 driver
Bill Paul
wpaul at FreeBSD.ORG
Sun Jul 6 21:36:55 PDT 2003
While wandering around CompUSA today, I came upon what I consider to be an
incredibly useful little device: the Targus USB mobile port replicator with
ethernet. This device is basically a multi-port USB hub with a bunch of
peripherals attached, including:
- PS/2 keyboard port
- PS/2 mouse port
- parallel printer port
- RS-232 serial port
- 10/100 ethernet port
- Two USB 1.1 ports for any other USB devices you care to use
For someone like me, who owns a 'legacy free' laptop that has no parallel
or serial ports, or external keyboard/mouse ports, this struck me as a
pretty clever idea.
When I got it home, I found that almost everything is supported in
FreeBSD 5.x, except for one thing: the serial port. The chip is a
MCT USB-232 device, which is supported in NetBSD, but not FreeBSD.
Not to be denied, I grabbed the umct(4) driver from NetBSD and got
it working well enough that I can run userland PPP over it with my
US Robotics external 56K modem. (If fact, I'm composing this e-mail over
it right now.) It's not perfect. One major problem is that unlike all the
other USB serial devices, this one provides incoming data via the
interrupt endpoint instead of the bulk IN endpoint. Somehow in NetBSD,
both the ucom(4) support module and the driver itself are able to
read from the interrupt endpoint, but this trick doesn't work in
FreeBSD. Consequently, I had to kludge things up to stuff data into the
terminal device from the umct(4) driver's interrupt pipe handler. This is
messy, but it works.
It anyone else wants to use this driver, you can download it from:
http://www.freebsd.org/~wpaul/MCT/mct.tar.gz
To use it, download the tarball, then do the following:
# cd /sys
# cat /path/to/mct.tar.gz | gzip -d | tar -xvf -
# cd modules/umct
# make; make install; make load
You need the ucom(4) module loaded as well.
I'm not going to commit this yet because there's one thing I haven't been able
to test, which is that I'm not sure how this device is supposed to signal
changes in the modem status register. It's supposed to signal changes via
the interrupt pipe, but I don't see how that can work if the interrupt pipe
is also being used for incoming data. There's no easy way for me to figure
it out either since I have no datasheet for this chip. In the meantime, I
consider this useful enough that I should make it available for others who
might have a USB<->RS232 adapter with the same chip.
Share and enjoy!
-Bill
--
=============================================================================
-Bill Paul (510) 749-2329 | Senior Engineer, Master of Unix-Fu
wpaul at windriver.com | Wind River Systems
=============================================================================
"If stupidity were a handicap, you'd have the best parking spot."
=============================================================================
More information about the freebsd-mobile
mailing list