Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Fix for PR#42572. I was running with this patch ...



details:   https://anonhg.NetBSD.org/src/rev/9c6ef1d2c663
branches:  trunk
changeset: 754260:9c6ef1d2c663
user:      matthias <matthias%NetBSD.org@localhost>
date:      Sun Apr 25 09:14:38 2010 +0000

description:
Fix for PR#42572. I was running with this patch for several month without
any problems.

diffstat:

 sys/dev/usb/usb_subr.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (48 lines):

diff -r e7fc12315150 -r 9c6ef1d2c663 sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c    Sun Apr 25 09:12:38 2010 +0000
+++ b/sys/dev/usb/usb_subr.c    Sun Apr 25 09:14:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_subr.c,v 1.167 2009/11/12 20:11:35 dyoung Exp $    */
+/*     $NetBSD: usb_subr.c,v 1.168 2010/04/25 09:14:38 matthias Exp $  */
 /*     $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $   */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.167 2009/11/12 20:11:35 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.168 2010/04/25 09:14:38 matthias Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_usbverbose.h"
@@ -1158,14 +1158,6 @@
 
        USETW(dev->def_ep_desc.wMaxPacketSize, dd->bMaxPacketSize);
 
-       err = usbd_reload_device_desc(dev);
-       if (err) {
-               DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc "
-                             "failed\n", addr));
-               usbd_remove_device(dev, up);
-               return (err);
-       }
-
        /* Set the address */
        DPRINTFN(5, ("usbd_new_device: setting device address=%d\n", addr));
        err = usbd_set_address(dev, addr);
@@ -1181,6 +1173,14 @@
        dev->address = addr;    /* new device address now */
        bus->devices[addr] = dev;
 
+       err = usbd_reload_device_desc(dev);
+       if (err) {
+               DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc "
+                             "failed\n", addr));
+               usbd_remove_device(dev, up);
+               return (err);
+       }
+
        /* Re-establish the default pipe with the new address. */
        usbd_kill_pipe(dev->default_pipe);
        err = usbd_setup_pipe(dev, 0, &dev->def_ep, USBD_DEFAULT_INTERVAL,



Home | Main Index | Thread Index | Old Index