Patch to fix (some? Logitech?) USB mice

Jonathan Fosburgh jonathan at fosburgh.org
Wed Nov 2 05:36:13 PST 2005


A similar patch was submitted several months ago to FreeBSD but has never been 
commited that I saw.  For those interested in the history the PR is 
usb/77604. Basically, this makes my Logitech LX700 mouse function correctly.  
In DragonFly without the patch the mouse doesn't work at all. Either in 
syscons or X.

The path is /usr/src/sys/bus/usb.  Hopefully if there is a reason not to 
commit someone will at least explain it. :)
--- hid.c.sav	2005-10-17 08:17:04.000000000 -0500
+++ hid.c	2005-10-17 08:26:01.000000000 -0500
@@ -371,16 +371,23 @@
 {
 	struct hid_data *d;
 	struct hid_item h;
-	int size, id;
+	int hi, lo, size, id;
 
-	h.report_ID = 0;
 	id = 0;
+	hi = lo = -1;
 	for (d = hid_start_parse(buf, len, 1<<k); hid_get_item(d, &h); ) {
-		if (h.report_ID != 0 && id == 0)
-			id = h.report_ID;
+		if (h.kind == k) {
+			if(h.report_ID != 0 && !id)
+				id = h.report_ID;
+			if(h.report_ID == id) {
+				if (lo < 0)
+					lo = h.loc.pos;
+				hi = h.loc.pos + h.loc.size * h.loc.count;
+			}
+		}
 	}
 	hid_end_parse(d);
-	size = h.loc.pos;
+	size = hi - lo;
 	if (id != 0) {
 		size += 8;
 		*idp = id;	/* XXX wrong */




More information about the Submit mailing list