aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Thompson <thompsa@FreeBSD.org>2009-03-10 19:35:41 +0000
committerAndrew Thompson <thompsa@FreeBSD.org>2009-03-10 19:35:41 +0000
commitb1e14b53e3e1c263b10cab11cef8c8cf0de2303f (patch)
treee851a78e066edb7a50071c223eef730136e45727
parent94ca1b2f84d9d4cf5b12a6be63dfe0b323146cfd (diff)
downloadsrc-b1e14b53e3e1c263b10cab11cef8c8cf0de2303f.tar.gz
src-b1e14b53e3e1c263b10cab11cef8c8cf0de2303f.zip
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
Notes
Notes: svn path=/head/; revision=189646
-rw-r--r--sys/dev/usb/usb_hid.c13
1 files 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 */