Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Sep 2003 15:29:28 +0800
From:      plasma <plasmaball@pchome.com.tw>
To:        stable@freebsd.org
Subject:   Re: USB keyboard problem
Message-ID:  <20030927072928.GA442@plasmanb.plasma.idv.tw>
In-Reply-To: <20030926181607.GA927@plasmanb.plasma.idv.tw>
References:  <20030925093548.GA1062@plasmanb.plasma.idv.tw> <20030926181607.GA927@plasmanb.plasma.idv.tw>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Sep 27, 2003 at 02:16:07AM +0800, plasma wrote:
> The problem is here:
> 
> Sep 27 01:37:28 plasmanb /kernel: before old: 22 44 
> Sep 27 01:37:28 plasmanb /kernel: before new: 44 
> Sep 27 01:37:28 plasmanb /kernel: no: 2, nn: 0
> Sep 27 01:37:28 plasmanb /kernel: 0x416 (1046) released
> Sep 27 01:37:28 plasmanb /kernel: 0x42c (1068) released

Ok, I finally found out what's really going on.  I added another debug
patch, and everything is clear:

Sep 27 14:30:24 plasmanb /kernel: before old: 12 22 0 0 0 0 (6) 
Sep 27 14:30:24 plasmanb /kernel: before new: 0 22 0 0 0 0 (6) 

That's it!  The 0's is not guaranteed to be the end of data.  With
this knowledge, the fix is obvious:

[[[
--- /usr/src/sys/dev/usb/ukbd.c.orig	Mon Mar 31 08:31:35 2003
+++ /usr/src/sys/dev/usb/ukbd.c	Sat Sep 27 15:13:31 2003
@@ -732,10 +732,10 @@
 	for (i = 0; i < NKEYCODE; i++) {
 		key = state->ks_odata.keycode[i];
 		if (key == 0)
-			break;
+			continue;
 		for (j = 0; j < NKEYCODE; j++) {
 			if (ud->keycode[j] == 0)
-				break;
+				continue;
 			if (key == ud->keycode[j])
 				goto rfound;
 		}
@@ -748,11 +748,11 @@
 	for (i = 0; i < NKEYCODE; i++) {
 		key = ud->keycode[i];
 		if (key == 0)
-			break;
+			continue;
 		state->ks_ntime[i] = now + kbd->kb_delay1;
 		for (j = 0; j < NKEYCODE; j++) {
 			if (state->ks_odata.keycode[j] == 0)
-				break;
+				continue;
 			if (key == state->ks_odata.keycode[j]) {
 				state->ks_ntime[i] = state->ks_otime[j];
 				if (state->ks_otime[j] > now)
]]]

Yes, I'm composing this email with my usb->ps/2 adaptor and my
favorite ps/2 keyboard. :D

I'll sendpr with this patch.  Enjoy the patch. :)


plasma


==========================================================
 收到帳單後最擔心的事
 http://edm-prg.epaper.com.tw/click.php?ad_code=25227
==========================================================
 PChome線上購物週年慶:抽汽車、DV天天送
 http://shopping.pchome.com.tw/
==========================================================



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