Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Oct 2006 12:53:13 -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:  <20061006175313.GA58888@FS.denninger.net>
In-Reply-To: <20061006135019.L76485@server.arg.sj.co.uk>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 06, 2006 at 02:25:31PM +0100, Andrew Gordon wrote:
> 
> On Thu, 5 Oct 2006, Karl Denninger wrote:
> > On Thu, Oct 05, 2006 at 05:04:41PM -0400, Bob Johnson wrote:
> > > I have used USB-to-serial converters with no problem. All the control
> > > signals (at least the ones my applications need) seem to work
> > > correctly. I don't remember any brands or models off hand, I bought
> > > what was cheap as I needed them and they all worked. "Cheap" means
> > > under $20 delivered (for one port).
> >
> > Interesting.
> >
> > Now, what happens when you reboot?  Do they come back in random order?
> > That won't work!  I need to know that port 2 will BE Port 2 the next time
> > the machine comes up....
> 
> Competent USB devices have serial numbers in them, although the current
> FreeBSD USB system doesn't provide easy access to the data (the
> kernel collects it as part of the device discovery, but AFAIR doesn't do
> anything with it).  I solved my problems in a different way (below).

I think there may be another option.

Here's the boot message, with just USB related things:

usb0: <Intel 82801EB (ICH5) USB controller USB-A> on uhci0
usb0: USB revision 1.0
usb1: <Intel 82801EB (ICH5) USB controller USB-B> on uhci1
usb1: USB revision 1.0
usb2: <Intel 82801EB (ICH5) USB controller USB-C> on uhci2
usb2: USB revision 1.0
usb3: <Intel 82801EB (ICH5) USB controller USB-D> on uhci3
usb3: USB revision 1.0
usb4: EHCI version 1.0
usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3
usb4: <Intel 82801EB/R (ICH5) USB 2.0 controller> on ehci0
usb4: USB revision 2.0

Now, isn't this in fact invarient?  That is, isn't the probe on the bus
going to be the same across boots?  

We can then get which device is on which port with....

Fs:/disk/karl> usbdevs  -v
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x0000), rev 1.00
 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
 port 2 powered
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x0000), rev 1.00
 port 1 addr 2: full speed, power 100 mA, config 1, USB-Serial
Controller(0x2008), Prolific Technology Inc.(0x0557), rev 3.00
 port 2 powered
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x0000), rev 1.00
 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
 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
 port 1 powered
 port 2 powered
 port 3 powered
 port 4 powered
 port 5 powered
 port 6 powered
 port 7 powered
 port 8 powered

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:

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.

I think I can get this from the usb(8) driver - going to code something up
to see if it works....

--
-- 
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?20061006175313.GA58888>