From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mauro Carvalho Chehab Subject: Re: [RFC] What are the goals for the architecture of an in-kernel IR system? Date: Mon, 07 Dec 2009 22:00:20 -0200 Message-ID: <4B1D9714.5060000@redhat.com> References: <4B14EDE3.5050201@redhat.com> <4B1524DD.3080708@redhat.com> <4B153617.8070608@redhat.com> <4B17AA6A.9060702@redhat.com> <20091203175531.GB776@core.coreip.homeip.net> <20091203163328.613699e5@pedra> <20091204100642.GD22570@core.coreip.homeip.net> <20091204121234.5144836b@pedra> <20091206070929.GB14651@core.coreip.homeip.net> <4B1B8F83.5080009@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com ([209.132.183.28]:58057 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935276AbZLHABD (ORCPT ); Mon, 7 Dec 2009 19:01:03 -0500 In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Krzysztof Halasa Cc: Dmitry Torokhov , Gerd Hoffmann , Jarod Wilson , Christoph Bartelmus , awalls@radix.net, j@jannau.net, jarod@redhat.com, jonsmirl@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, superm1@ubuntu.com Krzysztof Halasa wrote: > Mauro Carvalho Chehab writes: > >> struct input_keytable_entry { >> u16 index; >> u64 scancode; >> u32 keycode; >> } __attribute__ ((packed)); >> >> (the attribute packed avoids needing a compat for 64 bits) > > Maybe { u64 scancode; u32 keycode; u16 index; u16 reserved } would be a > bit better, no alignment problems and we could eventually change > "reserved" into something useful. > > But I think, if we are going to redesign it, we better use scancodes of > arbitrary length (e.g. protocol-dependent length). It should be opaque > except for the protocol handler. Yes, an opaque type for scancode at the userspace API can be better, but passing a pointer to kernel will require some compat32 logic (as pointer size is different on 32 and 64 bits). We may use something like an u8[] with an arbitrary large number of bytes. In this case, we need to take some care to avoid LSB/MSB troubles. Cheers, Mauro.