* module-init-tools - input devices id support
@ 2003-08-01 21:29 Andrey Borzenkov
2003-08-01 23:13 ` Rusty Russell
0 siblings, 1 reply; 6+ messages in thread
From: Andrey Borzenkov @ 2003-08-01 21:29 UTC (permalink / raw)
To: linux-kernel; +Cc: Rusty Russell
[-- Attachment #1: Type: text/plain, Size: 718 bytes --]
this adds support for generating modules.inputmap with input handler match
table that is used by input hotplug agent posted separately. Using hotplug
allowed me to completely eliminate any manual (input handler) module loading
in 2.6, it is also compatible with 2.4 in that usb.agent for 2.4 includes
fake usb table that maps device class to input handlers so this is mostly
transparent to users.
I do not have ability to test it on 64 bit system nor have any sufficient
knowledge about ELF - please, check and adjust table size if neccessary.
the patch is against 0.9.13-pre and relative to previous temp file patch I
sent. I can send patch against vanilla version if required.
Comments appreciated
-andrey
[-- Attachment #2: module-init-tools-0.9.13-inputmap.patch.bz2 --]
[-- Type: application/x-bzip2, Size: 1672 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: module-init-tools - input devices id support
2003-08-01 21:29 module-init-tools - input devices id support Andrey Borzenkov
@ 2003-08-01 23:13 ` Rusty Russell
2003-08-02 16:26 ` Andrey Borzenkov
0 siblings, 1 reply; 6+ messages in thread
From: Rusty Russell @ 2003-08-01 23:13 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: linux-kernel
In message <200308020129.51737.arvidjaar@mail.ru> you write:
> this adds support for generating modules.inputmap with input handler match
> table that is used by input hotplug agent posted separately. Using hotplug
> allowed me to completely eliminate any manual (input handler) module loading
> in 2.6, it is also compatible with 2.4 in that usb.agent for 2.4 includes
> fake usb table that maps device class to input handlers so this is mostly
> transparent to users.
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.
Hope that helps,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: module-init-tools - input devices id support
2003-08-01 23:13 ` Rusty Russell
@ 2003-08-02 16:26 ` Andrey Borzenkov
2003-08-08 17:20 ` Rusty Russell
0 siblings, 1 reply; 6+ messages in thread
From: Andrey Borzenkov @ 2003-08-02 16:26 UTC (permalink / raw)
To: Rusty Russell; +Cc: linux-kernel
On Saturday 02 August 2003 03:13, Rusty Russell wrote:
> In message <200308020129.51737.arvidjaar@mail.ru> you write:
> > this adds support for generating modules.inputmap with input handler
> > match table that is used by input hotplug agent posted separately. Using
> > hotplug allowed me to completely eliminate any manual (input handler)
> > module loading in 2.6, it is also compatible with 2.4 in that usb.agent
> > for 2.4 includes fake usb table that maps device class to input handlers
> > so this is mostly transparent to users.
>
> 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. This syntax fails even for some PCI entries already
(while using pcimap allows for more elaborate matching)
Can you name some current users of module.alias?
thank you
-andrey
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: module-init-tools - input devices id support
2003-08-02 16:26 ` Andrey Borzenkov
@ 2003-08-08 17:20 ` Rusty Russell
2003-08-08 21:07 ` Andrey Borzenkov
0 siblings, 1 reply; 6+ messages in thread
From: Rusty Russell @ 2003-08-08 17:20 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: greg, linux-kernel
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.
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: module-init-tools - input devices id support
2003-08-08 17:20 ` Rusty Russell
@ 2003-08-08 21:07 ` Andrey Borzenkov
2003-08-15 12:08 ` Rusty Russell
0 siblings, 1 reply; 6+ messages in thread
From: Andrey Borzenkov @ 2003-08-08 21:07 UTC (permalink / raw)
To: Rusty Russell; +Cc: greg, linux-kernel
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: module-init-tools - input devices id support
2003-08-08 21:07 ` Andrey Borzenkov
@ 2003-08-15 12:08 ` Rusty Russell
0 siblings, 0 replies; 6+ messages in thread
From: Rusty Russell @ 2003-08-15 12:08 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: greg, linux-kernel
In message <200308090107.51989.arvidjaar@mail.ru> you write:
> On Friday 08 August 2003 21:20, Rusty Russell wrote:
> > 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.
This is the only example I can think of: what else would you use the
inputmap file for?
> > 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. */
> > /*
>
> I hope you do not seriously suggest something like
>
> Knone-suspend-a-b-.... for all appr. 100 keys defined?
Not in the proc file, no: that would be silly. But there's no reason
not to convert it to do the modprobe: sure, it'll be very long, but
that's OK, at least it's clear. It has the advantage that if anyone
else ever wants to use it, it's nice and simple to understand.
> 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.
Yes.
> > > 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.
Yes, in practice noone does this because it doesn't really make sense:
when someone wants to match on finer granularity, we'll worry about it.
> > 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.
Because the aliases are added at kernel build time, which means that
all the knowledge about the data structures is inside the kernel
source tree, so they can change. And because the aliases are text
wildcards, they're easy to extend cleanly, without requiring any tools
to change. The PCI structure changed in a 2.4.0 test kernel, and
broke the outside tools. Greg KH still flinches when you ask about it
8)
> please understand - I am not against this syntax. I just fail to see how this
> particular task can be implemented using this syntax.
That's OK, we're having a refreshingly civilized discussion. If we
can't find a way of doing this using the alias syntax, then we'll keep
the map for input. But it'd be a shame for you to be the odd one out 8(
> And input agent is really needed for 2.6 it immensly simplifies configuration
> task.
What is input agent? I have only glanced at the kernel code: could
you explain to me how you would use the inputmap file?
> thank you for taking your time
No, thank *you*. It's always hard to come up with a new design when
there are so many people doing different things in the kernel. But
that's what makes it fun...
Cheers!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-08-15 18:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-01 21:29 module-init-tools - input devices id support Andrey Borzenkov
2003-08-01 23:13 ` Rusty Russell
2003-08-02 16:26 ` Andrey Borzenkov
2003-08-08 17:20 ` Rusty Russell
2003-08-08 21:07 ` Andrey Borzenkov
2003-08-15 12:08 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox