On Thu, Mar 13, 2008 at 2:03 PM, Leith Brandeland <leith@brandeland.com>
wrote:
quoted text > On Thu, Mar 13, 2008 at 1:13 PM, Leith Brandeland <leith@brandeland.com>
> wrote:
>
> >
> >
> > On Thu, Mar 13, 2008 at 9:11 AM, Stuart Henderson <stu@spacehopper.org>
> > wrote:
> >
> > > On 2008/03/13 08:52, Leith Brandeland wrote:
> > > > Mar 12 17:19:28 fw /bsd: cdce0 at uhub0 port 1 configuration 2
> > > interface 0
> > > > Mar 12 17:19:28 fw /bsd:
> > > > Mar 12 17:19:28 fw /bsd: cdce0: Linux 2.6.18gum/pxa2xx_udc
> > > RNDIS/Ethernet
> > > > Gadget, rev 2.00/2.03, addr 2
> > > > Mar 12 17:19:33 fw /bsd: cdce0: interface alternate setting 0 failed
> > > >
> > > > Many USB devices notoriously fail to report their class and
> > > interfaces
> > > > correctly. Undetected products might work flawlessly when
> > > their vendor
> > > > and product IDs are added to the driver manually.
> > > >
> > > > So, my questions are: How can I determine what the vendor and
> > > product ID
> > > > is? Once I find it, where in the OpenBSD code do I change it?
> > >
> > > It's a different problem, those vendor/product IDs are already in
> > > cdce(4) otherwise it wouldn't attach at all.
> > >
> > > USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_ETHERNETGADGET
> > >
> > >
> >
> > Fair enough. How do I address the "cdce0: interface alternate setting 0
> > failed" then?. I'm not sure on the next step. Is it still within cdce?
> >
>
>
> Stuart replied to me off list (Thanks!) and suggested I install the
> usbutils. I did and here is some selected output:
>
> $ usbdevs -v
> Controller /dev/usb0:
> addr 1: full speed, self powered, config 1, OHCI root hub(0x0000),
> Compaq(0x0e11), rev 1.00
> port 1 addr 2: full speed, self powered, config 2, RNDIS/Ethernet
> Gadget(0xa4a2), Linux 2.6.18gum/pxa2xx_udc(0x0525), rev 2.03
> port 2 powered
> port 3 powered
>
>
>
> $ usbctl -n -f /dev/usb0
> DEVICE addr 1
> DEVICE descriptor:
> bLength=18 bDescriptorType=device(1) bcdUSB=1.00 bDeviceClass=9
> bDeviceSubClass=0
> bDeviceProtocol=0 bMaxPacketSize=64 idVendor=0x0e11 idProduct=0x0000
> bcdDevice=100
> iManufacturer=1(Compaq) iProduct=2(OHCI root hub) iSerialNumber=0()
> bNumConfigurations=1
>
> CONFIGURATION descriptor 0:
> bLength=9 bDescriptorType=config(2) wTotalLength=25 bNumInterface=1
> bConfigurationValue=1 iConfiguration=0() bmAttributes=40 bMaxPower=0 mA
>
> INTERFACE descriptor 0:
> bLength=9 bDescriptorType=interface(4) bInterfaceNumber=0
> bAlternateSetting=0
> bNumEndpoints=1 bInterfaceClass=9 bInterfaceSubClass=0
> bInterfaceProtocol=0 iInterface=0()
>
> ENDPOINT descriptor:
> bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=1-in
> bmAttributes=interrupt wMaxPacketSize=8 bInterval=255
>
> current configuration 1
>
> HUB descriptor:
> bDescLength=11 bDescriptorType=41 bNbrPorts=3 wHubCharacteristics=01
> bPwrOn2PwrGood=1 bHubContrCurrent=0 DeviceRemovable=0
>
> Hub status 0000 0000
>
> Port 1 status=0103 change=0000
>
> Port 2 status=0100 change=0000
>
> Port 3 status=0100 change=0000
>
> ----------
> DEVICE addr 2
> DEVICE descriptor:
> bLength=18 bDescriptorType=device(1) bcdUSB=2.00 bDeviceClass=2
> bDeviceSubClass=0
> bDeviceProtocol=0 bMaxPacketSize=16 idVendor=0x0525 idProduct=0xa4a2
> bcdDevice=203
> iManufacturer=1(Linux 2.6.18gum/pxa2xx_udc) iProduct=2(RNDIS/Ethernet
> Gadget) iSerialNumber=0() bNumConfigurations=2
>
> CONFIGURATION descriptor 0:
> bLength=9 bDescriptorType=config(2) wTotalLength=67 bNumInterface=2
> bConfigurationValue=2 iConfiguration=9(RNDIS) bmAttributes=c0
> bMaxPower=100 mA
>
> INTERFACE descriptor 0:
> bLength=9 bDescriptorType=interface(4) bInterfaceNumber=0
> bAlternateSetting=0
> bNumEndpoints=1 bInterfaceClass=2 bInterfaceSubClass=2
> bInterfaceProtocol=255 iInterface=6(RNDIS Communications Control)
>
> CDC INTERFACE descriptor:
> bLength=5 bDescriptorType=cs_interface(36) bDescriptorSubtype=header
> bcdCDC=1.10
>
> CDC INTERFACE descriptor:
> bLength=5 bDescriptorType=cs_interface(36)
> bDescriptorSubtype=Call_Management
> bmCapabilities=0x0 bDataInterface=1
>
> CDC INTERFACE descriptor:
> bLength=4 bDescriptorType=cs_interface(36)
> bDescriptorSubtype=Abstract_Control_Model
> bmCapabilities=0x0
>
> CDC INTERFACE descriptor:
> bLength=5 bDescriptorType=cs_interface(36) bDescriptorSubtype=union
> bMasterInterface=0 bSlaveInterface0=1
>
> ENDPOINT descriptor:
> bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=6-in
> bmAttributes=interrupt wMaxPacketSize=16 bInterval=32
>
> INTERFACE descriptor 1:
> bLength=9 bDescriptorType=interface(4) bInterfaceNumber=1
> bAlternateSetting=0
> bNumEndpoints=2 bInterfaceClass=10 bInterfaceSubClass=0
> bInterfaceProtocol=0 iInterface=4(Ethernet Data)
>
> ENDPOINT descriptor:
> bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=1-in
> bmAttributes=bulk wMaxPacketSize=64 bInterval=0
>
> ENDPOINT descriptor:
> bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=2-out
> bmAttributes=bulk wMaxPacketSize=64 bInterval=0
>
> CONFIGURATION descriptor 1:
> bLength=9 bDescriptorType=config(2) wTotalLength=32 bNumInterface=1
> bConfigurationValue=1 iConfiguration=8(CDC Ethernet Subset)
> bmAttributes=c0 bMaxPower=100 mA
>
> INTERFACE descriptor 0:
> bLength=9 bDescriptorType=interface(4) bInterfaceNumber=0
> bAlternateSetting=0
> bNumEndpoints=2 bInterfaceClass=255 bInterfaceSubClass=0
> bInterfaceProtocol=0 iInterface=4(Ethernet Data)
>
> ENDPOINT descriptor:
> bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=1-in
> bmAttributes=bulk wMaxPacketSize=64 bInterval=0
>
> ENDPOINT descriptor:
> bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=2-out
> bmAttributes=bulk wMaxPacketSize=64 bInterval=0
>
> current configuration 2
>
> ----------
>
>
>
I'm still digging into this, but not making a whole lot of headway. I'm
hoping there are still some folks out there with some insight into this
little problem that can help.
So, again, the /var/log/messages error that I'm seeing is:
Mar 26 16:27:37 fw /bsd: cdce0: interface alternate setting 0 failed
looking into the code (sys/dev/usb/if_cdce.c), I think that this is where
the error is coming from:
for (j = 0; j < numalts; j++) {
if (usbd_set_interface(sc->cdce_data_iface, j)) {
printf("%s: interface alternate setting %d failed\n",
sc->cdce_dev.dv_xname, j);
return;
}
So, looking at the usbd_set_interface function (in usbdi.c)
usbd_set_interface(usbd_interface_handle iface, int altidx)
{
usb_device_request_t req;
usbd_status err;
void *endpoints;
if (LIST_FIRST(&iface->pipes) != 0)
return (USBD_IN_USE);
endpoints = iface->endpoints;
err = usbd_fill_iface_data(iface->device, iface->index, altidx);
if (err)
return (err);
....<snip>....
I don't know if perhaps the error is farther down the code, but I forked my
investigation to look at the usbd_fill_iface_data in "usb_subr.c"
usbd_status
usbd_fill_iface_data(usbd_device_handle dev, int ifaceidx, int altidx)
{
usbd_interface_handle ifc = &dev->ifaces[ifaceidx];
usb_interface_descriptor_t *idesc;
char *p, *end;
int endpt, nendpt;
DPRINTFN(4,("usbd_fill_iface_data: ifaceidx=%d altidx=%d\n",
ifaceidx, altidx));
idesc = usbd_find_idesc(dev->cdesc, ifaceidx, altidx);
if (idesc == NULL)
return (USBD_INVAL);
First of all, can anyone say if I'm going down the right path? Where can I
find some more information on this?
Thanks.