summaryrefslogtreecommitdiffstats
path: root/include/linux/dmi.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-01-19 20:55:50 +0100
committerJeff Garzik <jgarzik@redhat.com>2009-01-27 02:15:47 -0500
commitd7b1956fed33d30c4815e848fd7a143722916868 (patch)
tree611ed604c363b7e8b98c49126f11aa2e24cf857b /include/linux/dmi.h
parentabfe2d7b915c872f3a1fd203267cedebf90daa45 (diff)
downloadlinux-stable-d7b1956fed33d30c4815e848fd7a143722916868.tar.gz
linux-stable-d7b1956fed33d30c4815e848fd7a143722916868.tar.bz2
linux-stable-d7b1956fed33d30c4815e848fd7a143722916868.zip
DMI: Introduce dmi_first_match to make the interface more flexible
Some notebooks from HP have the problem that their BIOSes attempt to spin down hard drives before entering ACPI system states S4 and S5. This leads to a yo-yo effect during system power-off shutdown and the last phase of hibernation when the disk is first spun down by the kernel and then almost immediately turned on and off by the BIOS. This, in turn, may result in shortening the disk's life times. To prevent this from happening we can blacklist the affected systems using DMI information. However, only the on-board controlles should be blacklisted and their PCI slot numbers can be used for this purpose. Unfortunately the existing interface for checking DMI information of the system is not very convenient for this purpose, because to use it, we would have to define special callback functions or create a separate struct dmi_system_id table for each blacklisted system. To overcome this difficulty introduce a new function dmi_first_match() returning a pointer to the first entry in an array of struct dmi_system_id elements that matches the system DMI information. Then, we can use this pointer to access the entry's .driver_data field containing the additional information, such as the PCI slot number, allowing us to do the desired blacklisting. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'include/linux/dmi.h')
-rw-r--r--include/linux/dmi.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 34161907b2f8..aea23105d3ed 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -38,6 +38,7 @@ struct dmi_device {
#ifdef CONFIG_DMI
extern int dmi_check_system(const struct dmi_system_id *list);
+const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list);
extern const char * dmi_get_system_info(int field);
extern const struct dmi_device * dmi_find_device(int type, const char *name,
const struct dmi_device *from);