Re: module-init-tools - input devices id support

From: Rusty Russell
Date: Fri Aug 08 2003 - 14:41:31 EST


In message <200308022026.08906.arvidjaar@xxxxxxx> 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.

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.

> 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?

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.

Hope that clarifies!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/