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
This commit is contained in:
Andrew Thompson 2009-03-10 19:35:41 +00:00
parent 94ca1b2f84
commit b1e14b53e3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189646

View File

@ -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 */