From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S272000AbTHHWEZ (ORCPT ); Fri, 8 Aug 2003 18:04:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S272002AbTHHWEZ (ORCPT ); Fri, 8 Aug 2003 18:04:25 -0400 Received: from hueytecuilhuitl.mtu.ru ([195.34.32.123]:20996 "EHLO hueymiccailhuitl.mtu.ru") by vger.kernel.org with ESMTP id S272000AbTHHWEV (ORCPT ); Fri, 8 Aug 2003 18:04:21 -0400 From: Andrey Borzenkov To: Rusty Russell Subject: Re: module-init-tools - input devices id support Date: Sat, 9 Aug 2003 01:07:51 +0400 User-Agent: KMail/1.5 Cc: greg@kroah.com, linux-kernel@vger.kernel.org References: <20030808193441.510142C252@lists.samba.org> In-Reply-To: <20030808193441.510142C252@lists.samba.org> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308090107.51989.arvidjaar@mail.ru> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Friday 08 August 2003 21:20, Rusty Russell wrote: > In message <200308022026.08906.arvidjaar@mail.ru> you write: > > On Saturday 02 August 2003 03:13, Rusty Russell wrote: > > > Hi Andrey, > > > > > > For 2.6 you should not be using the maps generated by depmod. > > > You should be adding to scripts/file2alias.c, and using those aliases > > > to insert modules. This is much more flexible. > > > > well ... file2alias assumes scalar fields with "is equal" or "do not > > care" values. Input handler matching requires bit (sub-)fields matching > > (with longest filed being 512 bits). I od not see how it can be > > implemented using standard alias syntax. > > Sorry for the slow response; am on holidays. > > I'm confused. This is the first time I've looked at the input code, > so please bear with me. > > So, you hotplug in a device that has a suspend key, and you want the > power.ko module to match it? Hmm, cool. > I have never thought about this particular example, but yes, input agent will do it even without me knowing it :)) and not only hotplug - you coldplug and boot and have all handlers ready. > How about a mneumonic for each type? Like so for > drivers/input/power.c: > > /* B: bus, V: Vendor, P: Product, R: Version. > * E: evbit, K: keybit, A: absbit, M: mscbit, L: ledbit, > * S: sndbit, F: ffbit. */ > /* > input:B*V*P*R*E*key*K*suspend*A*M*L*S*F* > input:B*V*P*R*E*key*K*power*A*M*L*S*F* > input:B*V*P*R*E*K*power*A*M*L*S*F* > > You could use "p" instead of power, but the full names are probably > better since they are clear and most drivers only seem to have a > handful from my casual grepping. > The problem is not modules.alias (at least given curent input drivers). The problem is you have to convert driver data into this format to be able to match it. Now looking at my standard at keyboard: pts/1}% cat /proc/bus/input/devices I: Bus=0011 Vendor=0001 Product=0002 Version=ab02 N: Name="AT Set 2 keyboard" P: Phys=isa0060/serio0/input0 H: Handlers=kbd event0 B: EV=120003 B: KEY=4 2000000 c061f9 fbc9d621 efdfffdf ffefffff ffffffff fffffffe B: LED=7 I hope you do not seriously suggest something like Knone-suspend-a-b-.... for all appr. 100 keys defined? that is the main difference with PCI (and possible most others). They deal with single-value scalar fields. Input deals with bitfields where each bit counts. > > This syntax fails even for some PCI entries already > > (while using pcimap allows for more elaborate matching) > > Not in practice, at least so I was assured by Greg. Do you know of a > counter example? > no. I base my supposition on file2alias code: if ((baseclass_mask != 0 && baseclass_mask != 0xFF) || (subclass_mask != 0 && subclass_mask != 0xFF) || (interface_mask != 0 && interface_mask != 0xFF)) { fprintf(stderr, "*** Warning: Can't handle masks in %s:%04X\n", filename, id->class_mask); return 0; } if it has special case I assume this special case is possible. > I really prefer generating aliases to hold this meta-information where > possible, because it's so simple for anyone to use them. > > > Can you name some current users of module.alias? > > Well, noone uses it directly: it's an internal detail of modprobe. > But it's designed for the hotplug stuff. I'll eventually get around > to converting them if Greg doesn't first, because sooner or later > those map files are going to break. > why should it break? And sorry, but I do not find modules.alias any more simple than current tables. please understand - I am not against this syntax. I just fail to see how this particular task can be implemented using this syntax. And input agent is really needed for 2.6 it immensly simplifies configuration task. thank you for taking your time -andrey