aboutsummaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_hid.c
diff options
context:
space:
mode:
authorAndrew Thompson <thompsa@FreeBSD.org>2009-04-05 18:21:51 +0000
committerAndrew Thompson <thompsa@FreeBSD.org>2009-04-05 18:21:51 +0000
commitde967835e07b5d548002fbfcff497c1bac4d3d47 (patch)
tree32bfd655bd94c123f523ad00e6fff5510f1c4523 /sys/dev/usb/usb_hid.c
parent65fd114d53aea0cd8f80f75e279b2e8d4c44c1db (diff)
downloadsrc-de967835e07b5d548002fbfcff497c1bac4d3d47.tar.gz
src-de967835e07b5d548002fbfcff497c1bac4d3d47.zip
MFp4 //depot/projects/usb@159995
- add support for more complicated HID descriptors which can have multiple definitions of the same field. - remove old modulo patch in ums, which I think is due to bad HID parsing, which should be fixed now. Reported by: netchild Submitted by: Hans Petter Selasky
Notes
Notes: svn path=/head/; revision=190741
Diffstat (limited to 'sys/dev/usb/usb_hid.c')
-rw-r--r--sys/dev/usb/usb_hid.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/usb/usb_hid.c b/sys/dev/usb/usb_hid.c
index 29caf38500cd..555d324ded43 100644
--- a/sys/dev/usb/usb_hid.c
+++ b/sys/dev/usb/usb_hid.c
@@ -544,13 +544,15 @@ hid_report_size(const void *buf, usb2_size_t len, enum hid_kind k, uint8_t *id)
*------------------------------------------------------------------------*/
int
hid_locate(const void *desc, usb2_size_t size, uint32_t u, enum hid_kind k,
- struct hid_location *loc, uint32_t *flags, uint8_t *id)
+ uint8_t index, struct hid_location *loc, uint32_t *flags, uint8_t *id)
{
struct hid_data *d;
struct hid_item h;
for (d = hid_start_parse(desc, size, 1 << k); hid_get_item(d, &h);) {
if (h.kind == k && !(h.flags & HIO_CONST) && h.usage == u) {
+ if (index--)
+ continue;
if (loc != NULL)
*loc = h.loc;
if (flags != NULL)