Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Make attach of ugen work as it should so product...
details: https://anonhg.NetBSD.org/src/rev/4edc627b8aba
branches: trunk
changeset: 484894:4edc627b8aba
user: augustss <augustss%NetBSD.org@localhost>
date: Fri Apr 14 14:13:56 2000 +0000
description:
Make attach of ugen work as it should so product&vendor locators can be used.
diffstat:
sys/dev/usb/usb_subr.c | 61 +++++++++++++++++++++++++++----------------------
1 files changed, 34 insertions(+), 27 deletions(-)
diffs (99 lines):
diff -r f912e3bd4322 -r 4edc627b8aba sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c Fri Apr 14 14:12:47 2000 +0000
+++ b/sys/dev/usb/usb_subr.c Fri Apr 14 14:13:56 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_subr.c,v 1.71 2000/03/29 18:24:53 augustss Exp $ */
+/* $NetBSD: usb_subr.c,v 1.72 2000/04/14 14:13:56 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@@ -768,8 +768,8 @@
#endif
uaa.device = dev;
- uaa.iface = 0;
- uaa.ifaces = 0;
+ uaa.iface = NULL;
+ uaa.ifaces = NULL;
uaa.nifaces = 0;
uaa.usegeneric = 0;
uaa.port = port;
@@ -872,13 +872,10 @@
DPRINTF(("usbd_probe_and_attach: no interface drivers found\n"));
/* Finally try the generic driver. */
- uaa.iface = 0;
+ uaa.iface = NULL;
uaa.usegeneric = 1;
uaa.configno = UHUB_UNK_CONFIGURATION;
uaa.ifaceno = UHUB_UNK_INTERFACE;
- uaa.vendor = UHUB_UNK_VENDOR;
- uaa.product = UHUB_UNK_PRODUCT;
- uaa.release = UHUB_UNK_RELEASE;
dv = USB_DO_ATTACH(dev, bdev, parent, &uaa, usbd_print, usbd_submatch);
if (dv != NULL) {
dev->subdevs = malloc(2 * sizeof dv, M_USB, M_NOWAIT);
@@ -923,8 +920,8 @@
int addr;
int i;
- DPRINTF(("usbd_new_device bus=%p depth=%d lowspeed=%d\n",
- bus, depth, lowspeed));
+ DPRINTF(("usbd_new_device bus=%p port=%d depth=%d lowspeed=%d\n",
+ bus, port, depth, lowspeed));
addr = usbd_getnewaddr(bus);
if (addr < 0) {
printf("%s: No free USB addresses, new device ignored.\n",
@@ -1135,24 +1132,34 @@
#endif
struct usb_attach_arg *uaa = aux;
- if ((uaa->port != 0 &&
- cf->uhubcf_port != UHUB_UNK_PORT &&
- cf->uhubcf_port != uaa->port) ||
- (uaa->configno != UHUB_UNK_CONFIGURATION &&
- cf->uhubcf_configuration != UHUB_UNK_CONFIGURATION &&
- cf->uhubcf_configuration != uaa->configno) ||
- (uaa->ifaceno != UHUB_UNK_INTERFACE &&
- cf->uhubcf_interface != UHUB_UNK_INTERFACE &&
- cf->uhubcf_interface != uaa->ifaceno) ||
- (uaa->vendor != UHUB_UNK_VENDOR &&
- cf->uhubcf_vendor != UHUB_UNK_VENDOR &&
- cf->uhubcf_vendor != uaa->vendor) ||
- (uaa->product != UHUB_UNK_PRODUCT &&
- cf->uhubcf_product != UHUB_UNK_PRODUCT &&
- cf->uhubcf_product != uaa->product) ||
- (uaa->release != UHUB_UNK_RELEASE &&
- cf->uhubcf_release != UHUB_UNK_RELEASE &&
- cf->uhubcf_release != uaa->release)
+ DPRINTFN(5,("usbd_submatch port=%d,%d configno=%d,%d "
+ "ifaceno=%d,%d vendor=%d,%d product=%d,%d release=%d,%d\n",
+ uaa->port, cf->uhubcf_port,
+ uaa->configno, cf->uhubcf_configuration,
+ uaa->ifaceno, cf->uhubcf_interface,
+ uaa->vendor, cf->uhubcf_vendor,
+ uaa->product, cf->uhubcf_product,
+ uaa->release, cf->uhubcf_release));
+ if (uaa->port != 0 && /* root hub has port 0, it should match */
+ ((uaa->port != 0 &&
+ cf->uhubcf_port != UHUB_UNK_PORT &&
+ cf->uhubcf_port != uaa->port) ||
+ (uaa->configno != UHUB_UNK_CONFIGURATION &&
+ cf->uhubcf_configuration != UHUB_UNK_CONFIGURATION &&
+ cf->uhubcf_configuration != uaa->configno) ||
+ (uaa->ifaceno != UHUB_UNK_INTERFACE &&
+ cf->uhubcf_interface != UHUB_UNK_INTERFACE &&
+ cf->uhubcf_interface != uaa->ifaceno) ||
+ (uaa->vendor != UHUB_UNK_VENDOR &&
+ cf->uhubcf_vendor != UHUB_UNK_VENDOR &&
+ cf->uhubcf_vendor != uaa->vendor) ||
+ (uaa->product != UHUB_UNK_PRODUCT &&
+ cf->uhubcf_product != UHUB_UNK_PRODUCT &&
+ cf->uhubcf_product != uaa->product) ||
+ (uaa->release != UHUB_UNK_RELEASE &&
+ cf->uhubcf_release != UHUB_UNK_RELEASE &&
+ cf->uhubcf_release != uaa->release)
+ )
)
return 0;
return ((*cf->cf_attach->ca_match)(parent, cf, aux));
Home |
Main Index |
Thread Index |
Old Index