From owner-freebsd-stable@FreeBSD.ORG Sat Oct 7 05:44:08 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8099F16A417 for ; Sat, 7 Oct 2006 05:44:08 +0000 (UTC) (envelope-from karl@FS.denninger.net) Received: from FS.denninger.net (wsip-70-169-168-7.pn.at.cox.net [70.169.168.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BE7843D6A for ; Sat, 7 Oct 2006 05:43:55 +0000 (GMT) (envelope-from karl@FS.denninger.net) Received: from fs.denninger.net (localhost [127.0.0.1]) by FS.denninger.net (8.13.6/8.13.1) with SMTP id k975hsPK086921 for ; Sat, 7 Oct 2006 00:43:54 -0500 (CDT) (envelope-from karl@FS.denninger.net) Received: from fs.denninger.net [127.0.0.1] by Spamblock-sys (LOCAL); Sat Oct 7 00:43:54 2006 Received: (from karl@localhost) by FS.denninger.net (8.13.6/8.13.1/Submit) id k975hsUZ086918 for freebsd-stable@freebsd.org; Sat, 7 Oct 2006 00:43:54 -0500 (CDT) (envelope-from karl) Date: Sat, 7 Oct 2006 00:43:54 -0500 From: Karl Denninger To: freebsd-stable@freebsd.org Message-ID: <20061007054354.GA86698@FS.denninger.net> Mail-Followup-To: freebsd-stable@freebsd.org 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7.0.1.0.0.20061006142338.15f92680@sentex.net> User-Agent: Mutt/1.4.2.1i Organization: Karl's Sushi and Packet Smashers X-Die-Spammers: Spammers cheerfully broiled for supper and served with ketchup! Subject: Re: Recommendations for a serial port card you can actually BUY? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2006 05:44:08 -0000 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