1
0
Fork 0
alistair23-linux/drivers
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
..
acorn [PATCH] fix request->cmd == INT cases 2007-07-10 08:03:34 +02:00
acpi ACPI: fix acpi_osi=!Linux 2007-07-02 21:06:48 -07:00
amba uevent: use add_uevent_var() instead of open coding it 2007-04-27 10:57:29 -07:00
ata [libata] sata_mv: print out additional chip info during probe 2007-07-09 12:29:31 -04:00
atm potential compiler error, irqfunc caller sites update 2007-07-06 10:23:43 -07:00
auxdisplay cfag12864bfb: Use sys_ instead of cfb_ framebuffer accessors 2007-06-01 08:18:28 -07:00
base firmware: remove orphaned Email 2007-06-08 12:41:08 -07:00
block Merge branch 'splice-2.6.23' of git://git.kernel.dk/data/git/linux-2.6-block 2007-07-10 13:51:06 -07:00
bluetooth [Bluetooth] Always send HCI_Reset for Broadcom devices 2007-05-24 14:26:15 +02:00
cdrom Remove legacy CDROM drivers 2007-07-10 08:03:34 +02:00
char sx: switch subven and subid values 2007-07-10 17:51:13 -07:00
clocksource ACPI: correct pathname in comment 2007-04-25 14:27:06 -04:00
connector [NETLINK]: Switch cb_lock spinlock to mutex and allow to override it 2007-04-25 22:29:03 -07:00
cpufreq Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
crypto [CRYPTO] geode: Fix in-place operations and set key 2007-05-24 21:23:24 +10:00
dio
dma IOATDMA: fix section mismatches 2007-06-28 11:34:53 -07:00
edac [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
eisa virtual_eisa_root_init() should be __init 2007-05-08 11:15:02 -07:00
fc4
firewire firewire: fw-sbp2: fix DMA mapping of management ORBs 2007-07-10 00:07:49 +02:00
firmware DMI-based module autoloading 2007-07-11 16:09:00 -07:00
hid Merge branches 'debug-module-param' and 'upstream' into for-linus 2007-07-09 14:23:37 +02:00
hwmon hwmon/coretemp: fix a broken error path 2007-06-24 08:59:10 -07:00
i2c [ARM] 4403/1: Make the PXA-I2C driver work with lockdep validator 2007-05-26 10:09:39 +01:00
ide [PATCH] fix request->cmd == INT cases 2007-07-10 08:03:34 +02:00
ieee1394 ieee1394: remove old isochronous ABI 2007-07-10 00:07:41 +02:00
infiniband IPoIB/cm: Partial error clean up unmaps wrong address 2007-07-02 20:48:31 -07:00
input Input: tsdev - fix broken usec-to-millisecs conversion 2007-07-10 00:43:06 -04:00
isdn isdn/diva: fix section mismatch 2007-06-08 17:23:33 -07:00
kvm KVM: Prevent guest fpu state from leaking into the host 2007-06-15 12:30:59 +03:00
leds [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
macintosh x86_64: Fix only make Macintosh drivers default on Macs 2007-06-22 18:41:18 -07:00
mca mca: add integrated device bus matching 2007-05-09 12:30:49 -07:00
md md: fix bug in error handling during raid1 repair 2007-06-16 13:16:15 -07:00
media V4L/DVB (5822): Fix the return value in ttpci_budget_init() 2007-07-03 15:11:21 -03:00
message [SCSI] fusion: fix for BZ 8426 - massive slowdown on SCSI CD/DVD drive 2007-06-05 11:04:56 -05:00
mfd SM501: Check SM501 ID register on initialisation 2007-06-24 08:59:11 -07:00
misc DMI-based module autoloading 2007-07-11 16:09:00 -07:00
mmc mmc: at91_mci: fix hanging and rework to match flowcharts 2007-07-09 21:29:07 +02:00
mtd [MIPS] remove LASAT Networks platforms support 2007-07-10 17:33:04 +01:00
net Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 2007-07-10 14:56:22 -07:00
nubus
oprofile Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
parisc [PARISC] stop lcd driver from stripping initial whitespace 2007-06-21 17:46:19 -04:00
parport [PARISC] fix section mismatch in parport_gsc 2007-05-27 12:13:53 -04:00
pci msi: mask the msix vector before we unmap it 2007-06-01 08:18:27 -07:00
pcmcia at91: fix enable/disable_irq_wake symmetry in pcmcia driver 2007-05-31 07:58:13 -07:00
pnp PNP SMCf010 quirk: work around Toshiba Portege 4000 ACPI issues 2007-07-06 10:23:43 -07:00
power [BATTERY] One Laptop Per Child power/battery driver 2007-07-10 11:28:22 +01:00
ps3 Merge branch 'linux-2.6' 2007-05-08 13:37:51 +10:00
rapidio
rtc RTC: use fallback IRQ if PNP tables don't provide one 2007-06-01 08:18:29 -07:00
s390 [S390] vmlogrdr function annotation. 2007-07-10 11:24:54 +02:00
sbus [SPARC]: Missing #include <linux/mm.h> in drivers/sbus/char/flash.c 2007-05-31 01:52:53 -07:00
scsi scsi disk help file is not complete 2007-07-02 10:12:34 -04:00
serial PCMCIA-NETDEV : add new ID of lan&modem multifunction card 2007-07-08 22:16:39 -04:00
sh
sn
spi Blackfin SPI driver: fix bug SPI DMA incomplete transmission 2007-06-11 17:34:17 +08:00
tc [MIPS] DEC: Fix modpost warning. 2007-07-10 17:33:05 +01:00
telephony [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
usb potential compiler error, irqfunc caller sites update 2007-07-06 10:23:43 -07:00
video fix section mismatch in chipsfb 2007-06-28 11:34:54 -07:00
w1 [BATTERY] ds2760 W1 slave 2007-07-10 11:28:31 +01:00
zorro Amiga Zorro bus: kill resource_size_t warnings 2007-05-04 17:59:08 -07:00
Kconfig Merge git://git.infradead.org/~dwmw2/battery-2.6 2007-07-10 14:47:59 -07:00
Makefile [BATTERY] Universal power supply class (was: battery class) 2007-07-10 11:25:44 +01:00