Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Mar 2009 19:35:41 +0000 (UTC)
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r189646 - head/sys/dev/usb
Message-ID:  <200903101935.n2AJZfd9071776@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thompsa
Date: Tue Mar 10 19:35:41 2009
New Revision: 189646
URL: http://svn.freebsd.org/changeset/base/189646

Log:
  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

Modified:
  head/sys/dev/usb/usb_hid.c

Modified: head/sys/dev/usb/usb_hid.c
==============================================================================
--- head/sys/dev/usb/usb_hid.c	Tue Mar 10 19:35:37 2009	(r189645)
+++ head/sys/dev/usb/usb_hid.c	Tue Mar 10 19:35:41 2009	(r189646)
@@ -283,14 +283,15 @@ hid_get_item(struct hid_data *s, struct 
 					 */
 					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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903101935.n2AJZfd9071776>