Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Reload the full device descriptor after re-estab...
details: https://anonhg.NetBSD.org/src/rev/3798bf9b5bcf
branches: trunk
changeset: 789774:3798bf9b5bcf
user: skrll <skrll%NetBSD.org@localhost>
date: Sat Sep 07 16:39:15 2013 +0000
description:
Reload the full device descriptor after re-establishing the default pipe
with the new address.
Some HCDs, e.g. dwc2, need wMaxPacketSize to be the value returned from
the device to complete transfers after the set address. Opening the pipe
again gives the HCD access to the correct value.
diffstat:
sys/dev/usb/usb_subr.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diffs (48 lines):
diff -r 0c1cebb24938 -r 3798bf9b5bcf sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c Sat Sep 07 16:17:12 2013 +0000
+++ b/sys/dev/usb/usb_subr.c Sat Sep 07 16:39:15 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_subr.c,v 1.191 2013/08/21 17:59:40 jakllsch Exp $ */
+/* $NetBSD: usb_subr.c,v 1.192 2013/09/07 16:39:15 skrll 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.191 2013/08/21 17:59:40 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.192 2013/09/07 16:39:15 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -1253,14 +1253,6 @@
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_flags(dev, 0, &dev->def_ep, USBD_DEFAULT_INTERVAL,
@@ -1271,6 +1263,14 @@
return err;
}
+ 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);
+ }
+
/* Assume 100mA bus powered for now. Changed when configured. */
dev->power = USB_MIN_POWER;
dev->self_powered = 0;
Home |
Main Index |
Thread Index |
Old Index