summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb_subr.c
diff options
context:
space:
mode:
authorNick Hibma <n_hibma@FreeBSD.org>1999-01-22 00:51:12 +0000
committerNick Hibma <n_hibma@FreeBSD.org>1999-01-22 00:51:12 +0000
commit235dddd4eaacdb94823b8041ddd5ba5cdd006388 (patch)
treec01b467b5204c7b7ae92ddbb4d57fa8998ba8e3c /sys/dev/usb/usb_subr.c
parent5602b5091c31ba1a8aab08b8a7328a9055929517 (diff)
Notes
Diffstat (limited to 'sys/dev/usb/usb_subr.c')
-rw-r--r--sys/dev/usb/usb_subr.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index d903c0795164..b02be19bf439 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,5 +1,5 @@
/* $NetBSD: usb_subr.c,v 1.27 1999/01/08 11:58:25 augustss Exp $ */
-/* FreeBSD $Id: usb_subr.c,v 1.6 1999/01/07 23:31:40 n_hibma Exp $ */
+/* $FreeBSD$ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -725,7 +725,10 @@ usbd_probe_and_attach(parent, dev, port, addr)
{
struct usb_attach_arg uaa;
usb_device_descriptor_t *dd = &dev->ddesc;
- int r, found, i, confi, nifaces;
+#if defined(__NetBSD__)
+ int found = 0;
+#endif
+ int r, i, confi, nifaces;
usbd_interface_handle ifaces[256]; /* 256 is the absolute max */
#if defined(__FreeBSD__)
@@ -780,19 +783,25 @@ usbd_probe_and_attach(parent, dev, port, addr)
ifaces[i] = &dev->ifaces[i];
uaa.ifaces = ifaces;
uaa.nifaces = nifaces;
- for (found = i = 0; i < nifaces; i++) {
+ for (i = 0; i < nifaces; i++) {
if (!ifaces[i])
continue; /* interface already claimed */
uaa.iface = ifaces[i];
uaa.ifaceno = ifaces[i]->idesc->bInterfaceNumber;
if (USB_DO_ATTACH(dev, bdev, parent, &uaa, usbd_print,
usbd_submatch)) {
+#if defined(__NetBSD__)
found++;
ifaces[i] = 0; /* consumed */
+#elif defined(__FreeBSD__)
+ return (USBD_NORMAL_COMPLETION);
+#endif
}
}
+#if defined(__NetBSD__)
if (found != 0)
return (USBD_NORMAL_COMPLETION);
+#endif
}
/* No interfaces were attached in any of the configurations. */
if (dd->bNumConfigurations > 1)/* don't change if only 1 config */