Re: USB keyboard/mouse combo fails to attach

From: Jason Harmening <jason.harmening_at_gmail.com>
Date: Sun, 21 Jun 2009 15:26:09 -0500
On Sun, 21 Jun 2009 03:00:12 +0200
Hans Petter Selasky <hselasky_at_c2i.net> wrote:


> 
> In /sys/dev/usb/usb_device.c :
> 
> There is some code to re-enumerate the device, when errors are
> detected. Maybe we should add an automatic re-enumeration in case the
> full device descriptor cannot be retrieved aswell.
> 
> Search for:
>        err = usbd_req_get_desc(udev, NULL, NULL, &udev->ddesc,
>             USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0);
>         if (err) {
>                 DPRINTFN(0, "getting device descriptor "
>                     "at addr %d failed, %s!\n", udev->address,
>                     usbd_errstr(err));
>                 /* XXX try to re-enumerate the device */
>                 err = usbd_req_re_enumerate(udev, NULL);
>                 if (err) {
>                         goto done;
>                 }
>         }
> 
> Some lines down you patch the code like this:
> 
>         /* get the full device descriptor */
>         err = usbd_req_get_device_desc(udev, NULL, &udev->ddesc);
>         if (err) {
>                 DPRINTF("addr=%d, getting full desc failed\n",
>                     udev->address);
> +                /* XXX try to re-enumerate the device */
> +                err = usbd_req_re_enumerate(udev, NULL);
> +                if (err) {
> +                        goto done;
> +                }
> -                goto done;
>         }
> 
> --HPS

That seems to work--thanks!

So is this just flaky firmware then?  I had such high hopes for the
device, as it's advertised as needing no special drivers (in Windows of
course), but I guess the firmware probably still "expects" the
Windows HID layer on the other end...*sigh*

Also, thanks for your tremendous work on the new USB stack!  I should
mention that while this device always *enumerated* under 7, it never
completely *worked*--only the keyboard part seemed to work w/ the old
HID layer.  Also, it's really nice to be giant-free on a 4-CPU machine.

--Jason
Received on Sun Jun 21 2009 - 18:28:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:50 UTC