Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-28-2008, 04:37 AM
Leith Brandeland
 
Posts: n/a
Default Re: Trying to get usbnet working to gumstix

On Thu, Mar 13, 2008 at 2:03 PM, Leith Brandeland <leith@brandeland.com>
wrote:

> 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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:56 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165