From b1e14b53e3e1c263b10cab11cef8c8cf0de2303f Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Tue, 10 Mar 2009 19:35:41 +0000 Subject: [PATCH] Make sure HID has a default usage, this fixes recent mouse problems. Tested by: Renato Botelho Tested by: beech (earlier version) Submitted by: Hans Petter Selasky --- sys/dev/usb/usb_hid.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/dev/usb/usb_hid.c b/sys/dev/usb/usb_hid.c index 3082749f1b1c..3008184a0417 100644 --- a/sys/dev/usb/usb_hid.c +++ b/sys/dev/usb/usb_hid.c @@ -283,14 +283,15 @@ hid_get_item(struct hid_data *s, struct hid_item *h) */ c->loc.count = 1; } else { - /* make sure we have a usage */ - if (s->nusage == 0) { - s->usages_min[s->nusage] = 0; - s->usages_max[s->nusage] = 0; - s->nusage = 1; - } s->ncount = 1; } + /* make sure we have a usage */ + if (s->nusage == 0) { + /* use the undefined HID PAGE */ + s->usages_min[s->nusage] = 0x0000; + s->usages_max[s->nusage] = 0xFFFF; + s->nusage = s->ncount; + } goto top; case 9: /* Output */