From owner-freebsd-usb@FreeBSD.ORG Tue May 4 20:27:44 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A55F31065706 for ; Tue, 4 May 2010 20:27:44 +0000 (UTC) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by mx1.freebsd.org (Postfix) with ESMTP id 762B68FC13 for ; Tue, 4 May 2010 20:27:44 +0000 (UTC) Received: from mdt-xp.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.14.3/8.14.3) with ESMTP id o44KRete011712; Tue, 4 May 2010 16:27:40 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <201005042027.o44KRete011712@lava.sentex.ca> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Tue, 04 May 2010 16:27:41 -0400 To: Hans Petter Selasky From: Mike Tancsa In-Reply-To: <200912140948.08171.hselasky@c2i.net> References: <43EC7D78-31E5-4B86-9316-002AE650727A@tlb.org> <20091214074204.GW64905@hoeg.nl> <200912140948.08171.hselasky@c2i.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Cc: freebsd-usb@freebsd.org Subject: Re: USB serial device naming X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 May 2010 20:27:44 -0000 At 04:48 AM 12/14/2009, Hans Petter Selasky wrote: >On Monday 14 December 2009 08:42:04 Ed Schouten wrote: > > Hello Trevor, > > > > * Trevor Blackwell wrote: > > > I can't seem to find a way to match USB serial ports & tty names. I > > > have two serial USB devices, which I can distinguish easily from > > > "usbconfig show_ifdrv" > > > > > > > > > > > > and they result in two ttys: > > > /dev/cuaU0 > > > /dev/cuaU1 > > > > Be sure to keep in mind: the `real' TTY devices are ttyU0 and ttyU1. The > > cua* devices are callout devices, which unlike the tty* devices don't > > wait for a carrier detect signal during open(). > > > > My opinion is that the USB serial driver shouldn't use a bitmask to keep > > track of which unit number are available, because we've got a nice KPI > > for that: > > > > http://www.freebsd.org/cgi/man.cgi?query=new_unrhdr > > > > Unfortunately I cannot answer your question. Hopefully Hans can. ;-) > >That's OK, but the real problem is that TTY is not a visible child of UPLCOM >for example. I would suggest adding a new IOCTL or maybe you have a better >idea, where we can pass the "device_get_nameunit()" string, and then TTY can >store it and pass it to userland. > >Also TTY should have a printout in dmesg, which unit is create if this string >is specified. I think I am running into a similar problem in this old thread. But in my case, I am trying to identify the umodem type device. I have a few firewalls in the field that have a USB dialup modem and various u3g type devices that are attached. With the u3g devices in particular, they can sometimes show up as /dev/cuaU#.# or just /dev/cuaU# where as the modem shows up as /dev/cuaU#. I have to fire up different copies of ppp based on the device and modem they attach to. The problem I have is there seems to be no way of knowing which physical device corresponds to which /dev/cuaU#.# file interface. eg What is the safest way to find out that /dev/cuaU1 is the ZTE stick in this case ? Another model of ZTE shows up as /dev/cuaU2.0 which nothing on /dev/cuaU1 oddly enough. # usbconfig show_ifdrv ugen0.1: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen0.1.0: uhub0: ugen1.1: at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen1.1.0: uhub1: ugen1.2: at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen1.2.0: umodem0: ugen0.2: at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON ugen1.3: at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen1.3.0: u3g0: ugen1.3.2: umass0: # ls -l /dev/cuaU* crw-rw---- 1 uucp dialer - 0, 78 May 4 16:10 /dev/cuaU0 crw-rw---- 1 uucp dialer - 0, 79 May 4 09:19 /dev/cuaU0.init crw-rw---- 1 uucp dialer - 0, 80 May 4 09:19 /dev/cuaU0.lock crw-rw---- 1 uucp dialer - 0, 104 May 4 16:10 /dev/cuaU1 crw-rw---- 1 uucp dialer - 0, 105 May 4 09:19 /dev/cuaU1.init crw-rw---- 1 uucp dialer - 0, 106 May 4 09:19 /dev/cuaU1.lock nothing in sysctl unfortunately dev.umodem.0.%desc: AltIf0 dev.umodem.0.%driver: umodem dev.umodem.0.%location: port=2 interface=0 dev.umodem.0.%pnpinfo: vendor=0x0baf product=0x0303 devclass=0x02 devsubclass=0x00 sernum="0000002" release=0x0200 intclass=0x02 intsubclass=0x02 dev.umodem.0.%parent: uhub1 dev.u3g.0.%desc: ZTE, Incorporated ZTE CDMA Technologies MSM, class 0/0, rev 2.00/0.00, addr 3 dev.u3g.0.%driver: u3g dev.u3g.0.%location: port=1 interface=0 dev.u3g.0.%pnpinfo: vendor=0x19d2 product=0x0031 devclass=0x00 devsubclass=0x00 sernum="1234567890ABCDEF" release=0x0000 intclass=0xff intsubclass=0xff it would be great if there were something like dev.u3g.0.%fileinterface=/dev/cuaU1 or perhaps somewhere in devinfo ? umodem0 pnpinfo vendor=0x0baf product=0x0303 devclass=0x02 devsubclass=0x00 sernum="0000002" release=0x0200 intclass=0x02 intsubclass=0x02 at port=2 interface=0 u3g0 pnpinfo vendor=0x19d2 product=0x0031 devclass=0x00 devsubclass=0x00 sernum="1234567890ABCDEF" release=0x0000 intclass=0xff intsubclass= at port=1 interface=0 ugen1.2: at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0043 bNumInterfaces = 0x0002 bConfigurationValue = 0x0002 iConfiguration = 0x0000 bmAttributes = 0x0080 bMaxPower = 0x00b4 Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0000 bAlternateSetting = 0x0000 bNumEndpoints = 0x0001 bInterfaceClass = 0x0002 bInterfaceSubClass = 0x0002 bInterfaceProtocol = 0x0001 iInterface = 0x0005 Additional Descriptor bLength = 0x05 bDescriptorType = 0x24 bDescriptorSubType = 0x00 RAW dump: 0x00 | 0x05, 0x24, 0x00, 0x01, 0x10 Additional Descriptor bLength = 0x05 bDescriptorType = 0x24 >--HPS > >_______________________________________________ >freebsd-usb@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-usb >To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" -------------------------------------------------------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet since 1994 www.sentex.net Cambridge, Ontario Canada www.sentex.net/mike