Two module-init-
Subsystems (2)
Quoted 7 lines · Scott James Remnant
Hi Rusty,
Attached are two patches to module-init-tools from Ubuntu.
The first (
input_table_size) is a catch-up with 2.6.15, it's adding an extra field to theinput_device_idstruct; m-u-t needs updating to be able to read the modules correctly.
Hi Scott,
Unfortunately, it's not that simple. Your patch will break previous
kernels, which have a smaller structure. I've had the discussion years ago with the input people on using module aliases, and it's not entirely trivial. I will prepare another patch, however.
Meanwhile, as noone seems to use swbit in struct input_device_id, perhaps we can remove it for 2.6.15?
Quoted 4 lines
The second (
use_blacklist) adds a "-b" flag to modprobe that performs blacklist checking on those modules listed on the command line, it's handy for use when calling modprobe from udev for those subsystems without MODALIAS yet (input, ccw, etc.)
Hmm, well, the answer to that is the same as above. ccw should have support now, so it's just input we're missing I think.
Rusty.
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman
Quoted 5 lines · Rusty Russell
Quoted 4 lines · Scott James Remnant
Hi Rusty,
Attached are two patches to module-init-tools from Ubuntu.
Quoted 9 lines
Quoted 3 lines
The first (
input_table_size) is a catch-up with 2.6.15, it's adding an extra field to theinput_device_idstruct; m-u-t needs updating to be able to read the modules correctly.Unfortunately, it's not that simple. Your patch will break previous kernels, which have a smaller structure. I've had the discussion years ago with the input people on using module aliases, and it's not entirely trivial. I will prepare another patch, however.
Are the modules.*map files intended to be deprecated entirely in favour of aliases? The problem this patch fixed was that the parser couldn't read the tables, so produced invalid output for the modules (ie. an empty modules.inputmap).
Scott
Signature · 2 lines
Scott James Remnant [email protected]
Quoted 16 lines · Scott James Remnant
Quoted 5 lines · Rusty Russell
Quoted 4 lines · Scott James Remnant
Hi Rusty,
Attached are two patches to module-init-tools from Ubuntu.
Quoted 9 lines
Quoted 3 lines
The first (
input_table_size) is a catch-up with 2.6.15, it's adding an extra field to theinput_device_idstruct; m-u-t needs updating to be able to read the modules correctly.Unfortunately, it's not that simple. Your patch will break previous kernels, which have a smaller structure. I've had the discussion years ago with the input people on using module aliases, and it's not entirely trivial. I will prepare another patch, however.
Quoted 4 lines
Are the modules.*map files intended to be deprecated entirely in favour of aliases? The problem this patch fixed was that the parser couldn't read the tables, so produced invalid output for the modules (ie. an empty modules.inputmap).
Yes, but now it will produce a bad modules.inputmap for previous kernels.
Here's the patch for modalias support for input classes. It uses comma-separated numbers, and doesn't describe all the potential keys (no module currently cares, and that would make the strings huge). The changes to input.h are to move the definitions needed by file2alias outside __KERNEL__. I chose not to move those definitions to mod_devicetable.h, because there are so many that it might break compile of something else in the kernel.
The rest is fairly straightforward.
drivers/input/input.c +39 -0
@@ -529,10 +529,49 @@ INPUT_DEV_STRING_ATTR_SHOW(name);INPUT_DEV_STRING_ATTR_SHOW (phys);INPUT_DEV_STRING_ATTR_SHOW (uniq); +static int print_modalias_bits (char *buf,char prefix,unsigned long *arr, +unsigned int min,unsigned int max) +{ +int len, i; + + len =sprintf (buf,"%c" , prefix); +for (i = min; i < max; i++) +if (arr[LONG (i)] &BIT (i)) + len +=sprintf (buf+len,"%X," , i); +return len; +} + +static ssize_t input_dev_show_modalias (struct class_device *dev,char *buf) +{ +struct input_dev *id =to_input_dev (dev); +ssize_t len =0 ; + + len +=sprintf (buf+len,"input:b%04Xv%04Xp%04Xe%04X-" , + id->id.bustype, + id->id.vendor, + id->id.product, + id->id.version); + + len +=print_modalias_bits (buf+len,'e' , id->evbit,0 ,EV_MAX ); + len +=print_modalias_bits (buf+len,'k' , id->keybit, +KEY_MIN_INTERESTING ,KEY_MAX ); + len +=print_modalias_bits (buf+len,'r' , id->relbit,0 ,REL_MAX ); + len +=print_modalias_bits (buf+len,'a' , id->absbit,0 ,ABS_MAX ); + len +=print_modalias_bits (buf+len,'m' , id->mscbit,0 ,MSC_MAX ); + len +=print_modalias_bits (buf+len,'l' , id->ledbit,0 ,LED_MAX ); + len +=print_modalias_bits (buf+len,'s' , id->sndbit,0 ,SND_MAX ); + len +=print_modalias_bits (buf+len,'f' , id->ffbit,0 ,FF_MAX ); + len +=print_modalias_bits (buf+len,'w' , id->swbit,0 ,SW_MAX ); + len +=sprintf (buf+len,"\n" ); +return len; +} +static CLASS_DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL); +static struct attribute *input_dev_attrs[] = { &class_device_attr_name.attr, &class_device_attr_phys.attr, &class_device_attr_uniq.attr, + &class_device_attr_modalias.attr,NULL };
include/linux/input.h +41 -38
108 lines not on this page · raw message
scripts/mod/file2alias.c +61 -1
88 lines not on this page · raw message
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman
Quoted 3 lines · Rusty Russell
Meanwhile, as noone seems to use swbit in struct
input_device_id, perhaps we can remove it for 2.6.15?
Please take a look at drivers/input/keyboard/corgikbd.c
Signature · 1 line
Dmitry
Quoted 7 lines · Dmitry Torokhov
Quoted 3 lines · Rusty Russell
Meanwhile, as noone seems to use swbit in struct
input_device_id, perhaps we can remove it for 2.6.15?Please take a look at
drivers/input/keyboard/corgikbd.c
What I meant we do use EV_SW in the drivers and so it sould be part of input_device_id. Nobody uses ffbit or sndbit either and still they are present...
Signature · 1 line
Dmitry
Quoted 33 lines · Rusty Russell
Quoted 16 lines · Scott James Remnant
Quoted 5 lines · Rusty Russell
Quoted 4 lines · Scott James Remnant
Hi Rusty,
Attached are two patches to module-init-tools from Ubuntu.
Quoted 9 lines
Quoted 3 lines
The first (
input_table_size) is a catch-up with 2.6.15, it's adding an extra field to theinput_device_idstruct; m-u-t needs updating to be able to read the modules correctly.Unfortunately, it's not that simple. Your patch will break previous kernels, which have a smaller structure. I've had the discussion years ago with the input people on using module aliases, and it's not entirely trivial. I will prepare another patch, however.
Quoted 4 lines
Are the modules.*map files intended to be deprecated entirely in favour of aliases? The problem this patch fixed was that the parser couldn't read the tables, so produced invalid output for the modules (ie. an empty modules.inputmap).
Yes, but now it will produce a bad modules.inputmap for previous kernels.
Here's the patch for modalias support for input classes. It uses comma-separated numbers, and doesn't describe all the potential keys (no module currently cares, and that would make the strings huge). The changes to
input.hare to move the definitions needed by file2alias outside__KERNEL__. I chose not to move those definitions tomod_devicetable.h, because there are so many that it might break compile of something else in the kernel.
Quoted 1 line
The rest is fairly straightforward.
Nice! Seems the last user of the map files is gone now. Here is the MODALIAS for the event environment.
From: Kay Sievers <[email protected]>
input: add MODALIAS to the event environment
---
drivers/input/input.c +38 -19
@@ -528,40 +528,56 @@ INPUT_DEV_STRING_ATTR_SHOW(name);INPUT_DEV_STRING_ATTR_SHOW (phys);INPUT_DEV_STRING_ATTR_SHOW (uniq); -static int print_modalias_bits (char *buf,char prefix,unsigned long *arr, +static int print_modalias_bits (char *buf,int size,char prefix,unsigned long *arr,unsigned int min,unsigned int max) {int len, i; - len =sprintf (buf,"%c" , prefix); + len =snprintf (buf, size,"%c" , prefix);for (i = min; i < max; i++)if (arr[LONG (i)] &BIT (i)) - len +=sprintf (buf+len,"%X," , i); + len +=snprintf (buf + len, size - len,"%X," , i);return len; } - -static ssize_t input_dev_show_modalias (struct class_device *dev,char *buf) + +static int print_modalias (char *buf,int size,struct input_dev *id) { -struct input_dev *id =to_input_dev (dev); -ssize_t len =0 ; +int len; - len +=sprintf (buf+len,"input:b%04Xv%04Xp%04Xe%04X-" , + len =snprintf (buf, size,"input:b%04Xv%04Xp%04Xe%04X-" , id->id.bustype, id->id.vendor, id->id.product, id->id.version); - len +=print_modalias_bits (buf+len,'e' , id->evbit,0 ,EV_MAX ); - len +=print_modalias_bits (buf+len,'k' , id->keybit, + len +=print_modalias_bits (buf + len, size - len,'e' , id->evbit, +0 ,EV_MAX ); + len +=print_modalias_bits (buf + len, size - len,'k' , id->keybit,KEY_MIN_INTERESTING ,KEY_MAX ); - len +=print_modalias_bits (buf+len,'r' , id->relbit,0 ,REL_MAX ); - len +=print_modalias_bits (buf+len,'a' , id->absbit,0 ,ABS_MAX ); - len +=print_modalias_bits (buf+len,'m' , id->mscbit,0 ,MSC_MAX ); - len +=print_modalias_bits (buf+len,'l' , id->ledbit,0 ,LED_MAX ); - len +=print_modalias_bits (buf+len,'s' , id->sndbit,0 ,SND_MAX ); - len +=print_modalias_bits (buf+len,'f' , id->ffbit,0 ,FF_MAX ); - len +=print_modalias_bits (buf+len,'w' , id->swbit,0 ,SW_MAX ); - len +=sprintf (buf+len,"\n" ); + len +=print_modalias_bits (buf + len, size - len,'r' , id->relbit, +0 ,REL_MAX ); + len +=print_modalias_bits (buf + len, size - len,'a' , id->absbit, +0 ,ABS_MAX ); + len +=print_modalias_bits (buf + len, size - len,'m' , id->mscbit, +0 ,MSC_MAX ); + len +=print_modalias_bits (buf + len, size - len,'l' , id->ledbit, +0 ,LED_MAX ); + len +=print_modalias_bits (buf + len, size - len,'s' , id->sndbit, +0 ,SND_MAX ); + len +=print_modalias_bits (buf + len, size - len,'f' , id->ffbit, +0 ,FF_MAX ); + len +=print_modalias_bits (buf + len, size - len,'w' , id->swbit, +0 ,SW_MAX ); +return len; +} + +static ssize_t input_dev_show_modalias (struct class_device *dev,char *buf) +{ +struct input_dev *id =to_input_dev (dev); +ssize_t len; + + len =print_modalias (buf,PAGE_SIZE , id); + len +=snprintf (buf + len,PAGE_SIZE -len,"\n" );return len; } static CLASS_DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL);
@@ -728,8 +744,11 @@ static int input_dev_uevent(struct classif (test_bit (EV_SW , dev->evbit))INPUT_ADD_HOTPLUG_BM_VAR ("SW=" , dev->swbit,SW_MAX ); - envp[i] =NULL ; + envp[i++] = buffer + len; + len +=snprintf (buffer + len, buffer_size - len,"MODALIAS=" ); + len +=print_modalias (buffer + len, buffer_size - len, dev) +1 ; + envp[i] =NULL ;return 0 ; }
Quoted 6 lines · Dmitry Torokhov
Quoted 5 lines · Dmitry Torokhov
Quoted 3 lines · Rusty Russell
Meanwhile, as noone seems to use swbit in struct
input_device_id, perhaps we can remove it for 2.6.15?
Quoted 6 lines
Quoted 2 lines
Please take a look at
drivers/input/keyboard/corgikbd.cWhat I meant we do use
EV_SWin the drivers and so it sould be part ofinput_device_id. Nobody uses ffbit or sndbit either and still they are present...
Sure. BUT it will break current users. I'm suggesting we jerk that field out for 2.6.15, and reintroduce it for >= 2.6.16, when we can (1) ensure everyone has a fixed module-init tools, or (2) make sure everyone is using the module alias stuff, or both.
It seems the simplest solution, surely?
Rusty.
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman
Quoted 14 lines · Rusty Russell
Quoted 6 lines · Dmitry Torokhov
Quoted 5 lines · Dmitry Torokhov
Quoted 3 lines · Rusty Russell
Meanwhile, as noone seems to use swbit in struct
input_device_id, perhaps we can remove it for 2.6.15?Quoted 6 lines
Quoted 2 lines
Please take a look at
drivers/input/keyboard/corgikbd.cWhat I meant we do use
EV_SWin the drivers and so it sould be part ofinput_device_id. Nobody uses ffbit or sndbit either and still they are present...
Quoted 6 lines
Sure. BUT it will break current users. I'm suggesting we jerk that field out for 2.6.15, and reintroduce it for >= 2.6.16, when we can (1) ensure everyone has a fixed module-init tools, or (2) make sure everyone is using the module alias stuff, or both.
It seems the simplest solution, surely?
The two users of EV_SW I'm aware of are corgikbd.c and spitzkbd.c. Speaking as the maintainer of the kernel builds for the main users of Zaurus 2.6 kernels, I can safely say that those two drivers are always likely to be compiled into a kernel (not modules) and therefore this is unlikely to upset anyone from a technical point of view. I keep out of politics ;-)
Richard
Dmitry Torokhov
maintainerQuoted 14 lines · Rusty Russell
Quoted 6 lines · Dmitry Torokhov
Quoted 5 lines · Dmitry Torokhov
Quoted 3 lines · Rusty Russell
Meanwhile, as noone seems to use swbit in struct
input_device_id, perhaps we can remove it for 2.6.15?Quoted 6 lines
Quoted 2 lines
Please take a look at
drivers/input/keyboard/corgikbd.cWhat I meant we do use
EV_SWin the drivers and so it sould be part ofinput_device_id. Nobody uses ffbit or sndbit either and still they are present...
Quoted 6 lines
Sure. BUT it will break current users. I'm suggesting we jerk that field out for 2.6.15, and reintroduce it for >= 2.6.16, when we can (1) ensure everyone has a fixed module-init tools, or (2) make sure everyone is using the module alias stuff, or both.
It seems the simplest solution, surely?
Is there real users that are broken? It looks like most distros either have mousedev and evdev compiled in or load them unconditionally. So the simpliest is just probably get MODALIAS stuff in 2.6.16 and that's it. It's not like swbit is new in 2.6.15, it was there since 2.6.14 was opened.
--
Dmitry
Quoted 2 lines · Dmitry Torokhov
It's not like swbit is new in 2.6.15, it was there since 2.6.14 was opened.
Err, yeah, good point. I had assumed this was new in 2.6.14. Since we've only seen reports now, I'll assume it's low priority and we can wait until 2.6.16.
I have a cunning plan to fix module-init-tools in the meantime; expect a release if it works out...
Thanks all!
Rusty.
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman