summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoraugustss <augustss@NetBSD.org>2004-01-05 13:32:23 +0000
committeraugustss <augustss@NetBSD.org>2004-01-05 13:32:23 +0000
commit7cdc2658bbdfb5ce3df58ccbef8752b2db786208 (patch)
tree1145d7e5526a059539cb5a5dc14ea86774c6e296 /sys/dev
parent4d6e985752a203f89138a9a0347dec0dd1616931 (diff)
Try harder to get initial descriptor. Do a port reset now and then
in the retry loop.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usb_subr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index fb705eb21e2..01fc5dbaa6e 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_subr.c,v 1.106 2003/09/23 21:44:42 mycroft Exp $ */
+/* $NetBSD: usb_subr.c,v 1.107 2004/01/05 13:32:23 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.106 2003/09/23 21:44:42 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.107 2004/01/05 13:32:23 augustss Exp $");
#include "opt_usbverbose.h"
@@ -980,6 +980,7 @@ usbd_new_device(device_ptr_t parent, usbd_bus_handle bus, int depth,
usbd_device_handle dev;
struct usbd_device *hub;
usb_device_descriptor_t *dd;
+ usb_port_status_t ps;
usbd_status err;
int addr;
int i;
@@ -1036,12 +1037,14 @@ usbd_new_device(device_ptr_t parent, usbd_bus_handle bus, int depth,
up->device = dev;
dd = &dev->ddesc;
/* Try a few times in case the device is slow (i.e. outside specs.) */
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < 10; i++) {
/* Get the first 8 bytes of the device descriptor. */
err = usbd_get_desc(dev, UDESC_DEVICE, 0, USB_MAX_IPACKET, dd);
if (!err)
break;
usbd_delay_ms(dev, 200);
+ if ((i & 3) == 3)
+ usbd_reset_port(up->parent, port, &ps);
}
if (err) {
DPRINTFN(-1, ("usbd_new_device: addr=%d, getting first desc "