Don't clear global report values when reporting an item.
This commit is contained in:
parent
0d2905f4fc
commit
198e193c28
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: hid.c,v 1.18 2001/12/28 17:32:36 augustss Exp $ */
|
||||
/* $NetBSD: hid.c,v 1.19 2001/12/29 17:48:29 augustss Exp $ */
|
||||
/* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -39,7 +39,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.18 2001/12/28 17:32:36 augustss Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.19 2001/12/29 17:48:29 augustss Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -145,8 +145,6 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
|
|||
DPRINTFN(5,("return multi\n"));
|
||||
return (1);
|
||||
} else {
|
||||
c->loc.count = 0;
|
||||
c->loc.size = 0;
|
||||
s->multimax = 0;
|
||||
s->nu = 0;
|
||||
hid_clear_local(c);
|
||||
|
@ -246,7 +244,6 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
|
|||
c->collevel++;
|
||||
*h = *c;
|
||||
hid_clear_local(c);
|
||||
/*c->report_ID = 0;*/
|
||||
s->nu = 0;
|
||||
return (1);
|
||||
case 11: /* Feature */
|
||||
|
@ -258,7 +255,6 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
|
|||
c->kind = hid_endcollection;
|
||||
c->collevel--;
|
||||
*h = *c;
|
||||
/*hid_clear_local(c);*/
|
||||
s->nu = 0;
|
||||
return (1);
|
||||
default:
|
||||
|
@ -388,7 +384,7 @@ hid_report_size(void *buf, int len, enum hid_kind k, u_int8_t id)
|
|||
DPRINTFN(2,("hid_report_size: kind=%d id=%d\n", k, id));
|
||||
for (d = hid_start_parse(buf, len, k); hid_get_item(d, &h); ) {
|
||||
DPRINTFN(2,("hid_report_size: item kind=%d id=%d pos=%d "
|
||||
"size=%d cpunt=%d\n",
|
||||
"size=%d count=%d\n",
|
||||
h.kind, h.report_ID, h.loc.pos, h.loc.size,
|
||||
h.loc.count));
|
||||
if (h.report_ID == id && h.kind == k) {
|
||||
|
@ -399,6 +395,10 @@ hid_report_size(void *buf, int len, enum hid_kind k, u_int8_t id)
|
|||
}
|
||||
}
|
||||
hid_end_parse(d);
|
||||
#ifdef DIAGNOSTIC
|
||||
if (lo != 0)
|
||||
printf("hid_report_size: lo != 0\n");
|
||||
#endif
|
||||
return ((hi - lo + 7) / 8);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue