dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers/misc
Lennart Poettering 4f5c791a85 DMI-based module autoloading
The patch below adds DMI/SMBIOS based module autoloading to the Linux
kernel. The idea is to load laptop drivers automatically (and other
drivers which cannot be autoloaded otherwise), based on the DMI system
identification information of the BIOS.

Right now most distros manually try to load all available laptop
drivers on bootup in the hope that at least one of them loads
successfully. This patch does away with all that, and uses udev to
automatically load matching drivers on the right machines.

Basically the patch just exports the DMI information that has been
parsed by the kernel anyway to userspace via a sysfs device
/sys/class/dmi/id and makes sure that proper modalias attributes are
available. Besides adding the "modalias" attribute it also adds
attributes for a few other DMI fields which might be useful for
writing udev rules.

This patch is not an attempt to export the entire DMI/SMBIOS data to
userspace. We already have "dmidecode" which parses the complete DMI
info from userspace. The purpose of this patch is machine model
identification and good udev integration.

To take advantage of DMI based module autoloading, a driver should
export one or more MODULE_ALIAS fields similar to these:

MODULE_ALIAS("dmi:*:svnMICRO-STARINT'LCO.,LTD:pnMS-1013:pvr0131*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
MODULE_ALIAS("dmi:*:svnMicro-StarInternational:pnMS-1058:pvr0581:rvnMSI:rnMS-1058:*:ct10:*");
MODULE_ALIAS("dmi:*:svnMicro-StarInternational:pnMS-1412:*:rvnMSI:rnMS-1412:*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
MODULE_ALIAS("dmi:*:svnNOTEBOOK:pnSAM2000:pvr0131*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");

These lines are specific to my msi-laptop.c driver. They are basically
just a concatenation of a few carefully selected DMI fields with all
potentially bad characters stripped.

Besides laptop drivers, modules like "hdaps", the i2c modules
and the hwmon modules are good candidates for "dmi:" MODULE_ALIAS
lines.

Besides merely exporting the DMI data via sysfs the patch adds
support for a few more DMI fields. Especially the CHASSIS fields are
very useful to identify different laptop modules. The patch also adds
working MODULE_ALIAS lines to my msi-laptop.c driver.

I'd like to thank Kay Sievers for helping me to clean up this patch
for posting it on lkml.

Patch is against Linus' current GIT HEAD. Should probably apply to
older kernels as well without modification.


Signed-off-by: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-07-11 16:09:00 -07:00
..
hdpuftrs PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
ibmasm [PATCH] mark struct file_operations const 5 2007-02-12 09:48:45 -08:00
Kconfig [PATCH] Add 93cx6 eeprom library 2007-07-08 22:16:36 -04:00
Makefile [PATCH] Add 93cx6 eeprom library 2007-07-08 22:16:36 -04:00
asus-laptop.c asus-laptop: version bump and lindent 2007-05-10 02:40:42 -04:00
eeprom_93cx6.c eeprom_93cx6: shorten pulse timing to match spec (bis) 2007-07-10 12:41:09 -04:00
ioc4.c [PATCH] IOC3/IOC4: PCI mem space resources 2007-02-11 10:51:25 -08:00
lkdtm.c [PATCH] assigning enum constant to char * is vile, even if it happens to be 0 2007-02-09 08:28:48 -08:00
msi-laptop.c DMI-based module autoloading 2007-07-11 16:09:00 -07:00
phantom.c Misc: phantom, take care of pci posting 2007-05-23 20:14:14 -07:00
sony-laptop.c sony-laptop: rename SONY_LAPTOP_OLD to a more meaningful SONYPI_COMPAT 2007-05-10 02:42:45 -04:00
thinkpad_acpi.c ACPI: thinkpad-acpi: do not use named sysfs groups 2007-05-31 12:53:00 -04:00
thinkpad_acpi.h ACPI: thinkpad-acpi: do not use named sysfs groups 2007-05-31 12:53:00 -04:00
tifm_7xx1.c misc/tifm_7xx1: replace deprecated irq flag 2007-06-01 08:18:28 -07:00
tifm_core.c tifm: layout fixes, small changes to comments and printfs 2007-05-01 13:04:15 +02:00