Subject: install/33192: umodem0: Could not find data bulk in
To: None <install-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <ls.colby@gwirynybyd.com>
List: netbsd-bugs
Date: 04/04/2006 21:15:00
>Number:         33192
>Category:       install
>Synopsis:       umodem0: Could not find data bulk in
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 04 21:15:00 +0000 2006
>Originator:     L. S. Colby
>Release:        3.0
>Organization:
Gwirynybyd
>Environment:
NetBSD venice.gwirynybyd.com 3.0 NetBSD 3.0 (VENICE) #7: Sun Apr  2 11:15:59 PDT 2006  colby@venice.gwirynybyd.com:/usr/src/sys/arch/i386/compile/VENICE i386

The problem has persisted since GENERIC #0
>Description:
usb controller based acm/acf modem not supported and error message in umodem_common.c fails to display identification information:


usb boot messages:

uhci0 at pci0 dev 7 function 2: VIA Technologies VT83C572 USB Controller (rev. 0x16)
uhci0: interrupting at irq 5
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 7 function 3: VIA Technologies VT83C572 USB Controller (rev. 0x16)
uhci1: interrupting at irq 5
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered


....

umodem specific messages:

umodem0 at uhub0 port 1 configuration 1 interface 1
umodem0: Conexant Systems, Inc. USB ACF Modem, rev 1.10/1.00, addr 2, iclass 2/2

umodem0: data interface 1, has CM over data, has break


umodem0: Could not find data bulk in

ulpt0 at uhub0 port 2 configuration 1 interface 0
ulpt0: HewLett Packard HP LaserJet 3200, rev 1.10/1.00, addr 3, iclass 7/1
ulpt0: using bi-directional mode

....

fyi on 2.6 linux modem is correctly identified and supported. On Freebsd 6 the same error occurs - 

umodem0: could not find data bulk in

after which ucom attempts to attach and issues a 6 return code and exits.

>How-To-Repeat:
plug a best data controller based acm modem into a usb bus and boot.
>Fix:
Beats me, but, as Linux 2.6.12 recognizes and configures modem and driver properly as follows:

....

cdc_acm 1-1:1.1: ttyACM0: USB ACM device
usbcore: registered new driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters

....

Maybe Linux's cdc-acm has something new that is not in umodem_common; 

I took a quick look and noticed the following:

 /*workaround for switched interfaces */
         if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) {
                 if (control_interface->cur_altsetting->desc.bInterfaceClass == CDC_DATA_INTERFACE_TYPE) {
                         struct usb_interface *t;
                         dev_dbg(&intf->dev,"Your device has switched interfaces.\n");
 
                         t = control_interface;
                         control_interface = data_interface;
                         data_interface = t;
                 } else {
                         return -EINVAL;
                 }
         }


....

and

 /* workaround for switched endpoints */
         if ((epread->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN) {
                 /* descriptors are swapped */
                 struct usb_endpoint_descriptor *t;
                 dev_dbg(&intf->dev,"The data interface has switched endpoints\n");
                 
                 t = epread;
                 epread = epwrite;
                 epwrite = t;
         }


I know nothing about usb or device drivers for bsd or linux - and no knowledege is probably as dangerous as a little knowledge, but, after programming for 40 years - when I have my glasses on - its hard to resist a peek. 

Anyhow the switched interface and endpoints code in linux looked interesting.

And then again maybe not.

Thanks in advance for the fix.

Colby