shithub: riscv

Download patch

ref: a2b83a5aea0a5c1c4fbd4a12bdb14def9354ea2e
parent: 6b4c5380d84791e18577872b7963b0fc5a0885ed
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)
--