mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
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. ----------------------------
This commit is contained in:
parent
fef3edecbb
commit
d41fcbf0d0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90526
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user