git: 9front

Download patch

ref: a2fea3ad5c4960a4ad5542d403f6ef029b98f593
parent: c763e1e265dbb6dcc8f0179fc76d071ca4ed9c58
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Wed Jan 30 15:33:28 EST 2013

nusb/kb: increase maximum report descriptor size, non-continuous endpoints (from richard millars usbmouse-endpoint patch)

Another band-aid fix to the usb mouse driver, to cope with a mouse which has
an interrupt endpoint number 3 but no number 1 or 2, and a report descriptor
more than 128 bytes long.

--- a/sys/src/cmd/nusb/kb/kb.c
+++ b/sys/src/cmd/nusb/kb/kb.c
@@ -39,7 +39,7 @@
 
 	/* report descriptor */
 	int	nrep;
-	uchar	rep[128];
+	uchar	rep[512];
 };
 
 /*
@@ -806,7 +806,7 @@
 	ud = d->usb;
 	for(i = 0; i < nelem(ud->ep); i++){
 		if((ep = ud->ep[i]) == nil)
-			break;
+			continue;
 		if(ep->type == Eintr && ep->dir == Ein && ep->iface->csp == KbdCSP)
 			kbstart(d, ep, "/dev/kbin", kbdwork);
 		if(ep->type == Eintr && ep->dir == Ein && ep->iface->csp == PtrCSP)
--