Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Oct 2006 00:43:54 -0500
From:      Karl Denninger <karl@denninger.net>
To:        freebsd-stable@freebsd.org
Subject:   Re: Recommendations for a serial port card you can actually BUY?
Message-ID:  <20061007054354.GA86698@FS.denninger.net>
In-Reply-To: <7.0.1.0.0.20061006142338.15f92680@sentex.net>
References:  <20061005151925.GA1156@FS.denninger.net> <20061005190822.GA15547@icarus.home.lan> <20061005202144.GA11105@FS.denninger.net> <54db43990610051404x1816135ft9740ec29eb5da23@mail.gmail.com> <20061006000909.GB2473@FS.denninger.net> <20061006135019.L76485@server.arg.sj.co.uk> <20061006175313.GA58888@FS.denninger.net> <7.0.1.0.0.20061006142338.15f92680@sentex.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061007054354.GA86698>