Recommendations for a serial port card you can actually BUY?
Karl Denninger
karl at denninger.net
Sat Oct 7 05:44:08 UTC 2006
On Fri, Oct 06, 2006 at 02:27:21PM -0400, Mike Tancsa wrote:
> At 01:53 PM 10/6/2006, Karl Denninger wrote:
>
> >Now, where the problem comes in is that THIS line doesn't reference an
> >attached port. That sucks, but might not be hard to fix:
> >
>
> If there is just one USB *serial* device, it will always be
> /dev/ttyU0. It doesnt matter if you have 1 or 3 other USB devices
> (ugen0, uhid0, uhid1)
>
> >ucom0: Prolific Technology Inc. USB-Serial Controller, rev 1.10/3.00, addr
> >2
> >
> >So.... is there any way to discover what port a UCOM device is attached to?
> >If so, bingo - you've got it.
>
> You dont need to... It will always be ttyU0 in the above case if you
> just have one *serial* usb device.
>
> ---Mike
Yes, I understand that. I might have anywhere up to eight though!
I think it still works, as I can get the full list with the hub attachments,
and THOSE should be invarient (that is, they correspond to a port on the
machine, assuming we're talking all on-bus ports (e.g. no expanders)
# usbdevs -v -d
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
uhub0
port 1 addr 2: low speed, self powered, config 1, Smart-UPS 1500 FW:601.3.D USB FW:1.5(0x0002), American Power Conversion(0x051d), rev 0.06
ugen0
port 2 powered
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
uhub1
port 1 addr 2: full speed, power 100 mA, config 1, USB-Serial Controller(0x2008), Prolific Technology Inc.(0x0557), rev 3.00
ucom0
port 2 powered
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
uhub2
port 1 powered
port 2 powered
Controller /dev/usb3:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
uhub3
port 1 powered
port 2 powered
Controller /dev/usb4:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), Intel(0x0000), rev 1.00
uhub4
port 1 powered
port 2 powered
port 3 powered
port 4 powered
port 5 powered
port 6 powered
port 7 powered
port 8 powered
Since /dev/usb0 - /dev/usbx should not move from boot to boot (that is,
being that they're either on the PCI bus directly or on the motherboard,
they should always probe in the same order) I can thus discover which COM
port was assigned to which physical port, since the /dev/usbx ports
are in fact physical sockets.
Given that I can create a directory full of symlinks with invarient names
(e.g. "/ldev/usbtty0") pointing to the correct ports via a shell script.
This doesn't work if you plug and unplug some of the devices while the
machine is running (since the script wouldn't know to run again) but it
should for the case where the devices are connected at the time of boot.
--
--
Karl Denninger (karl at denninger.net) Internet Consultant & Kids Rights Activist
http://www.denninger.net My home on the net - links to everything I do!
http://scubaforum.org Your UNCENSORED place to talk about DIVING!
http://genesis3.blogspot.com Musings Of A Sentient Mind
More information about the freebsd-stable
mailing list