From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 24 01:43:51 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D59A16A420 for ; Fri, 24 Feb 2006 01:43:51 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from ismybrain.com (ismybrain.com [64.246.42.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1ABF343D45 for ; Fri, 24 Feb 2006 01:43:51 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [10.254.186.111] (localhost.localdomain [127.0.0.1]) by ismybrain.com (8.11.6/8.11.6) with ESMTP id k1O1hkM28194; Thu, 23 Feb 2006 20:43:47 -0500 Message-ID: <43FE64CF.6080009@savvis.net> Date: Thu, 23 Feb 2006 17:43:43 -0800 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Norbert Koch References: <000001c6379d$63036d80$4801a8c0@ws-ew-3.demig.intra> <43FE2C4F.6030909@savvis.net> <43FE36B8.7070601@savvis.net> In-Reply-To: <43FE36B8.7070601@savvis.net> Content-Type: multipart/mixed; boundary="------------050301000904030300000407" Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] does ukbd delay break scan codes? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2006 01:43:51 -0000 This is a multi-part message in MIME format. --------------050301000904030300000407 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Maksim Yevmenkin wrote: [...] >>> I still do not know where it comes from, >>> but what I found so far is, >>> that the usb keyboard (or ukbd driver) >>> seems to delay the break codes for >>> keys with prefix E0 (which may or may not >>> have anything to do with my problem). >>> >>> E.g., I press Keypad-Enter and see >>> E0 1C E0 >>> ^prefix >>> ^make code >>> ^prefix >>> and nothing else. As soon as I press >>> e.g. Enter (any key works) I see >>> 9C 1C 9C >>> ^break code >>> ^make code >>> ^delayed break code. >>> >>> Does anyone have an idea where that >>> may come from? >> >> >> i see this to on week old -current. if ukbd(4) delays break code then >> this might explain state synchronization problem with kbdmux(4). i >> guess we should start digging into ukbd(4), starting with >> ukbd_interrupt() to see why this happening. > > > just by looking at the code, i think, that ukbd_check_char() should also > return "true" if ks_buffered_char[0] != 0, i.e. try the following > untested patch i have tested the attached patch. it works for me. with this patch usb keyboard return Feb 23 17:30:54 beetle kernel: e0 1c Feb 23 17:30:54 beetle kernel: e0 9c when i press "gray enter" key and ps/2 keyboard return Feb 23 17:31:41 beetle kernel: e0 Feb 23 17:31:41 beetle kernel: 1c Feb 23 17:31:41 beetle kernel: e0 Feb 23 17:31:41 beetle kernel: 9c also i tried to freeze my keyboards by pressing ctrl+f1 but i can not reproduce it here. thanks, max --------------050301000904030300000407 Content-Type: text/plain; name="ukbd.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ukbd.c.diff" --- ukbd.c.orig Wed Mar 30 00:32:41 2005 +++ ukbd.c Thu Feb 23 17:18:37 2006 @@ -1145,9 +1145,7 @@ state = (ukbd_state_t *)kbd->kb_data; if (!(state->ks_flags & COMPOSE) && (state->ks_composed_char > 0)) return TRUE; - if (state->ks_inputs > 0) - return TRUE; - return FALSE; + return ukbd_check(kbd); } /* some useful control functions */ --------------050301000904030300000407--