diff options
Diffstat (limited to 'sys/dev/usb')
| -rw-r--r-- | sys/dev/usb/umct.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c index 7d09e70892d..c0e1c16547c 100644 --- a/sys/dev/usb/umct.c +++ b/sys/dev/usb/umct.c @@ -1,4 +1,4 @@ -/* $NetBSD: umct.c,v 1.13 2004/04/23 17:25:25 itojun Exp $ */ +/* $NetBSD: umct.c,v 1.14 2004/07/08 00:54:21 rumble Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: umct.c,v 1.13 2004/04/23 17:25:25 itojun Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umct.c,v 1.14 2004/07/08 00:54:21 rumble Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -180,7 +180,7 @@ USB_ATTACH(umct) char devinfo[1024]; char *devname = USBDEVNAME(sc->sc_dev); usbd_status err; - int i, found; + int i; struct ucom_attach_args uca; usbd_devinfo(dev, 0, devinfo, sizeof(devinfo)); @@ -230,7 +230,6 @@ USB_ATTACH(umct) id = usbd_get_interface_descriptor(sc->sc_iface); sc->sc_iface_number = id->bInterfaceNumber; - found = 0; for (i = 0; i < id->bNumEndpoints; i++) { ed = usbd_interface2endpoint_descriptor(sc->sc_iface, i); @@ -241,11 +240,15 @@ USB_ATTACH(umct) USB_ATTACH_ERROR_RETURN; } + /* + * The Bulkin endpoint is marked as an interrupt. Since + * we can't rely on the endpoint descriptor order, we'll + * check the wMaxPacketSize field to differentiate. + */ if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && UE_GET_XFERTYPE(ed->bmAttributes) == UE_INTERRUPT && - found == 0) { + UGETW(ed->wMaxPacketSize) != 0x2) { uca.bulkin = ed->bEndpointAddress; - found = 1; } else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT && UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) { uca.bulkout = ed->bEndpointAddress; |
