linux-stable-rt/scripts
Roman Kagan b19dcd9341 [PATCH] USB: scripts/mod/file2alias.c: handle numeric ranges for USB bcdDevice
Another attempt at that...

The attached patch fixes the longstanding problem with USB bcdDevice
numeric ranges incorrectly converted into patterns for MODULE_ALIAS
generation.  Previously it put both the lower and the upper limits into
the pattern, dlXdhY, making it impossible to fnmatch against except for
a few special cases, like dl*dh* or dlXdhX.

The patch makes it generate multiple MODULE_ALIAS lines covering the
whole range with fnmatch-able patterns.  E.g. for a range between 0x0001
and 0x8345 it gives the following patterns:

000[1-9]
00[1-9]*
0[1-9]*
[1-7]*
8[0-2]*
83[0-3]*
834[0-5]

Since bcdDevice is 2 bytes wide = 4 digits in hex representation, the
max no. of patters is 2 * 4 - 1 = 7.

The values are BCD (binary-coded decimals) and not hex, so patterns
using a dash seem to be safe regardless of locale collation order.

The patch changes bcdDevice part of the alias from dlXdhY to dZ, but
this shouldn't have big compatibility issues because fnmatch()-based
modprobing hasn't yet been widely used.  Besides, the most common (and
almost the only working) case of dl*dh* becomes d* and thus continues to
work.

The patch is against 2.6.12-rc2, applies to -mm3 with an offset.  The
matching patch to fix the MODALIAS environment variable now generated by
the usb hotplug function follows.

Signed-off-by: Roman Kagan <rkagan@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-04-22 15:07:01 -07:00
..
basic Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
genksyms Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
kconfig Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ksymoops Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
lxdialog Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mod [PATCH] USB: scripts/mod/file2alias.c: handle numeric ranges for USB bcdDevice 2005-04-22 15:07:01 -07:00
package Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Lindent Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile.build Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile.clean Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile.host Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile.lib Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile.modinst Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile.modpost Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
bin2c.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
binoffset.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
checkconfig.pl Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
checkincludes.pl Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
checkstack.pl Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
checkversion.pl Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
conmakehash.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
extract-ikconfig Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
gcc-version.sh Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
gen_initramfs_list.sh Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
kallsyms.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
kernel-doc Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
makelst Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
makeman Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mkcompile_h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mkmakefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mksysmap Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mkuboot.sh Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mkversion Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
namespace.pl Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
patch-kernel Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pnmtologo.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
reference_discarded.pl Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
reference_init.pl Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
show_delta Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
split-man Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ver_linux [PATCH] 2.6.12-rc1-mm3 Fix ver_linux script for no udev utils. 2005-04-18 21:57:33 -07:00