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 <t...@tlb.org> 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"
> >
> > <snip>
> >
> > 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: <OHCI root HUB AMD> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen0.1.0: uhub0: <AMD OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1>
ugen1.1: <EHCI root HUB AMD> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen1.1.0: uhub1: <AMD EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1>
ugen1.2: <USB Modem U.S.Robotics> at usbus1, cfg=0 md=HOST spd=HIGH
(480Mbps) pwr=ON
ugen1.2.0: umodem0: <AltIf0>
ugen0.2: <Back-UPS ES 650 FW:825.B1.D USB FW:B1 APC> at usbus0, cfg=0
md=HOST spd=LOW (1.5Mbps) pwr=ON
ugen1.3: <ZTE CDMA Technologies MSM ZTE, Incorporated> at usbus1,
cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen1.3.0: u3g0: <ZTE, Incorporated ZTE CDMA Technologies MSM, class
0/0, rev 2.00/0.00, addr 3>
ugen1.3.2: umass0: <ZTE, Incorporated ZTE CDMA Technologies MSM,
class 0/0, rev 2.00/0.00, addr 3>
# 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: <USB Modem U.S.Robotics> 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 <no string>
bmAttributes = 0x0080
bMaxPower = 0x00b4
Interface 0
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0000
bAlternateSetting = 0x0000
bNumEndpoints = 0x0001
bInterfaceClass = 0x0002
bInterfaceSubClass = 0x0002
bInterfaceProtocol = 0x0001
iInterface = 0x0005 <AltIf0>
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-unsubscr...@freebsd.org"
--------------------------------------------------------------------
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, m...@sentex.net
Providing Internet since 1994 www.sentex.net
Cambridge, Ontario Canada www.sentex.net/mike
_______________________________________________
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"