diff options
author | joe <joe@FreeBSD.org> | 2002-02-11 10:09:29 +0000 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2002-02-11 10:09:29 +0000 |
commit | 296d6685d4f2578d11b9f225b4e3aba6af9ea59e (patch) | |
tree | 8ae800c939ddd29a04a098c7007a35fe6b3fe01d | |
parent | d89b782d63e5cb3553b3a14b92ce208b9ac957c9 (diff) | |
download | FreeBSD-src-296d6685d4f2578d11b9f225b4e3aba6af9ea59e.zip FreeBSD-src-296d6685d4f2578d11b9f225b4e3aba6af9ea59e.tar.gz |
Merge from NetBSD: revs 1.89 and 1.90.
Also, add some 'const's to supress warnings. (Submitted back to NetBSD).
The original logs from NetBSD:
----------------------------
revision 1.90
date: 2001/12/03 01:47:12; author: augustss; lines: +4 -4
Handle vendor/product lookup with a common routine.
----------------------------
revision 1.89
date: 2001/12/02 23:25:25; author: augustss; lines: +18 -2
Add a subroutine to search for a vendor/product pair.
----------------------------
-rw-r--r-- | sys/dev/usb/usbdi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 20d6a03..c762918 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1094,6 +1094,22 @@ usbd_get_endpoint_descriptor(iface, address) return (0); } +/* + * 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) { + if (tbl->ud_vendor == vendor && tbl->ud_product == product) + return (tbl); + tbl = (const struct usb_devno *)((const char *)tbl + sz); + } + return (NULL); +} + #if defined(__FreeBSD__) int usbd_driver_load(module_t mod, int what, void *arg) |