summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2002-04-02 14:08:43 +0000
committerjoe <joe@FreeBSD.org>2002-04-02 14:08:43 +0000
commitbd5b0c32fd2fb16434cc0af4c98969fe540fadbe (patch)
tree4d23d0123b5356ad1599d92f391f59d7010c104d
parent9b962a4e9b5fedc67b4a99f7e601ead5e560046a (diff)
downloadFreeBSD-src-bd5b0c32fd2fb16434cc0af4c98969fe540fadbe.zip
FreeBSD-src-bd5b0c32fd2fb16434cc0af4c98969fe540fadbe.tar.gz
MFNetBSD: usb_subr.c (1.87), usbdi.h (1.53)
date: 2001/08/15 00:04:59; author: augustss; Add a little infrastructure so that individual drivers can easily check if thee was a vendor+product locator match.
-rw-r--r--sys/dev/usb/usb_subr.c14
-rw-r--r--sys/dev/usb/usbdi.h1
2 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index 30cb05e..966e738 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.86 2001/05/16 04:50:11 lukem Exp $ */
+/* $NetBSD: usb_subr.c,v 1.87 2001/08/15 00:04:59 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -1166,6 +1166,18 @@ usbd_submatch(struct device *parent, void *match, void *aux)
)
)
return 0;
+ if (cf->uhubcf_vendor != UHUB_UNK_VENDOR &&
+ cf->uhubcf_vendor == uaa->vendor &&
+ cf->uhubcf_product != UHUB_UNK_PRODUCT &&
+ cf->uhubcf_product == uaa->product) {
+ /* We have a vendor&product locator match */
+ if (cf->uhubcf_release != UHUB_UNK_RELEASE &&
+ cf->uhubcf_release == uaa->release)
+ uaa->matchlvl = UMATCH_VENDOR_PRODUCT_REV;
+ else
+ uaa->matchlvl = UMATCH_VENDOR_PRODUCT;
+ } else
+ uaa->matchlvl = 0;
return ((*cf->cf_attach->ca_match)(parent, cf, aux));
}
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index a1cbf33..65a483e 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -213,6 +213,7 @@ struct usb_attach_arg {
int vendor;
int product;
int release;
+ int matchlvl;
usbd_device_handle device; /* current device */
usbd_interface_handle iface; /* current interface */
int usegeneric;
OpenPOWER on IntegriCloud