summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usbdi.c
diff options
context:
space:
mode:
authorNathan Binkert <nate@cvs.openbsd.org>2002-04-01 21:47:08 +0000
committerNathan Binkert <nate@cvs.openbsd.org>2002-04-01 21:47:08 +0000
commit1374359a1cf4d5a2e671fb982c79e33c25ca8f13 (patch)
tree88928ba056519f342f0aaa1197d66fe6a69f173b /sys/dev/usb/usbdi.c
parenta2b77695fd05797b5de753ec3152064863aa030b (diff)
Add support for a bunch of new adapters.
Sync with NetBSD. ok deraadt
Diffstat (limited to 'sys/dev/usb/usbdi.c')
-rw-r--r--sys/dev/usb/usbdi.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index 8aa3f46afd3..932ed318765 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi.c,v 1.14 2001/05/03 02:20:34 aaron Exp $ */
+/* $OpenBSD: usbdi.c,v 1.15 2002/04/01 21:47:07 nate Exp $ */
/* $NetBSD: usbdi.c,v 1.81 2001/04/17 00:05:33 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */
@@ -1055,6 +1055,24 @@ usbd_ratecheck(struct timeval *last)
return (ratecheck(last, &errinterval));
}
+/*
+ * Search for a vendor/product pair in an array. The item size is
+ * given as an argument.
+ */
+const struct usb_devno *
+usb_match_device(const struct usb_devno *tbl, u_int nentries, u_int sz,
+ u_int16_t vendor, u_int16_t product)
+{
+ while (nentries-- > 0) {
+ u_int16_t tproduct = tbl->ud_product;
+ if (tbl->ud_vendor == vendor &&
+ (tproduct == product || tproduct == USB_PRODUCT_ANY))
+ return (tbl);
+ tbl = (struct usb_devno *)((char *)tbl + sz);
+ }
+ return (NULL);
+}
+
#if defined(__FreeBSD__)
int
usbd_driver_load(module_t mod, int what, void *arg)