On 23/05/16(Mon) 16:18, Gerhard Roth wrote:
> > > The mbim interface is a point-to-point type interface and will
> > > update the default route, once it is registered in the network.
> > 
> > Can't you insert the route later instead of updating it?
> 
> Have to try. I fact this part of the code is more or less copied from
> sppp_update_gw() in if_spppsubr.c

Yes please.  sppp_* way of doing things should die.

> > > [...] uhub.c may be needed: some modules appear at the usb bus just
> > > to detach themselves again and then reappear shortly after.
> > 
> > Do you know why?  On which controller?
> 
> Oh, I don't think this is a problem of the controller. It's the device
> itself that just detaches and re-attaches again. Guess the firmware has
> a bug. Here's an example:
> 
> usbd_fill_iface_data: bad max packet size
> usbd_fill_iface_data: bad max packet size
> ugen2 at uhub4 port 2 "Sierra Wireless, Incorporated EM8805" rev 2.00/0.00 
> addr 3
> ugen2: setting configuration index 0 failed
> ugen2 detached

This looks like a timing issue before reloading the descriptor.

You could try to increase the timeout in usbd_new_device().

Alternatively, does the diff below help?  It might be incomplete, but
the code fetching the device descriptor in our stack is for sure outdated.

Index: usb_subr.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/usb_subr.c,v
retrieving revision 1.123
diff -u -p -r1.123 usb_subr.c
--- usb_subr.c  23 May 2016 11:31:12 -0000      1.123
+++ usb_subr.c  23 May 2016 14:40:29 -0000
@@ -1048,7 +1048,12 @@ usbd_new_device(struct device *parent, s
        dev->def_ep_desc.bDescriptorType = UDESC_ENDPOINT;
        dev->def_ep_desc.bEndpointAddress = USB_CONTROL_ENDPOINT;
        dev->def_ep_desc.bmAttributes = UE_CONTROL;
-       USETW(dev->def_ep_desc.wMaxPacketSize, USB_MAX_IPACKET);
+
+       if (speed == USB_SPEED_LOW)
+               USETW(dev->def_ep_desc.wMaxPacketSize, USB_MAX_IPACKET);
+       else
+               USETW(dev->def_ep_desc.wMaxPacketSize, 64);
+
        dev->def_ep_desc.bInterval = 0;
 
        dev->quirks = &usbd_no_quirk;

Reply via email to