* [PATCH 03/34] arch specific changes for SMBIOS and System Firmware
[not found] <1310994528-26276-1-git-send-email-prarit@redhat.com>
2011-07-18 13:08 ` [PATCH 01/34] System Firmware Interface Prarit Bhargava
[not found] ` <1310994528-26276-1-git-send-email-prarit-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2011-07-18 13:08 ` Prarit Bhargava
2011-07-18 13:08 ` [PATCH 34/34] Remove old DMI & SMBIOS code and make SMBIOS default on Prarit Bhargava
3 siblings, 0 replies; 5+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
To: linux-kernel; +Cc: Prarit Bhargava, linux-ia64, x86
As part of the new SMBIOS and System Firmware code:
- add in ia64 and x86 calls to initialize SMBIOS
- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them
Cc: linux-ia64@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
arch/ia64/kernel/setup.c | 8 +-
arch/x86/include/asm/mmconfig.h | 4 +-
arch/x86/include/asm/pci_x86.h | 6 +-
arch/x86/kernel/acpi/boot.c | 177 ++++++++--------
arch/x86/kernel/acpi/sleep.c | 1 -
arch/x86/kernel/apic/apic.c | 20 +-
arch/x86/kernel/apic/bigsmp_32.c | 37 ++--
arch/x86/kernel/apm_32.c | 391 ++++++++++++++++++++++--------------
arch/x86/kernel/cpu/amd.c | 2 +-
arch/x86/kernel/cpu/vmware.c | 17 ++-
arch/x86/kernel/io_delay.c | 42 ++--
arch/x86/kernel/mmconf-fam10h_64.c | 28 ++--
arch/x86/kernel/probe_roms.c | 1 -
arch/x86/kernel/process.c | 8 +-
arch/x86/kernel/reboot.c | 132 +++++++------
arch/x86/kernel/setup.c | 14 +-
arch/x86/kernel/tsc.c | 16 +-
arch/x86/pci/acpi.c | 18 +-
arch/x86/pci/broadcom_bus.c | 1 -
arch/x86/pci/common.c | 163 ++++++++--------
arch/x86/pci/direct.c | 7 +-
arch/x86/pci/fixup.c | 33 ++--
arch/x86/pci/init.c | 4 +-
arch/x86/pci/irq.c | 26 ++--
arch/x86/pci/mmconfig-shared.c | 10 +-
arch/x86/pci/mrst.c | 1 -
drivers/cpufreq/acpi-cpufreq.c | 16 +-
drivers/cpufreq/powernow-k7.c | 14 +-
28 files changed, 657 insertions(+), 540 deletions(-)
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 5e2c724..e170fcc 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -36,7 +36,7 @@
#include <linux/string.h>
#include <linux/threads.h>
#include <linux/screen_info.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/efi.h>
@@ -1043,9 +1043,9 @@ check_bugs (void)
(unsigned long) __end___mckinley_e9_bundles);
}
-static int __init run_dmi_scan(void)
+static int __init run_smbios_scan(void)
{
- dmi_scan_machine();
+ smbios_init();
return 0;
}
-core_initcall(run_dmi_scan);
+core_initcall(run_smbios_scan);
diff --git a/arch/x86/include/asm/mmconfig.h b/arch/x86/include/asm/mmconfig.h
index 9b119da..1831965 100644
--- a/arch/x86/include/asm/mmconfig.h
+++ b/arch/x86/include/asm/mmconfig.h
@@ -3,10 +3,10 @@
#ifdef CONFIG_PCI_MMCONFIG
extern void __cpuinit fam10h_check_enable_mmcfg(void);
-extern void __cpuinit check_enable_amd_mmconf_dmi(void);
+extern void __cpuinit check_enable_amd_pci_mmconf(void);
#else
static inline void fam10h_check_enable_mmcfg(void) { }
-static inline void check_enable_amd_mmconf_dmi(void) { }
+static inline void check_enable_amd_pci_mmconf(void) { }
#endif
#endif /* _ASM_X86_MMCONFIG_H */
diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
index 7045267..28e3f3a 100644
--- a/arch/x86/include/asm/pci_x86.h
+++ b/arch/x86/include/asm/pci_x86.h
@@ -39,7 +39,7 @@ enum pci_bf_sort_state {
pci_bf_sort_default,
pci_force_nobf,
pci_force_bf,
- pci_dmi_bf,
+ pci_smbios_bf,
};
/* pci-i386.c */
@@ -109,8 +109,8 @@ extern bool port_cf9_safe;
extern int pci_direct_probe(void);
extern void pci_direct_init(int type);
extern void pci_pcbios_init(void);
-extern void __init dmi_check_pciprobe(void);
-extern void __init dmi_check_skip_isa_align(void);
+extern void __init smbios_check_pciprobe(void);
+extern void __init smbios_check_skip_isa_align(void);
/* some common used subsys_initcalls */
extern int __init pci_acpi_init(void);
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 4558f0d..180d4c7 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -29,7 +29,7 @@
#include <linux/efi.h>
#include <linux/cpumask.h>
#include <linux/module.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/irq.h>
#include <linux/slab.h>
#include <linux/bootmem.h>
@@ -1294,7 +1294,7 @@ static void __init acpi_process_madt(void)
return;
}
-static int __init disable_acpi_irq(const struct dmi_system_id *d)
+static int __init disable_acpi_irq(const struct sysfw_id *d)
{
if (!acpi_force) {
printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n",
@@ -1304,7 +1304,7 @@ static int __init disable_acpi_irq(const struct dmi_system_id *d)
return 0;
}
-static int __init disable_acpi_pci(const struct dmi_system_id *d)
+static int __init disable_acpi_pci(const struct sysfw_id *d)
{
if (!acpi_force) {
printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n",
@@ -1314,14 +1314,14 @@ static int __init disable_acpi_pci(const struct dmi_system_id *d)
return 0;
}
-static int __init dmi_disable_acpi(const struct dmi_system_id *d)
+static int __init id_disable_acpi(const struct sysfw_id *d)
{
if (!acpi_force) {
printk(KERN_NOTICE "%s detected: acpi off\n", d->ident);
disable_acpi();
} else {
- printk(KERN_NOTICE
- "Warning: DMI blacklist says broken, but acpi forced\n");
+ printk(KERN_NOTICE "Warning: SMBIOS blacklist says broken, "
+ "but acpi forced\n");
}
return 0;
}
@@ -1329,7 +1329,8 @@ static int __init dmi_disable_acpi(const struct dmi_system_id *d)
/*
* Force ignoring BIOS IRQ0 pin2 override
*/
-static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
+static int __init
+id_ignore_irq0_timer_override(const struct sysfw_id *d)
{
/*
* The ati_ixp4x0_rev() early PCI quirk should have set
@@ -1348,33 +1349,32 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
* If your system is blacklisted here, but you find that acpi=force
* works for you, please contact linux-acpi@vger.kernel.org
*/
-static struct dmi_system_id __initdata acpi_dmi_table[] = {
+static struct sysfw_id __initdata acpi_id_table[] = {
/*
* Boxes that need ACPI disabled
*/
{
- .callback = dmi_disable_acpi,
- .ident = "IBM Thinkpad",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
- DMI_MATCH(DMI_BOARD_NAME, "2629H1G"),
- },
+ .callback = id_disable_acpi,
+ .ident = "IBM Thinkpad",
+ .matches = {
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR, "IBM"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "2629H1G"),
+ },
},
-
/*
* Boxes that need ACPI PCI IRQ routing disabled
*/
{
- .callback = disable_acpi_irq,
- .ident = "ASUS A7V",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
- DMI_MATCH(DMI_BOARD_NAME, "<A7V>"),
- /* newer BIOS, Revision 1011, does work */
- DMI_MATCH(DMI_BIOS_VERSION,
- "ASUS A7V ACPI BIOS Revision 1007"),
- },
- },
+ .callback = disable_acpi_irq,
+ .ident = "ASUS A7V",
+ .matches = {
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR, "ASUSTeK Computer INC"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "<A7V>"),
+ /* newer BIOS, Revision 1011, does work */
+ SYSFW_MATCH(SYSFW_BIOS_VERSION,
+ "ASUS A7V ACPI BIOS Revision 1007"),
+ },
+ },
{
/*
* Latest BIOS for IBM 600E (1.16) has bad pcinum
@@ -1382,48 +1382,49 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
* interrupt links to work. DSDT fix is in bug 5966.
* 2645, 2646 model numbers are shared with 600/600E/600X
*/
- .callback = disable_acpi_irq,
- .ident = "IBM Thinkpad 600 Series 2645",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
- DMI_MATCH(DMI_BOARD_NAME, "2645"),
- },
- },
+ .callback = disable_acpi_irq,
+ .ident = "IBM Thinkpad 600 Series 2645",
+ .matches = {
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR, "IBM"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "2645"),
+ },
+ },
{
- .callback = disable_acpi_irq,
- .ident = "IBM Thinkpad 600 Series 2646",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
- DMI_MATCH(DMI_BOARD_NAME, "2646"),
- },
- },
+ .callback = disable_acpi_irq,
+ .ident = "IBM Thinkpad 600 Series 2646",
+ .matches = {
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR, "IBM"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "2646"),
+ },
+ },
/*
* Boxes that need ACPI PCI IRQ routing and PCI scan disabled
*/
{ /* _BBN 0 bug */
- .callback = disable_acpi_pci,
- .ident = "ASUS PR-DLS",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
- DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"),
- DMI_MATCH(DMI_BIOS_VERSION,
- "ASUS PR-DLS ACPI BIOS Revision 1010"),
- DMI_MATCH(DMI_BIOS_DATE, "03/21/2003")
- },
- },
+ .callback = disable_acpi_pci,
+ .ident = "ASUS PR-DLS",
+ .matches = {
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+ "ASUSTeK Computer INC."),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "PR-DLS"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION,
+ "ASUS PR-DLS ACPI BIOS Revision 1010"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "03/21/2003")
+ },
+ },
{
- .callback = disable_acpi_pci,
- .ident = "Acer TravelMate 36x Laptop",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
- DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
- },
- },
+ .callback = disable_acpi_pci,
+ .ident = "Acer TravelMate 36x Laptop",
+ .matches = {
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 360"),
+ },
+ },
{}
};
-/* second table for DMI checks that should run after early-quirks */
-static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
+/* second table for SMBIOS checks that should run after early-quirks */
+static struct sysfw_id __initdata acpi_id_late[] = {
/*
* HP laptops which use a DSDT reporting as HP/SB400/10000,
* which includes some code which overrides all temperature
@@ -1435,37 +1436,37 @@ static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
* override in that cases.
*/
{
- .callback = dmi_ignore_irq0_timer_override,
- .ident = "HP nx6115 laptop",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6115"),
- },
- },
+ .callback = id_ignore_irq0_timer_override,
+ .ident = "HP nx6115 laptop",
+ .matches = {
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP Compaq nx6115"),
+ },
+ },
{
- .callback = dmi_ignore_irq0_timer_override,
- .ident = "HP NX6125 laptop",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6125"),
- },
- },
+ .callback = id_ignore_irq0_timer_override,
+ .ident = "HP NX6125 laptop",
+ .matches = {
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP Compaq nx6125"),
+ },
+ },
{
- .callback = dmi_ignore_irq0_timer_override,
- .ident = "HP NX6325 laptop",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6325"),
- },
- },
+ .callback = id_ignore_irq0_timer_override,
+ .ident = "HP NX6325 laptop",
+ .matches = {
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP Compaq nx6325"),
+ },
+ },
{
- .callback = dmi_ignore_irq0_timer_override,
- .ident = "HP 6715b laptop",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 6715b"),
- },
- },
+ .callback = id_ignore_irq0_timer_override,
+ .ident = "HP 6715b laptop",
+ .matches = {
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP Compaq 6715b"),
+ },
+ },
{}
};
@@ -1490,7 +1491,7 @@ static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
void __init acpi_boot_table_init(void)
{
- dmi_check_system(acpi_dmi_table);
+ sysfw_callback(acpi_id_table);
/*
* If acpi_disabled, bail out
@@ -1541,7 +1542,7 @@ int __init early_acpi_boot_init(void)
int __init acpi_boot_init(void)
{
/* those are executed after early-quirks are executed */
- dmi_check_system(acpi_dmi_table_late);
+ sysfw_callback(acpi_id_late);
/*
* If acpi_disabled, bail out
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 103b6ab..c96b82d 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -8,7 +8,6 @@
#include <linux/acpi.h>
#include <linux/bootmem.h>
#include <linux/memblock.h>
-#include <linux/dmi.h>
#include <linux/cpumask.h>
#include <asm/segment.h>
#include <asm/desc.h>
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index b9338b8..a3a176d 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -30,7 +30,7 @@
#include <linux/dmar.h>
#include <linux/init.h>
#include <linux/cpu.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/smp.h>
#include <linux/mm.h>
@@ -162,7 +162,7 @@ early_param("nox2apic", setup_nox2apic);
unsigned long mp_lapic_addr;
int disable_apic;
-/* Disable local APIC timer from the kernel commandline or via dmi quirk */
+/* Disable local APIC timer from the kernel commandline or via smbios quirk */
static int disable_apic_timer __initdata;
/* Local APIC timer works in C2 */
int local_apic_timer_c2_ok;
@@ -2231,7 +2231,7 @@ static int __cpuinit apic_cluster_num(void)
static int __cpuinitdata multi_checked;
static int __cpuinitdata multi;
-static int __cpuinit set_multi(const struct dmi_system_id *d)
+static int __cpuinit set_multi(const struct sysfw_id *d)
{
if (multi)
return 0;
@@ -2240,24 +2240,24 @@ static int __cpuinit set_multi(const struct dmi_system_id *d)
return 0;
}
-static const __cpuinitconst struct dmi_system_id multi_dmi_table[] = {
+static const __cpuinitconst struct sysfw_id set_multi_table[] = {
{
.callback = set_multi,
.ident = "IBM System Summit2",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Summit2"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Summit2"),
},
},
{}
};
-static void __cpuinit dmi_check_multi(void)
+static void __cpuinit check_set_multi(void)
{
if (multi_checked)
return;
- dmi_check_system(multi_dmi_table);
+ sysfw_callback(set_multi_table);
multi_checked = 1;
}
@@ -2267,11 +2267,11 @@ static void __cpuinit dmi_check_multi(void)
* Thus far, the major user of this is IBM's Summit2 series:
* Clustered boxes may have unsynced TSC problems if they are
* multi-chassis.
- * Use DMI to check them
+ * Use SMBIOS to check them
*/
__cpuinit int apic_is_clustered_box(void)
{
- dmi_check_multi();
+ check_set_multi();
if (multi)
return 1;
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
index efd737e..76bee5d 100644
--- a/arch/x86/kernel/apic/bigsmp_32.c
+++ b/arch/x86/kernel/apic/bigsmp_32.c
@@ -7,7 +7,7 @@
#include <linux/cpumask.h>
#include <linux/kernel.h>
#include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/smp.h>
#include <asm/apicdef.h>
@@ -151,30 +151,35 @@ static void bigsmp_send_IPI_all(int vector)
bigsmp_send_IPI_mask(cpu_online_mask, vector);
}
-static int dmi_bigsmp; /* can be set by dmi scanners */
+static int smbios_bigsmp; /* can be set by smbios scanners */
-static int hp_ht_bigsmp(const struct dmi_system_id *d)
+static int hp_ht_bigsmp(const struct sysfw_id *d)
{
printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
- dmi_bigsmp = 1;
+ smbios_bigsmp = 1;
return 0;
}
-static const struct dmi_system_id bigsmp_dmi_table[] = {
- { hp_ht_bigsmp, "HP ProLiant DL760 G2",
- { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
- DMI_MATCH(DMI_BIOS_VERSION, "P44-"),
+static const struct sysfw_id bigsmp_id_table[] = {
+ {
+ .callback = hp_ht_bigsmp,
+ .ident = "HP ProLiant DL760 G2",
+ {
+ SYSFW_MATCH(SYSFW_BIOS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "P44-"),
}
},
-
- { hp_ht_bigsmp, "HP ProLiant DL740",
- { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
- DMI_MATCH(DMI_BIOS_VERSION, "P47-"),
+ {
+ .callback = hp_ht_bigsmp,
+ .ident = "HP ProLiant DL740",
+ {
+ SYSFW_MATCH(SYSFW_BIOS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "P47-"),
}
},
- { } /* NULL entry stops DMI scanning */
+ {} /* NULL entry stops SMBIOS scanning */
};
static void bigsmp_vector_allocation_domain(int cpu, struct cpumask *retmask)
@@ -186,11 +191,11 @@ static void bigsmp_vector_allocation_domain(int cpu, struct cpumask *retmask)
static int probe_bigsmp(void)
{
if (def_to_bigsmp)
- dmi_bigsmp = 1;
+ smbios_bigsmp = 1;
else
- dmi_check_system(bigsmp_dmi_table);
+ sysfw_callback(bigsmp_id_table);
- return dmi_bigsmp;
+ return smbios_bigsmp;
}
static struct apic apic_bigsmp = {
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 965a766..dd804ef 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -223,7 +223,7 @@
#include <linux/kernel.h>
#include <linux/freezer.h>
#include <linux/smp.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/suspend.h>
#include <linux/kthread.h>
#include <linux/jiffies.h>
@@ -1931,7 +1931,7 @@ static struct miscdevice apm_device = {
/* Simple "print if true" callback */
-static int __init print_if_true(const struct dmi_system_id *d)
+static int __init print_if_true(const struct sysfw_id *d)
{
printk("%s\n", d->ident);
return 0;
@@ -1941,7 +1941,7 @@ static int __init print_if_true(const struct dmi_system_id *d)
* Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it was
* disabled before the suspend. Linux used to get terribly confused by that.
*/
-static int __init broken_ps2_resume(const struct dmi_system_id *d)
+static int __init broken_ps2_resume(const struct sysfw_id *d)
{
printk(KERN_INFO "%s machine detected. Mousepad Resume Bug "
"workaround hopefully not needed.\n", d->ident);
@@ -1949,7 +1949,7 @@ static int __init broken_ps2_resume(const struct dmi_system_id *d)
}
/* Some bioses have a broken protected mode poweroff and need to use realmode */
-static int __init set_realmode_power_off(const struct dmi_system_id *d)
+static int __init set_realmode_power_off(const struct sysfw_id *d)
{
if (apm_info.realmode_power_off = 0) {
apm_info.realmode_power_off = 1;
@@ -1960,7 +1960,7 @@ static int __init set_realmode_power_off(const struct dmi_system_id *d)
}
/* Some laptops require interrupts to be enabled during APM calls */
-static int __init set_apm_ints(const struct dmi_system_id *d)
+static int __init set_apm_ints(const struct sysfw_id *d)
{
if (apm_info.allow_ints = 0) {
apm_info.allow_ints = 1;
@@ -1971,7 +1971,7 @@ static int __init set_apm_ints(const struct dmi_system_id *d)
}
/* Some APM bioses corrupt memory or just plain do not work */
-static int __init apm_is_horked(const struct dmi_system_id *d)
+static int __init apm_is_horked(const struct sysfw_id *d)
{
if (apm_info.disabled = 0) {
apm_info.disabled = 1;
@@ -1981,7 +1981,7 @@ static int __init apm_is_horked(const struct dmi_system_id *d)
return 0;
}
-static int __init apm_is_horked_d850md(const struct dmi_system_id *d)
+static int __init apm_is_horked_d850md(const struct sysfw_id *d)
{
if (apm_info.disabled = 0) {
apm_info.disabled = 1;
@@ -1994,7 +1994,7 @@ static int __init apm_is_horked_d850md(const struct dmi_system_id *d)
}
/* Some APM bioses hang on APM idle calls */
-static int __init apm_likes_to_melt(const struct dmi_system_id *d)
+static int __init apm_likes_to_melt(const struct sysfw_id *d)
{
if (apm_info.forbid_idle = 0) {
apm_info.forbid_idle = 1;
@@ -2019,7 +2019,7 @@ static int __init apm_likes_to_melt(const struct dmi_system_id *d)
* Phoenix A04 08/24/2000 is known bad (Dell Inspiron 5000e)
* Phoenix A07 09/29/2000 is known good (Dell Inspiron 5000)
*/
-static int __init broken_apm_power(const struct dmi_system_id *d)
+static int __init broken_apm_power(const struct sysfw_id *d)
{
apm_info.get_power_status_broken = 1;
printk(KERN_WARNING "BIOS strings suggest APM bugs, "
@@ -2031,7 +2031,7 @@ static int __init broken_apm_power(const struct dmi_system_id *d)
* This bios swaps the APM minute reporting bytes over (Many sony laptops
* have this problem).
*/
-static int __init swab_apm_power_in_minutes(const struct dmi_system_id *d)
+static int __init swab_apm_power_in_minutes(const struct sysfw_id *d)
{
apm_info.get_power_status_swabinminutes = 1;
printk(KERN_WARNING "BIOS strings suggest APM reports battery life "
@@ -2039,215 +2039,314 @@ static int __init swab_apm_power_in_minutes(const struct dmi_system_id *d)
return 0;
}
-static struct dmi_system_id __initdata apm_dmi_table[] = {
+static struct sysfw_id __initdata apm_id_table[] = {
{
- print_if_true,
+ .callback = print_if_true,
KERN_WARNING "IBM T23 - BIOS 1.03b+ and controller firmware 1.02+ may be needed for Linux APM.",
- { DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
- DMI_MATCH(DMI_BIOS_VERSION, "1AET38WW (1.01b)"), },
+ { SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "1AET38WW (1.01b)"),
+ },
},
{ /* Handle problems with APM on the C600 */
- broken_ps2_resume, "Dell Latitude C600",
- { DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Latitude C600"), },
+ .callback = broken_ps2_resume,
+ .ident = "Dell Latitude C600",
+ { SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Latitude C600")
+ },
},
{ /* Allow interrupts during suspend on Dell Latitude laptops*/
- set_apm_ints, "Dell Latitude",
- { DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Latitude C510"), }
+ .callback = set_apm_ints,
+ .ident = "Dell Latitude",
+ { SYSFW_MATCH(SYSFW_SYS_VENDOR,
+ "Dell Computer Corporation"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Latitude C510"),
+ },
},
{ /* APM crashes */
- apm_is_horked, "Dell Inspiron 2500",
- { DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 2500"),
- DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "A11"), },
+ .callback = apm_is_horked,
+ .ident = "Dell Inspiron 2500",
+ { SYSFW_MATCH(SYSFW_SYS_VENDOR,
+ "Dell Computer Corporation"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 2500"),
+ SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "A11"), },
},
{ /* Allow interrupts during suspend on Dell Inspiron laptops*/
- set_apm_ints, "Dell Inspiron", {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"), },
+ .callback = set_apm_ints,
+ .ident = "Dell Inspiron", {
+ SYSFW_MATCH(SYSFW_SYS_VENDOR,
+ "Dell Computer Corporation"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 4000"),
+ },
},
{ /* Handle problems with APM on Inspiron 5000e */
- broken_apm_power, "Dell Inspiron 5000e",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "A04"),
- DMI_MATCH(DMI_BIOS_DATE, "08/24/2000"), },
+ .callback = broken_apm_power,
+ .ident = "Dell Inspiron 5000e",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "A04"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "08/24/2000"),
+ },
},
{ /* Handle problems with APM on Inspiron 2500 */
- broken_apm_power, "Dell Inspiron 2500",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "A12"),
- DMI_MATCH(DMI_BIOS_DATE, "02/04/2002"), },
+ .callback = broken_apm_power,
+ .ident = "Dell Inspiron 2500",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "A12"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "02/04/2002"),
+ },
},
{ /* APM crashes */
- apm_is_horked, "Dell Dimension 4100",
- { DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "XPS-Z"),
- DMI_MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
- DMI_MATCH(DMI_BIOS_VERSION, "A11"), },
+ .callback = apm_is_horked,
+ .ident = "Dell Dimension 4100",
+ { SYSFW_MATCH(SYSFW_SYS_VENDOR,
+ "Dell Computer Corporation"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "XPS-Z"),
+ SYSFW_MATCH(SYSFW_BIOS_VENDOR, "Intel Corp."),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "A11"),
+ },
},
{ /* Allow interrupts during suspend on Compaq Laptops*/
- set_apm_ints, "Compaq 12XL125",
- { DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Compaq PC"),
- DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "4.06"), },
+ .callback = set_apm_ints,
+ .ident = "Compaq 12XL125",
+ { SYSFW_MATCH(SYSFW_SYS_VENDOR, "Compaq"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Compaq PC"),
+ SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "4.06"),
+ },
},
{ /* Allow interrupts during APM or the clock goes slow */
- set_apm_ints, "ASUSTeK",
- { DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "L8400K series Notebook PC"), },
+ .callback = set_apm_ints,
+ .ident = "ASUSTeK",
+ { SYSFW_MATCH(SYSFW_SYS_VENDOR,
+ "ASUSTeK Computer Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+ "L8400K series Notebook PC"),
+ },
},
{ /* APM blows on shutdown */
- apm_is_horked, "ABIT KX7-333[R]",
- { DMI_MATCH(DMI_BOARD_VENDOR, "ABIT"),
- DMI_MATCH(DMI_BOARD_NAME, "VT8367-8233A (KX7-333[R])"), },
+ .callback = apm_is_horked,
+ .ident = "ABIT KX7-333[R]",
+ { SYSFW_MATCH(SYSFW_BOARD_VENDOR, "ABIT"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME,
+ "VT8367-8233A (KX7-333[R])"), },
},
{ /* APM crashes */
- apm_is_horked, "Trigem Delhi3",
- { DMI_MATCH(DMI_SYS_VENDOR, "TriGem Computer, Inc"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Delhi3"), },
+ .callback = apm_is_horked,
+ .ident = "Trigem Delhi3",
+ { SYSFW_MATCH(SYSFW_SYS_VENDOR, "TriGem Computer, Inc"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Delhi3"),
+ },
},
{ /* APM crashes */
- apm_is_horked, "Fujitsu-Siemens",
- { DMI_MATCH(DMI_BIOS_VENDOR, "hoenix/FUJITSU SIEMENS"),
- DMI_MATCH(DMI_BIOS_VERSION, "Version1.01"), },
+ .callback = apm_is_horked,
+ .ident = "Fujitsu-Siemens",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "hoenix/FUJITSU SIEMENS"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "Version1.01")
+ },
},
{ /* APM crashes */
- apm_is_horked_d850md, "Intel D850MD",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
- DMI_MATCH(DMI_BIOS_VERSION, "MV85010A.86A.0016.P07.0201251536"), },
+ .callback = apm_is_horked_d850md,
+ .ident = "Intel D850MD",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR, "Intel Corp."),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION,
+ "MV85010A.86A.0016.P07.0201251536"),
+ },
},
{ /* APM crashes */
- apm_is_horked, "Intel D810EMO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
- DMI_MATCH(DMI_BIOS_VERSION, "MO81010A.86A.0008.P04.0004170800"), },
+ .callback = apm_is_horked,
+ .ident = "Intel D810EMO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR, "Intel Corp."),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION,
+ "MO81010A.86A.0008.P04.0004170800"),
+ },
},
{ /* APM crashes */
- apm_is_horked, "Dell XPS-Z",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
- DMI_MATCH(DMI_BIOS_VERSION, "A11"),
- DMI_MATCH(DMI_PRODUCT_NAME, "XPS-Z"), },
+ .callback = apm_is_horked,
+ .ident = "Dell XPS-Z",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR, "Intel Corp."),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "A11"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "XPS-Z"),
+ },
},
{ /* APM crashes */
- apm_is_horked, "Sharp PC-PJ/AX",
- { DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PC-PJ/AX"),
- DMI_MATCH(DMI_BIOS_VENDOR, "SystemSoft"),
- DMI_MATCH(DMI_BIOS_VERSION, "Version R2.08"), },
+ .callback = apm_is_horked,
+ .ident = "Sharp PC-PJ/AX",
+ { SYSFW_MATCH(SYSFW_SYS_VENDOR, "SHARP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PC-PJ/AX"),
+ SYSFW_MATCH(SYSFW_BIOS_VENDOR, "SystemSoft"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "Version R2.08"),
+ },
},
{ /* APM crashes */
- apm_is_horked, "Dell Inspiron 2500",
- { DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 2500"),
- DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "A11"), },
+ .callback = apm_is_horked,
+ .ident = "Dell Inspiron 2500",
+ { SYSFW_MATCH(SYSFW_SYS_VENDOR,
+ "Dell Computer Corporation"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron 2500"),
+ SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "A11"),
+ },
},
{ /* APM idle hangs */
- apm_likes_to_melt, "Jabil AMD",
- { DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
- DMI_MATCH(DMI_BIOS_VERSION, "0AASNP06"), },
+ .callback = apm_likes_to_melt,
+ .ident = "Jabil AMD",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "American Megatrends Inc."),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "0AASNP06"),
+ },
},
{ /* APM idle hangs */
- apm_likes_to_melt, "AMI Bios",
- { DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
- DMI_MATCH(DMI_BIOS_VERSION, "0AASNP05"), },
+ .callback = apm_likes_to_melt,
+ .ident = "AMI Bios",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "American Megatrends Inc."),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "0AASNP05"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-N505X(DE) */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "R0206H"),
- DMI_MATCH(DMI_BIOS_DATE, "08/23/99"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0206H"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "08/23/99"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-N505VX */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "W2K06H0"),
- DMI_MATCH(DMI_BIOS_DATE, "02/03/00"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "W2K06H0"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "02/03/00"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-XG29 */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "R0117A0"),
- DMI_MATCH(DMI_BIOS_DATE, "04/25/00"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0117A0"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "04/25/00"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-Z600NE */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "R0121Z1"),
- DMI_MATCH(DMI_BIOS_DATE, "05/11/00"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0121Z1"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "05/11/00"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-Z600NE */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "WME01Z1"),
- DMI_MATCH(DMI_BIOS_DATE, "08/11/00"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "WME01Z1"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "08/11/00"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-Z600LEK(DE) */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "R0206Z3"),
- DMI_MATCH(DMI_BIOS_DATE, "12/25/00"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0206Z3"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "12/25/00"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-Z505LS */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "R0203D0"),
- DMI_MATCH(DMI_BIOS_DATE, "05/12/00"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0203D0"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "05/12/00"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-Z505LS */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "R0203Z3"),
- DMI_MATCH(DMI_BIOS_DATE, "08/25/00"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0203Z3"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "08/25/00"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-Z505LS (with updated BIOS) */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "R0209Z3"),
- DMI_MATCH(DMI_BIOS_DATE, "05/12/01"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0209Z3"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "05/12/01"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-F104K */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "R0204K2"),
- DMI_MATCH(DMI_BIOS_DATE, "08/28/00"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0204K2"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "08/28/00"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-C1VN/C1VE */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "R0208P1"),
- DMI_MATCH(DMI_BIOS_DATE, "11/09/00"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0208P1"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "11/09/00"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-C1VE */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "R0204P1"),
- DMI_MATCH(DMI_BIOS_DATE, "09/12/00"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "R0204P1"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "09/12/00"),
+ },
},
{ /* Handle problems with APM on Sony Vaio PCG-C1VE */
- swab_apm_power_in_minutes, "Sony VAIO",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
- DMI_MATCH(DMI_BIOS_VERSION, "WXPO1Z3"),
- DMI_MATCH(DMI_BIOS_DATE, "10/26/01"), },
+ .callback = swab_apm_power_in_minutes,
+ .ident = "Sony VAIO",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Phoenix Technologies LTD"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "WXPO1Z3"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "10/26/01"),
+ },
},
{ /* broken PM poweroff bios */
- set_realmode_power_off, "Award Software v4.60 PGMA",
- { DMI_MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."),
- DMI_MATCH(DMI_BIOS_VERSION, "4.60 PGMA"),
- DMI_MATCH(DMI_BIOS_DATE, "134526184"), },
+ .callback = set_realmode_power_off,
+ .ident = "Award Software v4.60 PGMA",
+ { SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+ "Award Software International, Inc."),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "4.60 PGMA"),
+ SYSFW_MATCH(SYSFW_BIOS_DATE, "134526184"),
+ },
},
/* Generic per vendor APM settings */
{ /* Allow interrupts during suspend on IBM laptops */
- set_apm_ints, "IBM",
- { DMI_MATCH(DMI_SYS_VENDOR, "IBM"), },
+ .callback = set_apm_ints,
+ .ident = "IBM",
+ {
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+ },
},
-
- { }
+ {}
};
/*
@@ -2265,7 +2364,7 @@ static int __init apm_init(void)
struct desc_struct *gdt;
int err;
- dmi_check_system(apm_dmi_table);
+ sysfw_callback(apm_id_table);
if (apm_info.bios.version = 0 || paravirt_enabled() || machine_is_olpc()) {
printk(KERN_INFO "apm: BIOS not found.\n");
@@ -2288,7 +2387,7 @@ static int __init apm_init(void)
apm_info.get_power_status_broken = 1;
if (realmode_power_off)
apm_info.realmode_power_off = 1;
- /* User can override, but default is to trust DMI */
+ /* User can override, but default is to trust SMBIOS */
if (apm_disabled != -1)
apm_info.disabled = apm_disabled;
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index b13ed39..79fd786 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -587,7 +587,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
if (c->x86 = 0x10) {
/* do this for boot cpu */
if (c = &boot_cpu_data)
- check_enable_amd_mmconf_dmi();
+ check_enable_amd_pci_mmconf();
fam10h_check_enable_mmcfg();
}
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index d22d0c4..e427451 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -21,7 +21,7 @@
*
*/
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/module.h>
#include <asm/div64.h>
#include <asm/x86_init.h>
@@ -85,8 +85,18 @@ static void __init vmware_platform_setup(void)
"Failed to get TSC freq from the hypervisor\n");
}
+static struct sysfw_id vmware_id_table[] = {
+ {
+ .ident = "VMware",
+ .matches = {
+ SYSFW_MATCH(SYSFW_PRODUCT_SERIAL, "VMWare"),
+ },
+ },
+ {},
+};
+
/*
- * While checking the dmi string information, just checking the product
+ * While checking the smbios string information, just checking the product
* serial key should be enough, as this will always have a VMware
* specific string when running under VMware hypervisor.
*/
@@ -100,8 +110,7 @@ static bool __init vmware_platform(void)
&hyper_vendor_id[1], &hyper_vendor_id[2]);
if (!memcmp(hyper_vendor_id, "VMwareVMware", 12))
return true;
- } else if (dmi_available && dmi_name_in_serial("VMware") &&
- __vmware_platform())
+ } else if (sysfw_callback(vmware_id_table) && __vmware_platform())
return true;
return false;
diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c
index a979b5b..27c0390 100644
--- a/arch/x86/kernel/io_delay.c
+++ b/arch/x86/kernel/io_delay.c
@@ -1,7 +1,7 @@
/*
* I/O delay strategies for inb_p/outb_p
*
- * Allow for a DMI based override of port 0x80, needed for certain HP laptops
+ * Allow for a SMBIOS based override of port 0x80, needed for certain HP laptops
* and possibly other systems. Also allow for the gradual elimination of
* outb_p/inb_p API uses.
*/
@@ -9,7 +9,7 @@
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/io.h>
int io_delay_type __read_mostly = CONFIG_DEFAULT_IO_DELAY_TYPE;
@@ -44,7 +44,7 @@ void native_io_delay(void)
}
EXPORT_SYMBOL(native_io_delay);
-static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
+static int __init io_delay_0xed_port(const struct sysfw_id *id)
{
if (io_delay_type = CONFIG_IO_DELAY_TYPE_0X80) {
pr_notice("%s: using 0xed I/O delay port\n", id->ident);
@@ -58,54 +58,54 @@ static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
* Quirk table for systems that misbehave (lock up, etc.) if port
* 0x80 is used:
*/
-static struct dmi_system_id __initdata io_delay_0xed_port_dmi_table[] = {
+static struct sysfw_id __initdata io_delay_0xed_port_table[] = {
{
- .callback = dmi_io_delay_0xed_port,
+ .callback = io_delay_0xed_port,
.ident = "Compaq Presario V6000",
.matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
- DMI_MATCH(DMI_BOARD_NAME, "30B7")
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Quanta"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "30B7")
}
},
{
- .callback = dmi_io_delay_0xed_port,
+ .callback = io_delay_0xed_port,
.ident = "HP Pavilion dv9000z",
.matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
- DMI_MATCH(DMI_BOARD_NAME, "30B9")
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Quanta"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "30B9")
}
},
{
- .callback = dmi_io_delay_0xed_port,
+ .callback = io_delay_0xed_port,
.ident = "HP Pavilion dv6000",
.matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
- DMI_MATCH(DMI_BOARD_NAME, "30B8")
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Quanta"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "30B8")
}
},
{
- .callback = dmi_io_delay_0xed_port,
+ .callback = io_delay_0xed_port,
.ident = "HP Pavilion tx1000",
.matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
- DMI_MATCH(DMI_BOARD_NAME, "30BF")
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Quanta"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "30BF")
}
},
{
- .callback = dmi_io_delay_0xed_port,
+ .callback = io_delay_0xed_port,
.ident = "Presario F700",
.matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
- DMI_MATCH(DMI_BOARD_NAME, "30D3")
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Quanta"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "30D3")
}
},
- { }
+ {}
};
void __init io_delay_init(void)
{
if (!io_delay_override)
- dmi_check_system(io_delay_0xed_port_dmi_table);
+ sysfw_callback(io_delay_0xed_port_table);
}
static int __init io_delay_param(char *s)
diff --git a/arch/x86/kernel/mmconf-fam10h_64.c b/arch/x86/kernel/mmconf-fam10h_64.c
index ac861b8..f24400a 100644
--- a/arch/x86/kernel/mmconf-fam10h_64.c
+++ b/arch/x86/kernel/mmconf-fam10h_64.c
@@ -6,7 +6,7 @@
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/pci.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/range.h>
#include <asm/pci-direct.h>
@@ -213,25 +213,25 @@ void __cpuinit fam10h_check_enable_mmcfg(void)
wrmsrl(address, val);
}
-static int __init set_check_enable_amd_mmconf(const struct dmi_system_id *d)
+static int __init set_check_enable_amd_mmconf(const struct sysfw_id *d)
{
- pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF;
- return 0;
+ pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF;
+ return 0;
}
-static const struct dmi_system_id __initconst mmconf_dmi_table[] = {
- {
- .callback = set_check_enable_amd_mmconf,
- .ident = "Sun Microsystems Machine",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sun Microsystems"),
- },
- },
+static const struct sysfw_id __initconst mmconf_id_table[] = {
+ {
+ .callback = set_check_enable_amd_mmconf,
+ .ident = "Sun Microsystems Machine",
+ .matches = {
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sun Microsystems"),
+ },
+ },
{}
};
/* Called from a __cpuinit function, but only on the BSP. */
-void __ref check_enable_amd_mmconf_dmi(void)
+void __ref check_enable_amd_pci_mmconf(void)
{
- dmi_check_system(mmconf_dmi_table);
+ sysfw_callback(mmconf_id_table);
}
diff --git a/arch/x86/kernel/probe_roms.c b/arch/x86/kernel/probe_roms.c
index ba0a4cc..e36d641 100644
--- a/arch/x86/kernel/probe_roms.c
+++ b/arch/x86/kernel/probe_roms.c
@@ -7,7 +7,6 @@
#include <linux/console.h>
#include <linux/init.h>
#include <linux/edd.h>
-#include <linux/dmi.h>
#include <linux/pfn.h>
#include <linux/pci.h>
#include <asm/pci-direct.h>
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index e1ba8cb..c1d7c54 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -10,7 +10,7 @@
#include <linux/clockchips.h>
#include <linux/random.h>
#include <linux/user-return-notifier.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/utsname.h>
#include <trace/events/power.h>
#include <linux/hw_breakpoint.h>
@@ -94,15 +94,15 @@ void show_regs_common(void)
{
const char *vendor, *product, *board;
- vendor = dmi_get_system_info(DMI_SYS_VENDOR);
+ vendor = sysfw_lookup(SYSFW_SYS_VENDOR);
if (!vendor)
vendor = "";
- product = dmi_get_system_info(DMI_PRODUCT_NAME);
+ product = sysfw_lookup(SYSFW_PRODUCT_NAME);
if (!product)
product = "";
/* Board Name is optional */
- board = dmi_get_system_info(DMI_BOARD_NAME);
+ board = sysfw_lookup(SYSFW_BOARD_NAME);
printk(KERN_CONT "\n");
printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s",
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 4f0d46f..b3837c5 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -3,7 +3,7 @@
#include <linux/init.h>
#include <linux/pm.h>
#include <linux/efi.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/sched.h>
#include <linux/tboot.h>
#include <linux/delay.h>
@@ -127,7 +127,7 @@ __setup("reboot=", reboot_setup);
* Some machines require the "reboot=b" commandline option,
* this quirk makes that automatic.
*/
-static int __init set_bios_reboot(const struct dmi_system_id *d)
+static int __init set_bios_reboot(const struct sysfw_id *d)
{
if (reboot_type != BOOT_BIOS) {
reboot_type = BOOT_BIOS;
@@ -136,178 +136,186 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
return 0;
}
-static struct dmi_system_id __initdata reboot_dmi_table[] = {
+static struct sysfw_id __initdata reboot_id_table[] = {
{ /* Handle problems with rebooting on Dell E520's */
.callback = set_bios_reboot,
.ident = "Dell E520",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Dell DM061"),
},
},
{ /* Handle problems with rebooting on Dell 1300's */
.callback = set_bios_reboot,
.ident = "Dell PowerEdge 1300",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR,
+ "Dell Computer Corporation"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 1300/"),
},
},
{ /* Handle problems with rebooting on Dell 300's */
.callback = set_bios_reboot,
.ident = "Dell PowerEdge 300",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR,
+ "Dell Computer Corporation"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 300/"),
},
},
{ /* Handle problems with rebooting on Dell Optiplex 745's SFF*/
.callback = set_bios_reboot,
.ident = "Dell OptiPlex 745",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 745"),
},
},
{ /* Handle problems with rebooting on Dell Optiplex 745's DFF*/
.callback = set_bios_reboot,
.ident = "Dell OptiPlex 745",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
- DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 745"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "0MM599"),
},
},
{ /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */
.callback = set_bios_reboot,
.ident = "Dell OptiPlex 745",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
- DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 745"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "0KW626"),
},
},
{ /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
.callback = set_bios_reboot,
.ident = "Dell OptiPlex 330",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
- DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 330"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "0KP561"),
},
},
{ /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */
.callback = set_bios_reboot,
.ident = "Dell OptiPlex 360",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
- DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 360"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "0T656F"),
},
},
{ /* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G*/
.callback = set_bios_reboot,
.ident = "Dell OptiPlex 760",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 760"),
- DMI_MATCH(DMI_BOARD_NAME, "0G919G"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex 760"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "0G919G"),
},
},
{ /* Handle problems with rebooting on Dell 2400's */
.callback = set_bios_reboot,
.ident = "Dell PowerEdge 2400",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR,
+ "Dell Computer Corporation"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 2400"),
},
},
{ /* Handle problems with rebooting on Dell T5400's */
.callback = set_bios_reboot,
.ident = "Dell Precision T5400",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+ "Precision WorkStation T5400"),
},
},
{ /* Handle problems with rebooting on Dell T7400's */
.callback = set_bios_reboot,
.ident = "Dell Precision T7400",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T7400"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+ "Precision WorkStation T7400"),
},
},
{ /* Handle problems with rebooting on HP laptops */
.callback = set_bios_reboot,
.ident = "HP Compaq Laptop",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP Compaq"),
},
},
{ /* Handle problems with rebooting on Dell XPS710 */
.callback = set_bios_reboot,
.ident = "Dell XPS710",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Dell XPS710"),
},
},
{ /* Handle problems with rebooting on Dell DXP061 */
.callback = set_bios_reboot,
.ident = "Dell DXP061",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Dell DXP061"),
},
},
{ /* Handle problems with rebooting on Sony VGN-Z540N */
.callback = set_bios_reboot,
.ident = "Sony VGN-Z540N",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-Z540N"),
},
},
{ /* Handle problems with rebooting on CompuLab SBC-FITPC2 */
.callback = set_bios_reboot,
.ident = "CompuLab SBC-FITPC2",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "CompuLab"),
- DMI_MATCH(DMI_PRODUCT_NAME, "SBC-FITPC2"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "CompuLab"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SBC-FITPC2"),
},
},
{ /* Handle problems with rebooting on ASUS P4S800 */
.callback = set_bios_reboot,
.ident = "ASUS P4S800",
.matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
- DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+ "ASUSTeK Computer INC."),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "P4S800"),
},
},
{ /* Handle problems with rebooting on VersaLogic Menlow boards */
.callback = set_bios_reboot,
.ident = "VersaLogic Menlow based board",
.matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "VersaLogic Corporation"),
- DMI_MATCH(DMI_BOARD_NAME, "VersaLogic Menlow board"),
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+ "VersaLogic Corporation"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME,
+ "VersaLogic Menlow board"),
},
},
{ /* Handle reboot issue on Acer Aspire one */
.callback = set_bios_reboot,
.ident = "Acer Aspire One A110",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
- DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AOA110"),
},
},
- { }
+ {}
};
static int __init reboot_init(void)
{
- dmi_check_system(reboot_dmi_table);
+ sysfw_callback(reboot_id_table);
return 0;
}
core_initcall(reboot_init);
@@ -376,7 +384,7 @@ EXPORT_SYMBOL(machine_real_restart);
/*
* Some Apple MacBook and MacBookPro's needs reboot=p to be able to reboot
*/
-static int __init set_pci_reboot(const struct dmi_system_id *d)
+static int __init set_pci_reboot(const struct sysfw_id *d)
{
if (reboot_type != BOOT_CF9) {
reboot_type = BOOT_CF9;
@@ -386,45 +394,45 @@ static int __init set_pci_reboot(const struct dmi_system_id *d)
return 0;
}
-static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
+static struct sysfw_id __initdata pci_reboot_id_table[] = {
{ /* Handle problems with rebooting on Apple MacBook5 */
.callback = set_pci_reboot,
.ident = "Apple MacBook5",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MacBook5"),
},
},
{ /* Handle problems with rebooting on Apple MacBookPro5 */
.callback = set_pci_reboot,
.ident = "Apple MacBookPro5",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MacBookPro5"),
},
},
{ /* Handle problems with rebooting on Apple Macmini3,1 */
.callback = set_pci_reboot,
.ident = "Apple Macmini3,1",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Macmini3,1"),
},
},
{ /* Handle problems with rebooting on the iMac9,1. */
.callback = set_pci_reboot,
.ident = "Apple iMac9,1",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple Inc."),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "iMac9,1"),
},
},
- { }
+ {}
};
static int __init pci_reboot_init(void)
{
- dmi_check_system(pci_reboot_dmi_table);
+ sysfw_callback(pci_reboot_id_table);
return 0;
}
core_initcall(pci_reboot_init);
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index afaf384..8b74838 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -44,7 +44,7 @@
#include <linux/iscsi_ibft.h>
#include <linux/nodemask.h>
#include <linux/kexec.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
#include <linux/pfn.h>
#include <linux/pci.h>
#include <asm/pci-direct.h>
@@ -81,7 +81,7 @@
#include <asm/timer.h>
#include <asm/i8259.h>
#include <asm/sections.h>
-#include <asm/dmi.h>
+#include <asm/smbios.h>
#include <asm/io_apic.h>
#include <asm/ist.h>
#include <asm/setup_arch.h>
@@ -123,8 +123,8 @@
unsigned long max_low_pfn_mapped;
unsigned long max_pfn_mapped;
-#ifdef CONFIG_DMI
-RESERVE_BRK(dmi_alloc, 65536);
+#ifdef CONFIG_SMBIOS
+RESERVE_BRK(smbios_alloc, SMBIOS_SIZE);
#endif
@@ -834,11 +834,11 @@ void __init setup_arch(char **cmdline_p)
if (efi_enabled)
efi_init();
- dmi_scan_machine();
+ smbios_init();
/*
- * VMware detection requires dmi to be available, so this
- * needs to be done after dmi_scan_machine, for the BP.
+ * VMware detection requires smbios to be available, so this
+ * needs to be done after smbios_init(), for the BP.
*/
init_hypervisor_platform();
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 6cc6922..36c4160 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -5,7 +5,7 @@
#include <linux/timer.h>
#include <linux/acpi_pmtmr.h>
#include <linux/cpufreq.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/delay.h>
#include <linux/clocksource.h>
#include <linux/percpu.h>
@@ -800,22 +800,22 @@ void mark_tsc_unstable(char *reason)
EXPORT_SYMBOL_GPL(mark_tsc_unstable);
-static int __init dmi_mark_tsc_unstable(const struct dmi_system_id *d)
+static int __init quirk_mark_tsc_unstable(const struct sysfw_id *d)
{
printk(KERN_NOTICE "%s detected: marking TSC unstable.\n",
- d->ident);
+ d->ident);
tsc_unstable = 1;
return 0;
}
/* List of systems that have known TSC problems */
-static struct dmi_system_id __initdata bad_tsc_dmi_table[] = {
+static struct sysfw_id __initdata bad_tsc_table[] = {
{
- .callback = dmi_mark_tsc_unstable,
+ .callback = quirk_mark_tsc_unstable,
.ident = "IBM Thinkpad 380XD",
.matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
- DMI_MATCH(DMI_BOARD_NAME, "2635FA0"),
+ SYSFW_MATCH(SYSFW_BOARD_VENDOR, "IBM"),
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "2635FA0"),
},
},
{}
@@ -1011,7 +1011,7 @@ void __init tsc_init(void)
use_tsc_delay();
/* Check and install the TSC clocksource */
- dmi_check_system(bad_tsc_dmi_table);
+ sysfw_callback(bad_tsc_table);
if (unsynchronized_tsc())
mark_tsc_unstable("TSCs unsynchronized");
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 68c3c13..51517a1 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -2,7 +2,7 @@
#include <linux/acpi.h>
#include <linux/init.h>
#include <linux/irq.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/slab.h>
#include <asm/numa.h>
#include <asm/pci_x86.h>
@@ -18,20 +18,20 @@ struct pci_root_info {
static bool pci_use_crs = true;
-static int __init set_use_crs(const struct dmi_system_id *id)
+static int __init set_use_crs(const struct sysfw_id *id)
{
pci_use_crs = true;
return 0;
}
-static const struct dmi_system_id pci_use_crs_table[] __initconst = {
+static const struct sysfw_id pci_use_crs_table[] __initconst = {
/* http://bugzilla.kernel.org/show_bug.cgi?id\x14183 */
{
.callback = set_use_crs,
.ident = "IBM System x3800",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
- DMI_MATCH(DMI_PRODUCT_NAME, "x3800"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "x3800"),
},
},
/* https://bugzilla.kernel.org/show_bug.cgi?id\x16007 */
@@ -40,7 +40,7 @@ static const struct dmi_system_id pci_use_crs_table[] __initconst = {
.callback = set_use_crs,
.ident = "ASRock ALiveSATA2-GLAN",
.matches = {
- DMI_MATCH(DMI_PRODUCT_NAME, "ALiveSATA2-GLAN"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ALiveSATA2-GLAN"),
},
},
{}
@@ -48,12 +48,10 @@ static const struct dmi_system_id pci_use_crs_table[] __initconst = {
void __init pci_acpi_crs_quirks(void)
{
- int year;
-
- if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && year < 2008)
+ if (!(sysfw_get_date() >= 20080000))
pci_use_crs = false;
- dmi_check_system(pci_use_crs_table);
+ sysfw_callback(pci_use_crs_table);
/*
* If the user specifies "pci=use_crs" or "pci=nocrs" explicitly, that
diff --git a/arch/x86/pci/broadcom_bus.c b/arch/x86/pci/broadcom_bus.c
index ab8269b..c332b7b 100644
--- a/arch/x86/pci/broadcom_bus.c
+++ b/arch/x86/pci/broadcom_bus.c
@@ -11,7 +11,6 @@
#include <linux/acpi.h>
#include <linux/delay.h>
-#include <linux/dmi.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <asm/pci_x86.h>
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 5fe7502..ee193bd 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -8,7 +8,8 @@
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
+#include <linux/sysfw.h>
#include <linux/slab.h>
#include <asm/acpi.h>
@@ -79,14 +80,15 @@ struct pci_ops pci_root_ops = {
*/
DEFINE_RAW_SPINLOCK(pci_config_lock);
-static int __devinit can_skip_ioresource_align(const struct dmi_system_id *d)
+static int __devinit can_skip_ioresource_align(const struct sysfw_id *d)
{
pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident);
return 0;
}
-static const struct dmi_system_id can_skip_pciprobe_dmi_table[] __devinitconst = {
+static const struct sysfw_id
+can_skip_pciprobe_smbios_table[] __devinitconst = {
/*
* Systems where PCI IO resource ISA alignment can be skipped
* when the ISA enable bit in the bridge control is not set
@@ -95,32 +97,32 @@ static const struct dmi_system_id can_skip_pciprobe_dmi_table[] __devinitconst .callback = can_skip_ioresource_align,
.ident = "IBM System x3800",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
- DMI_MATCH(DMI_PRODUCT_NAME, "x3800"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "x3800"),
},
},
{
.callback = can_skip_ioresource_align,
.ident = "IBM System x3850",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
- DMI_MATCH(DMI_PRODUCT_NAME, "x3850"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "x3850"),
},
},
{
.callback = can_skip_ioresource_align,
.ident = "IBM System x3950",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
- DMI_MATCH(DMI_PRODUCT_NAME, "x3950"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "x3950"),
},
},
{}
};
-void __init dmi_check_skip_isa_align(void)
+void __init smbios_check_skip_isa_align(void)
{
- dmi_check_system(can_skip_pciprobe_dmi_table);
+ sysfw_callback(can_skip_pciprobe_smbios_table);
}
static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
@@ -173,32 +175,37 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b)
}
/*
- * Only use DMI information to set this if nothing was passed
+ * Only use SMBIOS information to set this if nothing was passed
* on the kernel command line (which was parsed earlier).
*/
-static int __devinit set_bf_sort(const struct dmi_system_id *d)
+static int __devinit set_bf_sort(const struct sysfw_id *d)
{
if (pci_bf_sort = pci_bf_sort_default) {
- pci_bf_sort = pci_dmi_bf;
+ pci_bf_sort = pci_smbios_bf;
printk(KERN_INFO "PCI: %s detected, enabling pci¿sort.\n", d->ident);
}
return 0;
}
-static void __devinit read_dmi_type_b1(const struct dmi_header *dm,
- void *private_data)
+static int __devinit dell_sort_method_decode(const union smbios_struct *ss,
+ void *data)
{
- u8 *d = (u8 *)dm + 4;
+ u8 *p;
+ const struct sysfw_id *d = (const struct sysfw_id *)data;
- if (dm->type != 0xB1)
- return;
- switch (((*(u32 *)d) >> 9) & 0x03) {
+ if ((ss->header.type) != 0xb1)
+ return SMBIOS_WALK_CONTINUE;
+
+ p = (u8 *)ss + 4;
+ switch (((*(u32 *)p) >> 9) & 0x03) {
case 0x00:
- printk(KERN_INFO "dmi type 0xB1 record - unknown flag\n");
+ printk(KERN_INFO "smbios type 0xB1 record - unknown flag\n");
break;
case 0x01: /* set pci¿sort */
smbios_type_b1_flag = 1;
+ set_bf_sort(d);
+ return SMBIOS_WALK_STOP;
break;
case 0x02: /* do not set pci¿sort */
smbios_type_b1_flag = 2;
@@ -206,24 +213,22 @@ static void __devinit read_dmi_type_b1(const struct dmi_header *dm,
default:
break;
}
-}
-static int __devinit find_sort_method(const struct dmi_system_id *d)
-{
- dmi_walk(read_dmi_type_b1, NULL);
+ return SMBIOS_WALK_STOP;
- if (smbios_type_b1_flag = 1) {
- set_bf_sort(d);
- return 0;
- }
- return -1;
+}
+static int __devinit find_sort_method(const struct sysfw_id *d)
+{
+ if (smbios_walk(dell_sort_method_decode, (void *)d))
+ return 1;
+ return 0;
}
/*
* Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)
*/
#ifdef __i386__
-static int __devinit assign_all_busses(const struct dmi_system_id *d)
+static int __devinit assign_all_busses(const struct sysfw_id *d)
{
pci_probe |= PCI_ASSIGN_ALL_BUSSES;
printk(KERN_INFO "%s detected: enabling PCI bus# renumbering"
@@ -232,7 +237,7 @@ static int __devinit assign_all_busses(const struct dmi_system_id *d)
}
#endif
-static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
+static const struct sysfw_id __devinitconst pciprobe_smbios_table[] = {
#ifdef __i386__
/*
* Laptops which need pci=assign-busses to see Cardbus cards
@@ -241,8 +246,8 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
.callback = assign_all_busses,
.ident = "Samsung X20 Laptop",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Samsung Electronics"),
- DMI_MATCH(DMI_PRODUCT_NAME, "SX20S"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Samsung Electronics"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SX20S"),
},
},
#endif /* __i386__ */
@@ -250,151 +255,151 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
.callback = find_sort_method,
.ident = "Dell System",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc"),
},
},
{
.callback = set_bf_sort,
.ident = "Dell PowerEdge 1950",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1950"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 1950"),
},
},
{
.callback = set_bf_sort,
.ident = "Dell PowerEdge 1955",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1955"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 1955"),
},
},
{
.callback = set_bf_sort,
.ident = "Dell PowerEdge 2900",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2900"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 2900"),
},
},
{
.callback = set_bf_sort,
.ident = "Dell PowerEdge 2950",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2950"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge 2950"),
},
},
{
.callback = set_bf_sort,
.ident = "Dell PowerEdge R900",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
- DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R900"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PowerEdge R900"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant BL20p G3",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL20p G3"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL20p G3"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant BL20p G4",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL20p G4"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL20p G4"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant BL30p G1",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL30p G1"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL30p G1"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant BL25p G1",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL25p G1"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL25p G1"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant BL35p G1",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL35p G1"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL35p G1"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant BL45p G1",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL45p G1"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL45p G1"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant BL45p G2",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL45p G2"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL45p G2"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant BL460c G1",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL460c G1"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL460c G1"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant BL465c G1",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL465c G1"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL465c G1"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant BL480c G1",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL480c G1"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL480c G1"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant BL685c G1",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant BL685c G1"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant BL685c G1"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant DL360",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL360"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant DL360"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant DL380",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL380"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant DL380"),
},
},
#ifdef __i386__
@@ -402,8 +407,8 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
.callback = assign_all_busses,
.ident = "Compaq EVO N800c",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
- DMI_MATCH(DMI_PRODUCT_NAME, "EVO N800c"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Compaq"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "EVO N800c"),
},
},
#endif
@@ -411,24 +416,24 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
.callback = set_bf_sort,
.ident = "HP ProLiant DL385 G2",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL385 G2"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant DL385 G2"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant DL585 G2",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "HP"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL585 G2"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "HP"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ProLiant DL585 G2"),
},
},
{}
};
-void __init dmi_check_pciprobe(void)
+void __init smbios_check_pciprobe(void)
{
- dmi_check_system(pciprobe_dmi_table);
+ sysfw_callback(pciprobe_smbios_table);
}
struct pci_bus * __devinit pcibios_scan_root(int busnum)
diff --git a/arch/x86/pci/direct.c b/arch/x86/pci/direct.c
index e6fd847..217d788 100644
--- a/arch/x86/pci/direct.c
+++ b/arch/x86/pci/direct.c
@@ -4,7 +4,7 @@
#include <linux/pci.h>
#include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <asm/pci_x86.h>
/*
@@ -192,14 +192,13 @@ struct pci_raw_ops pci_direct_conf2 = {
static int __init pci_sanity_check(struct pci_raw_ops *o)
{
u32 x = 0;
- int year, devfn;
+ int devfn;
if (pci_probe & PCI_NO_CHECKS)
return 1;
/* Assume Type 1 works for newer systems.
This handles machines that don't have anything on PCI Bus 0. */
- dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL);
- if (year >= 2001)
+ if (sysfw_get_date() >= 20010000)
return 1;
for (devfn = 0; devfn < 0x100; devfn++) {
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 6dd8955..381c136 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -3,7 +3,7 @@
*/
#include <linux/delay.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <asm/pci_x86.h>
@@ -356,12 +356,12 @@ static void __devinit pci_fixup_video(struct pci_dev *pdev)
DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
-static const struct dmi_system_id __devinitconst msi_k8t_dmi_table[] = {
+static const struct sysfw_id __devinitconst msi_k8t_quirk_table[] = {
{
.ident = "MSI-K8T-Neo2Fir",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "MSI"),
- DMI_MATCH(DMI_PRODUCT_NAME, "MS-6702E"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "MSI"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MS-6702E"),
},
},
{}
@@ -375,12 +375,12 @@ static const struct dmi_system_id __devinitconst msi_k8t_dmi_table[] = {
* the corresponding register-value to enable the soundcard.
*
* The soundcard is only enabled, if the mainborad is identified
- * via DMI-tables and the soundcard is detected to be off.
+ * via SMBIOS tables and the soundcard is detected to be off.
*/
static void __devinit pci_fixup_msi_k8t_onboard_sound(struct pci_dev *dev)
{
unsigned char val;
- if (!dmi_check_system(msi_k8t_dmi_table))
+ if (!sysfw_callback(msi_k8t_quirk_table))
return; /* only applies to MSI K8T Neo2-FIR */
pci_read_config_byte(dev, 0x50, &val);
@@ -413,34 +413,35 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237,
*/
static u16 toshiba_line_size;
-static const struct dmi_system_id __devinitconst toshiba_ohci1394_dmi_table[] = {
+static const struct sysfw_id __devinitconst
+toshiba_ohci1394_quirk_table[] = {
{
.ident = "Toshiba PS5 based laptop",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
- DMI_MATCH(DMI_PRODUCT_VERSION, "PS5"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+ SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "PS5"),
},
},
{
.ident = "Toshiba PSM4 based laptop",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
- DMI_MATCH(DMI_PRODUCT_VERSION, "PSM4"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+ SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "PSM4"),
},
},
{
.ident = "Toshiba A40 based laptop",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
- DMI_MATCH(DMI_PRODUCT_VERSION, "PSA40U"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+ SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "PSA40U"),
},
},
- { }
+ {}
};
static void __devinit pci_pre_fixup_toshiba_ohci1394(struct pci_dev *dev)
{
- if (!dmi_check_system(toshiba_ohci1394_dmi_table))
+ if (!sysfw_callback(toshiba_ohci1394_quirk_table))
return; /* only applies to certain Toshibas (so far) */
dev->current_state = PCI_D3cold;
@@ -451,7 +452,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, 0x8032,
static void __devinit pci_post_fixup_toshiba_ohci1394(struct pci_dev *dev)
{
- if (!dmi_check_system(toshiba_ohci1394_dmi_table))
+ if (!sysfw_callback(toshiba_ohci1394_quirk_table))
return; /* only applies to certain Toshibas (so far) */
/* Restore config space on Toshiba laptops */
diff --git a/arch/x86/pci/init.c b/arch/x86/pci/init.c
index adb62aa..9afdbc3 100644
--- a/arch/x86/pci/init.c
+++ b/arch/x86/pci/init.c
@@ -35,9 +35,9 @@ static __init int pci_arch_init(void)
printk(KERN_ERR
"PCI: Fatal: No config space access function found\n");
- dmi_check_pciprobe();
+ smbios_check_pciprobe();
- dmi_check_skip_isa_align();
+ smbios_check_skip_isa_align();
return 0;
}
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index 372e9b8..3e2ac8f 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -9,7 +9,7 @@
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/interrupt.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/io.h>
#include <linux/smp.h>
#include <asm/io_apic.h>
@@ -1070,7 +1070,7 @@ void __init pcibios_fixup_irqs(void)
* Work around broken HP Pavilion Notebooks which assign USB to
* IRQ 9 even though it is actually wired to IRQ 11
*/
-static int __init fix_broken_hp_bios_irq9(const struct dmi_system_id *d)
+static int __init fix_broken_hp_bios_irq9(const struct sysfw_id *d)
{
if (!broken_hp_bios_irq9) {
broken_hp_bios_irq9 = 1;
@@ -1084,7 +1084,7 @@ static int __init fix_broken_hp_bios_irq9(const struct dmi_system_id *d)
* Work around broken Acer TravelMate 360 Notebooks which assign
* Cardbus to IRQ 11 even though it is actually wired to IRQ 10
*/
-static int __init fix_acer_tm360_irqrouting(const struct dmi_system_id *d)
+static int __init fix_acer_tm360_irqrouting(const struct sysfw_id *d)
{
if (!acer_tm360_irqrouting) {
acer_tm360_irqrouting = 1;
@@ -1094,27 +1094,27 @@ static int __init fix_acer_tm360_irqrouting(const struct dmi_system_id *d)
return 0;
}
-static struct dmi_system_id __initdata pciirq_dmi_table[] = {
+static struct sysfw_id __initdata pciirq_quirk_table[] = {
{
.callback = fix_broken_hp_bios_irq9,
.ident = "HP Pavilion N5400 Series Laptop",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_BIOS_VERSION, "GE.M1.03"),
- DMI_MATCH(DMI_PRODUCT_VERSION,
- "HP Pavilion Notebook Model GE"),
- DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "GE.M1.03"),
+ SYSFW_MATCH(SYSFW_PRODUCT_VERSION,
+ "HP Pavilion Notebook Model GE"),
+ SYSFW_MATCH(SYSFW_BOARD_VERSION, "OmniBook N32N-736"),
},
},
{
.callback = fix_acer_tm360_irqrouting,
.ident = "Acer TravelMate 36x Laptop",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
- DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 360"),
},
},
- { }
+ {}
};
void __init pcibios_irq_init(void)
@@ -1124,7 +1124,7 @@ void __init pcibios_irq_init(void)
if (raw_pci_ops = NULL)
return;
- dmi_check_system(pciirq_dmi_table);
+ sysfw_callback(pciirq_quirk_table);
pirq_table = pirq_find_routing_table();
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index 750c346..730b36b 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -15,7 +15,7 @@
#include <linux/acpi.h>
#include <linux/sfi_acpi.h>
#include <linux/bitmap.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/slab.h>
#include <asm/e820.h>
#include <asm/pci_x86.h>
@@ -514,19 +514,15 @@ static int __initdata known_bridge;
static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
struct acpi_mcfg_allocation *cfg)
{
- int year;
-
if (cfg->address < 0xFFFFFFFF)
return 0;
if (!strcmp(mcfg->header.oem_id, "SGI"))
return 0;
- if (mcfg->header.revision >= 1) {
- if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) &&
- year >= 2010)
+ if (mcfg->header.revision >= 1)
+ if (sysfw_get_date() >= 20100000)
return 0;
- }
printk(KERN_ERR PREFIX "MCFG region for %04x [bus %02x-%02x] at %#llx "
"is above 4GB, ignored\n", cfg->pci_segment,
diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c
index cb29191..741dbb0 100644
--- a/arch/x86/pci/mrst.c
+++ b/arch/x86/pci/mrst.c
@@ -22,7 +22,6 @@
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/init.h>
-#include <linux/dmi.h>
#include <asm/acpi.h>
#include <asm/segment.h>
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 596d5dd..6880c41 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -32,7 +32,7 @@
#include <linux/sched.h>
#include <linux/cpufreq.h>
#include <linux/compiler.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/slab.h>
#include <linux/acpi.h>
@@ -462,23 +462,23 @@ static int __init acpi_cpufreq_early_init(void)
*/
static int bios_with_sw_any_bug;
-static int sw_any_bug_found(const struct dmi_system_id *d)
+static int sw_any_bug_found(const struct sysfw_id *d)
{
bios_with_sw_any_bug = 1;
return 0;
}
-static const struct dmi_system_id sw_any_bug_dmi_table[] = {
+static const struct sysfw_id sw_any_bug_table[] = {
{
.callback = sw_any_bug_found,
.ident = "Supermicro Server X6DLP",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Supermicro"),
- DMI_MATCH(DMI_BIOS_VERSION, "080010"),
- DMI_MATCH(DMI_PRODUCT_NAME, "X6DLP"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Supermicro"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "080010"),
+ SYSFW_MATCH(SYSFW_PRODUCT_NAME, "X6DLP"),
},
},
- { }
+ {}
};
static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)
@@ -554,7 +554,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
cpumask_copy(policy->related_cpus, perf->shared_cpu_map);
#ifdef CONFIG_SMP
- dmi_check_system(sw_any_bug_dmi_table);
+ sysfw_callback(sw_any_bug_table);
if (bios_with_sw_any_bug && cpumask_weight(policy->cpus) = 1) {
policy->shared_type = CPUFREQ_SHARED_TYPE_ALL;
cpumask_copy(policy->cpus, cpu_core_mask(cpu));
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c
index d71d9f3..ce33c9f 100644
--- a/drivers/cpufreq/powernow-k7.c
+++ b/drivers/cpufreq/powernow-k7.c
@@ -21,7 +21,7 @@
#include <linux/cpufreq.h>
#include <linux/slab.h>
#include <linux/string.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/timex.h>
#include <linux/io.h>
@@ -598,7 +598,7 @@ static unsigned int powernow_get(unsigned int cpu)
}
-static int __cpuinit acer_cpufreq_pst(const struct dmi_system_id *d)
+static int __cpuinit acer_cpufreq_pst(const struct sysfw_id *d)
{
printk(KERN_WARNING PFX
"%s laptop with broken PST tables in BIOS detected.\n",
@@ -616,16 +616,16 @@ static int __cpuinit acer_cpufreq_pst(const struct dmi_system_id *d)
* A BIOS update is all that can save them.
* Mention this, and disable cpufreq.
*/
-static struct dmi_system_id __cpuinitdata powernow_dmi_table[] = {
+static struct sysfw_id __cpuinitdata powernow_id_table[] = {
{
.callback = acer_cpufreq_pst,
.ident = "Acer Aspire",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Insyde Software"),
- DMI_MATCH(DMI_BIOS_VERSION, "3A71"),
+ SYSFW_MATCH(SYSFW_SYS_VENDOR, "Insyde Software"),
+ SYSFW_MATCH(SYSFW_BIOS_VERSION, "3A71"),
},
},
- { }
+ {}
};
static int __cpuinit powernow_cpu_init(struct cpufreq_policy *policy)
@@ -647,7 +647,7 @@ static int __cpuinit powernow_cpu_init(struct cpufreq_policy *policy)
}
pr_debug("FSB: %3dMHz\n", fsb/1000);
- if (dmi_check_system(powernow_dmi_table) || acpi_force) {
+ if (sysfw_callback(powernow_id_table) || acpi_force) {
printk(KERN_INFO PFX "PSB/PST known to be broken. "
"Trying ACPI instead\n");
result = powernow_acpi_init();
--
1.6.5.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 34/34] Remove old DMI & SMBIOS code and make SMBIOS default on
[not found] <1310994528-26276-1-git-send-email-prarit@redhat.com>
` (2 preceding siblings ...)
2011-07-18 13:08 ` [PATCH 03/34] arch specific changes for SMBIOS and System Firmware Prarit Bhargava
@ 2011-07-18 13:08 ` Prarit Bhargava
3 siblings, 0 replies; 5+ messages in thread
From: Prarit Bhargava @ 2011-07-18 13:08 UTC (permalink / raw)
To: linux-kernel
Cc: linux-ia64, linux-pci, dri-devel, platform-driver-x86,
grant.likely, linux-ide, linux-i2c, device-drivers-devel, abelay,
Prarit Bhargava, eric.piel, x86, lm-sensors, linux-acpi,
linux-input, linux-media, johnpol, linux-watchdog, rtc-linux, dz,
openipmi-developer, evel, netdev, linux-usb, rpurdie,
linux-crypto
This code has now been completely replaced by the new System Firmware
Interface (SYSFW) and SMBIOS code. It is no longer needed in the kernel.
Cc: linux-ia64@vger.kernel.org
Cc: x86@kernel.org
Cc: linux-acpi@vger.kernel.org
Cc: linux-ide@vger.kernel.org
Cc: openipmi-developer@lists.sourceforge.net
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-crypto@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: lm-sensors@lm-sensors.org
Cc: linux-i2c@vger.kernel.org
Cc: linux-ide@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: linux-media@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: rtc-linux@googlegroups.com
Cc: evel@driverdev.osuosl.org
Cc: linux-usb@vger.kernel.org
Cc: device-drivers-devel@blackfin.uclinux.org
Cc: linux-watchdog@vger.kernel.org
Cc: grant.likely@secretlab.ca
Cc: dz@debian.org
Cc: rpurdie@rpsys.net
Cc: eric.piel@tremplin-utc.net
Cc: abelay@mit.edu
Cc: johnpol@2ka.mipt.ru
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
arch/ia64/include/asm/dmi.h | 12 -
arch/x86/Kconfig | 9 -
arch/x86/include/asm/dmi.h | 19 -
drivers/firmware/Kconfig | 20 -
drivers/firmware/Makefile | 3 -
drivers/firmware/dmi-id.c | 245 -------------
drivers/firmware/dmi-sysfs.c | 696 ------------------------------------
drivers/firmware/dmi_scan.c | 751 ---------------------------------------
include/linux/dmi.h | 139 -------
include/linux/mod_devicetable.h | 55 ---
10 files changed, 0 insertions(+), 1949 deletions(-)
delete mode 100644 arch/ia64/include/asm/dmi.h
delete mode 100644 arch/x86/include/asm/dmi.h
delete mode 100644 drivers/firmware/dmi-id.c
delete mode 100644 drivers/firmware/dmi-sysfs.c
delete mode 100644 drivers/firmware/dmi_scan.c
delete mode 100644 include/linux/dmi.h
diff --git a/arch/ia64/include/asm/dmi.h b/arch/ia64/include/asm/dmi.h
deleted file mode 100644
index 1ed4c8f..0000000
--- a/arch/ia64/include/asm/dmi.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASM_DMI_H
-#define _ASM_DMI_H 1
-
-#include <linux/slab.h>
-#include <asm/io.h>
-
-/* Use normal IO mappings for DMI */
-#define dmi_ioremap ioremap
-#define dmi_iounmap(x,l) iounmap(x)
-#define dmi_alloc(l) kmalloc(l, GFP_ATOMIC)
-
-#endif
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e7cdde8..92ee12b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -626,15 +626,6 @@ config APB_TIMER
# Mark as expert because too many people got it wrong.
# The code disables itself when not needed.
-config DMI
- default y
- bool "Enable DMI scanning" if EXPERT
- ---help---
- Enabled scanning of DMI to identify machine quirks. Say Y
- here unless you have verified that your setup is not
- affected by entries in the DMI blacklist. Required by PNP
- BIOS code.
-
config SMBIOS
depends on SYSTEM_FIRMWARE
bool "Enable SMBIOS scanning" if EXPERT
diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h
deleted file mode 100644
index fd8f9e2..0000000
--- a/arch/x86/include/asm/dmi.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _ASM_X86_DMI_H
-#define _ASM_X86_DMI_H
-
-#include <linux/compiler.h>
-#include <linux/init.h>
-
-#include <asm/io.h>
-#include <asm/setup.h>
-
-static __always_inline __init void *dmi_alloc(unsigned len)
-{
- return extend_brk(len, sizeof(int));
-}
-
-/* Use early IO mappings for DMI because it's initialized early */
-#define dmi_ioremap early_ioremap
-#define dmi_iounmap early_iounmap
-
-#endif /* _ASM_X86_DMI_H */
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 23066d8..a46c162 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -104,26 +104,6 @@ config DCDBAS
Say Y or M here to enable the driver for use by Dell systems
management software such as Dell OpenManage.
-config DMIID
- bool "Export DMI identification via sysfs to userspace"
- depends on DMI
- default y
- help
- Say Y here if you want to query SMBIOS/DMI system identification
- information from userspace through /sys/class/dmi/id/ or if you want
- DMI-based module auto-loading.
-
-config DMI_SYSFS
- tristate "DMI table support in sysfs"
- depends on SYSFS && DMI
- default n
- help
- Say Y or M here to enable the exporting of the raw DMI table
- data via sysfs. This is useful for consuming the data without
- requiring any access to /dev/mem at all. Tables are found
- under /sys/firmware/dmi when this option is enabled and
- loaded.
-
config ISCSI_IBFT_FIND
bool "iSCSI Boot Firmware Table Attributes"
depends on X86
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 5c9d81f..f372289 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -1,14 +1,11 @@
#
# Makefile for the linux kernel.
#
-obj-$(CONFIG_DMI) += dmi_scan.o
-obj-$(CONFIG_DMI_SYSFS) += dmi-sysfs.o
obj-$(CONFIG_EDD) += edd.o
obj-$(CONFIG_EFI_VARS) += efivars.o
obj-$(CONFIG_EFI_PCDP) += pcdp.o
obj-$(CONFIG_DELL_RBU) += dell_rbu.o
obj-$(CONFIG_DCDBAS) += dcdbas.o
-obj-$(CONFIG_DMIID) += dmi-id.o
obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o
obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
deleted file mode 100644
index 94a58a0..0000000
--- a/drivers/firmware/dmi-id.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Export SMBIOS/DMI info via sysfs to userspace
- *
- * Copyright 2007, Lennart Poettering
- *
- * Licensed under GPLv2
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/dmi.h>
-#include <linux/device.h>
-#include <linux/slab.h>
-
-struct dmi_device_attribute{
- struct device_attribute dev_attr;
- int field;
-};
-#define to_dmi_dev_attr(_dev_attr) \
- container_of(_dev_attr, struct dmi_device_attribute, dev_attr)
-
-static ssize_t sys_dmi_field_show(struct device *dev,
- struct device_attribute *attr,
- char *page)
-{
- int field = to_dmi_dev_attr(attr)->field;
- ssize_t len;
- len = scnprintf(page, PAGE_SIZE, "%s\n", dmi_get_system_info(field));
- page[len-1] = '\n';
- return len;
-}
-
-#define DMI_ATTR(_name, _mode, _show, _field) \
- { .dev_attr = __ATTR(_name, _mode, _show, NULL), \
- .field = _field }
-
-#define DEFINE_DMI_ATTR_WITH_SHOW(_name, _mode, _field) \
-static struct dmi_device_attribute sys_dmi_##_name##_attr = \
- DMI_ATTR(_name, _mode, sys_dmi_field_show, _field);
-
-DEFINE_DMI_ATTR_WITH_SHOW(bios_vendor, 0444, DMI_BIOS_VENDOR);
-DEFINE_DMI_ATTR_WITH_SHOW(bios_version, 0444, DMI_BIOS_VERSION);
-DEFINE_DMI_ATTR_WITH_SHOW(bios_date, 0444, DMI_BIOS_DATE);
-DEFINE_DMI_ATTR_WITH_SHOW(sys_vendor, 0444, DMI_SYS_VENDOR);
-DEFINE_DMI_ATTR_WITH_SHOW(product_name, 0444, DMI_PRODUCT_NAME);
-DEFINE_DMI_ATTR_WITH_SHOW(product_version, 0444, DMI_PRODUCT_VERSION);
-DEFINE_DMI_ATTR_WITH_SHOW(product_serial, 0400, DMI_PRODUCT_SERIAL);
-DEFINE_DMI_ATTR_WITH_SHOW(product_uuid, 0400, DMI_PRODUCT_UUID);
-DEFINE_DMI_ATTR_WITH_SHOW(board_vendor, 0444, DMI_BOARD_VENDOR);
-DEFINE_DMI_ATTR_WITH_SHOW(board_name, 0444, DMI_BOARD_NAME);
-DEFINE_DMI_ATTR_WITH_SHOW(board_version, 0444, DMI_BOARD_VERSION);
-DEFINE_DMI_ATTR_WITH_SHOW(board_serial, 0400, DMI_BOARD_SERIAL);
-DEFINE_DMI_ATTR_WITH_SHOW(board_asset_tag, 0444, DMI_BOARD_ASSET_TAG);
-DEFINE_DMI_ATTR_WITH_SHOW(chassis_vendor, 0444, DMI_CHASSIS_VENDOR);
-DEFINE_DMI_ATTR_WITH_SHOW(chassis_type, 0444, DMI_CHASSIS_TYPE);
-DEFINE_DMI_ATTR_WITH_SHOW(chassis_version, 0444, DMI_CHASSIS_VERSION);
-DEFINE_DMI_ATTR_WITH_SHOW(chassis_serial, 0400, DMI_CHASSIS_SERIAL);
-DEFINE_DMI_ATTR_WITH_SHOW(chassis_asset_tag, 0444, DMI_CHASSIS_ASSET_TAG);
-
-static void ascii_filter(char *d, const char *s)
-{
- /* Filter out characters we don't want to see in the modalias string */
- for (; *s; s++)
- if (*s > ' ' && *s < 127 && *s != ':')
- *(d++) = *s;
-
- *d = 0;
-}
-
-static ssize_t get_modalias(char *buffer, size_t buffer_size)
-{
- static const struct mafield {
- const char *prefix;
- int field;
- } fields[] = {
- { "bvn", DMI_BIOS_VENDOR },
- { "bvr", DMI_BIOS_VERSION },
- { "bd", DMI_BIOS_DATE },
- { "svn", DMI_SYS_VENDOR },
- { "pn", DMI_PRODUCT_NAME },
- { "pvr", DMI_PRODUCT_VERSION },
- { "rvn", DMI_BOARD_VENDOR },
- { "rn", DMI_BOARD_NAME },
- { "rvr", DMI_BOARD_VERSION },
- { "cvn", DMI_CHASSIS_VENDOR },
- { "ct", DMI_CHASSIS_TYPE },
- { "cvr", DMI_CHASSIS_VERSION },
- { NULL, DMI_NONE }
- };
-
- ssize_t l, left;
- char *p;
- const struct mafield *f;
-
- strcpy(buffer, "dmi");
- p = buffer + 3; left = buffer_size - 4;
-
- for (f = fields; f->prefix && left > 0; f++) {
- const char *c;
- char *t;
-
- c = dmi_get_system_info(f->field);
- if (!c)
- continue;
-
- t = kmalloc(strlen(c) + 1, GFP_KERNEL);
- if (!t)
- break;
- ascii_filter(t, c);
- l = scnprintf(p, left, ":%s%s", f->prefix, t);
- kfree(t);
-
- p += l;
- left -= l;
- }
-
- p[0] = ':';
- p[1] = 0;
-
- return p - buffer + 1;
-}
-
-static ssize_t sys_dmi_modalias_show(struct device *dev,
- struct device_attribute *attr, char *page)
-{
- ssize_t r;
- r = get_modalias(page, PAGE_SIZE-1);
- page[r] = '\n';
- page[r+1] = 0;
- return r+1;
-}
-
-static struct device_attribute sys_dmi_modalias_attr - __ATTR(modalias, 0444, sys_dmi_modalias_show, NULL);
-
-static struct attribute *sys_dmi_attributes[DMI_STRING_MAX+2];
-
-static struct attribute_group sys_dmi_attribute_group = {
- .attrs = sys_dmi_attributes,
-};
-
-static const struct attribute_group* sys_dmi_attribute_groups[] = {
- &sys_dmi_attribute_group,
- NULL
-};
-
-static int dmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
-{
- ssize_t len;
-
- if (add_uevent_var(env, "MODALIAS="))
- return -ENOMEM;
- len = get_modalias(&env->buf[env->buflen - 1],
- sizeof(env->buf) - env->buflen);
- if (len >= (sizeof(env->buf) - env->buflen))
- return -ENOMEM;
- env->buflen += len;
- return 0;
-}
-
-static struct class dmi_class = {
- .name = "dmi",
- .dev_release = (void(*)(struct device *)) kfree,
- .dev_uevent = dmi_dev_uevent,
-};
-
-static struct device *dmi_dev;
-
-/* Initialization */
-
-#define ADD_DMI_ATTR(_name, _field) \
- if (dmi_get_system_info(_field)) \
- sys_dmi_attributes[i++] = &sys_dmi_##_name##_attr.dev_attr.attr;
-
-/* In a separate function to keep gcc 3.2 happy - do NOT merge this in
- dmi_id_init! */
-static void __init dmi_id_init_attr_table(void)
-{
- int i;
-
- /* Not necessarily all DMI fields are available on all
- * systems, hence let's built an attribute table of just
- * what's available */
- i = 0;
- ADD_DMI_ATTR(bios_vendor, DMI_BIOS_VENDOR);
- ADD_DMI_ATTR(bios_version, DMI_BIOS_VERSION);
- ADD_DMI_ATTR(bios_date, DMI_BIOS_DATE);
- ADD_DMI_ATTR(sys_vendor, DMI_SYS_VENDOR);
- ADD_DMI_ATTR(product_name, DMI_PRODUCT_NAME);
- ADD_DMI_ATTR(product_version, DMI_PRODUCT_VERSION);
- ADD_DMI_ATTR(product_serial, DMI_PRODUCT_SERIAL);
- ADD_DMI_ATTR(product_uuid, DMI_PRODUCT_UUID);
- ADD_DMI_ATTR(board_vendor, DMI_BOARD_VENDOR);
- ADD_DMI_ATTR(board_name, DMI_BOARD_NAME);
- ADD_DMI_ATTR(board_version, DMI_BOARD_VERSION);
- ADD_DMI_ATTR(board_serial, DMI_BOARD_SERIAL);
- ADD_DMI_ATTR(board_asset_tag, DMI_BOARD_ASSET_TAG);
- ADD_DMI_ATTR(chassis_vendor, DMI_CHASSIS_VENDOR);
- ADD_DMI_ATTR(chassis_type, DMI_CHASSIS_TYPE);
- ADD_DMI_ATTR(chassis_version, DMI_CHASSIS_VERSION);
- ADD_DMI_ATTR(chassis_serial, DMI_CHASSIS_SERIAL);
- ADD_DMI_ATTR(chassis_asset_tag, DMI_CHASSIS_ASSET_TAG);
- sys_dmi_attributes[i++] = &sys_dmi_modalias_attr.attr;
-}
-
-static int __init dmi_id_init(void)
-{
- int ret;
-
- if (!dmi_available)
- return -ENODEV;
-
- dmi_id_init_attr_table();
-
- ret = class_register(&dmi_class);
- if (ret)
- return ret;
-
- dmi_dev = kzalloc(sizeof(*dmi_dev), GFP_KERNEL);
- if (!dmi_dev) {
- ret = -ENOMEM;
- goto fail_class_unregister;
- }
-
- dmi_dev->class = &dmi_class;
- dev_set_name(dmi_dev, "id");
- dmi_dev->groups = sys_dmi_attribute_groups;
-
- ret = device_register(dmi_dev);
- if (ret)
- goto fail_free_dmi_dev;
-
- return 0;
-
-fail_free_dmi_dev:
- kfree(dmi_dev);
-fail_class_unregister:
-
- class_unregister(&dmi_class);
-
- return ret;
-}
-
-arch_initcall(dmi_id_init);
diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c
deleted file mode 100644
index eb26d62..0000000
--- a/drivers/firmware/dmi-sysfs.c
+++ /dev/null
@@ -1,696 +0,0 @@
-/*
- * dmi-sysfs.c
- *
- * This module exports the DMI tables read-only to userspace through the
- * sysfs file system.
- *
- * Data is currently found below
- * /sys/firmware/dmi/...
- *
- * DMI attributes are presented in attribute files with names
- * formatted using %d-%d, so that the first integer indicates the
- * structure type (0-255), and the second field is the instance of that
- * entry.
- *
- * Copyright 2011 Google, Inc.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kobject.h>
-#include <linux/dmi.h>
-#include <linux/capability.h>
-#include <linux/slab.h>
-#include <linux/list.h>
-#include <linux/io.h>
-
-#define MAX_ENTRY_TYPE 255 /* Most of these aren't used, but we consider
- the top entry type is only 8 bits */
-
-struct dmi_sysfs_entry {
- struct dmi_header dh;
- struct kobject kobj;
- int instance;
- int position;
- struct list_head list;
- struct kobject *child;
-};
-
-/*
- * Global list of dmi_sysfs_entry. Even though this should only be
- * manipulated at setup and teardown, the lazy nature of the kobject
- * system means we get lazy removes.
- */
-static LIST_HEAD(entry_list);
-static DEFINE_SPINLOCK(entry_list_lock);
-
-/* dmi_sysfs_attribute - Top level attribute. used by all entries. */
-struct dmi_sysfs_attribute {
- struct attribute attr;
- ssize_t (*show)(struct dmi_sysfs_entry *entry, char *buf);
-};
-
-#define DMI_SYSFS_ATTR(_entry, _name) \
-struct dmi_sysfs_attribute dmi_sysfs_attr_##_entry##_##_name = { \
- .attr = {.name = __stringify(_name), .mode = 0400}, \
- .show = dmi_sysfs_##_entry##_##_name, \
-}
-
-/*
- * dmi_sysfs_mapped_attribute - Attribute where we require the entry be
- * mapped in. Use in conjunction with dmi_sysfs_specialize_attr_ops.
- */
-struct dmi_sysfs_mapped_attribute {
- struct attribute attr;
- ssize_t (*show)(struct dmi_sysfs_entry *entry,
- const struct dmi_header *dh,
- char *buf);
-};
-
-#define DMI_SYSFS_MAPPED_ATTR(_entry, _name) \
-struct dmi_sysfs_mapped_attribute dmi_sysfs_attr_##_entry##_##_name = { \
- .attr = {.name = __stringify(_name), .mode = 0400}, \
- .show = dmi_sysfs_##_entry##_##_name, \
-}
-
-/*************************************************
- * Generic DMI entry support.
- *************************************************/
-static void dmi_entry_free(struct kobject *kobj)
-{
- kfree(kobj);
-}
-
-static struct dmi_sysfs_entry *to_entry(struct kobject *kobj)
-{
- return container_of(kobj, struct dmi_sysfs_entry, kobj);
-}
-
-static struct dmi_sysfs_attribute *to_attr(struct attribute *attr)
-{
- return container_of(attr, struct dmi_sysfs_attribute, attr);
-}
-
-static ssize_t dmi_sysfs_attr_show(struct kobject *kobj,
- struct attribute *_attr, char *buf)
-{
- struct dmi_sysfs_entry *entry = to_entry(kobj);
- struct dmi_sysfs_attribute *attr = to_attr(_attr);
-
- /* DMI stuff is only ever admin visible */
- if (!capable(CAP_SYS_ADMIN))
- return -EACCES;
-
- return attr->show(entry, buf);
-}
-
-static const struct sysfs_ops dmi_sysfs_attr_ops = {
- .show = dmi_sysfs_attr_show,
-};
-
-typedef ssize_t (*dmi_callback)(struct dmi_sysfs_entry *,
- const struct dmi_header *dh, void *);
-
-struct find_dmi_data {
- struct dmi_sysfs_entry *entry;
- dmi_callback callback;
- void *private;
- int instance_countdown;
- ssize_t ret;
-};
-
-static void find_dmi_entry_helper(const struct dmi_header *dh,
- void *_data)
-{
- struct find_dmi_data *data = _data;
- struct dmi_sysfs_entry *entry = data->entry;
-
- /* Is this the entry we want? */
- if (dh->type != entry->dh.type)
- return;
-
- if (data->instance_countdown != 0) {
- /* try the next instance? */
- data->instance_countdown--;
- return;
- }
-
- /*
- * Don't ever revisit the instance. Short circuit later
- * instances by letting the instance_countdown run negative
- */
- data->instance_countdown--;
-
- /* Found the entry */
- data->ret = data->callback(entry, dh, data->private);
-}
-
-/* State for passing the read parameters through dmi_find_entry() */
-struct dmi_read_state {
- char *buf;
- loff_t pos;
- size_t count;
-};
-
-static ssize_t find_dmi_entry(struct dmi_sysfs_entry *entry,
- dmi_callback callback, void *private)
-{
- struct find_dmi_data data = {
- .entry = entry,
- .callback = callback,
- .private = private,
- .instance_countdown = entry->instance,
- .ret = -EIO, /* To signal the entry disappeared */
- };
- int ret;
-
- ret = dmi_walk(find_dmi_entry_helper, &data);
- /* This shouldn't happen, but just in case. */
- if (ret)
- return -EINVAL;
- return data.ret;
-}
-
-/*
- * Calculate and return the byte length of the dmi entry identified by
- * dh. This includes both the formatted portion as well as the
- * unformatted string space, including the two trailing nul characters.
- */
-static size_t dmi_entry_length(const struct dmi_header *dh)
-{
- const char *p = (const char *)dh;
-
- p += dh->length;
-
- while (p[0] || p[1])
- p++;
-
- return 2 + p - (const char *)dh;
-}
-
-/*************************************************
- * Support bits for specialized DMI entry support
- *************************************************/
-struct dmi_entry_attr_show_data {
- struct attribute *attr;
- char *buf;
-};
-
-static ssize_t dmi_entry_attr_show_helper(struct dmi_sysfs_entry *entry,
- const struct dmi_header *dh,
- void *_data)
-{
- struct dmi_entry_attr_show_data *data = _data;
- struct dmi_sysfs_mapped_attribute *attr;
-
- attr = container_of(data->attr,
- struct dmi_sysfs_mapped_attribute, attr);
- return attr->show(entry, dh, data->buf);
-}
-
-static ssize_t dmi_entry_attr_show(struct kobject *kobj,
- struct attribute *attr,
- char *buf)
-{
- struct dmi_entry_attr_show_data data = {
- .attr = attr,
- .buf = buf,
- };
- /* Find the entry according to our parent and call the
- * normalized show method hanging off of the attribute */
- return find_dmi_entry(to_entry(kobj->parent),
- dmi_entry_attr_show_helper, &data);
-}
-
-static const struct sysfs_ops dmi_sysfs_specialize_attr_ops = {
- .show = dmi_entry_attr_show,
-};
-
-/*************************************************
- * Specialized DMI entry support.
- *************************************************/
-
-/*** Type 15 - System Event Table ***/
-
-#define DMI_SEL_ACCESS_METHOD_IO8 0x00
-#define DMI_SEL_ACCESS_METHOD_IO2x8 0x01
-#define DMI_SEL_ACCESS_METHOD_IO16 0x02
-#define DMI_SEL_ACCESS_METHOD_PHYS32 0x03
-#define DMI_SEL_ACCESS_METHOD_GPNV 0x04
-
-struct dmi_system_event_log {
- struct dmi_header header;
- u16 area_length;
- u16 header_start_offset;
- u16 data_start_offset;
- u8 access_method;
- u8 status;
- u32 change_token;
- union {
- struct {
- u16 index_addr;
- u16 data_addr;
- } io;
- u32 phys_addr32;
- u16 gpnv_handle;
- u32 access_method_address;
- };
- u8 header_format;
- u8 type_descriptors_supported_count;
- u8 per_log_type_descriptor_length;
- u8 supported_log_type_descriptos[0];
-} __packed;
-
-#define DMI_SYSFS_SEL_FIELD(_field) \
-static ssize_t dmi_sysfs_sel_##_field(struct dmi_sysfs_entry *entry, \
- const struct dmi_header *dh, \
- char *buf) \
-{ \
- struct dmi_system_event_log sel; \
- if (sizeof(sel) > dmi_entry_length(dh)) \
- return -EIO; \
- memcpy(&sel, dh, sizeof(sel)); \
- return sprintf(buf, "%u\n", sel._field); \
-} \
-static DMI_SYSFS_MAPPED_ATTR(sel, _field)
-
-DMI_SYSFS_SEL_FIELD(area_length);
-DMI_SYSFS_SEL_FIELD(header_start_offset);
-DMI_SYSFS_SEL_FIELD(data_start_offset);
-DMI_SYSFS_SEL_FIELD(access_method);
-DMI_SYSFS_SEL_FIELD(status);
-DMI_SYSFS_SEL_FIELD(change_token);
-DMI_SYSFS_SEL_FIELD(access_method_address);
-DMI_SYSFS_SEL_FIELD(header_format);
-DMI_SYSFS_SEL_FIELD(type_descriptors_supported_count);
-DMI_SYSFS_SEL_FIELD(per_log_type_descriptor_length);
-
-static struct attribute *dmi_sysfs_sel_attrs[] = {
- &dmi_sysfs_attr_sel_area_length.attr,
- &dmi_sysfs_attr_sel_header_start_offset.attr,
- &dmi_sysfs_attr_sel_data_start_offset.attr,
- &dmi_sysfs_attr_sel_access_method.attr,
- &dmi_sysfs_attr_sel_status.attr,
- &dmi_sysfs_attr_sel_change_token.attr,
- &dmi_sysfs_attr_sel_access_method_address.attr,
- &dmi_sysfs_attr_sel_header_format.attr,
- &dmi_sysfs_attr_sel_type_descriptors_supported_count.attr,
- &dmi_sysfs_attr_sel_per_log_type_descriptor_length.attr,
- NULL,
-};
-
-
-static struct kobj_type dmi_system_event_log_ktype = {
- .release = dmi_entry_free,
- .sysfs_ops = &dmi_sysfs_specialize_attr_ops,
- .default_attrs = dmi_sysfs_sel_attrs,
-};
-
-typedef u8 (*sel_io_reader)(const struct dmi_system_event_log *sel,
- loff_t offset);
-
-static DEFINE_MUTEX(io_port_lock);
-
-static u8 read_sel_8bit_indexed_io(const struct dmi_system_event_log *sel,
- loff_t offset)
-{
- u8 ret;
-
- mutex_lock(&io_port_lock);
- outb((u8)offset, sel->io.index_addr);
- ret = inb(sel->io.data_addr);
- mutex_unlock(&io_port_lock);
- return ret;
-}
-
-static u8 read_sel_2x8bit_indexed_io(const struct dmi_system_event_log *sel,
- loff_t offset)
-{
- u8 ret;
-
- mutex_lock(&io_port_lock);
- outb((u8)offset, sel->io.index_addr);
- outb((u8)(offset >> 8), sel->io.index_addr + 1);
- ret = inb(sel->io.data_addr);
- mutex_unlock(&io_port_lock);
- return ret;
-}
-
-static u8 read_sel_16bit_indexed_io(const struct dmi_system_event_log *sel,
- loff_t offset)
-{
- u8 ret;
-
- mutex_lock(&io_port_lock);
- outw((u16)offset, sel->io.index_addr);
- ret = inb(sel->io.data_addr);
- mutex_unlock(&io_port_lock);
- return ret;
-}
-
-static sel_io_reader sel_io_readers[] = {
- [DMI_SEL_ACCESS_METHOD_IO8] = read_sel_8bit_indexed_io,
- [DMI_SEL_ACCESS_METHOD_IO2x8] = read_sel_2x8bit_indexed_io,
- [DMI_SEL_ACCESS_METHOD_IO16] = read_sel_16bit_indexed_io,
-};
-
-static ssize_t dmi_sel_raw_read_io(struct dmi_sysfs_entry *entry,
- const struct dmi_system_event_log *sel,
- char *buf, loff_t pos, size_t count)
-{
- ssize_t wrote = 0;
-
- sel_io_reader io_reader = sel_io_readers[sel->access_method];
-
- while (count && pos < sel->area_length) {
- count--;
- *(buf++) = io_reader(sel, pos++);
- wrote++;
- }
-
- return wrote;
-}
-
-static ssize_t dmi_sel_raw_read_phys32(struct dmi_sysfs_entry *entry,
- const struct dmi_system_event_log *sel,
- char *buf, loff_t pos, size_t count)
-{
- u8 __iomem *mapped;
- ssize_t wrote = 0;
-
- mapped = ioremap(sel->access_method_address, sel->area_length);
- if (!mapped)
- return -EIO;
-
- while (count && pos < sel->area_length) {
- count--;
- *(buf++) = readb(mapped + pos++);
- wrote++;
- }
-
- iounmap(mapped);
- return wrote;
-}
-
-static ssize_t dmi_sel_raw_read_helper(struct dmi_sysfs_entry *entry,
- const struct dmi_header *dh,
- void *_state)
-{
- struct dmi_read_state *state = _state;
- struct dmi_system_event_log sel;
-
- if (sizeof(sel) > dmi_entry_length(dh))
- return -EIO;
-
- memcpy(&sel, dh, sizeof(sel));
-
- switch (sel.access_method) {
- case DMI_SEL_ACCESS_METHOD_IO8:
- case DMI_SEL_ACCESS_METHOD_IO2x8:
- case DMI_SEL_ACCESS_METHOD_IO16:
- return dmi_sel_raw_read_io(entry, &sel, state->buf,
- state->pos, state->count);
- case DMI_SEL_ACCESS_METHOD_PHYS32:
- return dmi_sel_raw_read_phys32(entry, &sel, state->buf,
- state->pos, state->count);
- case DMI_SEL_ACCESS_METHOD_GPNV:
- pr_info("dmi-sysfs: GPNV support missing.\n");
- return -EIO;
- default:
- pr_info("dmi-sysfs: Unknown access method %02x\n",
- sel.access_method);
- return -EIO;
- }
-}
-
-static ssize_t dmi_sel_raw_read(struct file *filp, struct kobject *kobj,
- struct bin_attribute *bin_attr,
- char *buf, loff_t pos, size_t count)
-{
- struct dmi_sysfs_entry *entry = to_entry(kobj->parent);
- struct dmi_read_state state = {
- .buf = buf,
- .pos = pos,
- .count = count,
- };
-
- return find_dmi_entry(entry, dmi_sel_raw_read_helper, &state);
-}
-
-static struct bin_attribute dmi_sel_raw_attr = {
- .attr = {.name = "raw_event_log", .mode = 0400},
- .read = dmi_sel_raw_read,
-};
-
-static int dmi_system_event_log(struct dmi_sysfs_entry *entry)
-{
- int ret;
-
- entry->child = kzalloc(sizeof(*entry->child), GFP_KERNEL);
- if (!entry->child)
- return -ENOMEM;
- ret = kobject_init_and_add(entry->child,
- &dmi_system_event_log_ktype,
- &entry->kobj,
- "system_event_log");
- if (ret)
- goto out_free;
-
- ret = sysfs_create_bin_file(entry->child, &dmi_sel_raw_attr);
- if (ret)
- goto out_del;
-
- return 0;
-
-out_del:
- kobject_del(entry->child);
-out_free:
- kfree(entry->child);
- return ret;
-}
-
-/*************************************************
- * Generic DMI entry support.
- *************************************************/
-
-static ssize_t dmi_sysfs_entry_length(struct dmi_sysfs_entry *entry, char *buf)
-{
- return sprintf(buf, "%d\n", entry->dh.length);
-}
-
-static ssize_t dmi_sysfs_entry_handle(struct dmi_sysfs_entry *entry, char *buf)
-{
- return sprintf(buf, "%d\n", entry->dh.handle);
-}
-
-static ssize_t dmi_sysfs_entry_type(struct dmi_sysfs_entry *entry, char *buf)
-{
- return sprintf(buf, "%d\n", entry->dh.type);
-}
-
-static ssize_t dmi_sysfs_entry_instance(struct dmi_sysfs_entry *entry,
- char *buf)
-{
- return sprintf(buf, "%d\n", entry->instance);
-}
-
-static ssize_t dmi_sysfs_entry_position(struct dmi_sysfs_entry *entry,
- char *buf)
-{
- return sprintf(buf, "%d\n", entry->position);
-}
-
-static DMI_SYSFS_ATTR(entry, length);
-static DMI_SYSFS_ATTR(entry, handle);
-static DMI_SYSFS_ATTR(entry, type);
-static DMI_SYSFS_ATTR(entry, instance);
-static DMI_SYSFS_ATTR(entry, position);
-
-static struct attribute *dmi_sysfs_entry_attrs[] = {
- &dmi_sysfs_attr_entry_length.attr,
- &dmi_sysfs_attr_entry_handle.attr,
- &dmi_sysfs_attr_entry_type.attr,
- &dmi_sysfs_attr_entry_instance.attr,
- &dmi_sysfs_attr_entry_position.attr,
- NULL,
-};
-
-static ssize_t dmi_entry_raw_read_helper(struct dmi_sysfs_entry *entry,
- const struct dmi_header *dh,
- void *_state)
-{
- struct dmi_read_state *state = _state;
- size_t entry_length;
-
- entry_length = dmi_entry_length(dh);
-
- return memory_read_from_buffer(state->buf, state->count,
- &state->pos, dh, entry_length);
-}
-
-static ssize_t dmi_entry_raw_read(struct file *filp,
- struct kobject *kobj,
- struct bin_attribute *bin_attr,
- char *buf, loff_t pos, size_t count)
-{
- struct dmi_sysfs_entry *entry = to_entry(kobj);
- struct dmi_read_state state = {
- .buf = buf,
- .pos = pos,
- .count = count,
- };
-
- return find_dmi_entry(entry, dmi_entry_raw_read_helper, &state);
-}
-
-static const struct bin_attribute dmi_entry_raw_attr = {
- .attr = {.name = "raw", .mode = 0400},
- .read = dmi_entry_raw_read,
-};
-
-static void dmi_sysfs_entry_release(struct kobject *kobj)
-{
- struct dmi_sysfs_entry *entry = to_entry(kobj);
- sysfs_remove_bin_file(&entry->kobj, &dmi_entry_raw_attr);
- spin_lock(&entry_list_lock);
- list_del(&entry->list);
- spin_unlock(&entry_list_lock);
- kfree(entry);
-}
-
-static struct kobj_type dmi_sysfs_entry_ktype = {
- .release = dmi_sysfs_entry_release,
- .sysfs_ops = &dmi_sysfs_attr_ops,
- .default_attrs = dmi_sysfs_entry_attrs,
-};
-
-static struct kobject *dmi_kobj;
-static struct kset *dmi_kset;
-
-/* Global count of all instances seen. Only for setup */
-static int __initdata instance_counts[MAX_ENTRY_TYPE + 1];
-
-/* Global positional count of all entries seen. Only for setup */
-static int __initdata position_count;
-
-static void __init dmi_sysfs_register_handle(const struct dmi_header *dh,
- void *_ret)
-{
- struct dmi_sysfs_entry *entry;
- int *ret = _ret;
-
- /* If a previous entry saw an error, short circuit */
- if (*ret)
- return;
-
- /* Allocate and register a new entry into the entries set */
- entry = kzalloc(sizeof(*entry), GFP_KERNEL);
- if (!entry) {
- *ret = -ENOMEM;
- return;
- }
-
- /* Set the key */
- memcpy(&entry->dh, dh, sizeof(*dh));
- entry->instance = instance_counts[dh->type]++;
- entry->position = position_count++;
-
- entry->kobj.kset = dmi_kset;
- *ret = kobject_init_and_add(&entry->kobj, &dmi_sysfs_entry_ktype, NULL,
- "%d-%d", dh->type, entry->instance);
-
- if (*ret) {
- kfree(entry);
- return;
- }
-
- /* Thread on the global list for cleanup */
- spin_lock(&entry_list_lock);
- list_add_tail(&entry->list, &entry_list);
- spin_unlock(&entry_list_lock);
-
- /* Handle specializations by type */
- switch (dh->type) {
- case DMI_ENTRY_SYSTEM_EVENT_LOG:
- *ret = dmi_system_event_log(entry);
- break;
- default:
- /* No specialization */
- break;
- }
- if (*ret)
- goto out_err;
-
- /* Create the raw binary file to access the entry */
- *ret = sysfs_create_bin_file(&entry->kobj, &dmi_entry_raw_attr);
- if (*ret)
- goto out_err;
-
- return;
-out_err:
- kobject_put(entry->child);
- kobject_put(&entry->kobj);
- return;
-}
-
-static void cleanup_entry_list(void)
-{
- struct dmi_sysfs_entry *entry, *next;
-
- /* No locks, we are on our way out */
- list_for_each_entry_safe(entry, next, &entry_list, list) {
- kobject_put(entry->child);
- kobject_put(&entry->kobj);
- }
-}
-
-static int __init dmi_sysfs_init(void)
-{
- int error = -ENOMEM;
- int val;
-
- /* Set up our directory */
- dmi_kobj = kobject_create_and_add("dmi", firmware_kobj);
- if (!dmi_kobj)
- goto err;
-
- dmi_kset = kset_create_and_add("entries", NULL, dmi_kobj);
- if (!dmi_kset)
- goto err;
-
- val = 0;
- error = dmi_walk(dmi_sysfs_register_handle, &val);
- if (error)
- goto err;
- if (val) {
- error = val;
- goto err;
- }
-
- pr_debug("dmi-sysfs: loaded.\n");
-
- return 0;
-err:
- cleanup_entry_list();
- kset_unregister(dmi_kset);
- kobject_put(dmi_kobj);
- return error;
-}
-
-/* clean up everything. */
-static void __exit dmi_sysfs_exit(void)
-{
- pr_debug("dmi-sysfs: unloading.\n");
- cleanup_entry_list();
- kset_unregister(dmi_kset);
- kobject_put(dmi_kobj);
-}
-
-module_init(dmi_sysfs_init);
-module_exit(dmi_sysfs_exit);
-
-MODULE_AUTHOR("Mike Waychison <mikew@google.com>");
-MODULE_DESCRIPTION("DMI sysfs support");
-MODULE_LICENSE("GPL");
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
deleted file mode 100644
index bcb1126..0000000
--- a/drivers/firmware/dmi_scan.c
+++ /dev/null
@@ -1,751 +0,0 @@
-#include <linux/types.h>
-#include <linux/string.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/ctype.h>
-#include <linux/dmi.h>
-#include <linux/efi.h>
-#include <linux/bootmem.h>
-#include <asm/dmi.h>
-
-/*
- * DMI stands for "Desktop Management Interface". It is part
- * of and an antecedent to, SMBIOS, which stands for System
- * Management BIOS. See further: http://www.dmtf.org/standards
- */
-static char dmi_empty_string[] = " ";
-
-/*
- * Catch too early calls to dmi_check_system():
- */
-static int dmi_initialized;
-
-static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
-{
- const u8 *bp = ((u8 *) dm) + dm->length;
-
- if (s) {
- s--;
- while (s > 0 && *bp) {
- bp += strlen(bp) + 1;
- s--;
- }
-
- if (*bp != 0) {
- size_t len = strlen(bp)+1;
- size_t cmp_len = len > 8 ? 8 : len;
-
- if (!memcmp(bp, dmi_empty_string, cmp_len))
- return dmi_empty_string;
- return bp;
- }
- }
-
- return "";
-}
-
-static char * __init dmi_string(const struct dmi_header *dm, u8 s)
-{
- const char *bp = dmi_string_nosave(dm, s);
- char *str;
- size_t len;
-
- if (bp = dmi_empty_string)
- return dmi_empty_string;
-
- len = strlen(bp) + 1;
- str = dmi_alloc(len);
- if (str != NULL)
- strcpy(str, bp);
- else
- printk(KERN_ERR "dmi_string: cannot allocate %Zu bytes.\n", len);
-
- return str;
-}
-
-/*
- * We have to be cautious here. We have seen BIOSes with DMI pointers
- * pointing to completely the wrong place for example
- */
-static void dmi_table(u8 *buf, int len, int num,
- void (*decode)(const struct dmi_header *, void *),
- void *private_data)
-{
- u8 *data = buf;
- int i = 0;
-
- /*
- * Stop when we see all the items the table claimed to have
- * OR we run off the end of the table (also happens)
- */
- while ((i < num) && (data - buf + sizeof(struct dmi_header)) <= len) {
- const struct dmi_header *dm = (const struct dmi_header *)data;
-
- /*
- * We want to know the total length (formatted area and
- * strings) before decoding to make sure we won't run off the
- * table in dmi_decode or dmi_string
- */
- data += dm->length;
- while ((data - buf < len - 1) && (data[0] || data[1]))
- data++;
- if (data - buf < len - 1)
- decode(dm, private_data);
- data += 2;
- i++;
- }
-}
-
-static u32 dmi_base;
-static u16 dmi_len;
-static u16 dmi_num;
-
-static int __init dmi_walk_early(void (*decode)(const struct dmi_header *,
- void *))
-{
- u8 *buf;
-
- buf = dmi_ioremap(dmi_base, dmi_len);
- if (buf = NULL)
- return -1;
-
- dmi_table(buf, dmi_len, dmi_num, decode, NULL);
-
- dmi_iounmap(buf, dmi_len);
- return 0;
-}
-
-static int __init dmi_checksum(const u8 *buf)
-{
- u8 sum = 0;
- int a;
-
- for (a = 0; a < 15; a++)
- sum += buf[a];
-
- return sum = 0;
-}
-
-static char *dmi_ident[DMI_STRING_MAX];
-static LIST_HEAD(dmi_devices);
-int dmi_available;
-
-/*
- * Save a DMI string
- */
-static void __init dmi_save_ident(const struct dmi_header *dm, int slot, int string)
-{
- const char *d = (const char*) dm;
- char *p;
-
- if (dmi_ident[slot])
- return;
-
- p = dmi_string(dm, d[string]);
- if (p = NULL)
- return;
-
- dmi_ident[slot] = p;
-}
-
-static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int index)
-{
- const u8 *d = (u8*) dm + index;
- char *s;
- int is_ff = 1, is_00 = 1, i;
-
- if (dmi_ident[slot])
- return;
-
- for (i = 0; i < 16 && (is_ff || is_00); i++) {
- if(d[i] != 0x00) is_ff = 0;
- if(d[i] != 0xFF) is_00 = 0;
- }
-
- if (is_ff || is_00)
- return;
-
- s = dmi_alloc(16*2+4+1);
- if (!s)
- return;
-
- sprintf(s, "%pUB", d);
-
- dmi_ident[slot] = s;
-}
-
-static void __init dmi_save_type(const struct dmi_header *dm, int slot, int index)
-{
- const u8 *d = (u8*) dm + index;
- char *s;
-
- if (dmi_ident[slot])
- return;
-
- s = dmi_alloc(4);
- if (!s)
- return;
-
- sprintf(s, "%u", *d & 0x7F);
- dmi_ident[slot] = s;
-}
-
-static void __init dmi_save_one_device(int type, const char *name)
-{
- struct dmi_device *dev;
-
- /* No duplicate device */
- if (dmi_find_device(type, name, NULL))
- return;
-
- dev = dmi_alloc(sizeof(*dev) + strlen(name) + 1);
- if (!dev) {
- printk(KERN_ERR "dmi_save_one_device: out of memory.\n");
- return;
- }
-
- dev->type = type;
- strcpy((char *)(dev + 1), name);
- dev->name = (char *)(dev + 1);
- dev->device_data = NULL;
- list_add(&dev->list, &dmi_devices);
-}
-
-static void __init dmi_save_devices(const struct dmi_header *dm)
-{
- int i, count = (dm->length - sizeof(struct dmi_header)) / 2;
-
- for (i = 0; i < count; i++) {
- const char *d = (char *)(dm + 1) + (i * 2);
-
- /* Skip disabled device */
- if ((*d & 0x80) = 0)
- continue;
-
- dmi_save_one_device(*d & 0x7f, dmi_string_nosave(dm, *(d + 1)));
- }
-}
-
-static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm)
-{
- int i, count = *(u8 *)(dm + 1);
- struct dmi_device *dev;
-
- for (i = 1; i <= count; i++) {
- char *devname = dmi_string(dm, i);
-
- if (devname = dmi_empty_string)
- continue;
-
- dev = dmi_alloc(sizeof(*dev));
- if (!dev) {
- printk(KERN_ERR
- "dmi_save_oem_strings_devices: out of memory.\n");
- break;
- }
-
- dev->type = DMI_DEV_TYPE_OEM_STRING;
- dev->name = devname;
- dev->device_data = NULL;
-
- list_add(&dev->list, &dmi_devices);
- }
-}
-
-static void __init dmi_save_ipmi_device(const struct dmi_header *dm)
-{
- struct dmi_device *dev;
- void * data;
-
- data = dmi_alloc(dm->length);
- if (data = NULL) {
- printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
- return;
- }
-
- memcpy(data, dm, dm->length);
-
- dev = dmi_alloc(sizeof(*dev));
- if (!dev) {
- printk(KERN_ERR "dmi_save_ipmi_device: out of memory.\n");
- return;
- }
-
- dev->type = DMI_DEV_TYPE_IPMI;
- dev->name = "IPMI controller";
- dev->device_data = data;
-
- list_add_tail(&dev->list, &dmi_devices);
-}
-
-static void __init dmi_save_dev_onboard(int instance, int segment, int bus,
- int devfn, const char *name)
-{
- struct dmi_dev_onboard *onboard_dev;
-
- onboard_dev = dmi_alloc(sizeof(*onboard_dev) + strlen(name) + 1);
- if (!onboard_dev) {
- printk(KERN_ERR "dmi_save_dev_onboard: out of memory.\n");
- return;
- }
- onboard_dev->instance = instance;
- onboard_dev->segment = segment;
- onboard_dev->bus = bus;
- onboard_dev->devfn = devfn;
-
- strcpy((char *)&onboard_dev[1], name);
- onboard_dev->dev.type = DMI_DEV_TYPE_DEV_ONBOARD;
- onboard_dev->dev.name = (char *)&onboard_dev[1];
- onboard_dev->dev.device_data = onboard_dev;
-
- list_add(&onboard_dev->dev.list, &dmi_devices);
-}
-
-static void __init dmi_save_extended_devices(const struct dmi_header *dm)
-{
- const u8 *d = (u8*) dm + 5;
-
- /* Skip disabled device */
- if ((*d & 0x80) = 0)
- return;
-
- dmi_save_dev_onboard(*(d+1), *(u16 *)(d+2), *(d+4), *(d+5),
- dmi_string_nosave(dm, *(d-1)));
- dmi_save_one_device(*d & 0x7f, dmi_string_nosave(dm, *(d - 1)));
-}
-
-/*
- * Process a DMI table entry. Right now all we care about are the BIOS
- * and machine entries. For 2.5 we should pull the smbus controller info
- * out of here.
- */
-static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
-{
- switch(dm->type) {
- case 0: /* BIOS Information */
- dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
- dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
- dmi_save_ident(dm, DMI_BIOS_DATE, 8);
- break;
- case 1: /* System Information */
- dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
- dmi_save_ident(dm, DMI_PRODUCT_NAME, 5);
- dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
- dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);
- dmi_save_uuid(dm, DMI_PRODUCT_UUID, 8);
- break;
- case 2: /* Base Board Information */
- dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
- dmi_save_ident(dm, DMI_BOARD_NAME, 5);
- dmi_save_ident(dm, DMI_BOARD_VERSION, 6);
- dmi_save_ident(dm, DMI_BOARD_SERIAL, 7);
- dmi_save_ident(dm, DMI_BOARD_ASSET_TAG, 8);
- break;
- case 3: /* Chassis Information */
- dmi_save_ident(dm, DMI_CHASSIS_VENDOR, 4);
- dmi_save_type(dm, DMI_CHASSIS_TYPE, 5);
- dmi_save_ident(dm, DMI_CHASSIS_VERSION, 6);
- dmi_save_ident(dm, DMI_CHASSIS_SERIAL, 7);
- dmi_save_ident(dm, DMI_CHASSIS_ASSET_TAG, 8);
- break;
- case 10: /* Onboard Devices Information */
- dmi_save_devices(dm);
- break;
- case 11: /* OEM Strings */
- dmi_save_oem_strings_devices(dm);
- break;
- case 38: /* IPMI Device Information */
- dmi_save_ipmi_device(dm);
- break;
- case 41: /* Onboard Devices Extended Information */
- dmi_save_extended_devices(dm);
- }
-}
-
-static void __init print_filtered(const char *info)
-{
- const char *p;
-
- if (!info)
- return;
-
- for (p = info; *p; p++)
- if (isprint(*p))
- printk(KERN_CONT "%c", *p);
- else
- printk(KERN_CONT "\\x%02x", *p & 0xff);
-}
-
-static void __init dmi_dump_ids(void)
-{
- const char *board; /* Board Name is optional */
-
- printk(KERN_DEBUG "DMI: ");
- print_filtered(dmi_get_system_info(DMI_SYS_VENDOR));
- printk(KERN_CONT " ");
- print_filtered(dmi_get_system_info(DMI_PRODUCT_NAME));
- board = dmi_get_system_info(DMI_BOARD_NAME);
- if (board) {
- printk(KERN_CONT "/");
- print_filtered(board);
- }
- printk(KERN_CONT ", BIOS ");
- print_filtered(dmi_get_system_info(DMI_BIOS_VERSION));
- printk(KERN_CONT " ");
- print_filtered(dmi_get_system_info(DMI_BIOS_DATE));
- printk(KERN_CONT "\n");
-}
-
-static int __init dmi_present(const char __iomem *p)
-{
- u8 buf[15];
-
- memcpy_fromio(buf, p, 15);
- if ((memcmp(buf, "_DMI_", 5) = 0) && dmi_checksum(buf)) {
- dmi_num = (buf[13] << 8) | buf[12];
- dmi_len = (buf[7] << 8) | buf[6];
- dmi_base = (buf[11] << 24) | (buf[10] << 16) |
- (buf[9] << 8) | buf[8];
-
- /*
- * DMI version 0.0 means that the real version is taken from
- * the SMBIOS version, which we don't know at this point.
- */
- if (buf[14] != 0)
- printk(KERN_INFO "DMI %d.%d present.\n",
- buf[14] >> 4, buf[14] & 0xF);
- else
- printk(KERN_INFO "DMI present.\n");
- if (dmi_walk_early(dmi_decode) = 0) {
- dmi_dump_ids();
- return 0;
- }
- }
- return 1;
-}
-
-void __init dmi_scan_machine(void)
-{
- char __iomem *p, *q;
- int rc;
-
- if (efi_enabled) {
- if (efi.smbios = EFI_INVALID_TABLE_ADDR)
- goto error;
-
- /* This is called as a core_initcall() because it isn't
- * needed during early boot. This also means we can
- * iounmap the space when we're done with it.
- */
- p = dmi_ioremap(efi.smbios, 32);
- if (p = NULL)
- goto error;
-
- rc = dmi_present(p + 0x10); /* offset of _DMI_ string */
- dmi_iounmap(p, 32);
- if (!rc) {
- dmi_available = 1;
- goto out;
- }
- }
- else {
- /*
- * no iounmap() for that ioremap(); it would be a no-op, but
- * it's so early in setup that sucker gets confused into doing
- * what it shouldn't if we actually call it.
- */
- p = dmi_ioremap(0xF0000, 0x10000);
- if (p = NULL)
- goto error;
-
- for (q = p; q < p + 0x10000; q += 16) {
- rc = dmi_present(q);
- if (!rc) {
- dmi_available = 1;
- dmi_iounmap(p, 0x10000);
- goto out;
- }
- }
- dmi_iounmap(p, 0x10000);
- }
- error:
- printk(KERN_INFO "DMI not present or invalid.\n");
- out:
- dmi_initialized = 1;
-}
-
-/**
- * dmi_matches - check if dmi_system_id structure matches system DMI data
- * @dmi: pointer to the dmi_system_id structure to check
- */
-static bool dmi_matches(const struct dmi_system_id *dmi)
-{
- int i;
-
- WARN(!dmi_initialized, KERN_ERR "dmi check: not initialized yet.\n");
-
- for (i = 0; i < ARRAY_SIZE(dmi->matches); i++) {
- int s = dmi->matches[i].slot;
- if (s = DMI_NONE)
- break;
- if (dmi_ident[s]
- && strstr(dmi_ident[s], dmi->matches[i].substr))
- continue;
- /* No match */
- return false;
- }
- return true;
-}
-
-/**
- * dmi_is_end_of_table - check for end-of-table marker
- * @dmi: pointer to the dmi_system_id structure to check
- */
-static bool dmi_is_end_of_table(const struct dmi_system_id *dmi)
-{
- return dmi->matches[0].slot = DMI_NONE;
-}
-
-/**
- * dmi_check_system - check system DMI data
- * @list: array of dmi_system_id structures to match against
- * All non-null elements of the list must match
- * their slot's (field index's) data (i.e., each
- * list string must be a substring of the specified
- * DMI slot's string data) to be considered a
- * successful match.
- *
- * Walk the blacklist table running matching functions until someone
- * returns non zero or we hit the end. Callback function is called for
- * each successful match. Returns the number of matches.
- */
-int dmi_check_system(const struct dmi_system_id *list)
-{
- int count = 0;
- const struct dmi_system_id *d;
-
- for (d = list; !dmi_is_end_of_table(d); d++)
- if (dmi_matches(d)) {
- count++;
- if (d->callback && d->callback(d))
- break;
- }
-
- return count;
-}
-EXPORT_SYMBOL(dmi_check_system);
-
-/**
- * dmi_first_match - find dmi_system_id structure matching system DMI data
- * @list: array of dmi_system_id structures to match against
- * All non-null elements of the list must match
- * their slot's (field index's) data (i.e., each
- * list string must be a substring of the specified
- * DMI slot's string data) to be considered a
- * successful match.
- *
- * Walk the blacklist table until the first match is found. Return the
- * pointer to the matching entry or NULL if there's no match.
- */
-const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list)
-{
- const struct dmi_system_id *d;
-
- for (d = list; !dmi_is_end_of_table(d); d++)
- if (dmi_matches(d))
- return d;
-
- return NULL;
-}
-EXPORT_SYMBOL(dmi_first_match);
-
-/**
- * dmi_get_system_info - return DMI data value
- * @field: data index (see enum dmi_field)
- *
- * Returns one DMI data value, can be used to perform
- * complex DMI data checks.
- */
-const char *dmi_get_system_info(int field)
-{
- return dmi_ident[field];
-}
-EXPORT_SYMBOL(dmi_get_system_info);
-
-/**
- * dmi_name_in_serial - Check if string is in the DMI product serial information
- * @str: string to check for
- */
-int dmi_name_in_serial(const char *str)
-{
- int f = DMI_PRODUCT_SERIAL;
- if (dmi_ident[f] && strstr(dmi_ident[f], str))
- return 1;
- return 0;
-}
-
-/**
- * dmi_name_in_vendors - Check if string is anywhere in the DMI vendor information.
- * @str: Case sensitive Name
- */
-int dmi_name_in_vendors(const char *str)
-{
- static int fields[] = { DMI_BIOS_VENDOR, DMI_BIOS_VERSION, DMI_SYS_VENDOR,
- DMI_PRODUCT_NAME, DMI_PRODUCT_VERSION, DMI_BOARD_VENDOR,
- DMI_BOARD_NAME, DMI_BOARD_VERSION, DMI_NONE };
- int i;
- for (i = 0; fields[i] != DMI_NONE; i++) {
- int f = fields[i];
- if (dmi_ident[f] && strstr(dmi_ident[f], str))
- return 1;
- }
- return 0;
-}
-EXPORT_SYMBOL(dmi_name_in_vendors);
-
-/**
- * dmi_find_device - find onboard device by type/name
- * @type: device type or %DMI_DEV_TYPE_ANY to match all device types
- * @name: device name string or %NULL to match all
- * @from: previous device found in search, or %NULL for new search.
- *
- * Iterates through the list of known onboard devices. If a device is
- * found with a matching @vendor and @device, a pointer to its device
- * structure is returned. Otherwise, %NULL is returned.
- * A new search is initiated by passing %NULL as the @from argument.
- * If @from is not %NULL, searches continue from next device.
- */
-const struct dmi_device * dmi_find_device(int type, const char *name,
- const struct dmi_device *from)
-{
- const struct list_head *head = from ? &from->list : &dmi_devices;
- struct list_head *d;
-
- for(d = head->next; d != &dmi_devices; d = d->next) {
- const struct dmi_device *dev - list_entry(d, struct dmi_device, list);
-
- if (((type = DMI_DEV_TYPE_ANY) || (dev->type = type)) &&
- ((name = NULL) || (strcmp(dev->name, name) = 0)))
- return dev;
- }
-
- return NULL;
-}
-EXPORT_SYMBOL(dmi_find_device);
-
-/**
- * dmi_get_date - parse a DMI date
- * @field: data index (see enum dmi_field)
- * @yearp: optional out parameter for the year
- * @monthp: optional out parameter for the month
- * @dayp: optional out parameter for the day
- *
- * The date field is assumed to be in the form resembling
- * [mm[/dd]]/yy[yy] and the result is stored in the out
- * parameters any or all of which can be omitted.
- *
- * If the field doesn't exist, all out parameters are set to zero
- * and false is returned. Otherwise, true is returned with any
- * invalid part of date set to zero.
- *
- * On return, year, month and day are guaranteed to be in the
- * range of [0,9999], [0,12] and [0,31] respectively.
- */
-bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
-{
- int year = 0, month = 0, day = 0;
- bool exists;
- const char *s, *y;
- char *e;
-
- s = dmi_get_system_info(field);
- exists = s;
- if (!exists)
- goto out;
-
- /*
- * Determine year first. We assume the date string resembles
- * mm/dd/yy[yy] but the original code extracted only the year
- * from the end. Keep the behavior in the spirit of no
- * surprises.
- */
- y = strrchr(s, '/');
- if (!y)
- goto out;
-
- y++;
- year = simple_strtoul(y, &e, 10);
- if (y != e && year < 100) { /* 2-digit year */
- year += 1900;
- if (year < 1996) /* no dates < spec 1.0 */
- year += 100;
- }
- if (year > 9999) /* year should fit in %04d */
- year = 0;
-
- /* parse the mm and dd */
- month = simple_strtoul(s, &e, 10);
- if (s = e || *e != '/' || !month || month > 12) {
- month = 0;
- goto out;
- }
-
- s = e + 1;
- day = simple_strtoul(s, &e, 10);
- if (s = y || s = e || *e != '/' || day > 31)
- day = 0;
-out:
- if (yearp)
- *yearp = year;
- if (monthp)
- *monthp = month;
- if (dayp)
- *dayp = day;
- return exists;
-}
-EXPORT_SYMBOL(dmi_get_date);
-
-/**
- * dmi_walk - Walk the DMI table and get called back for every record
- * @decode: Callback function
- * @private_data: Private data to be passed to the callback function
- *
- * Returns -1 when the DMI table can't be reached, 0 on success.
- */
-int dmi_walk(void (*decode)(const struct dmi_header *, void *),
- void *private_data)
-{
- u8 *buf;
-
- if (!dmi_available)
- return -1;
-
- buf = ioremap(dmi_base, dmi_len);
- if (buf = NULL)
- return -1;
-
- dmi_table(buf, dmi_len, dmi_num, decode, private_data);
-
- iounmap(buf);
- return 0;
-}
-EXPORT_SYMBOL_GPL(dmi_walk);
-
-/**
- * dmi_match - compare a string to the dmi field (if exists)
- * @f: DMI field identifier
- * @str: string to compare the DMI field to
- *
- * Returns true if the requested field equals to the str (including NULL).
- */
-bool dmi_match(enum dmi_field f, const char *str)
-{
- const char *info = dmi_get_system_info(f);
-
- if (info = NULL || str = NULL)
- return info = str;
-
- return !strcmp(info, str);
-}
-EXPORT_SYMBOL_GPL(dmi_match);
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
deleted file mode 100644
index f156cca..0000000
--- a/include/linux/dmi.h
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef __DMI_H__
-#define __DMI_H__
-
-#include <linux/list.h>
-#include <linux/mod_devicetable.h>
-
-/* enum dmi_field is in mod_devicetable.h */
-
-enum dmi_device_type {
- DMI_DEV_TYPE_ANY = 0,
- DMI_DEV_TYPE_OTHER,
- DMI_DEV_TYPE_UNKNOWN,
- DMI_DEV_TYPE_VIDEO,
- DMI_DEV_TYPE_SCSI,
- DMI_DEV_TYPE_ETHERNET,
- DMI_DEV_TYPE_TOKENRING,
- DMI_DEV_TYPE_SOUND,
- DMI_DEV_TYPE_PATA,
- DMI_DEV_TYPE_SATA,
- DMI_DEV_TYPE_SAS,
- DMI_DEV_TYPE_IPMI = -1,
- DMI_DEV_TYPE_OEM_STRING = -2,
- DMI_DEV_TYPE_DEV_ONBOARD = -3,
-};
-
-enum dmi_entry_type {
- DMI_ENTRY_BIOS = 0,
- DMI_ENTRY_SYSTEM,
- DMI_ENTRY_BASEBOARD,
- DMI_ENTRY_CHASSIS,
- DMI_ENTRY_PROCESSOR,
- DMI_ENTRY_MEM_CONTROLLER,
- DMI_ENTRY_MEM_MODULE,
- DMI_ENTRY_CACHE,
- DMI_ENTRY_PORT_CONNECTOR,
- DMI_ENTRY_SYSTEM_SLOT,
- DMI_ENTRY_ONBOARD_DEVICE,
- DMI_ENTRY_OEMSTRINGS,
- DMI_ENTRY_SYSCONF,
- DMI_ENTRY_BIOS_LANG,
- DMI_ENTRY_GROUP_ASSOC,
- DMI_ENTRY_SYSTEM_EVENT_LOG,
- DMI_ENTRY_PHYS_MEM_ARRAY,
- DMI_ENTRY_MEM_DEVICE,
- DMI_ENTRY_32_MEM_ERROR,
- DMI_ENTRY_MEM_ARRAY_MAPPED_ADDR,
- DMI_ENTRY_MEM_DEV_MAPPED_ADDR,
- DMI_ENTRY_BUILTIN_POINTING_DEV,
- DMI_ENTRY_PORTABLE_BATTERY,
- DMI_ENTRY_SYSTEM_RESET,
- DMI_ENTRY_HW_SECURITY,
- DMI_ENTRY_SYSTEM_POWER_CONTROLS,
- DMI_ENTRY_VOLTAGE_PROBE,
- DMI_ENTRY_COOLING_DEV,
- DMI_ENTRY_TEMP_PROBE,
- DMI_ENTRY_ELECTRICAL_CURRENT_PROBE,
- DMI_ENTRY_OOB_REMOTE_ACCESS,
- DMI_ENTRY_BIS_ENTRY,
- DMI_ENTRY_SYSTEM_BOOT,
- DMI_ENTRY_MGMT_DEV,
- DMI_ENTRY_MGMT_DEV_COMPONENT,
- DMI_ENTRY_MGMT_DEV_THRES,
- DMI_ENTRY_MEM_CHANNEL,
- DMI_ENTRY_IPMI_DEV,
- DMI_ENTRY_SYS_POWER_SUPPLY,
- DMI_ENTRY_ADDITIONAL,
- DMI_ENTRY_ONBOARD_DEV_EXT,
- DMI_ENTRY_MGMT_CONTROLLER_HOST,
- DMI_ENTRY_INACTIVE = 126,
- DMI_ENTRY_END_OF_TABLE = 127,
-};
-
-struct dmi_header {
- u8 type;
- u8 length;
- u16 handle;
-};
-
-struct dmi_device {
- struct list_head list;
- int type;
- const char *name;
- void *device_data; /* Type specific data */
-};
-
-#ifdef CONFIG_DMI
-
-struct dmi_dev_onboard {
- struct dmi_device dev;
- int instance;
- int segment;
- int bus;
- int devfn;
-};
-
-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);
-extern void dmi_scan_machine(void);
-extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
-extern int dmi_name_in_vendors(const char *str);
-extern int dmi_name_in_serial(const char *str);
-extern int dmi_available;
-extern int dmi_walk(void (*decode)(const struct dmi_header *, void *),
- void *private_data);
-extern bool dmi_match(enum dmi_field f, const char *str);
-
-#else
-
-static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; }
-static inline const char * dmi_get_system_info(int field) { return NULL; }
-static inline const struct dmi_device * dmi_find_device(int type, const char *name,
- const struct dmi_device *from) { return NULL; }
-static inline void dmi_scan_machine(void) { return; }
-static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
-{
- if (yearp)
- *yearp = 0;
- if (monthp)
- *monthp = 0;
- if (dayp)
- *dayp = 0;
- return false;
-}
-static inline int dmi_name_in_vendors(const char *s) { return 0; }
-static inline int dmi_name_in_serial(const char *s) { return 0; }
-#define dmi_available 0
-static inline int dmi_walk(void (*decode)(const struct dmi_header *, void *),
- void *private_data) { return -1; }
-static inline bool dmi_match(enum dmi_field f, const char *str)
- { return false; }
-static inline const struct dmi_system_id *
- dmi_first_match(const struct dmi_system_id *list) { return NULL; }
-
-#endif
-
-#endif /* __DMI_H__ */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 89153ad..5e8d1bc 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -427,61 +427,6 @@ struct spi_device_id {
__attribute__((aligned(sizeof(kernel_ulong_t))));
};
-/* dmi */
-enum dmi_field {
- DMI_NONE,
- DMI_BIOS_VENDOR,
- DMI_BIOS_VERSION,
- DMI_BIOS_DATE,
- DMI_SYS_VENDOR,
- DMI_PRODUCT_NAME,
- DMI_PRODUCT_VERSION,
- DMI_PRODUCT_SERIAL,
- DMI_PRODUCT_UUID,
- DMI_BOARD_VENDOR,
- DMI_BOARD_NAME,
- DMI_BOARD_VERSION,
- DMI_BOARD_SERIAL,
- DMI_BOARD_ASSET_TAG,
- DMI_CHASSIS_VENDOR,
- DMI_CHASSIS_TYPE,
- DMI_CHASSIS_VERSION,
- DMI_CHASSIS_SERIAL,
- DMI_CHASSIS_ASSET_TAG,
- DMI_STRING_MAX,
-};
-
-struct dmi_strmatch {
- unsigned char slot;
- char substr[79];
-};
-
-#ifndef __KERNEL__
-struct dmi_system_id {
- kernel_ulong_t callback;
- kernel_ulong_t ident;
- struct dmi_strmatch matches[4];
- kernel_ulong_t driver_data
- __attribute__((aligned(sizeof(kernel_ulong_t))));
-};
-#else
-struct dmi_system_id {
- int (*callback)(const struct dmi_system_id *);
- const char *ident;
- struct dmi_strmatch matches[4];
- void *driver_data;
-};
-/*
- * struct dmi_device_id appears during expansion of
- * "MODULE_DEVICE_TABLE(dmi, x)". Compiler doesn't look inside it
- * but this is enough for gcc 3.4.6 to error out:
- * error: storage size of '__mod_dmi_device_table' isn't known
- */
-#define dmi_device_id dmi_system_id
-#endif
-
-#define DMI_MATCH(a, b) { a, b }
-
/*
* sysfw field - right now these are based on x86/ia64's SMBIOS fields. But
* other arches are certainly welcome to add additional fields. The
--
1.6.5.2
^ permalink raw reply related [flat|nested] 5+ messages in thread