I sometimes need to use an USB (CDC- ACM) for connecting from a remote place
(mountains :-) but I've some issues w/ it.
[...]
umodem0 at uhub1 port 1 configuration 1 interface 0 "Conexant USB Modem" rev
1.10/1.00 addr
umodem0: no pointer to data interfacE
[...]
I've tried to understand what's going and I ended up w/ the following tweak.
I've tested it w/ other available phones too but
also if it works I'm pretty sure it's a bad tweak. some hint?
thanks
Index: umodem.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/umodem.c,v
retrieving revision 1.37
diff -u -p -u -b -r1.37 umodem.c
--- umodem.c 13 Oct 2009 19:33:19 -0000 1.37
+++ umodem.c 7 Jun 2010 08:08:40 -0000
@@ -212,12 +212,17 @@ umodem_attach(struct device *parent, str
sc->sc_udev = dev;
sc->sc_ctl_iface = uaa->iface;
+ sc->sc_ctl_iface_no = -1;
id = usbd_get_interface_descriptor(sc->sc_ctl_iface);
//printf("%s: iclass %d/%d\n", sc->sc_dev.dv_xname,
// id->bInterfaceClass, id->bInterfaceSubClass);
+ if (id->bNumEndpoints > 1)
sc->sc_ctl_iface_no = id->bInterfaceNumber;
+ printf(">bInterfaceNumber %d\n", id->bInterfaceNumber);
+ printf(">bNumEndpoints %d\n", id->bNumEndpoints);
+
/* Get the data interface no. and capabilities */
sc->sc_cm_cap = 0;
sc->sc_data_iface_no = 0;
@@ -227,10 +232,23 @@ umodem_attach(struct device *parent, str
while (desc) {
if (desc->bDescriptorType == UDESC_INTERFACE) {
idesc = (usb_interface_descriptor_t *)desc;
+ if (idesc->bNumEndpoints > 1) {
current_iface_no = idesc->bInterfaceNumber;
+ printf("*bInterfaceNumber %d\n",
idesc->bInterfaceNumber);
+ printf("*bNumEndpoints %d\n",
idesc->bNumEndpoints);
+ }
+ else
+ goto next_desc;
}
+
+ if (sc->sc_ctl_iface_no == -1 &&
+ desc->bDescriptorType == UDESC_CS_INTERFACE)
+ sc->sc_ctl_iface_no = current_iface_no;
+
if (current_iface_no == sc->sc_ctl_iface_no &&
desc->bDescriptorType == UDESC_CS_INTERFACE) {
+ printf("InterfaceNumber %d\n", current_iface_no);
+ printf("bNumEndpoints %d\n", idesc->bNumEndpoints );
switch(desc->bDescriptorSubtype) {
case UDESCSUB_CDC_CM:
cmd = (usb_cdc_cm_descriptor_t *)desc;
@@ -248,6 +266,8 @@ umodem_attach(struct device *parent, str
break;
}
}
+
+ next_desc:
desc = usb_desc_iter_next(&iter);
}
[...]
umodem0 at uhub1 port 1 configuration 1 interface 0 "Conexant USB Modem" rev
1.10/1.00 addr 2
umodem0: data interface 1, has CM over data, has break
umodem0: status change notification available
ucom0 at umodem0
[...]
---------
Controller /dev/usb1:
addr 2: full speed, power 100 mA, config 1, USB Modem(0x1321),
Conexant(0x0572), rev 1.00, iSerialNumber 24680246
umodem0
----------
DEVICE addr 2
DEVICE descriptor:
bLength=18 bDescriptorType=device(1) bcdUSB=1.10 bDeviceClass=2
bDeviceSubClass=0
bDeviceProtocol=0 bMaxPacketSize=64 idVendor=0x0572 idProduct=0x1321
bcdDevice=100
iManufacturer=1(Conexant) iProduct=2(USB Modem) iSerialNumber=3(24680246)
bNumConfigurations=2
CONFIGURATION descriptor 0:
bLength=9 bDescriptorType=config(2) wTotalLength=73 bNumInterface=2
bConfigurationValue=1 iConfiguration=0() bmAttributes=80 bMaxPower=100 mA
INTERFACE descriptor 0:
bLength=9 bDescriptorType=interface(4) bInterfaceNumber=0 bAlternateSetting=0
bNumEndpoints=1 bInterfaceClass=2 bInterfaceSubClass=2
bInterfaceProtocol=1 iInterface=0()
ENDPOINT descriptor:
bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=1-in
bmAttributes=interrupt wMaxPacketSize=64 bInterval=128
INTERFACE descriptor 1:
bLength=9 bDescriptorType=interface(4) bInterfaceNumber=1 bAlternateSetting=0
bNumEndpoints=2 bInterfaceClass=10 bInterfaceSubClass=0
bInterfaceProtocol=0 iInterface=0()
ENDPOINT descriptor:
bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=2-in
bmAttributes=bulk wMaxPacketSize=64 bInterval=1
ENDPOINT descriptor:
bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=2-out
bmAttributes=bulk wMaxPacketSize=64 bInterval=1
Unknown descriptor (class 10/0):
bLength=5 bDescriptorType=36 ...
Unknown descriptor (class 10/0):
bLength=5 bDescriptorType=36 ...
Unknown descriptor (class 10/0):
bLength=4 bDescriptorType=36 ...
Unknown descriptor (class 10/0):
bLength=5 bDescriptorType=36 ...
Unknown descriptor (class 10/0):
bLength=6 bDescriptorType=36 ...
CONFIGURATION descriptor 1:
bLength=9 bDescriptorType=config(2) wTotalLength=96 bNumInterface=3
bConfigurationValue=2 iConfiguration=0() bmAttributes=80 bMaxPower=100 mA
INTERFACE descriptor 0:
bLength=9 bDescriptorType=interface(4) bInterfaceNumber=0 bAlternateSetting=0
bNumEndpoints=1 bInterfaceClass=2 bInterfaceSubClass=2
bInterfaceProtocol=1 iInterface=0()
ENDPOINT descriptor:
bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=1-in
bmAttributes=interrupt wMaxPacketSize=64 bInterval=128
INTERFACE descriptor 1:
bLength=9 bDescriptorType=interface(4) bInterfaceNumber=1 bAlternateSetting=0
bNumEndpoints=2 bInterfaceClass=10 bInterfaceSubClass=0
bInterfaceProtocol=0 iInterface=0()
ENDPOINT descriptor:
bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=2-in
bmAttributes=bulk wMaxPacketSize=64 bInterval=10
ENDPOINT descriptor:
bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=2-out
bmAttributes=bulk wMaxPacketSize=64 bInterval=10
INTERFACE descriptor 2:
bLength=9 bDescriptorType=interface(4) bInterfaceNumber=2 bAlternateSetting=0
bNumEndpoints=2 bInterfaceClass=10 bInterfaceSubClass=0
bInterfaceProtocol=0 iInterface=0()
ENDPOINT descriptor:
bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=3-in
bmAttributes=bulk wMaxPacketSize=64 bInterval=1
ENDPOINT descriptor:
bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=3-out
bmAttributes=bulk wMaxPacketSize=64 bInterval=1
Unknown descriptor (class 10/0):
bLength=5 bDescriptorType=36 ...
Unknown descriptor (class 10/0):
bLength=5 bDescriptorType=36 ...
Unknown descriptor (class 10/0):
bLength=4 bDescriptorType=36 ...
Unknown descriptor (class 10/0):
bLength=5 bDescriptorType=36 ...
Unknown descriptor (class 10/0):
bLength=6 bDescriptorType=36 ...
current configuration 1
--
see ya,
giovanni