Skip to contentSkip to conversation

System Firmware and SMBIOS Support [v3]

PATCH In review Prarit Bhargava 6 participants 48 messages Jul 18, 2011 – Aug 11, 2011

Subsystems (63)
lore
Share & tools
lore
#1 lore raw

PATCH 1/34 System Firmware Interface

In reply to Prarit Bhargava

This patch introduces a general System Firmware interface to the kernel, called sysfw.

Inlcluded in this interface is the ability to search a standard set of fields, sysfw_lookup(). The fields are currently based upon the x86 and ia64 SMBIOS fields but exapandable to fields that other arches may introduce. Also included is the ability to search and match against those fields, and run a callback function against the matches, sysfw_callback().

Modify module code to use sysfw instead of old DMI interface.

[v2]: Modified sysfw_id to include up to 8 matches. Almost all declarations of sysfw_id are __init so the increased kernel image size isn't a big issue.

[v3]: Use sysfs bus instead of class, restore existing dmi class for backwards compatibility.

---
 drivers/firmware/Kconfig        |   25 +++
 drivers/firmware/Makefile       |    3 +-
 drivers/firmware/sysfw-sysfs.c  |  306 +++++++++++++++++++++++++++++++++++++++
 drivers/firmware/sysfw.c        |  168 +++++++++++++++++++++
 include/linux/mod_devicetable.h |   62 ++++++++
 include/linux/sysfw.h           |  113 ++++++++++++++
 init/main.c                     |    3 +
 scripts/mod/file2alias.c        |   52 ++++----
 8 files changed, 705 insertions(+), 27 deletions(-)
 create mode 100644 drivers/firmware/sysfw-sysfs.c
 create mode 100644 drivers/firmware/sysfw.c
 create mode 100644 include/linux/sysfw.h
drivers/firmware/Kconfig +25 -0
index efba163..79a1b9d 100644
@@ -157,6 +157,31 @@ config SIGMA
 	  If unsure, say N here.  Drivers that need these helpers will select
 	  this option automatically.
 
+config SYSTEM_FIRMWARE
+	bool "System Firmware Interface"
+	default y
+	help
+	  Enables common System Firmware Interface to export system firmware
+	  (SMBIOS, DMI, etc.) information to kernel and userspace.
+
+config SYSTEM_FIRMWARE_SYSFS
+	bool "Export System Firmware identification via sysfs to userspace"
+	depends on SYSTEM_FIRMWARE
+	help
+	  Say Y here if you want to query system identification information
+	  from userspace through /sys/class/sysfw/id/ or if you want
+	  system firmware (sysfw) based module auto-loading.
+
+config SYSTEM_FIRMWARE_DMI_COMPAT
+	bool "Export dmi compatibility class in sysfs"
+	depends on SYSTEM_FIRMWARE
+	default y
+	help
+	  This exposes /sys/class/dmi/* as a pointer to the sysfw class for
+	  old software.  This is purely a backwards compatability feature and
+	  should not be used in new user space software.  Please see
+	  Documentation/ABI for details.
+
 source "drivers/firmware/google/Kconfig"
 
 endmenu
drivers/firmware/Makefile +2 -1
index 47338c9..41bc64a 100644
@@ -13,5 +13,6 @@ obj-$(CONFIG_ISCSI_IBFT_FIND)	+= iscsi_ibft_find.o
 obj-$(CONFIG_ISCSI_IBFT)	+= iscsi_ibft.o
 obj-$(CONFIG_FIRMWARE_MEMMAP)	+= memmap.o
 obj-$(CONFIG_SIGMA)		+= sigma.o
-
 obj-$(CONFIG_GOOGLE_FIRMWARE)	+= google/
+obj-$(CONFIG_SYSTEM_FIRMWARE)	+= sysfw.o
+obj-$(CONFIG_SYSTEM_FIRMWARE_SYSFS)	+= sysfw-sysfs.o
drivers/firmware/sysfw-sysfs.c new file +306 -0

306 lines not on this page · raw message

drivers/firmware/sysfw.c new file +168 -0

168 lines not on this page · raw message

include/linux/mod_devicetable.h +62 -0

68 lines not on this page · raw message

include/linux/sysfw.h new file +113 -0

113 lines not on this page · raw message

init/main.c +3 -0
index d7211fa..8b99aeb 100644
@@ -68,6 +68,7 @@
 #include <linux/shmem_fs.h>
 #include <linux/slab.h>
 #include <linux/perf_event.h>
+#include <linux/sysfw.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -554,6 +555,8 @@ asmlinkage void __init start_kernel(void)
 
 	kmem_cache_init_late();
 
+	sysfw_init_late();
+
 	/*
 	 * HACK ALERT! This is early. We're enabling the console before
 	 * we've done PCI setups etc, and console_init() must be aware of
scripts/mod/file2alias.c +26 -26

82 lines not on this page · raw message

Signature · 1 line
1.6.5.2
#13 lore raw

PATCH 2/34 New SMBIOS driver for x86 and ia64.

In reply to Prarit Bhargava

This, along with the System Firmware (sysfw) interface replaces the existing DMI code in the kernel.

This subsystem provides functionality for individual drivers to access the SMBIOS structures for their own use, smbios_walk(), as well as some helper functions for some kernel modules.

---
 Documentation/ABI/obsolete/sysfs-dmi   |   40 ++
 Documentation/ABI/testing/sysfw-smbios |   36 ++
 arch/ia64/Kconfig                      |    5 +
 arch/ia64/include/asm/smbios.h         |   12 +
 arch/x86/Kconfig                       |   10 +
 arch/x86/include/asm/smbios.h          |   19 +
 drivers/firmware/Kconfig               |   20 +
 drivers/firmware/Makefile              |    2 +
 drivers/firmware/smbios-sysfs.c        |  705 ++++++++++++++++++++++++++++++++
 drivers/firmware/smbios.c              |  687 +++++++++++++++++++++++++++++++
 include/linux/smbios.h                 |  243 +++++++++++
 11 files changed, 1779 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ABI/obsolete/sysfs-dmi
 create mode 100644 Documentation/ABI/testing/sysfw-smbios
 create mode 100644 arch/ia64/include/asm/smbios.h
 create mode 100644 arch/x86/include/asm/smbios.h
 create mode 100644 drivers/firmware/smbios-sysfs.c
 create mode 100644 drivers/firmware/smbios.c
 create mode 100644 include/linux/smbios.h
Documentation/ABI/obsolete/sysfs-dmi new file +40 -0
new file mode 100644
index 0000000..547dc4b
@@ -0,0 +1,40 @@
+What:		/sys/class/dmi
+Date:		July 2011
+KernelVersion:	3.0
+Contact:	Prarit Bhargava <[email protected]>
+Description:
+		The dmi class is exported if CONFIG_SMBIOS_DMI_COMPAT is
+		set.
+
+		The DMI code currently exposes several values via sysfs.
+		These values are:
+
+		bios_date: The datestamp of the BIOS.
+		bios_vendor: The company that wrote the BIOS.
+		bios_version: The version of the BIOS.
+		board_asset_tag: A unique identifier for the system
+				 motherboard.
+		board_name: The name of the type of motherboard.
+		board_serial: The serial number of the motherboard.
+		board_vendor: The company that designed the motherboard.
+		board_version: The version of the motherboard.
+		chassis_asset_tag: A unique identifier for the chassis.
+		chassis_serial: The serial number of the chassis.
+		chassis_type: The type of chassis.
+		chassis_vendor: The company that designed the chassis.
+		chassis_version: The version of the chassis.
+		product_name: The name of the system as determined by the
+			      OEM.
+		product_serial: The serial number of the system.
+		product_uuid: A unique UUID for the system.
+		product_version: The version number of the system.
+		sys_vendor: The OEM company for the system.
+
+		In addition to these the standard class files are exposed
+		for DMI (uvent, power, subsystem) as well as a modalias
+		file.
+
+		The dmi class is deprecated and should not be used by new
+		code.  Existing code should be migrated to use
+		/sys/class/smbios/* which exposes the same data.
+		The dmi class link will be removed in July of 2013.
Documentation/ABI/testing/sysfw-smbios new file +36 -0
new file mode 100644
index 0000000..c6045f1
@@ -0,0 +1,36 @@
+What:		/sys/bus/sysfw
+Date:		May 1 2011
+KernelVersion:	2.6.39
+Contact:	Prarit Bhargava <[email protected]>
+Description:
+		The dmi class is exported if CONFIG_SMBIOS is set.
+
+		The SMBIOS code currently exposes several values via sysfs
+		primarily for use by module handling code.
+
+		These values are:
+
+		bios_date: The datestamp of the BIOS.
+		bios_vendor: The company that wrote the BIOS.
+		bios_version: The version of the BIOS.
+		board_asset_tag: A unique identifier for the system
+				 motherboard.
+		board_name: The name of the type of motherboard.
+		board_serial: The serial number of the motherboard.
+		board_vendor: The company that designed the motherboard.
+		board_version: The version of the motherboard.
+		chassis_asset_tag: A unique identifier for the chassis.
+		chassis_serial: The serial number of the chassis.
+		chassis_type: The type of chassis.
+		chassis_vendor: The company that designed the chassis.
+		chassis_version: The version of the chassis.
+		product_name: The name of the system as determined by the
+			      OEM.
+		product_serial: The serial number of the system.
+		product_uuid: A unique UUID for the system.
+		product_version: The version number of the system.
+		sys_vendor: The OEM company for the system.
+
+		In addition to these the standard class files are exposed
+		for SMBIOS (uvent, power, subsystem) as well as a modalias
+		file.
arch/ia64/Kconfig +5 -0
index 38280ef..ac14d3c 100644
@@ -93,6 +93,11 @@ config DMI
 	bool
 	default y
 
+config SMBIOS
+	bool
+	default y
+	depends on SYSTEM_FIRMWARE
+
 config EFI
 	bool
 	default y
arch/ia64/include/asm/smbios.h new file +12 -0
new file mode 100644
index 0000000..19c0019
@@ -0,0 +1,12 @@
+#ifndef _ASM_SMBIOS_H
+#define _ASM_SMBIOS_H 1
+
+#include <linux/slab.h>
+#include <asm/io.h>
+
+/* Use normal IO mappings for SMBIOS */
+#define smbios_ioremap ioremap
+#define smbios_iounmap(x, l) iounmap(x)
+#define smbios_alloc(l) kmalloc(l, GFP_ATOMIC)
+
+#endif
arch/x86/Kconfig +10 -0
index da34972..e7cdde8 100644
@@ -635,6 +635,16 @@ config DMI
 	  affected by entries in the DMI blacklist. Required by PNP
 	  BIOS code.
 
+config SMBIOS
+	depends on SYSTEM_FIRMWARE
+	bool "Enable SMBIOS scanning" if EXPERT
+	default y
+	---help---
+	  Enabled scanning of SMBIOS to identify machine quirks. Say Y
+	  here unless you have verified that your setup is not
+	  affected by entries in the SMBIOS blacklist. Required by PNP
+	  BIOS code.
+
 config GART_IOMMU
 	bool "GART IOMMU support" if EXPERT
 	default y
arch/x86/include/asm/smbios.h new file +19 -0
new file mode 100644
index 0000000..767270b
@@ -0,0 +1,19 @@
+#ifndef _ASM_X86_SMBIOS_H
+#define _ASM_X86_SMBIOS_H
+
+#include <linux/compiler.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+#include <asm/setup.h>
+
+static __always_inline __init void *smbios_alloc(unsigned len)
+{
+	return extend_brk(len, sizeof(int));
+}
+
+/* Use early IO mappings for SMBIOS because it's initialized early */
+#define smbios_ioremap early_ioremap
+#define smbios_iounmap early_iounmap
+
+#endif /* _ASM_X86_SMBIOS_H */
drivers/firmware/Kconfig +20 -0
index 79a1b9d..23066d8 100644
@@ -182,6 +182,26 @@ config SYSTEM_FIRMWARE_DMI_COMPAT
 	  should not be used in new user space software.  Please see
 	  Documentation/ABI for details.
 
+config SYSTEM_FIRMWARE_DMI_COMPAT
+	bool "Export dmi compatibility class in sysfs"
+	depends on SMBIOSID
+	default y
+	help
+	  This exposes /sys/class/dmi/* as a pointer to the sysfw class for
+	  old software.  This is purely a backwards compatability feature and
+	  should not be used in new user space software.  Please see
+	  Documentation/ABI for details.
+
+config SMBIOS_SYSFS
+	tristate "SMBIOS table support in sysfs"
+	depends on SYSFS && SMBIOS
+	help
+	  Say Y or M here to enable the exporting of the raw SMBIOS 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/smbios when this option is enabled and
+	  loaded.
+
 source "drivers/firmware/google/Kconfig"
 
 endmenu
drivers/firmware/Makefile +2 -0
index 41bc64a..5c9d81f 100644
@@ -16,3 +16,5 @@ obj-$(CONFIG_SIGMA)		+= sigma.o
 obj-$(CONFIG_GOOGLE_FIRMWARE)	+= google/
 obj-$(CONFIG_SYSTEM_FIRMWARE)	+= sysfw.o
 obj-$(CONFIG_SYSTEM_FIRMWARE_SYSFS)	+= sysfw-sysfs.o
+obj-$(CONFIG_SMBIOS)		+= smbios.o
+obj-$(CONFIG_SMBIOS_SYSFS)	+= smbios-sysfs.o
drivers/firmware/smbios-sysfs.c new file +705 -0

705 lines not on this page · raw message

drivers/firmware/smbios.c new file +687 -0

687 lines not on this page · raw message

include/linux/smbios.h new file +243 -0

243 lines not on this page · raw message

Signature · 6 lines
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#14 lore raw

PATCH 3/34 arch specific changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

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

---
 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(-)
arch/ia64/kernel/setup.c +4 -4
index 5e2c724..e170fcc 100644
@@ -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);
arch/x86/include/asm/mmconfig.h +2 -2
index 9b119da..1831965 100644
@@ -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 */
arch/x86/include/asm/pci_x86.h +3 -3
index 7045267..28e3f3a 100644
@@ -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);
arch/x86/kernel/acpi/boot.c +89 -88

263 lines not on this page · raw message

arch/x86/kernel/acpi/sleep.c +0 -1
index 103b6ab..c96b82d 100644
@@ -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>
arch/x86/kernel/apic/apic.c +10 -10
index b9338b8..a3a176d 100644
@@ -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;
 
arch/x86/kernel/apic/bigsmp_32.c +21 -16
index efd737e..76bee5d 100644
@@ -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 = {
arch/x86/kernel/apm_32.c +245 -146

544 lines not on this page · raw message

arch/x86/kernel/cpu/amd.c +1 -1
index b13ed39..79fd786 100644
@@ -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();
 	}
arch/x86/kernel/cpu/vmware.c +13 -4
index d22d0c4..e427451 100644
@@ -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;
arch/x86/kernel/io_delay.c +21 -21

96 lines not on this page · raw message

arch/x86/kernel/mmconf-fam10h_64.c +14 -14
index ac861b8..f24400a 100644
@@ -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);
 }
arch/x86/kernel/probe_roms.c +0 -1
index ba0a4cc..e36d641 100644
@@ -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>
arch/x86/kernel/process.c +4 -4
index e1ba8cb..c1d7c54 100644
@@ -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",
arch/x86/kernel/reboot.c +70 -62

314 lines not on this page · raw message

arch/x86/kernel/setup.c +7 -7
index afaf384..8b74838 100644
@@ -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();
 
arch/x86/kernel/tsc.c +8 -8
index 6cc6922..36c4160 100644
@@ -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");
arch/x86/pci/acpi.c +8 -10
index 68c3c13..51517a1 100644
@@ -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?id183 */
 	{
 		.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?id007 */
@@ -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
arch/x86/pci/broadcom_bus.c +0 -1
index ab8269b..c332b7b 100644
@@ -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>
arch/x86/pci/common.c +84 -79

390 lines not on this page · raw message

arch/x86/pci/direct.c +3 -4
index e6fd847..217d788 100644
@@ -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++) {
arch/x86/pci/fixup.c +17 -16
index 6dd8955..381c136 100644
@@ -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 */
arch/x86/pci/init.c +2 -2
index adb62aa..9afdbc3 100644
@@ -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;
 }
arch/x86/pci/irq.c +13 -13
index 372e9b8..3e2ac8f 100644
@@ -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();
 
arch/x86/pci/mmconfig-shared.c +3 -7
index 750c346..730b36b 100644
@@ -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,
arch/x86/pci/mrst.c +0 -1
index cb29191..741dbb0 100644
@@ -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>
drivers/cpufreq/acpi-cpufreq.c +8 -8
index 596d5dd..6880c41 100644
@@ -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));
drivers/cpufreq/powernow-k7.c +7 -7
index d71d9f3..ce33c9f 100644
@@ -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();
Signature · 1 line
1.6.5.2
#15 lore raw

PATCH 4/34 drivers/acpi changes for SMBIOS and System Firmware interface

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- 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

---
 drivers/acpi/battery.c           |    5 +-
 drivers/acpi/blacklist.c         |  125 ++++++++++++++++++-------------------
 drivers/acpi/bus.c               |   16 +++---
 drivers/acpi/ec.c                |  101 ++++++++++++++++++++++---------
 drivers/acpi/osl.c               |   17 +++---
 drivers/acpi/pci_irq.c           |   33 +++++-----
 drivers/acpi/pci_slot.c          |   12 ++--
 drivers/acpi/processor_core.c    |   25 +++++---
 drivers/acpi/processor_driver.c  |    1 -
 drivers/acpi/processor_idle.c    |   51 +++++++++++-----
 drivers/acpi/scan.c              |    4 +-
 drivers/acpi/sleep.c             |   46 +++++++-------
 drivers/acpi/thermal.c           |   42 +++++++------
 drivers/acpi/video.c             |   28 ++++----
 drivers/acpi/video_detect.c      |    3 +-
 drivers/hwmon/acpi_power_meter.c |   15 +++--
 16 files changed, 295 insertions(+), 229 deletions(-)
drivers/acpi/battery.c +2 -3
index fcc13ac..cf4faba 100644
@@ -31,7 +31,7 @@
 #include <linux/types.h>
 #include <linux/jiffies.h>
 #include <linux/async.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 #include <linux/suspend.h>
 
@@ -575,9 +575,8 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
 
 static void acpi_battery_quirks(struct acpi_battery *battery)
 {
-	if (dmi_name_in_vendors("Acer") && battery->power_unit) {
+	if (sysfw_vendor_is("Acer") && battery->power_unit)
 		set_bit(ACPI_BATTERY_QUIRK_SIGNED16_CURRENT, &battery->flags);
-	}
 }
 
 /*
drivers/acpi/blacklist.c +61 -64

257 lines not on this page · raw message

drivers/acpi/bus.c +8 -8
index d1e06c1..09ad035 100644
@@ -39,7 +39,7 @@
 #include <linux/pci.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/suspend.h>
 
 #include "internal.h"
@@ -55,7 +55,7 @@ EXPORT_SYMBOL(acpi_root_dir);
 
 
 #ifdef CONFIG_X86
-static int set_copy_dsdt(const struct dmi_system_id *id)
+static int set_copy_dsdt(const struct sysfw_id *id)
 {
 	printk(KERN_NOTICE "%s detected - "
 		"force copy of DSDT to local memory\n", id->ident);
@@ -63,7 +63,7 @@ static int set_copy_dsdt(const struct dmi_system_id *id)
 	return 0;
 }
 
-static struct dmi_system_id dsdt_dmi_table[] __initdata = {
+static struct sysfw_id dsdt_id_table[] __initdata = {
 	/*
 	 * Invoke DSDT corruption work-around on all Toshiba Satellite.
 	 * https://bugzilla.kernel.org/show_bug.cgi?id=14679
@@ -72,14 +72,14 @@ static struct dmi_system_id dsdt_dmi_table[] __initdata = {
 	 .callback = set_copy_dsdt,
 	 .ident = "TOSHIBA Satellite",
 	 .matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"),
+		SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Satellite"),
 		},
 	},
 	{}
 };
 #else
-static struct dmi_system_id dsdt_dmi_table[] __initdata = {
+static struct sysfw_id dsdt_id_table[] __initdata = {
 	{}
 };
 #endif
@@ -856,10 +856,10 @@ void __init acpi_early_init(void)
 	acpi_gbl_permanent_mmap = 1;
 
 	/*
-	 * If the machine falls into the DMI check table,
+	 * If the machine falls into the SMBIOS check table,
 	 * DSDT will be copied to memory
 	 */
-	dmi_check_system(dsdt_dmi_table);
+	sysfw_callback(dsdt_id_table);
 
 	status = acpi_reallocate_root_table();
 	if (ACPI_FAILURE(status)) {
drivers/acpi/ec.c +72 -29

155 lines not on this page · raw message

drivers/acpi/osl.c +9 -8
index 52ca964..bbf1c68 100644
@@ -141,13 +141,13 @@ static void __init acpi_osi_setup_late(void);
  * BIOS writers should NOT query _OSI(Linux) on future systems.
  * Linux will complain on the console when it sees it, and return FALSE.
  * To get Linux to return TRUE for your system  will require
- * a kernel source update to add a DMI entry,
+ * a kernel source update to add a SMBIOS entry,
  * or boot with "acpi_osi=Linux"
  */
 
 static struct osi_linux {
 	unsigned int	enable:1;
-	unsigned int	dmi:1;
+	unsigned int	smbios:1;
 	unsigned int	cmdline:1;
 } osi_linux = {0, 0, 0};
 
@@ -159,7 +159,7 @@ static u32 acpi_osi_handler(acpi_string interface, u32 supported)
 			"BIOS _OSI(Linux) query %s%s\n",
 			osi_linux.enable ? "honored" : "ignored",
 			osi_linux.cmdline ? " via cmdline" :
-			osi_linux.dmi ? " via DMI" : "");
+			osi_linux.smbios ? " via SMBIOS" : "");
 	}
 
 	return supported;
@@ -1133,21 +1133,22 @@ static void __init set_osi_linux(unsigned int enable)
 
 static void __init acpi_cmdline_osi_linux(unsigned int enable)
 {
-	osi_linux.cmdline = 1;	/* cmdline set the default and override DMI */
-	osi_linux.dmi = 0;
+	/* cmdline set the default and override SMBIOS */
+	osi_linux.cmdline = 1;
+	osi_linux.smbios = 0;
 	set_osi_linux(enable);
 
 	return;
 }
 
-void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d)
+void __init acpi_smbios_osi_linux(int enable, const struct sysfw_id *d)
 {
-	printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
+	printk(KERN_NOTICE PREFIX "SMBIOS detected: %s\n", d->ident);
 
 	if (enable == -1)
 		return;
 
-	osi_linux.dmi = 1;	/* DMI knows that this box asks OSI(Linux) */
+	osi_linux.smbios = 1;	/* SMBIOS knows that this box asks OSI(Linux) */
 	set_osi_linux(enable);
 
 	return;
drivers/acpi/pci_irq.c +17 -16
index f907cfb..ffc7af3 100644
@@ -27,7 +27,7 @@
  */
 
 
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -88,44 +88,45 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(struct pci_dev *dev,
 }
 
 /* http://bugzilla.kernel.org/show_bug.cgi?id=4773 */
-static const struct dmi_system_id medion_md9580[] = {
+static const struct sysfw_id medion_md9580[] = {
 	{
 		.ident = "Medion MD9580-F laptop",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A555"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MEDIONNB"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A555"),
 		},
 	},
-	{ }
+	{}
 };
 
 /* http://bugzilla.kernel.org/show_bug.cgi?id=5044 */
-static const struct dmi_system_id dell_optiplex[] = {
+static const struct sysfw_id dell_optiplex[] = {
 	{
 		.ident = "Dell Optiplex GX1",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex GX1 600S+"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OptiPlex GX1 600S+"),
 		},
 	},
-	{ }
+	{}
 };
 
 /* http://bugzilla.kernel.org/show_bug.cgi?id=10138 */
-static const struct dmi_system_id hp_t5710[] = {
+static const struct sysfw_id hp_t5710[] = {
 	{
 		.ident = "HP t5710",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "hp t5000 series"),
-			DMI_MATCH(DMI_BOARD_NAME, "098Ch"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "hp t5000 series"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "098Ch"),
 		},
 	},
-	{ }
+	{}
 };
 
 struct prt_quirk {
-	const struct dmi_system_id *system;
+	const struct sysfw_id *system;
 	unsigned int		segment;
 	unsigned int		bus;
 	unsigned int		device;
@@ -166,7 +167,7 @@ static void do_prt_fixups(struct acpi_prt_entry *entry,
 		if (!prt->source)
 			continue;
 
-		if (dmi_check_system(quirk->system) &&
+		if (sysfw_callback(quirk->system) &&
 		    entry->id.segment == quirk->segment &&
 		    entry->id.bus == quirk->bus &&
 		    entry->id.device == quirk->device &&
drivers/acpi/pci_slot.c +6 -6
index 07f7fea..1db7f02 100644
@@ -32,7 +32,7 @@
 #include <linux/acpi.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 static int debug;
 static int check_sta_before_sun;
@@ -329,14 +329,14 @@ acpi_pci_slot_remove(acpi_handle handle)
 	mutex_unlock(&slot_list_lock);
 }
 
-static int do_sta_before_sun(const struct dmi_system_id *d)
+static int do_sta_before_sun(const struct sysfw_id *d)
 {
 	info("%s detected: will evaluate _STA before calling _SUN\n", d->ident);
 	check_sta_before_sun = 1;
 	return 0;
 }
 
-static struct dmi_system_id acpi_pci_slot_dmi_table[] __initdata = {
+static struct sysfw_id acpi_pci_slot_id_table[] __initdata = {
 	/*
 	 * Fujitsu Primequest machines will return 1023 to indicate an
 	 * error if the _SUN method is evaluated on SxFy objects that
@@ -347,8 +347,8 @@ static struct dmi_system_id acpi_pci_slot_dmi_table[] __initdata = {
 	 .callback = do_sta_before_sun,
 	 .ident = "Fujitsu PRIMEQUEST",
 	 .matches = {
-		DMI_MATCH(DMI_BIOS_VENDOR, "FUJITSU LIMITED"),
-		DMI_MATCH(DMI_BIOS_VERSION, "PRIMEQUEST"),
+		SYSFW_MATCH(SYSFW_BIOS_VENDOR, "FUJITSU LIMITED"),
+		SYSFW_MATCH(SYSFW_BIOS_VERSION, "PRIMEQUEST"),
 		},
 	},
 	{}
@@ -357,7 +357,7 @@ static struct dmi_system_id acpi_pci_slot_dmi_table[] __initdata = {
 static int __init
 acpi_pci_slot_init(void)
 {
-	dmi_check_system(acpi_pci_slot_dmi_table);
+	sysfw_callback(acpi_pci_slot_id_table);
 	acpi_pci_register_driver(&acpi_pci_slot_driver);
 	return 0;
 }
drivers/acpi/processor_core.c +15 -10
index 02d2a4c..ab3955a 100644
@@ -7,7 +7,7 @@
  *	Venkatesh Pallipadi <[email protected]>
  *	- Added _PDC for platforms with Intel CPUs
  */
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 
 #include <acpi/acpi_drivers.h>
@@ -19,7 +19,7 @@
 #define _COMPONENT		ACPI_PROCESSOR_COMPONENT
 ACPI_MODULE_NAME("processor_core");
 
-static int __init set_no_mwait(const struct dmi_system_id *id)
+static int __init set_no_mwait(const struct sysfw_id *id)
 {
 	printk(KERN_NOTICE PREFIX "%s detected - "
 		"disabling mwait for CPU C-states\n", id->ident);
@@ -27,13 +27,18 @@ static int __init set_no_mwait(const struct dmi_system_id *id)
 	return 0;
 }
 
-static struct dmi_system_id __initdata processor_idle_dmi_table[] = {
+static struct sysfw_id __initdata processor_idle_id_table[] = {
 	{
-	set_no_mwait, "Extensa 5220", {
-	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-	DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-	DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
-	DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL},
+		.callback = set_no_mwait,
+		.ident = "Extensa 5220",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies LTD"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "0100"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Columbia")
+		}
+	},
 	{},
 };
 
@@ -343,10 +348,10 @@ early_init_pdc(acpi_handle handle, u32 lvl, void *context, void **rv)
 void __init acpi_early_processor_set_pdc(void)
 {
 	/*
-	 * Check whether the system is DMI table. If yes, OSPM
+	 * Check whether the system is SMBIOS table. If yes, OSPM
 	 * should not use mwait for CPU-states.
 	 */
-	dmi_check_system(processor_idle_dmi_table);
+	sysfw_callback(processor_idle_id_table);
 
 	acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
 			    ACPI_UINT32_MAX,
drivers/acpi/processor_driver.c +0 -1
index a4e0f1b..a78045e 100644
@@ -40,7 +40,6 @@
 #include <linux/pm.h>
 #include <linux/cpufreq.h>
 #include <linux/cpu.h>
-#include <linux/dmi.h>
 #include <linux/moduleparam.h>
 #include <linux/cpuidle.h>
 #include <linux/slab.h>
drivers/acpi/processor_idle.c +35 -16

75 lines not on this page · raw message

drivers/acpi/scan.c +2 -2
index 449c556..ff94b79 100644
@@ -9,7 +9,7 @@
 #include <linux/acpi.h>
 #include <linux/signal.h>
 #include <linux/kthread.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <acpi/acpi_drivers.h>
 
@@ -1083,7 +1083,7 @@ static int acpi_ibm_smbus_match(struct acpi_device *device)
 	struct acpi_buffer path = {ACPI_ALLOCATE_BUFFER, NULL};
 	int result;
 
-	if (!dmi_name_in_vendors("IBM"))
+	if (!sysfw_vendor_is("IBM"))
 		return -ENODEV;
 
 	/* Look for SMBS object */
drivers/acpi/sleep.c +23 -23

127 lines not on this page · raw message

drivers/acpi/thermal.c +22 -20

106 lines not on this page · raw message

drivers/acpi/video.c +14 -14
index db39e9e..b28912b 100644
@@ -38,7 +38,7 @@
 #include <linux/pci_ids.h>
 #include <linux/slab.h>
 #include <asm/uaccess.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 #include <linux/suspend.h>
@@ -384,13 +384,13 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
  */
 
 static int bqc_offset_aml_bug_workaround;
-static int __init video_set_bqc_offset(const struct dmi_system_id *d)
+static int __init video_set_bqc_offset(const struct sysfw_id *d)
 {
 	bqc_offset_aml_bug_workaround = 9;
 	return 0;
 }
 
-static struct dmi_system_id video_dmi_table[] __initdata = {
+static struct sysfw_id video_id_table[] __initdata = {
 	/*
 	 * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
 	 */
@@ -398,40 +398,40 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
 	 .callback = video_set_bqc_offset,
 	 .ident = "Acer Aspire 5720",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5720"),
 		},
 	},
 	{
 	 .callback = video_set_bqc_offset,
 	 .ident = "Acer Aspire 5710Z",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710Z"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5710Z"),
 		},
 	},
 	{
 	 .callback = video_set_bqc_offset,
 	 .ident = "eMachines E510",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "EMACHINES"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "eMachines E510"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "EMACHINES"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "eMachines E510"),
 		},
 	},
 	{
 	 .callback = video_set_bqc_offset,
 	 .ident = "Acer Aspire 5315",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5315"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5315"),
 		},
 	},
 	{
 	 .callback = video_set_bqc_offset,
 	 .ident = "Acer Aspire 7720",
 	 .matches = {
-		DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"),
+		SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer"),
+		SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 7720"),
 		},
 	},
 	{}
@@ -1801,7 +1801,7 @@ EXPORT_SYMBOL(acpi_video_unregister);
 
 static int __init acpi_video_init(void)
 {
-	dmi_check_system(video_dmi_table);
+	sysfw_callback(video_id_table);
 
 	if (intel_opregion_present())
 		return 0;
drivers/acpi/video_detect.c +1 -2
index 5af3479..41f0d10 100644
@@ -34,7 +34,6 @@
  */
 
 #include <linux/acpi.h>
-#include <linux/dmi.h>
 #include <linux/pci.h>
 
 #define PREFIX "ACPI: "
@@ -158,7 +157,7 @@ long acpi_video_get_capabilities(acpi_handle graphics_handle)
 		/* Add blacklists here. Be careful to use the right *DMI* bits
 		 * to still be able to override logic via boot params, e.g.:
 		 *
-		 *   if (dmi_name_in_vendors("XY")) {
+		 *   if (smbios_vendor_is("XY")) {
 		 *	acpi_video_support |=
 		 *		ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
 		 *}
drivers/hwmon/acpi_power_meter.c +8 -7
index 66f6729..47175c6 100644
@@ -24,7 +24,7 @@
 #include <linux/hwmon-sysfs.h>
 #include <linux/jiffies.h>
 #include <linux/mutex.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 #include <linux/kdev_t.h>
 #include <linux/sched.h>
@@ -975,17 +975,18 @@ static struct acpi_driver acpi_power_meter_driver = {
 };
 
 /* Module init/exit routines */
-static int __init enable_cap_knobs(const struct dmi_system_id *d)
+static int __init enable_cap_knobs(const struct sysfw_id *d)
 {
 	cap_in_hardware = 1;
 	return 0;
 }
 
-static struct dmi_system_id __initdata pm_dmi_table[] = {
+static struct sysfw_id __initdata pm_id_table[] = {
 	{
-		enable_cap_knobs, "IBM Active Energy Manager",
-		{
-			DMI_MATCH(DMI_SYS_VENDOR, "IBM")
+		.callback = enable_cap_knobs,
+		.ident = "IBM Active Energy Manager",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM")
 		},
 	},
 	{}
@@ -998,7 +999,7 @@ static int __init acpi_power_meter_init(void)
 	if (acpi_disabled)
 		return -ENODEV;
 
-	dmi_check_system(pm_dmi_table);
+	sysfw_callback(pm_id_table);
 
 	result = acpi_bus_register_driver(&acpi_power_meter_driver);
 	if (result < 0)
Signature · 1 line
1.6.5.2
#16 lore raw

PATCH 5/34 drivers/ata changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- 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

[v2]: removed sysfw_match() from ata_piix.c code. The matching code is limited to four matches, and this manual comparison was required. The sysfw_id struct now has been modified to allow up to 8 matches instead so the need for sysfw_match() has been eliminated.

---
 drivers/ata/acard-ahci.c  |    1 -
 drivers/ata/ahci.c        |  177 +++++++++++++++++++++++----------------------
 drivers/ata/ata_piix.c    |  154 +++++++++++++++++++++------------------
 drivers/ata/pata_ali.c    |   18 +++---
 drivers/ata/pata_cs5530.c |   12 ++--
 drivers/ata/pata_rdc.c    |    1 -
 drivers/ata/pata_sch.c    |    1 -
 drivers/ata/pata_via.c    |   14 ++--
 drivers/ata/sata_sil.c    |   19 +++---
 9 files changed, 203 insertions(+), 194 deletions(-)
drivers/ata/acard-ahci.c +0 -1
index ae22be4..d16b700 100644
@@ -42,7 +42,6 @@
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
 #include <linux/device.h>
-#include <linux/dmi.h>
 #include <linux/gfp.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_cmnd.h>
drivers/ata/ahci.c +89 -88

350 lines not on this page · raw message

drivers/ata/ata_piix.c +82 -72

307 lines not on this page · raw message

drivers/ata/pata_ali.c +9 -9
index 794ec6e..d6e158b 100644
@@ -32,7 +32,7 @@
 #include <linux/delay.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define DRV_NAME "pata_ali"
 #define DRV_VERSION "0.7.8"
@@ -47,22 +47,22 @@ static struct pci_dev *ali_isa_bridge;
  *	Cable special cases
  */
 
-static const struct dmi_system_id cable_dmi_table[] = {
+static const struct sysfw_id cable_override_table[] = {
 	{
 		.ident = "HP Pavilion N5430",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "OmniBook N32N-736"),
 		},
 	},
 	{
 		.ident = "Toshiba Satelite S1800-814",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "S1800-814"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "S1800-814"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int ali_cable_override(struct pci_dev *pdev)
@@ -73,8 +73,8 @@ static int ali_cable_override(struct pci_dev *pdev)
 	/* Mitac 8317 (Winbook-A) and relatives */
 	if (pdev->subsystem_vendor == 0x1071 && pdev->subsystem_device == 0x8317)
 		return 1;
-	/* Systems by DMI */
-	if (dmi_check_system(cable_dmi_table))
+	/* Systems by SMBIOS */
+	if (sysfw_callback(cable_override_table))
 		return 1;
 	return 0;
 }
drivers/ata/pata_cs5530.c +6 -6
index f792330..085820a 100644
@@ -31,7 +31,7 @@
 #include <linux/delay.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define DRV_NAME	"pata_cs5530"
 #define DRV_VERSION	"0.7.4"
@@ -175,20 +175,20 @@ static struct ata_port_operations cs5530_port_ops = {
 	.set_dmamode	= cs5530_set_dmamode,
 };
 
-static const struct dmi_system_id palmax_dmi_table[] = {
+static const struct sysfw_id palmax_id_table[] = {
 	{
 		.ident = "Palmax PD1100",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Cyrix"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Caddis"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Cyrix"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Caddis"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int cs5530_is_palmax(void)
 {
-	if (dmi_check_system(palmax_dmi_table)) {
+	if (sysfw_callback(palmax_id_table)) {
 		printk(KERN_INFO "Palmax PD1100: Disabling DMA on docking port.\n");
 		return 1;
 	}
drivers/ata/pata_rdc.c +0 -1
index 5fbe9b1..497f514 100644
@@ -31,7 +31,6 @@
 #include <linux/gfp.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
 
 #define DRV_NAME	"pata_rdc"
 #define DRV_VERSION	"0.01"
drivers/ata/pata_sch.c +0 -1
index e97b32f..8b95c13 100644
@@ -33,7 +33,6 @@
 #include <linux/device.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
 
 #define DRV_NAME	"pata_sch"
 #define DRV_VERSION	"0.2"
drivers/ata/pata_via.c +7 -7
index ac8d7d9..2175119 100644
@@ -61,7 +61,7 @@
 #include <linux/gfp.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define DRV_NAME "pata_via"
 #define DRV_VERSION "0.3.4"
@@ -132,21 +132,21 @@ struct via_port {
  *	Cable special cases
  */
 
-static const struct dmi_system_id cable_dmi_table[] = {
+static const struct sysfw_id cable_override_table[] = {
 	{
 		.ident = "Acer Ferrari 3400",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Acer,Inc."),
-			DMI_MATCH(DMI_BOARD_NAME, "Ferrari 3400"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer,Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Ferrari 3400"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int via_cable_override(struct pci_dev *pdev)
 {
-	/* Systems by DMI */
-	if (dmi_check_system(cable_dmi_table))
+	/* Systems by SMBIOS */
+	if (sysfw_callback(cable_override_table))
 		return 1;
 	/* Arima W730-K8/Targa Visionary 811/... */
 	if (pdev->subsystem_vendor == 0x161F && pdev->subsystem_device == 0x2032)
drivers/ata/sata_sil.c +10 -9
index b42edaa..fff0e2b 100644
@@ -44,7 +44,7 @@
 #include <linux/device.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define DRV_NAME	"sata_sil"
 #define DRV_VERSION	"2.4"
@@ -707,23 +707,24 @@ static void sil_init_controller(struct ata_host *host)
 
 static bool sil_broken_system_poweroff(struct pci_dev *pdev)
 {
-	static const struct dmi_system_id broken_systems[] = {
+	static const struct sysfw_id broken_systems[] = {
 		{
 			.ident = "HP Compaq nx6325",
 			.matches = {
-				DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-				DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6325"),
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					    "Hewlett-Packard"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME,
+					    "HP Compaq nx6325"),
 			},
 			/* PCI slot number of the controller */
 			.driver_data = (void *)0x12UL,
 		},
-
-		{ }	/* terminate list */
+		{}	/* terminate list */
 	};
-	const struct dmi_system_id *dmi = dmi_first_match(broken_systems);
+	const struct sysfw_id *id = sysfw_callback(broken_systems);
 
-	if (dmi) {
-		unsigned long slot = (unsigned long)dmi->driver_data;
+	if (id) {
+		unsigned long slot = (unsigned long)id->driver_data;
 		/* apply the quirk only to on-board controllers */
 		return slot == PCI_SLOT(pdev->devfn);
 	}
Signature · 1 line
1.6.5.2
#18 lore raw

PATCH 7/34 drivers/char changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables

---
 drivers/char/i8k.c               |   75 +++++++++---------
 drivers/char/ipmi/ipmi_si_intf.c |  159 +++++++++++++++++++-------------------
 drivers/char/sonypi.c            |   16 ++--
 3 files changed, 125 insertions(+), 125 deletions(-)
drivers/char/i8k.c +39 -36
index 6e40072..f198fac 100644
@@ -24,7 +24,7 @@
 #include <linux/init.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/capability.h>
 #include <linux/mutex.h>
 #include <linux/hwmon.h>
@@ -73,9 +73,10 @@ static int force;
 module_param(force, bool, 0);
 MODULE_PARM_DESC(force, "Force loading without checking for supported models");
 
-static int ignore_dmi;
-module_param(ignore_dmi, bool, 0);
-MODULE_PARM_DESC(ignore_dmi, "Continue probing hardware even if DMI data does not match");
+static int ignore_smbios;
+module_param(ignore_smbios, bool, 0);
+MODULE_PARM_DESC(ignore_smbios,
+		"Continue probing hardware even if SMBIOS data does not match");
 
 static int restricted;
 module_param(restricted, bool, 0);
@@ -110,11 +111,11 @@ struct smm_regs {
 	unsigned int edi __attribute__ ((packed));
 };
 
-static inline const char *i8k_get_dmi_data(int field)
+static inline const char *i8k_get_smbios_data(int field)
 {
-	const char *dmi_data = dmi_get_system_info(field);
+	const char *smbios_data = sysfw_lookup(field);
 
-	return dmi_data && *dmi_data ? dmi_data : "?";
+	return smbios_data && *smbios_data ? smbios_data : "?";
 }
 
 /*
@@ -333,7 +334,8 @@ i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
 
 	case I8K_MACHINE_ID:
 		memset(buff, 0, 16);
-		strlcpy(buff, i8k_get_dmi_data(DMI_PRODUCT_SERIAL), sizeof(buff));
+		strlcpy(buff, i8k_get_smbios_data(SYSFW_PRODUCT_SERIAL),
+			sizeof(buff));
 		break;
 
 	case I8K_FN_STATUS:
@@ -450,7 +452,7 @@ static int i8k_proc_show(struct seq_file *seq, void *offset)
 	return seq_printf(seq, "%s %s %s %d %d %d %d %d %d %d\n",
 			  I8K_PROC_FMT,
 			  bios_version,
-			  i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
+			  i8k_get_smbios_data(SYSFW_PRODUCT_SERIAL),
 			  cpu_temp,
 			  left_fan, right_fan, left_speed, right_speed,
 			  ac_power, fn_key);
@@ -607,64 +609,64 @@ static void __exit i8k_exit_hwmon(void)
 	hwmon_device_unregister(i8k_hwmon_dev);
 }
 
-static struct dmi_system_id __initdata i8k_dmi_table[] = {
+static struct sysfw_id __initdata i8k_smbios_table[] = {
 	{
 		.ident = "Dell Inspiron",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Computer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron"),
 		},
 	},
 	{
 		.ident = "Dell Latitude",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Computer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Latitude"),
 		},
 	},
 	{
 		.ident = "Dell Inspiron 2",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron"),
 		},
 	},
 	{
 		.ident = "Dell Latitude 2",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Latitude"),
 		},
 	},
 	{	/* UK Inspiron 6400  */
 		.ident = "Dell Inspiron 3",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MM061"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MM061"),
 		},
 	},
 	{
 		.ident = "Dell Inspiron 3",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MP061"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MP061"),
 		},
 	},
 	{
 		.ident = "Dell Precision",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Precision"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Precision"),
 		},
 	},
 	{
 		.ident = "Dell Vostro",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Vostro"),
 		},
 	},
-        { }
+	{}
 };
 
 /*
@@ -676,20 +678,21 @@ static int __init i8k_probe(void)
 	int version;
 
 	/*
-	 * Get DMI information
+	 * Get SMBIOS information
 	 */
-	if (!dmi_check_system(i8k_dmi_table)) {
-		if (!ignore_dmi && !force)
+	if (!sysfw_callback(i8k_smbios_table)) {
+		if (!ignore_smbios && !force)
 			return -ENODEV;
 
 		printk(KERN_INFO "i8k: not running on a supported Dell system.\n");
 		printk(KERN_INFO "i8k: vendor=%s, model=%s, version=%s\n",
-			i8k_get_dmi_data(DMI_SYS_VENDOR),
-			i8k_get_dmi_data(DMI_PRODUCT_NAME),
-			i8k_get_dmi_data(DMI_BIOS_VERSION));
+			i8k_get_smbios_data(SYSFW_SYS_VENDOR),
+			i8k_get_smbios_data(SYSFW_PRODUCT_NAME),
+			i8k_get_smbios_data(SYSFW_BIOS_VERSION));
 	}
 
-	strlcpy(bios_version, i8k_get_dmi_data(DMI_BIOS_VERSION), sizeof(bios_version));
+	strlcpy(bios_version, i8k_get_smbios_data(SYSFW_BIOS_VERSION),
+		sizeof(bios_version));
 
 	/*
 	 * Get SMM Dell signature
@@ -713,9 +716,9 @@ static int __init i8k_probe(void)
 		buff[2] = (version) & 0xff;
 		buff[3] = '\0';
 		/*
-		 * If DMI BIOS version is unknown use SMM BIOS version.
+		 * If SMBIOS version is unknown use SMM BIOS version.
 		 */
-		if (!dmi_get_system_info(DMI_BIOS_VERSION))
+		if (!sysfw_lookup(SYSFW_BIOS_VERSION))
 			strlcpy(bios_version, buff, sizeof(bios_version));
 
 		/*
drivers/char/ipmi/ipmi_si_intf.c +78 -81

199 lines not on this page · raw message

drivers/char/sonypi.c +8 -8
index 1ee8ce7..4a50ebd 100644
@@ -46,11 +46,11 @@
 #include <linux/delay.h>
 #include <linux/wait.h>
 #include <linux/acpi.h>
-#include <linux/dmi.h>
 #include <linux/err.h>
 #include <linux/kfifo.h>
 #include <linux/platform_device.h>
 #include <linux/gfp.h>
+#include <linux/sysfw.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -1497,22 +1497,22 @@ static struct platform_driver sonypi_driver = {
 
 static struct platform_device *sonypi_platform_device;
 
-static struct dmi_system_id __initdata sonypi_dmi_table[] = {
+static struct sysfw_id __initdata sonypi_smbios_table[] = {
 	{
 		.ident = "Sony Vaio",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PCG-"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PCG-"),
 		},
 	},
 	{
 		.ident = "Sony Vaio",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int __init sonypi_init(void)
@@ -1523,7 +1523,7 @@ static int __init sonypi_init(void)
 		"sonypi: Sony Programmable I/O Controller Driver v%s.\n",
 		SONYPI_DRIVER_VERSION);
 
-	if (!dmi_check_system(sonypi_dmi_table))
+	if (!sysfw_callback(sonypi_smbios_table))
 		return -ENODEV;
 
 	error = platform_driver_register(&sonypi_driver);
Signature · 1 line
1.6.5.2
#19 lore raw

PATCH 8/34 drivers/crypto changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them

---
 drivers/crypto/amcc/crypto4xx_sa.c |    1 -
 drivers/crypto/hifn_795x.c         |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)
drivers/crypto/amcc/crypto4xx_sa.c +0 -1
index de8a7a4..2995fe7 100644
@@ -22,7 +22,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/mod_devicetable.h>
 #include <linux/interrupt.h>
 #include <linux/spinlock_types.h>
 #include <linux/highmem.h>
drivers/crypto/hifn_795x.c +0 -1
index a84250a..9ada5b5 100644
@@ -20,7 +20,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/mod_devicetable.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
Signature · 1 line
1.6.5.2
#22 lore raw

PATCH 11/34 drivers/hwmon changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- add exactmatch functionality
- edit udev notifiers
- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them

---
 drivers/hwmon/abituguru.c    |   18 ++++++--
 drivers/hwmon/abituguru3.c   |   75 ++++++++++++++++--------------
 drivers/hwmon/adcxx.c        |    1 -
 drivers/hwmon/applesmc.c     |   73 +++++++++++++++++------------
 drivers/hwmon/asus_atk0110.c |   10 ++--
 drivers/hwmon/fschmd.c       |  104 ++++++++++++++++++++++--------------------
 drivers/hwmon/it87.c         |   42 ++++++++++-------
 drivers/hwmon/lm70.c         |    1 -
 8 files changed, 181 insertions(+), 143 deletions(-)
drivers/hwmon/abituguru.c +14 -4
index 65a35cf..b9053cb 100644
@@ -34,7 +34,7 @@
 #include <linux/platform_device.h>
 #include <linux/hwmon.h>
 #include <linux/hwmon-sysfs.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/io.h>
 
 /* Banks */
@@ -1444,15 +1444,25 @@ static int __init abituguru_detect(void)
 
 static struct platform_device *abituguru_pdev;
 
+static struct sysfw_id abitguru_id_table[] = {
+	{
+		 .ident = "Abit Motherboards",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "http://www.abit.com.tw/"),
+		},
+		.exactmatch = 1,
+	},
+	{},
+};
+
 static int __init abituguru_init(void)
 {
 	int address, err;
 	struct resource res = { .flags = IORESOURCE_IO };
-	const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
 
 	/* safety check, refuse to load on non Abit motherboards */
-	if (!force && (!board_vendor ||
-			strcmp(board_vendor, "http://www.abit.com.tw/")))
+	if (!force && !sysfw_callback(abitguru_id_table))
 		return -ENODEV;
 
 	address = abituguru_detect();
drivers/hwmon/abituguru3.c +41 -34

191 lines not on this page · raw message

drivers/hwmon/adcxx.c +0 -1
index b2cacbe..ff47453 100644
@@ -44,7 +44,6 @@
 #include <linux/hwmon.h>
 #include <linux/hwmon-sysfs.h>
 #include <linux/mutex.h>
-#include <linux/mod_devicetable.h>
 #include <linux/spi/spi.h>
 
 #define DRVNAME		"adcxx"
drivers/hwmon/applesmc.c +43 -30

100 lines not on this page · raw message

drivers/hwmon/asus_atk0110.c +5 -5
index dcb78a7..b355020 100644
@@ -13,7 +13,7 @@
 #include <linux/list.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <acpi/acpi.h>
 #include <acpi/acpixf.h>
@@ -27,15 +27,15 @@ static bool new_if;
 module_param(new_if, bool, 0);
 MODULE_PARM_DESC(new_if, "Override detection heuristic and force the use of the new ATK0110 interface");
 
-static const struct dmi_system_id __initconst atk_force_new_if[] = {
+static const struct sysfw_id __initconst atk_force_new_if[] = {
 	{
 		/* Old interface has broken MCH temp monitoring */
 		.ident = "Asus Sabertooth X58",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_NAME, "SABERTOOTH X58")
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "SABERTOOTH X58")
 		}
 	},
-	{ }
+	{}
 };
 
 /* Minimum time between readings, enforced in order to avoid
@@ -1435,7 +1435,7 @@ static int __init atk0110_init(void)
 		return -EBUSY;
 	}
 
-	if (dmi_check_system(atk_force_new_if))
+	if (sysfw_callback(atk_force_new_if))
 		new_if = true;
 
 	ret = acpi_bus_register_driver(&atk_driver);
drivers/hwmon/fschmd.c +54 -50

171 lines not on this page · raw message

drivers/hwmon/it87.c +24 -18

72 lines not on this page · raw message

drivers/hwmon/lm70.c +0 -1
index c274ea2..bdb34f8 100644
@@ -34,7 +34,6 @@
 #include <linux/sysfs.h>
 #include <linux/hwmon.h>
 #include <linux/mutex.h>
-#include <linux/mod_devicetable.h>
 #include <linux/spi/spi.h>
 #include <linux/slab.h>
 
Signature · 7 lines
1.6.5.2


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#23 lore raw

PATCH 12/34 drivers/i2c changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables

---
 drivers/i2c/busses/i2c-i801.c    |   76 ++++++++++---------------------------
 drivers/i2c/busses/i2c-nforce2.c |   12 +++---
 drivers/i2c/busses/i2c-piix4.c   |   24 ++++++------
 3 files changed, 39 insertions(+), 73 deletions(-)
drivers/i2c/busses/i2c-i801.c +21 -55
index ab26840..7e19ea2 100644
@@ -73,7 +73,8 @@
 #include <linux/i2c.h>
 #include <linux/acpi.h>
 #include <linux/io.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 
 /* I801 SMBus address offsets */
@@ -669,69 +670,34 @@ static void __init input_apanel_init(void)
 	iounmap(bios);
 }
 
-struct dmi_onboard_device_info {
+struct smbios_onboard_device_info {
 	const char *name;
-	u8 type;
 	unsigned short i2c_addr;
 	const char *i2c_type;
 };
 
-static struct dmi_onboard_device_info __devinitdata dmi_devices[] = {
-	{ "Syleus", DMI_DEV_TYPE_OTHER, 0x73, "fscsyl" },
-	{ "Hermes", DMI_DEV_TYPE_OTHER, 0x73, "fscher" },
-	{ "Hades",  DMI_DEV_TYPE_OTHER, 0x73, "fschds" },
+static struct smbios_onboard_device_info __devinitdata smbios_devices[] = {
+	{ "Syleus", 0x73, "fscsyl" },
+	{ "SYLEUS", 0x73, "fscsyl" },
+	{ "Hermes", 0x73, "fscher" },
+	{ "HERMES", 0x73, "fscher" },
+	{ "Hades", 0x73, "fschds" },
+	{ "HADES", 0x73, "fschds" },
 };
 
-static void __devinit dmi_check_onboard_device(u8 type, const char *name,
-					       struct i2c_adapter *adap)
+static void __devinit smbios_check_fschmd(struct i2c_adapter *adap)
 {
 	int i;
 	struct i2c_board_info info;
 
-	for (i = 0; i < ARRAY_SIZE(dmi_devices); i++) {
-		/* & ~0x80, ignore enabled/disabled bit */
-		if ((type & ~0x80) != dmi_devices[i].type)
-			continue;
-		if (strcasecmp(name, dmi_devices[i].name))
-			continue;
-
-		memset(&info, 0, sizeof(struct i2c_board_info));
-		info.addr = dmi_devices[i].i2c_addr;
-		strlcpy(info.type, dmi_devices[i].i2c_type, I2C_NAME_SIZE);
-		i2c_new_device(adap, &info);
-		break;
-	}
-}
-
-/* We use our own function to check for onboard devices instead of
-   dmi_find_device() as some buggy BIOS's have the devices we are interested
-   in marked as disabled */
-static void __devinit dmi_check_onboard_devices(const struct dmi_header *dm,
-						void *adap)
-{
-	int i, count;
-
-	if (dm->type != 10)
-		return;
-
-	count = (dm->length - sizeof(struct dmi_header)) / 2;
-	for (i = 0; i < count; i++) {
-		const u8 *d = (char *)(dm + 1) + (i * 2);
-		const char *name = ((char *) dm) + dm->length;
-		u8 type = d[0];
-		u8 s = d[1];
-
-		if (!s)
-			continue;
-		s--;
-		while (s > 0 && name[0]) {
-			name += strlen(name) + 1;
-			s--;
+	for (i = 0; i < ARRAY_SIZE(onboard); i++) {
+		/* some buggy BIOSes have the devices disabled */
+		if (smbios_is_onboard_device(onboard[i].name, 1)) {
+			memset(&info, 0, sizeof(struct i2c_board_info));
+			info.addr = onboard[i].i2c_addr;
+			strlcpy(info.type, onboard[i].i2c_type,	I2C_NAME_SIZE);
+			i2c_new_device(adap, &info);
 		}
-		if (name[0] == 0) /* Bogus string reference */
-			continue;
-
-		dmi_check_onboard_device(type, name, adap);
 	}
 }
 
@@ -751,8 +717,8 @@ static void __devinit i801_probe_optional_slaves(struct i801_priv *priv)
 		i2c_new_device(&priv->adapter, &info);
 	}
 
-	if (dmi_name_in_vendors("FUJITSU"))
-		dmi_walk(dmi_check_onboard_devices, &priv->adapter);
+	if (sysfw_vendor_is("FUJITSU"))
+		smbios_check_fschmd(&priv->adapter);
 }
 #else
 static void __init input_apanel_init(void) {}
@@ -927,7 +893,7 @@ static struct pci_driver i801_driver = {
 
 static int __init i2c_i801_init(void)
 {
-	if (dmi_name_in_vendors("FUJITSU"))
+	if (sysfw_vendor_is("FUJITSU"))
 		input_apanel_init();
 	return pci_register_driver(&i801_driver);
 }
drivers/i2c/busses/i2c-nforce2.c +6 -6
index ff1e127..458623e 100644
@@ -54,7 +54,7 @@
 #include <linux/init.h>
 #include <linux/i2c.h>
 #include <linux/delay.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/acpi.h>
 #include <linux/slab.h>
 #include <linux/io.h>
@@ -117,15 +117,15 @@ struct nforce2_smbus {
 #define MAX_TIMEOUT	100
 
 /* We disable the second SMBus channel on these boards */
-static struct dmi_system_id __devinitdata nforce2_dmi_blacklist2[] = {
+static struct sysfw_id __devinitdata nforce2_id_blacklist2[] = {
 	{
 		.ident = "DFI Lanparty NF4 Expert",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "DFI Corp,LTD"),
-			DMI_MATCH(DMI_BOARD_NAME, "LP UT NF4 Expert"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "DFI Corp,LTD"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "LP UT NF4 Expert"),
 		},
 	},
-	{ }
+	{}
 };
 
 static struct pci_driver nforce2_driver;
@@ -408,7 +408,7 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_
 		smbuses[0].base = 0;	/* to have a check value */
 
 	/* SMBus adapter 2 */
-	if (dmi_check_system(nforce2_dmi_blacklist2)) {
+	if (sysfw_callback(nforce2_id_blacklist2)) {
 		dev_err(&dev->dev, "Disabling SMB2 for safety reasons.\n");
 		res2 = -EPERM;
 		smbuses[1].base = 0;
drivers/i2c/busses/i2c-piix4.c +12 -12
index 6d14ac2..12b4019 100644
@@ -37,7 +37,7 @@
 #include <linux/ioport.h>
 #include <linux/i2c.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/acpi.h>
 #include <linux/io.h>
 
@@ -99,32 +99,32 @@ static int srvrworks_csb5_delay;
 static struct pci_driver piix4_driver;
 static struct i2c_adapter piix4_adapter;
 
-static struct dmi_system_id __devinitdata piix4_dmi_blacklist[] = {
+static struct sysfw_id __devinitdata piix4_id_blacklist[] = {
 	{
 		.ident = "Sapphire AM2RD790",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "SAPPHIRE Inc."),
-			DMI_MATCH(DMI_BOARD_NAME, "PC-AM2RD790"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "SAPPHIRE Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "PC-AM2RD790"),
 		},
 	},
 	{
 		.ident = "DFI Lanparty UT 790FX",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "DFI Inc."),
-			DMI_MATCH(DMI_BOARD_NAME, "LP UT 790FX"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "DFI Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "LP UT 790FX"),
 		},
 	},
-	{ }
+	{}
 };
 
 /* The IBM entry is in a separate table because we only check it
    on Intel-based systems */
-static struct dmi_system_id __devinitdata piix4_dmi_ibm[] = {
+static struct sysfw_id __devinitdata piix4_id_ibm[] = {
 	{
 		.ident = "IBM",
-		.matches = { DMI_MATCH(DMI_SYS_VENDOR, "IBM"), },
+		.matches = { SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"), },
 	},
-	{ },
+	{},
 };
 
 static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,
@@ -138,14 +138,14 @@ static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,
 
 	/* On some motherboards, it was reported that accessing the SMBus
 	   caused severe hardware problems */
-	if (dmi_check_system(piix4_dmi_blacklist)) {
+	if (sysfw_callback(piix4_id_blacklist)) {
 		dev_err(&PIIX4_dev->dev,
 			"Accessing the SMBus on this system is unsafe!\n");
 		return -EPERM;
 	}
 
 	/* Don't access SMBus on IBM systems which get corrupted eeproms */
-	if (dmi_check_system(piix4_dmi_ibm) &&
+	if (sysfw_callback(piix4_id_ibm) &&
 			PIIX4_dev->vendor == PCI_VENDOR_ID_INTEL) {
 		dev_err(&PIIX4_dev->dev, "IBM system detected; this module "
 			"may corrupt your serial eeprom! Refusing to load "
Signature · 1 line
1.6.5.2
#24 lore raw

PATCH 13/34 drivers/ide changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables

---
 drivers/ide/alim15x3.c  |   18 +++++++++---------
 drivers/ide/ide-acpi.c  |   16 ++++++++--------
 drivers/ide/ide-gd.c    |   10 +++++-----
 drivers/ide/via82cxxx.c |   14 +++++++-------
 4 files changed, 29 insertions(+), 29 deletions(-)
drivers/ide/alim15x3.c +9 -9
index 2c8016a..d5194e1 100644
@@ -33,7 +33,7 @@
 #include <linux/pci.h>
 #include <linux/ide.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <asm/io.h>
 
@@ -333,22 +333,22 @@ out:
  *	Cable special cases
  */
 
-static const struct dmi_system_id cable_dmi_table[] = {
+static const struct sysfw_id cable_smbios_table[] = {
 	{
 		.ident = "HP Pavilion N5430",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "OmniBook N32N-736"),
 		},
 	},
 	{
 		.ident = "Toshiba Satellite S1800-814",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "S1800-814"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "S1800-814"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int ali_cable_override(struct pci_dev *pdev)
@@ -363,8 +363,8 @@ static int ali_cable_override(struct pci_dev *pdev)
 	    pdev->subsystem_device == 0x8317)
 		return 1;
 
-	/* Systems by DMI */
-	if (dmi_check_system(cable_dmi_table))
+	/* Systems by SMBIOS */
+	if (sysfw_callback(cable_smbios_table))
 		return 1;
 
 	return 0;
drivers/ide/ide-acpi.c +8 -8
index 2af8cb4..dfcff27 100644
@@ -16,7 +16,7 @@
 #include <acpi/acpi.h>
 #include <linux/ide.h>
 #include <linux/pci.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <acpi/acpi_bus.h>
 
@@ -65,31 +65,31 @@ module_param_named(acpionboot, ide_acpionboot, bool, 0);
 MODULE_PARM_DESC(acpionboot, "call IDE ACPI methods on boot");
 
 static bool ide_noacpi_psx;
-static int no_acpi_psx(const struct dmi_system_id *id)
+static int no_acpi_psx(const struct sysfw_id *id)
 {
 	ide_noacpi_psx = true;
 	printk(KERN_NOTICE"%s detected - disable ACPI _PSx.\n", id->ident);
 	return 0;
 }
 
-static const struct dmi_system_id ide_acpi_dmi_table[] = {
+static const struct sysfw_id ide_acpi_smbios_table[] = {
 	/* Bug 9673. */
 	/* We should check if this is because ACPI NVS isn't save/restored. */
 	{
 		.callback = no_acpi_psx,
 		.ident    = "HP nx9005",
 		.matches  = {
-			DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies Ltd."),
-			DMI_MATCH(DMI_BIOS_VERSION, "KAM1.60")
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies Ltd."),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "KAM1.60")
 		},
 	},
-
-	{ }	/* terminate list */
+	{}
 };
 
 int ide_acpi_init(void)
 {
-	dmi_check_system(ide_acpi_dmi_table);
+	sysfw_callback(ide_acpi_smbios_table);
 	return 0;
 }
 
drivers/ide/ide-gd.c +5 -5
index 70ea876..3801f49 100644
@@ -7,8 +7,8 @@
 #include <linux/mutex.h>
 #include <linux/ide.h>
 #include <linux/hdreg.h>
-#include <linux/dmi.h>
 #include <linux/slab.h>
+#include <linux/sysfw.h>
 
 #if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT)
 #define IDE_DISK_MINORS		(1 << PARTN_BITS)
@@ -102,13 +102,13 @@ static void ide_gd_resume(ide_drive_t *drive)
 		(void)drive->disk_ops->get_capacity(drive);
 }
 
-static const struct dmi_system_id ide_coldreboot_table[] = {
+static const struct sysfw_id ide_coldreboot_table[] = {
 	{
 		/* Acer TravelMate 66x cuts power during reboot */
 		.ident   = "Acer TravelMate 660",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 660"),
 		},
 	},
 
@@ -132,7 +132,7 @@ static void ide_gd_shutdown(ide_drive_t *drive)
 	if (system_state != SYSTEM_POWER_OFF) {
 #else
 	if (system_state == SYSTEM_RESTART &&
-		!dmi_check_system(ide_coldreboot_table)) {
+	    !sysfw_callback(ide_coldreboot_table)) {
 #endif
 		drive->disk_ops->flush(drive);
 		return;
drivers/ide/via82cxxx.c +7 -7
index f46f49c..a51eb2b 100644
@@ -30,7 +30,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/ide.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #ifdef CONFIG_PPC_CHRP
 #include <asm/processor.h>
@@ -354,21 +354,21 @@ static int init_chipset_via82cxxx(struct pci_dev *dev)
  *	Cable special cases
  */
 
-static const struct dmi_system_id cable_dmi_table[] = {
+static const struct sysfw_id cable_smbios_table[] = {
 	{
 		.ident = "Acer Ferrari 3400",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Acer,Inc."),
-			DMI_MATCH(DMI_BOARD_NAME, "Ferrari 3400"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Acer,Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Ferrari 3400"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int via_cable_override(struct pci_dev *pdev)
 {
-	/* Systems by DMI */
-	if (dmi_check_system(cable_dmi_table))
+	/* Systems by SMBIOS */
+	if (sysfw_callback(cable_smbios_table))
 		return 1;
 
 	/* Arima W730-K8/Targa Visionary 811/... */
Signature · 1 line
1.6.5.2
#30 lore raw

PATCH 19/34 drivers/net changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- 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

---
 drivers/net/skge.c                 |   11 ++++++-----
 drivers/net/via-rhine.c            |   18 ++++++++++--------
 drivers/net/wireless/wl1251/sdio.c |    1 -
 3 files changed, 16 insertions(+), 14 deletions(-)
drivers/net/skge.c +6 -5
index f4be5c7..1200c53 100644
@@ -43,7 +43,7 @@
 #include <linux/seq_file.h>
 #include <linux/mii.h>
 #include <linux/slab.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/prefetch.h>
 #include <asm/irq.h>
 
@@ -4089,12 +4089,13 @@ static struct pci_driver skge_driver = {
 	.driver.pm =	SKGE_PM_OPS,
 };
 
-static struct dmi_system_id skge_32bit_dma_boards[] = {
+static struct sysfw_id skge_32bit_dma_boards[] = {
 	{
 		.ident = "Gigabyte nForce boards",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co"),
-			DMI_MATCH(DMI_BOARD_NAME, "nForce"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				     "Gigabyte Technology Co"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "nForce"),
 		},
 	},
 	{}
@@ -4102,7 +4103,7 @@ static struct dmi_system_id skge_32bit_dma_boards[] = {
 
 static int __init skge_init_module(void)
 {
-	if (dmi_check_system(skge_32bit_dma_boards))
+	if (sysfw_callback(skge_32bit_dma_boards))
 		only_32bit_dma = 1;
 	skge_debug_init();
 	return pci_register_driver(&skge_driver);
drivers/net/via-rhine.c +10 -8
index 7f23ab9..81725d5 100644
@@ -110,7 +110,7 @@ static const int multicast_filter_limit = 32;
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/uaccess.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 /* These identify the driver base version and may not be removed. */
 static const char version[] __devinitconst =
@@ -2294,22 +2294,24 @@ static struct pci_driver rhine_driver = {
 	.shutdown =	rhine_shutdown,
 };
 
-static struct dmi_system_id __initdata rhine_dmi_table[] = {
+static struct sysfw_id __initdata rhine_id_table[] = {
 	{
 		.ident = "EPIA-M",
 		.matches = {
-			DMI_MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."),
-			DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"),
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Award Software International, Inc."),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "6.00 PG"),
 		},
 	},
 	{
 		.ident = "KV7",
 		.matches = {
-			DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
-			DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"),
+			SYSFW_MATCH(SYSFW_BIOS_VENDOR,
+				    "Phoenix Technologies, LTD"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "6.00 PG"),
 		},
 	},
-	{ NULL }
+	{}
 };
 
 static int __init rhine_init(void)
@@ -2318,7 +2320,7 @@ static int __init rhine_init(void)
 #ifdef MODULE
 	pr_info("%s\n", version);
 #endif
-	if (dmi_check_system(rhine_dmi_table)) {
+	if (sysfw_callback(rhine_id_table)) {
 		/* these BIOSes fail at PXE boot if chip is in D3 */
 		avoid_D3 = 1;
 		pr_warn("Broken BIOS detected, avoid_D3 enabled\n");
drivers/net/wireless/wl1251/sdio.c +0 -1
index f51a024..68e36d7 100644
@@ -20,7 +20,6 @@
  * Copyright (C) 2009 Bob Copeland ([email protected])
  */
 #include <linux/module.h>
-#include <linux/mod_devicetable.h>
 #include <linux/mmc/sdio_func.h>
 #include <linux/mmc/sdio_ids.h>
 #include <linux/platform_device.h>
Signature · 1 line
1.6.5.2
#43 lore raw

PATCH 30/34 drivers/watchdog changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables

---
 drivers/watchdog/hpwdt.c          |   16 +++++++++-------
 drivers/watchdog/ibmasr.c         |    9 +++------
 drivers/watchdog/sbc_fitpc2_wdt.c |   22 +++++++++++++++-------
 3 files changed, 27 insertions(+), 20 deletions(-)
drivers/watchdog/hpwdt.c +9 -7
index 8cb2685..8849eac 100644
@@ -28,7 +28,7 @@
 #include <linux/uaccess.h>
 #include <linux/watchdog.h>
 #ifdef CONFIG_HPWDT_NMI_DECODING
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 #include <linux/spinlock.h>
 #include <linux/nmi.h>
 #include <linux/kdebug.h>
@@ -374,19 +374,19 @@ asm(".text                      \n\t"
     ".previous");
 
 /*
- *	dmi_find_cru
+ *	smbios_find_cru
  *
  *	Routine Description:
- *	This function checks whether or not a SMBIOS/DMI record is
+ *	This function checks whether or not a SMBIOS/SMBIOS record is
  *	the 64bit CRU info or not
  */
-static void __devinit dmi_find_cru(const struct dmi_header *dm, void *dummy)
+static int __devinit smbios_find_cru(const union smbios_struct *ss, void *dummy)
 {
 	struct smbios_cru64_info *smbios_cru64_ptr;
 	unsigned long cru_physical_address;
 
-	if (dm->type == SMBIOS_CRU64_INFORMATION) {
-		smbios_cru64_ptr = (struct smbios_cru64_info *) dm;
+	if (ss->header.type == SMBIOS_CRU64_INFORMATION) {
+		smbios_cru64_ptr = (struct smbios_cru64_info *) &ss;
 		if (smbios_cru64_ptr->signature == CRU_BIOS_SIGNATURE_VALUE) {
 			cru_physical_address =
 				smbios_cru64_ptr->physical_address +
@@ -395,15 +395,17 @@ static void __devinit dmi_find_cru(const struct dmi_header *dm, void *dummy)
 				smbios_cru64_ptr->double_length);
 			set_memory_x((unsigned long)cru_rom_addr & PAGE_MASK,
 				smbios_cru64_ptr->double_length >> PAGE_SHIFT);
+			return SMBIOS_WALK_STOP;
 		}
 	}
+	return SMBIOS_WALK_CONTINUE;
 }
 
 static int __devinit detect_cru_service(void)
 {
 	cru_rom_addr = NULL;
 
-	dmi_walk(dmi_find_cru, NULL);
+	smbios_walk(smbios_find_cru, NULL);
 
 	/* if cru_rom_addr has been set then we found a CRU service */
 	return ((cru_rom_addr != NULL) ? 0 : -ENODEV);
drivers/watchdog/ibmasr.c +3 -6
index 195e0f7..b8cc126 100644
@@ -17,7 +17,7 @@
 #include <linux/timer.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 #include <linux/io.h>
 #include <linux/uaccess.h>
 
@@ -376,12 +376,9 @@ static int __init ibmasr_init(void)
 	struct ibmasr_id *id;
 	int rc;
 
-	for (id = ibmasr_id_table; id->desc; id++) {
-		if (dmi_find_device(DMI_DEV_TYPE_OTHER, id->desc, NULL)) {
+	for (id = ibmasr_id_table; id->desc; id++)
+		if (smbios_is_onboard_device(id->desc, 0))
 			asr_type = id->type;
-			break;
-		}
-	}
 
 	if (!asr_type)
 		return -ENODEV;
drivers/watchdog/sbc_fitpc2_wdt.c +15 -7
index d5d3994..0419e01 100644
@@ -21,7 +21,7 @@
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/moduleparam.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/io.h>
 #include <linux/uaccess.h>
 
@@ -198,17 +198,25 @@ static struct miscdevice fitpc2_wdt_miscdev = {
 	.fops		= &fitpc2_wdt_fops,
 };
 
+static struct sysfw_id __initdata fitpc2_device_table[] = {
+	{
+		.ident = "SBC-FITPC2 Watchdog",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "SBC-FITPC2"),
+		},
+	},
+	{}
+};
+
 static int __init fitpc2_wdt_init(void)
 {
 	int err;
-	const char *brd_name;
+	const struct sysfw_id *id;
 
-	brd_name = dmi_get_system_info(DMI_BOARD_NAME);
-
-	if (!brd_name || !strstr(brd_name, "SBC-FITPC2"))
+	id = sysfw_callback(fitpc2_device_table);
+	if (!id)
 		return -ENODEV;
-
-	pr_info("%s found\n", brd_name);
+	pr_info("%s found\n", id->ident);
 
 	if (!request_region(COMMAND_PORT, 1, WATCHDOG_NAME)) {
 		pr_err("I/O address 0x%04x already in use\n", COMMAND_PORT);
Signature · 1 line
1.6.5.2
#44 lore raw

PATCH 31/34 include/linux/acpi.h changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers

---
 include/linux/acpi.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/acpi.h +1 -1
index 1deb2a7..29d7de8 100644
@@ -217,7 +217,7 @@ static inline int acpi_video_display_switch_support(void)
 #endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */
 
 extern int acpi_blacklisted(void);
-extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d);
+extern void acpi_smbios_osi_linux(int enable, const struct sysfw_id *d);
 extern void acpi_osi_setup(char *str);
 
 #ifdef CONFIG_ACPI_NUMA
Signature · 1 line
1.6.5.2
#47 lore raw

PATCH 34/34 Remove old DMI & SMBIOS code and make SMBIOS default on

In reply to Prarit Bhargava

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.

---
 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
arch/ia64/include/asm/dmi.h deleted +0 -12
deleted file mode 100644
index 1ed4c8f..0000000
@@ -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
arch/x86/Kconfig +0 -9
index e7cdde8..92ee12b 100644
@@ -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
arch/x86/include/asm/dmi.h deleted +0 -19
deleted file mode 100644
index fd8f9e2..0000000
@@ -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 */
drivers/firmware/Kconfig +0 -20
index 23066d8..a46c162 100644
@@ -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
drivers/firmware/Makefile +0 -3
index 5c9d81f..f372289 100644
@@ -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
drivers/firmware/dmi-id.c deleted +0 -245

245 lines not on this page · raw message

drivers/firmware/dmi-sysfs.c deleted +0 -696

696 lines not on this page · raw message

drivers/firmware/dmi_scan.c deleted +0 -751

751 lines not on this page · raw message

include/linux/dmi.h deleted +0 -139

139 lines not on this page · raw message

include/linux/mod_devicetable.h +0 -55

61 lines not on this page · raw message

Signature · 1 line
1.6.5.2
#0 lore raw

cover System Firmware and SMBIOS Support [v3]

[Sorry if anyone receives this twice. It didn't make it to LKML the first time.]

This change is targeted for 3.2 in order to give is "soak" time in linux-next.

DMI, or the Desktop Management Interface, provides access to OEM and hardware specific details about the x86 or ia64 system the kernel is currently runnig on. DMI has been deprecated since 2003, which was the last update of the DMI Specification.

The System Management BIOS, or SMBIOS, supercedes DMI -- the SMBIOS tables include the possibility of a _DMI_ entry and tables. However, in the Linux kernel we do not access any of the DMI data and only access SMBIOS data.

Currently, the kernel uses dmi_* functions (as defined in drivers/firmware/dmi_scan.c) to access the data. The functions allow kernel subsystems and modules to set specific options based on the platform and BIOS version.

The dmi_* functions in the kernel fail in several ways. First, as mentioned the dmi_* functions are really accessing SMBIOS data. The existing code queries for the _SMB_ entry and determines data access after that. The existing dmi_* functions create an array of x86 and ia64 specific entries which are defined as part of x86 and ia64 specific udev entries, and allows drivers and subsystems to make platform specific decisions. In addition to the arch specific code, the dmi_* code creates a list of "devices" to which makes updating very difficult and does not easily scale.

Another key issue with the existing code is that several drivers do their own search through the SMBIOS, for example, see drivers/pci/hotplug/cpqphp*.c.

Three months (or so) ago I proposed a patch which was based on a simple request from a colleague -- create a sysfs file that would export the SMBIOS version. This simple request was not something that was easy to do given the layout of the existing DMI code. The request resulted in having to create a new smbios class within the kernel, and essentially doing a separate search through memory.

This new patchset reworks the existing DMI code into two separate layers. It is based off of the feedback I received previously when discussing the SMBIOS version patch on LKML.

The first layer is the System Firmware Interface, which is based upon Alan Cox's suggestion of a common platform driver (unfortunately, platform driver is already defined and used within the kernel). This is meant to be an arch independent subsystem in the kernel for all arches. It is a common interface which provides access to specific system values in the kernel such as the Chassis Manufacturer, the BIOS developer, or the BIOS date. The System Firmware Interface, or sysfw allows for easy updating by simply adding fields to an array in include/linux/mod_devicetable.h.
Standard simple searching functions, sysfw_lookup() and sysfw_callback() are provided to the kernel and modules. sysfw_callback() is similar to dmi_check_system() but the new function allows for exact matching which some drivers required.

The second layer introduced in this patchset is the SMBIOS sysfw driver. This driver (obviously) registers with the interface and also provides it's own interface. The reason for the separate interface is that specific drivers have their own need to search the SMBIOS for OEM or platform specific information (see, for example, drivers/watchdog/hpwdt.c, or drivers/pci/pci-label.c). This new driver provides a function, smbios_walk() which allows individual drivers or subsystems to traverse the SMBIOS table looking for OEM or platform specific data. The new SMBIOS driver can be easily updated by adding SMBIOS structure information to the smbios_struct union in include/linux/smbios.h.

These changes are now targeted for 3.2 and if there are no objections (there have been none for v1 and v2) I will request a pull for linux-next during the 3.1 merge window.

A git tree with these changes has been set up here:

git://git.kernel.org/pub/scm/linux/kernel/git/prarit/smbios.git

with the latest changes in the smbios-3.0-rc7-v3 branch.

Prarit Bhargava (34):
System Firmware Interface
New SMBIOS driver for x86 and ia64.
arch specific changes for SMBIOS and System Firmware drivers/acpi changes for SMBIOS and System Firmware interface drivers/ata changes for SMBIOS and System Firmware drivers/floppy changes for SMBIOS and System Firmware drivers/char changes for SMBIOS and System Firmware drivers/crypto changes for SMBIOS and System Firmware drivers/gpio changes for SMBIOS and System Firmware drivers/gpu changes for SMBIOS and System Firmware drivers/hwmon changes for SMBIOS and System Firmware drivers/i2c changes for SMBIOS and System Firmware drivers/ide changes for SMBIOS and System Firmware drivers/input changes for SMBIOS and System Firmware drivers/leds changes for SMBIOS and System Firmware drivers/media changes for SMBIOS and System Firmware drivers/misc changes for SMBIOS and System Firmware drivers/mtd changes for SMBIOS and System Firmware drivers/net changes for SMBIOS and System Firmware drivers/pci changes for SMBIOS and System Firmware drivers/platform changes for SMBIOS and System Firmware drivers/pnp changes for SMBIOS and System Firmware drivers/power changes for SMBIOS and System Firmware drivers/rtc changes for SMBIOS and System Firmware drivers/staging changes for SMBIOS and System Firmware drivers/tty changes for SMBIOS and System Firmware drivers/usb changes for SMBIOS and System Firmware drivers/video changes for SMBIOS and System Firmware drivers/w1 changes for SMBIOS and System Firmware drivers/watchdog changes for SMBIOS and System Firmware include/linux/acpi.h changes for SMBIOS and System Firmware

  Kernel panic changes for SMBIOS and System Firmware
  sound/pci/hda changes for SMBIOS and System Firmware
  Remove old DMI & SMBIOS code and make SMBIOS default on
 Documentation/ABI/obsolete/sysfs-dmi           |   40 ++
 Documentation/ABI/testing/sysfw-smbios         |   36 ++
 arch/ia64/Kconfig                              |    5 +
 arch/ia64/include/asm/dmi.h                    |   12 -
 arch/ia64/include/asm/smbios.h                 |   12 +
 arch/ia64/kernel/setup.c                       |    8 +-
 arch/x86/Kconfig                               |    9 +-
 arch/x86/include/asm/dmi.h                     |   19 -
 arch/x86/include/asm/mmconfig.h                |    4 +-
 arch/x86/include/asm/pci_x86.h                 |    6 +-
 arch/x86/include/asm/smbios.h                  |   19 +
 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/acpi/battery.c                         |    5 +-
 drivers/acpi/blacklist.c                       |  125 ++--
 drivers/acpi/bus.c                             |   16 +-
 drivers/acpi/ec.c                              |  101 +++-
 drivers/acpi/osl.c                             |   17 +-
 drivers/acpi/pci_irq.c                         |   33 +-
 drivers/acpi/pci_slot.c                        |   12 +-
 drivers/acpi/processor_core.c                  |   25 +-
 drivers/acpi/processor_driver.c                |    1 -
 drivers/acpi/processor_idle.c                  |   51 ++-
 drivers/acpi/scan.c                            |    4 +-
 drivers/acpi/sleep.c                           |   46 +-
 drivers/acpi/thermal.c                         |   42 +-
 drivers/acpi/video.c                           |   28 +-
 drivers/acpi/video_detect.c                    |    3 +-
 drivers/ata/acard-ahci.c                       |    1 -
 drivers/ata/ahci.c                             |  177 +++---
 drivers/ata/ata_piix.c                         |  154 +++---
 drivers/ata/pata_ali.c                         |   18 +-
 drivers/ata/pata_cs5530.c                      |   12 +-
 drivers/ata/pata_rdc.c                         |    1 -
 drivers/ata/pata_sch.c                         |    1 -
 drivers/ata/pata_via.c                         |   14 +-
 drivers/ata/sata_sil.c                         |   19 +-
 drivers/block/floppy.c                         |    1 -
 drivers/char/i8k.c                             |   75 ++--
 drivers/char/ipmi/ipmi_si_intf.c               |  159 +++---
 drivers/char/sonypi.c                          |   16 +-
 drivers/cpufreq/acpi-cpufreq.c                 |   16 +-
 drivers/cpufreq/powernow-k7.c                  |   14 +-
 drivers/crypto/amcc/crypto4xx_sa.c             |    1 -
 drivers/crypto/hifn_795x.c                     |    1 -
 drivers/firmware/Kconfig                       |   65 ++-
 drivers/firmware/Makefile                      |    8 +-
 drivers/firmware/dmi-id.c                      |  245 --------
 drivers/firmware/dmi-sysfs.c                   |  696 ----------------------
 drivers/firmware/dmi_scan.c                    |  751 ------------------------
 drivers/firmware/smbios-sysfs.c                |  705 ++++++++++++++++++++++
 drivers/firmware/smbios.c                      |  687 ++++++++++++++++++++++
 drivers/firmware/sysfw-sysfs.c                 |  306 ++++++++++
 drivers/firmware/sysfw.c                       |  168 ++++++
 drivers/gpio/basic_mmio_gpio.c                 |    1 -
 drivers/gpu/drm/i915/intel_lvds.c              |   81 ++--
 drivers/gpu/vga/vga_switcheroo.c               |    1 -
 drivers/hwmon/abituguru.c                      |   18 +-
 drivers/hwmon/abituguru3.c                     |   75 ++--
 drivers/hwmon/acpi_power_meter.c               |   15 +-
 drivers/hwmon/adcxx.c                          |    1 -
 drivers/hwmon/applesmc.c                       |   73 ++-
 drivers/hwmon/asus_atk0110.c                   |   10 +-
 drivers/hwmon/fschmd.c                         |  104 ++--
 drivers/hwmon/it87.c                           |   42 +-
 drivers/hwmon/lm70.c                           |    1 -
 drivers/i2c/busses/i2c-i801.c                  |   76 +--
 drivers/i2c/busses/i2c-nforce2.c               |   12 +-
 drivers/i2c/busses/i2c-piix4.c                 |   24 +-
 drivers/ide/alim15x3.c                         |   18 +-
 drivers/ide/ide-acpi.c                         |   16 +-
 drivers/ide/ide-gd.c                           |   10 +-
 drivers/ide/via82cxxx.c                        |   14 +-
 drivers/input/keyboard/atkbd.c                 |   80 ++--
 drivers/input/misc/wistron_btns.c              |  239 ++++----
 drivers/input/mouse/lifebook.c                 |   42 +-
 drivers/input/mouse/synaptics.c                |   44 +-
 drivers/input/serio/i8042-x86ia64io.h          |  367 ++++++------
 drivers/input/tablet/wacom.h                   |    1 -
 drivers/input/touchscreen/htcpen.c             |   13 +-
 drivers/leds/leds-clevo-mail.c                 |   78 ++--
 drivers/leds/leds-ss4200.c                     |   23 +-
 drivers/media/dvb/firewire/firedtv-fw.c        |    1 -
 drivers/media/dvb/firewire/firedtv.h           |    1 -
 drivers/media/video/cafe_ccic.c                |   14 +-
 drivers/media/video/gspca/m5602/m5602_ov9650.c |   46 +-
 drivers/media/video/gspca/m5602/m5602_ov9650.h |    2 +-
 drivers/media/video/gspca/m5602/m5602_s5k4aa.c |  102 ++--
 drivers/media/video/gspca/m5602/m5602_s5k4aa.h |    2 +-
 drivers/media/video/gspca/sn9c20x.c            |   30 +-
 drivers/media/video/pvrusb2/pvrusb2-devattr.h  |    1 -
 drivers/misc/eeprom/at24.c                     |    1 -
 drivers/misc/lis3lv02d/lis3lv02d.c             |    1 -
 drivers/misc/pch_phub.c                        |   14 +-
 drivers/mtd/devices/m25p80.c                   |    1 -
 drivers/net/skge.c                             |   11 +-
 drivers/net/via-rhine.c                        |   18 +-
 drivers/net/wireless/wl1251/sdio.c             |    1 -
 drivers/pci/dmar.c                             |   14 +-
 drivers/pci/hotplug/cpqphp.h                   |   81 +---
 drivers/pci/hotplug/cpqphp_core.c              |  207 +------
 drivers/pci/intel-iommu.c                      |   20 +-
 drivers/pci/pci-label.c                        |   82 ++--
 drivers/pci/pci.h                              |    2 +-
 drivers/pci/pcie/portdrv_pci.c                 |   26 +-
 drivers/pci/quirks.c                           |   29 +-
 drivers/platform/x86/acer-wmi.c                |  119 ++--
 drivers/platform/x86/acerhdf.c                 |   18 +-
 drivers/platform/x86/asus-laptop.c             |   29 +-
 drivers/platform/x86/compal-laptop.c           |  106 ++--
 drivers/platform/x86/dell-laptop.c             |   66 ++-
 drivers/platform/x86/dell-wmi.c                |   15 +-
 drivers/platform/x86/eeepc-laptop.c            |   58 ++-
 drivers/platform/x86/eeepc-wmi.c               |   30 +-
 drivers/platform/x86/fujitsu-laptop.c          |   41 +-
 drivers/platform/x86/hdaps.c                   |   76 ++--
 drivers/platform/x86/hp_accel.c                |   98 ++--
 drivers/platform/x86/ibm_rtl.c                 |   21 +-
 drivers/platform/x86/intel_oaktrail.c          |   15 +-
 drivers/platform/x86/msi-laptop.c              |  115 ++--
 drivers/platform/x86/samsung-laptop.c          |  183 +++---
 drivers/platform/x86/sony-laptop.c             |   16 +-
 drivers/platform/x86/thinkpad_acpi.c           |   64 +--
 drivers/pnp/pnpacpi/core.c                     |    1 -
 drivers/pnp/pnpbios/core.c                     |   20 +-
 drivers/power/max17042_battery.c               |    1 -
 drivers/rtc/rtc-cmos.c                         |    1 -
 drivers/rtc/rtc-mrst.c                         |    1 -
 drivers/staging/hv/hv_mouse.c                  |    1 -
 drivers/staging/hv/hv_timesource.c             |   18 +-
 drivers/staging/hv/hv_util.c                   |   17 +-
 drivers/staging/hv/netvsc_drv.c                |   17 +-
 drivers/staging/hv/vmbus_drv.c                 |    1 -
 drivers/tty/serial/pch_uart.c                  |   16 +-
 drivers/usb/host/pci-quirks.c                  |   19 +-
 drivers/usb/host/uhci-hcd.c                    |    2 +-
 drivers/usb/host/uhci-pci.c                    |   15 +-
 drivers/video/aty/atyfb_base.c                 |   18 +-
 drivers/video/backlight/kb3886_bl.c            |   13 +-
 drivers/video/efifb.c                          |  124 ++--
 drivers/w1/masters/ds2490.c                    |    1 -
 drivers/watchdog/hpwdt.c                       |   16 +-
 drivers/watchdog/ibmasr.c                      |    9 +-
 drivers/watchdog/sbc_fitpc2_wdt.c              |   22 +-
 include/linux/acpi.h                           |    2 +-
 include/linux/dmi.h                            |  139 -----
 include/linux/mod_devicetable.h                |   73 ++-
 include/linux/smbios.h                         |  243 ++++++++
 include/linux/sysfw.h                          |  113 ++++
 init/main.c                                    |    3 +
 kernel/panic.c                                 |    4 +-
 scripts/mod/file2alias.c                       |   52 +-
 sound/pci/hda/patch_sigmatel.c                 |   29 +-
 174 files changed, 5506 insertions(+), 4880 deletions(-)
 create mode 100644 Documentation/ABI/obsolete/sysfs-dmi
 create mode 100644 Documentation/ABI/testing/sysfw-smbios
 delete mode 100644 arch/ia64/include/asm/dmi.h
 create mode 100644 arch/ia64/include/asm/smbios.h
 delete mode 100644 arch/x86/include/asm/dmi.h
 create mode 100644 arch/x86/include/asm/smbios.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
 create mode 100644 drivers/firmware/smbios-sysfs.c
 create mode 100644 drivers/firmware/smbios.c
 create mode 100644 drivers/firmware/sysfw-sysfs.c
 create mode 100644 drivers/firmware/sysfw.c
 delete mode 100644 include/linux/dmi.h
 create mode 100644 include/linux/smbios.h
 create mode 100644 include/linux/sysfw.h
#17 lore raw

PATCH 6/34 drivers/floppy changes for SMBIOS and System Firmware

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them

---
 drivers/block/floppy.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/block/floppy.c +0 -1
index 98de8f4..a12f8e1 100644
@@ -187,7 +187,6 @@ static int print_unex = 1;
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/mod_devicetable.h>
 #include <linux/buffer_head.h>	/* for invalidate_buffers() */
 #include <linux/mutex.h>
 #include <linux/io.h>
Signature · 1 line
1.6.5.2
#21 lore raw

PATCH 10/34 drivers/gpu changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- 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

---
 drivers/gpu/drm/i915/intel_lvds.c |   81 ++++++++++++++++++-------------------
 drivers/gpu/vga/vga_switcheroo.c  |    1 -
 2 files changed, 40 insertions(+), 42 deletions(-)
drivers/gpu/drm/i915/intel_lvds.c +40 -41
index b28f7bd..5d59058 100644
@@ -28,7 +28,7 @@
  */
 
 #include <acpi/button.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/i2c.h>
 #include <linux/slab.h>
 #include "drmP.h"
@@ -502,20 +502,20 @@ static int intel_lvds_get_modes(struct drm_connector *connector)
 	return 1;
 }
 
-static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id)
+static int intel_no_modeset_on_lid_callback(const struct sysfw_id *id)
 {
 	DRM_DEBUG_KMS("Skipping forced modeset for %s\n", id->ident);
 	return 1;
 }
 
 /* The GPU hangs up on these systems if modeset is performed on LID open */
-static const struct dmi_system_id intel_no_modeset_on_lid[] = {
+static const struct sysfw_id intel_no_modeset_on_lid[] = {
 	{
-		.callback = intel_no_modeset_on_lid_dmi_callback,
+		.callback = intel_no_modeset_on_lid_callback,
 		.ident = "Toshiba Tecra A11",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A11"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TECRA A11"),
 		},
 	},
 
@@ -551,7 +551,7 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
 							     false);
 
 	/* Don't force modeset on machines where it causes a GPU lockup */
-	if (dmi_check_system(intel_no_modeset_on_lid))
+	if (sysfw_callback(intel_no_modeset_on_lid))
 		return NOTIFY_OK;
 	if (!acpi_lid_open()) {
 		dev_priv->modeset_on_lid = 1;
@@ -648,95 +648,94 @@ static const struct drm_encoder_funcs intel_lvds_enc_funcs = {
 	.destroy = intel_encoder_destroy,
 };
 
-static int __init intel_no_lvds_dmi_callback(const struct dmi_system_id *id)
+static int __init intel_no_lvds_callback(const struct sysfw_id *id)
 {
 	DRM_DEBUG_KMS("Skipping LVDS initialization for %s\n", id->ident);
 	return 1;
 }
 
 /* These systems claim to have LVDS, but really don't */
-static const struct dmi_system_id intel_no_lvds[] = {
+static const struct sysfw_id intel_no_lvds[] = {
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Apple Mac Mini (Core series)",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Apple"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Macmini1,1"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Apple Mac Mini (Core 2 series)",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Apple"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Macmini2,1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Macmini2,1"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "MSI IM-945GSE-A",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MSI"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "A9830IMS"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MSI"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A9830IMS"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Dell Studio Hybrid",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Studio Hybrid 140g"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Studio Hybrid 140g"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "AOpen Mini PC",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "AOpen"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "i965GMx-IF"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "AOpen"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "i965GMx-IF"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "AOpen Mini PC MP915",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
-			DMI_MATCH(DMI_BOARD_NAME, "i915GMx-F"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "AOpen"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "i915GMx-F"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "AOpen i915GMm-HFS",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
-			DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "AOpen"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "i915GMm-HFS"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Aopen i945GTt-VFA",
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "AO00001JW"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Clientron U800",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Clientron"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "U800"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Clientron"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "U800"),
 		},
 	},
 	{
-		.callback = intel_no_lvds_dmi_callback,
+		.callback = intel_no_lvds_callback,
 		.ident = "Asus EeeBox PC EB1007",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer INC."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "EB1007"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer INC."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "EB1007"),
 		},
 	},
-
-	{ }	/* terminating entry */
+	{}
 };
 
 /**
@@ -862,7 +861,7 @@ bool intel_lvds_init(struct drm_device *dev)
 	u8 pin;
 
 	/* Skip init on machines we know falsely report LVDS */
-	if (dmi_check_system(intel_no_lvds))
+	if (sysfw_callback(intel_no_lvds))
 		return false;
 
 	pin = GMBUS_PORT_PANEL;
drivers/gpu/vga/vga_switcheroo.c +0 -1
index 58434e8..1a9139c 100644
@@ -18,7 +18,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/dmi.h>
 #include <linux/seq_file.h>
 #include <linux/uaccess.h>
 #include <linux/fs.h>
Signature · 1 line
1.6.5.2
#25 lore raw

PATCH 14/34 drivers/input changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- 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

---
 drivers/input/keyboard/atkbd.c        |   80 ++++----
 drivers/input/misc/wistron_btns.c     |  239 +++++++++++-----------
 drivers/input/mouse/lifebook.c        |   42 ++--
 drivers/input/mouse/synaptics.c       |   44 ++--
 drivers/input/serio/i8042-x86ia64io.h |  367 +++++++++++++++++----------------
 drivers/input/tablet/wacom.h          |    1 -
 drivers/input/touchscreen/htcpen.c    |   13 +-
 7 files changed, 405 insertions(+), 381 deletions(-)
drivers/input/keyboard/atkbd.c +42 -38
index 11478eb..b66c8dd 100644
@@ -27,7 +27,7 @@
 #include <linux/workqueue.h>
 #include <linux/libps2.h>
 #include <linux/mutex.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define DRIVER_DESC	"AT and PS/2 keyboard driver"
 
@@ -1573,7 +1573,7 @@ static ssize_t atkbd_show_err_count(struct atkbd *atkbd, char *buf)
 	return sprintf(buf, "%lu\n", atkbd->err_count);
 }
 
-static int __init atkbd_setup_forced_release(const struct dmi_system_id *id)
+static int __init atkbd_setup_forced_release(const struct sysfw_id *id)
 {
 	atkbd_platform_fixup = atkbd_apply_forced_release_keylist;
 	atkbd_platform_fixup_data = id->driver_data;
@@ -1581,66 +1581,67 @@ static int __init atkbd_setup_forced_release(const struct dmi_system_id *id)
 	return 0;
 }
 
-static int __init atkbd_setup_scancode_fixup(const struct dmi_system_id *id)
+static int __init atkbd_setup_scancode_fixup(const struct sysfw_id *id)
 {
 	atkbd_platform_scancode_fixup = id->driver_data;
 
 	return 0;
 }
 
-static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
+static const struct sysfw_id atkbd_id_quirk_table[] __initconst = {
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_CHASSIS_TYPE, "8"), /* Portable */
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_dell_laptop_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "Dell Computer Corporation"),
+			SYSFW_MATCH(SYSFW_CHASSIS_TYPE, "8"), /* Portable */
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_dell_laptop_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "HP 2133"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP 2133"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_hp_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion ZV6100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Pavilion ZV6100"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4000"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Presario R4000"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Presario R4100"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4200"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Presario R4200"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
@@ -1648,8 +1649,8 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Inventec Symphony */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "INVENTEC"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "SYMPHONY 6.0/7.0"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "INVENTEC"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SYMPHONY 6.0/7.0"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
@@ -1657,8 +1658,9 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Samsung NC10 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "NC10"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "NC10"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_samsung_forced_release_keys,
@@ -1666,8 +1668,9 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Samsung NC20 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "NC20"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "NC20"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_samsung_forced_release_keys,
@@ -1675,8 +1678,9 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Samsung SQ45S70S */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "SQ45S70S"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "SAMSUNG ELECTRONICS CO., LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SQ45S70S"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_samsung_forced_release_keys,
@@ -1684,8 +1688,8 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Fujitsu Amilo PA 1510 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 1510"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Pa 1510"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_volume_forced_release_keys,
@@ -1693,8 +1697,8 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Fujitsu Amilo Pi 3525 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 3525"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Pi 3525"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_amilo_pi3525_forced_release_keys,
@@ -1702,16 +1706,16 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* Fujitsu Amilo Xi 3650 */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 3650"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Xi 3650"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkbd_amilo_xi3650_forced_release_keys,
 	},
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Soltech Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TA12"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Soltech Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TA12"),
 		},
 		.callback = atkbd_setup_forced_release,
 		.driver_data = atkdb_soltech_ta12_forced_release_keys,
@@ -1719,18 +1723,18 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		/* OQO Model 01+ */
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "OQO"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "ZEPTO"),
 		},
 		.callback = atkbd_setup_scancode_fixup,
 		.driver_data = atkbd_oqo_01plus_scancode_fixup,
 	},
-	{ }
+	{}
 };
 
 static int __init atkbd_init(void)
 {
-	dmi_check_system(atkbd_dmi_quirk_table);
+	sysfw_callback(atkbd_id_quirk_table);
 
 	return serio_register_driver(&atkbd_drv);
 }
drivers/input/misc/wistron_btns.c +121 -118

488 lines not on this page · raw message

drivers/input/mouse/lifebook.c +22 -20

134 lines not on this page · raw message

drivers/input/mouse/synaptics.c +23 -21

99 lines not on this page · raw message

drivers/input/serio/i8042-x86ia64io.h +190 -177

780 lines not on this page · raw message

drivers/input/tablet/wacom.h +0 -1
index 23317bd..1b43e02 100644
@@ -85,7 +85,6 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/module.h>
-#include <linux/mod_devicetable.h>
 #include <linux/init.h>
 #include <linux/usb/input.h>
 #include <asm/unaligned.h>
drivers/input/touchscreen/htcpen.c +7 -6
index 62811de..8375462 100644
@@ -18,7 +18,7 @@
 #include <linux/irq.h>
 #include <linux/isa.h>
 #include <linux/ioport.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 MODULE_AUTHOR("Pau Oliva Fora <[email protected]>");
 MODULE_DESCRIPTION("HTC Shift touchscreen driver");
@@ -227,20 +227,21 @@ static struct isa_driver htcpen_isa_driver = {
 	}
 };
 
-static struct dmi_system_id __initdata htcshift_dmi_table[] = {
+static struct sysfw_id __initdata htcshift_smbios_table[] = {
 	{
 		.ident = "Shift",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "High Tech Computer Corp"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Shift"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "High Tech Computer Corp"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Shift"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int __init htcpen_isa_init(void)
 {
-	if (!dmi_check_system(htcshift_dmi_table))
+	if (!sysfw_callback(htcshift_smbios_table))
 		return -ENODEV;
 
 	return isa_register_driver(&htcpen_isa_driver, 1);
Signature · 1 line
1.6.5.2
#27 lore raw

PATCH 16/34 drivers/media changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- 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

---
 drivers/media/dvb/firewire/firedtv-fw.c        |    1 -
 drivers/media/dvb/firewire/firedtv.h           |    1 -
 drivers/media/video/cafe_ccic.c                |   14 ++--
 drivers/media/video/gspca/m5602/m5602_ov9650.c |   46 ++++++------
 drivers/media/video/gspca/m5602/m5602_ov9650.h |    2 +-
 drivers/media/video/gspca/m5602/m5602_s5k4aa.c |  102 ++++++++++++++----------
 drivers/media/video/gspca/m5602/m5602_s5k4aa.h |    2 +-
 drivers/media/video/gspca/sn9c20x.c            |   30 ++++---
 drivers/media/video/pvrusb2/pvrusb2-devattr.h  |    1 -
 9 files changed, 107 insertions(+), 92 deletions(-)
drivers/media/dvb/firewire/firedtv-fw.c +0 -1
index 864b627..5f808c1 100644
@@ -9,7 +9,6 @@
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/mm.h>
-#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
drivers/media/dvb/firewire/firedtv.h +0 -1
index bd00b04..409b892 100644
@@ -16,7 +16,6 @@
 #include <linux/dvb/dmx.h>
 #include <linux/dvb/frontend.h>
 #include <linux/list.h>
-#include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
 #include <linux/spinlock_types.h>
 #include <linux/types.h>
drivers/media/video/cafe_ccic.c +7 -7
index 6647033..831d11d 100644
@@ -25,7 +25,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/fs.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
 #include <linux/i2c.h>
@@ -1974,15 +1974,15 @@ static irqreturn_t cafe_irq(int irq, void *data)
  * PCI interface stuff.
  */
 
-static const struct dmi_system_id olpc_xo1_dmi[] = {
+static const struct sysfw_id olpc_xo1_id[] = {
 	{
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "OLPC"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "XO"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "1"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "OLPC"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "XO"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "1"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int cafe_pci_probe(struct pci_dev *pdev,
@@ -2064,7 +2064,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
 		goto out_freeirq;
 
 	/* Apply XO-1 clock speed */
-	if (dmi_check_system(olpc_xo1_dmi))
+	if (sysfw_callback(olpc_xo1_id))
 		sensor_cfg.clock_speed = 45;
 
 	cam->sensor_addr = ov7670_info.addr;
drivers/media/video/gspca/m5602/m5602_ov9650.c +23 -23

115 lines not on this page · raw message

drivers/media/video/gspca/m5602/m5602_ov9650.h +1 -1
index da9a129..394042f 100644
@@ -19,7 +19,7 @@
 #ifndef M5602_OV9650_H_
 #define M5602_OV9650_H_
 
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include "m5602_sensor.h"
 
 /*****************************************************************************/
drivers/media/video/gspca/m5602/m5602_s5k4aa.c +59 -43

158 lines not on this page · raw message

drivers/media/video/gspca/m5602/m5602_s5k4aa.h +1 -1
index 8cc7a3f..d6d1338 100644
@@ -19,7 +19,7 @@
 #ifndef M5602_S5K4AA_H_
 #define M5602_S5K4AA_H_
 
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include "m5602_sensor.h"
 
drivers/media/video/gspca/sn9c20x.c +16 -14
index c431900..90f919a 100644
@@ -24,7 +24,7 @@
 #include "jpeg.h"
 
 #include <media/v4l2-chip-ident.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 MODULE_AUTHOR("Brian Johnson <[email protected]>, "
 		"microdia project <[email protected]>");
@@ -135,41 +135,43 @@ static int sd_getexposure(struct gspca_dev *gspca_dev, s32 *val);
 static int sd_setautoexposure(struct gspca_dev *gspca_dev, s32 val);
 static int sd_getautoexposure(struct gspca_dev *gspca_dev, s32 *val);
 
-static const struct dmi_system_id flip_dmi_table[] = {
+static const struct sysfw_id flip_id_table[] = {
 	{
 		.ident = "MSI MS-1034",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT'L CO.,LTD."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MS-1034"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "0341")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR,
+				    "MICRO-STAR INT'L CO.,LTD."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MS-1034"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "0341")
 		}
 	},
 	{
 		.ident = "MSI MS-1632",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "MSI"),
-			DMI_MATCH(DMI_BOARD_NAME, "MS-1632")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "MSI"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "MS-1632")
 		}
 	},
 	{
 		.ident = "MSI MS-1633X",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "MSI"),
-			DMI_MATCH(DMI_BOARD_NAME, "MS-1633X")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "MSI"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "MS-1633X")
 		}
 	},
 	{
 		.ident = "MSI MS-1635X",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "MSI"),
-			DMI_MATCH(DMI_BOARD_NAME, "MS-1635X")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "MSI"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "MS-1635X")
 		}
 	},
 	{
 		.ident = "ASUSTeK W7J",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
-			DMI_MATCH(DMI_BOARD_NAME, "W7J       ")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR,
+				    "ASUSTeK Computer Inc."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "W7J       ")
 		}
 	},
 	{}
@@ -1607,7 +1609,7 @@ static int set_hvflip(struct gspca_dev *gspca_dev)
 	u16 value2;
 	struct sd *sd = (struct sd *) gspca_dev;
 
-	if ((sd->flags & FLIP_DETECT) && dmi_check_system(flip_dmi_table)) {
+	if ((sd->flags & FLIP_DETECT) && sysfw_callback(flip_id_table)) {
 		hflip = !sd->hflip;
 		vflip = !sd->vflip;
 	} else {
drivers/media/video/pvrusb2/pvrusb2-devattr.h +0 -1
index 273c8d4..68b8073 100644
@@ -20,7 +20,6 @@
 #ifndef __PVRUSB2_DEVATTR_H
 #define __PVRUSB2_DEVATTR_H
 
-#include <linux/mod_devicetable.h>
 #include <linux/videodev2.h>
 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
 #include "pvrusb2-dvb.h"
Signature · 1 line
1.6.5.2
#32 lore raw

PATCH 21/34 drivers/platform changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- add exactmatch functionality
- edit udev notifiers
- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them

[v2]: Re-exported dmi MODULE_ALIAS

---
 drivers/platform/x86/acer-wmi.c       |  119 +++++++++++-----------
 drivers/platform/x86/acerhdf.c        |   18 +++-
 drivers/platform/x86/asus-laptop.c    |   29 +++---
 drivers/platform/x86/compal-laptop.c  |  106 +++++++++++---------
 drivers/platform/x86/dell-laptop.c    |   66 +++++++------
 drivers/platform/x86/dell-wmi.c       |   15 ++-
 drivers/platform/x86/eeepc-laptop.c   |   58 +++++++++--
 drivers/platform/x86/eeepc-wmi.c      |   30 +++---
 drivers/platform/x86/fujitsu-laptop.c |   41 ++++----
 drivers/platform/x86/hdaps.c          |   76 +++++++-------
 drivers/platform/x86/hp_accel.c       |   98 +++++++++---------
 drivers/platform/x86/ibm_rtl.c        |   21 ++--
 drivers/platform/x86/intel_oaktrail.c |   15 ++--
 drivers/platform/x86/msi-laptop.c     |  115 +++++++++++---------
 drivers/platform/x86/samsung-laptop.c |  183 +++++++++++++++++----------------
 drivers/platform/x86/sony-laptop.c    |   16 ++--
 drivers/platform/x86/thinkpad_acpi.c  |   64 ++++++------
 17 files changed, 580 insertions(+), 490 deletions(-)
drivers/platform/x86/acer-wmi.c +61 -58
index e1c4938..3a9dba1 100644
@@ -28,7 +28,8 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
+#include <linux/sysfw.h>
 #include <linux/fb.h>
 #include <linux/backlight.h>
 #include <linux/leds.h>
@@ -278,9 +279,9 @@ static void set_quirks(void)
 		interface->capability |= ACER_CAP_BRIGHTNESS;
 }
 
-static int dmi_matched(const struct dmi_system_id *dmi)
+static int quirk_matched(const struct sysfw_id *quirk)
 {
-	quirks = dmi->driver_data;
+	quirks = quirk->driver_data;
 	return 1;
 }
 
@@ -305,148 +306,148 @@ static struct quirk_entry quirk_fujitsu_amilo_li_1718 = {
 };
 
 /* The Aspire One has a dummy ACPI-WMI interface - disable it */
-static struct dmi_system_id __devinitdata acer_blacklist[] = {
+static struct sysfw_id __devinitdata acer_blacklist[] = {
 	{
 		.ident = "Acer Aspire One (SSD)",
 		.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"),
 		},
 	},
 	{
 		.ident = "Acer Aspire One (HDD)",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AOA150"),
 		},
 	},
 	{}
 };
 
-static struct dmi_system_id acer_quirks[] = {
+static struct sysfw_id acer_quirks[] = {
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 1360",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 1360"),
 		},
 		.driver_data = &quirk_acer_aspire_1520,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 1520",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1520"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 1520"),
 		},
 		.driver_data = &quirk_acer_aspire_1520,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 3100",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 3100"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 3610",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3610"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 3610"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 5100",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5100"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 5610",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5610"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 5630",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5630"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 5650",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5650"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 5680",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 5680"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer Aspire 9110",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Aspire 9110"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer TravelMate 2490",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 2490"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Acer TravelMate 4200",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4200"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Acer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TravelMate 4200"),
 		},
 		.driver_data = &quirk_acer_travelmate_2490,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Fujitsu Siemens Amilo Li 1718",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Li 1718"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "FUJITSU SIEMENS"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "AMILO Li 1718"),
 		},
 		.driver_data = &quirk_fujitsu_amilo_li_1718,
 	},
 	{
-		.callback = dmi_matched,
+		.callback = quirk_matched,
 		.ident = "Medion MD 98300",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "WAM2030"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "MEDION"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "WAM2030"),
 		},
 		.driver_data = &quirk_medion_md_98300,
 	},
@@ -457,7 +458,7 @@ static struct dmi_system_id acer_quirks[] = {
 static void find_quirks(void)
 {
 	if (!force_series) {
-		dmi_check_system(acer_quirks);
+		sysfw_callback(acer_quirks);
 	} else if (force_series == 2490) {
 		quirks = &quirk_acer_travelmate_2490;
 	}
@@ -848,16 +849,16 @@ static acpi_status WMID_set_u32(u32 value, u32 cap, struct wmi_interface *iface)
 	return WMI_execute_u32(method_id, (u32)value, NULL);
 }
 
-static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
+static int type_aa_smbios_decode(const union smbios_struct *ss, void *dummy)
 {
 	struct hotkey_function_type_aa *type_aa;
 
 	/* We are looking for OEM-specific Type AAh */
-	if (header->type != 0xAA)
-		return;
+	if (ss->header.type != 0xAA)
+		return SMBIOS_WALK_CONTINUE;
 
 	has_type_aa = true;
-	type_aa = (struct hotkey_function_type_aa *) header;
+	type_aa = (struct hotkey_function_type_aa *) &ss->header;
 
 	pr_info("Function bitmap for Communication Button: 0x%x\n",
 		type_aa->commun_func_bitmap);
@@ -868,6 +869,8 @@ static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
 		interface->capability |= ACER_CAP_THREEG;
 	if (type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH)
 		interface->capability |= ACER_CAP_BLUETOOTH;
+
+	return SMBIOS_WALK_STOP;
 }
 
 static acpi_status WMID_set_capabilities(void)
@@ -893,7 +896,7 @@ static acpi_status WMID_set_capabilities(void)
 		return AE_ERROR;
 	}
 
-	dmi_walk(type_aa_dmi_decode, NULL);
+	smbios_walk(type_aa_smbios_decode, NULL);
 	if (!has_type_aa) {
 		interface->capability |= ACER_CAP_WIRELESS;
 		if (devices & 0x40)
@@ -1835,7 +1838,7 @@ static int __init acer_wmi_init(void)
 
 	pr_info("Acer Laptop ACPI-WMI Extras\n");
 
-	if (dmi_check_system(acer_blacklist)) {
+	if (sysfw_callback(acer_blacklist)) {
 		pr_info("Blacklisted hardware detected - not loading\n");
 		return -ENODEV;
 	}
drivers/platform/x86/acerhdf.c +14 -4
index fca3489..3f951fc 100644
@@ -35,7 +35,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/acpi.h>
 #include <linux/thermal.h>
 #include <linux/platform_device.h>
@@ -544,9 +544,9 @@ static int acerhdf_check_hardware(void)
 	const struct bios_settings_t *bt = NULL;
 
 	/* get BIOS data */
-	vendor  = dmi_get_system_info(DMI_SYS_VENDOR);
-	version = dmi_get_system_info(DMI_BIOS_VERSION);
-	product = dmi_get_system_info(DMI_PRODUCT_NAME);
+	vendor  = sysfw_lookup(SYSFW_SYS_VENDOR);
+	version = sysfw_lookup(SYSFW_BIOS_VERSION);
+	product = sysfw_lookup(SYSFW_PRODUCT_NAME);
 
 	if (!vendor || !version || !product) {
 		pr_err("error getting hardware information\n");
@@ -712,6 +712,16 @@ MODULE_ALIAS("dmi:*:*Packard Bell*:pnAOA*:");
 MODULE_ALIAS("dmi:*:*Packard Bell*:pnDOA*:");
 MODULE_ALIAS("dmi:*:*Packard Bell*:pnDOTMU*:");
 MODULE_ALIAS("dmi:*:*Packard Bell*:pnDOTMA*:");
+MODULE_ALIAS("sysfw:*:*Acer*:pnAOA*:");
+MODULE_ALIAS("sysfw:*:*Acer*:pnAspire 1410*:");
+MODULE_ALIAS("sysfw:*:*Acer*:pnAspire 1810*:");
+MODULE_ALIAS("sysfw:*:*Acer*:pnAO531*:");
+MODULE_ALIAS("sysfw:*:*Gateway*:pnAOA*:");
+MODULE_ALIAS("sysfw:*:*Gateway*:pnLT31*:");
+MODULE_ALIAS("sysfw:*:*Packard Bell*:pnAOA*:");
+MODULE_ALIAS("sysfw:*:*Packard Bell*:pnDOA*:");
+MODULE_ALIAS("sysfw:*:*Packard Bell*:pnDOTMU*:");
+MODULE_ALIAS("sysfw:*:*Packard Bell*:pnDOTMA*:");
 
 module_init(acerhdf_init);
 module_exit(acerhdf_exit);
drivers/platform/x86/asus-laptop.c +14 -15
index d65df92..1841e01 100644
@@ -50,7 +50,7 @@
 #include <linux/input/sparse-keymap.h>
 #include <linux/rfkill.h>
 #include <linux/slab.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <acpi/acpi_drivers.h>
 #include <acpi/acpi_bus.h>
 
@@ -1401,19 +1401,16 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus)
 	return result;
 }
 
-static void __devinit asus_dmi_check(void)
-{
-	const char *model;
-
-	model = dmi_get_system_info(DMI_PRODUCT_NAME);
-	if (!model)
-		return;
-
-	/* On L1400B WLED control the sound card, don't mess with it ... */
-	if (strncmp(model, "L1400B", 6) == 0) {
-		wlan_status = -1;
-	}
-}
+static struct sysfw_id asus_wlan_table[] = {
+	{
+		 .ident = "L1400B",
+		.matches = {
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "L1400B"),
+		},
+		.exactmatch = 1,
+	},
+	{},
+};
 
 static bool asus_device_present;
 
@@ -1433,7 +1430,9 @@ static int __devinit asus_acpi_add(struct acpi_device *device)
 	device->driver_data = asus;
 	asus->device = device;
 
-	asus_dmi_check();
+	/* On L1400B WLED control the sound card, don't mess with it ... */
+	if (sysfw_callback(asus_wlan_table))
+		wlan_status = -1;
 
 	result = asus_acpi_init(asus);
 	if (result)
drivers/platform/x86/compal-laptop.c +59 -47

216 lines not on this page · raw message

drivers/platform/x86/dell-laptop.c +36 -30

167 lines not on this page · raw message

drivers/platform/x86/dell-wmi.c +9 -6
index ce79082..b71c908 100644
@@ -35,7 +35,7 @@
 #include <acpi/acpi_drivers.h>
 #include <linux/acpi.h>
 #include <linux/string.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 
 MODULE_AUTHOR("Matthew Garrett <[email protected]>");
 MODULE_DESCRIPTION("Dell laptop WMI hotkeys driver");
@@ -103,7 +103,7 @@ struct dell_bios_keymap_entry {
 };
 
 struct dell_bios_hotkey_table {
-	struct dmi_header header;
+	struct smbios_header header;
 	struct dell_bios_keymap_entry keymap[];
 
 };
@@ -261,13 +261,16 @@ static void dell_wmi_input_destroy(void)
 	input_unregister_device(dell_wmi_input_dev);
 }
 
-static void __init find_hk_type(const struct dmi_header *dm, void *dummy)
+static int __init find_hk_type(const union smbios_struct *ss, void *dummy)
 {
-	if (dm->type == 0xb2 && dm->length > 6) {
+	if (ss->header.type == 0xb2 && ss->header.length > 6) {
 		dell_new_hk_type = true;
 		dell_bios_hotkey_table =
-			container_of(dm, struct dell_bios_hotkey_table, header);
+			container_of(&ss->header, struct dell_bios_hotkey_table,
+				     header);
+		return SMBIOS_WALK_STOP;
 	}
+	return SMBIOS_WALK_CONTINUE;
 }
 
 static int __init dell_wmi_init(void)
@@ -280,7 +283,7 @@ static int __init dell_wmi_init(void)
 		return -ENODEV;
 	}
 
-	dmi_walk(find_hk_type, NULL);
+	smbios_walk(find_hk_type, NULL);
 	acpi_video = acpi_video_backlight_support();
 
 	err = dell_wmi_input_setup();
drivers/platform/x86/eeepc-laptop.c +50 -8

94 lines not on this page · raw message

drivers/platform/x86/eeepc-wmi.c +15 -15
index 4aa867a..8494074 100644
@@ -31,7 +31,7 @@
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/input/sparse-keymap.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <acpi/acpi_bus.h>
 
 #include "asus-wmi.h"
@@ -116,14 +116,20 @@ static int eeepc_wmi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static void eeepc_dmi_check(struct asus_wmi_driver *driver)
-{
-	const char *model;
-
-	model = dmi_get_system_info(DMI_PRODUCT_NAME);
-	if (!model)
-		return;
+static struct sysfw_id eeepc_wlan_hotplug_id[] = {
+	{
+		 .ident = "Asus 1000H",
+		.matches = {
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "1000H"),
+		},
+		.exactmatch = 1,
+	},
+	{},
+};
 
+static void eeepc_wmi_quirks(struct asus_wmi_driver *driver)
+{
+	driver->hotplug_wireless = hotplug_wireless;
 	/*
 	 * Whitelist for wlan hotplug
 	 *
@@ -132,18 +138,12 @@ static void eeepc_dmi_check(struct asus_wmi_driver *driver)
 	 * it seems that most of the laptops supported by asus-wmi
 	 * don't need to be on this list
 	 */
-	if (strcmp(model, "1000H") == 0) {
+	if (sysfw_callback(eeepc_wlan_hotplug_id)) {
 		driver->hotplug_wireless = true;
 		pr_info("wlan hotplug enabled\n");
 	}
 }
 
-static void eeepc_wmi_quirks(struct asus_wmi_driver *driver)
-{
-	driver->hotplug_wireless = hotplug_wireless;
-	eeepc_dmi_check(driver);
-}
-
 static struct asus_wmi_driver asus_wmi_driver = {
 	.name = EEEPC_WMI_FILE,
 	.owner = THIS_MODULE,
drivers/platform/x86/fujitsu-laptop.c +22 -19

102 lines not on this page · raw message

drivers/platform/x86/hdaps.c +38 -38

114 lines not on this page · raw message

drivers/platform/x86/hp_accel.c +49 -49

137 lines not on this page · raw message

drivers/platform/x86/ibm_rtl.c +11 -10
index 811d436..570106c 100644
@@ -29,14 +29,15 @@
 #include <linux/module.h>
 #include <linux/io.h>
 #include <linux/sysdev.h>
-#include <linux/dmi.h>
 #include <linux/efi.h>
 #include <linux/mutex.h>
+#include <linux/sysfw.h>
+
 #include <asm/bios_ebda.h>
 
 static bool force;
 module_param(force, bool, 0);
-MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
+MODULE_PARM_DESC(force, "Force driver load, ignore SMBIOS data");
 
 static bool debug;
 module_param(debug, bool, 0644);
@@ -237,14 +238,14 @@ static void rtl_teardown_sysfs(void) {
 	sysdev_class_unregister(&class_rtl);
 }
 
-
-static struct dmi_system_id __initdata ibm_rtl_dmi_table[] = {
-	{                                                  \
-		.matches = {                               \
-			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),  \
-		},                                         \
+static struct sysfw_id __initdata ibm_rtl_smbios_table[] = {
+	{
+		.ident = "IBM",
+		.matches = {
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "IBM"),
+		},
 	},
-	{ }
+	{}
 };
 
 static int __init ibm_rtl_init(void) {
@@ -255,7 +256,7 @@ static int __init ibm_rtl_init(void) {
 	if (force)
 		pr_warn("module loaded by force\n");
 	/* first ensure that we are running on IBM HW */
-	else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table))
+	else if (efi_enabled || !sysfw_callback(ibm_rtl_smbios_table))
 		return -ENODEV;
 
 	/* Get the address for the Extended BIOS Data Area */
drivers/platform/x86/intel_oaktrail.c +8 -7
index 7f88c79..76f1c9d 100644
@@ -48,7 +48,7 @@
 #include <linux/i2c.h>
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/rfkill.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
@@ -297,21 +297,21 @@ static struct platform_driver oaktrail_driver = {
 	.remove	= __devexit_p(oaktrail_remove)
 };
 
-static int dmi_check_cb(const struct dmi_system_id *id)
+static int system_check_cb(const struct sysfw_id *id)
 {
 	pr_info("Identified model '%s'\n", id->ident);
 	return 0;
 }
 
-static struct dmi_system_id __initdata oaktrail_dmi_table[] = {
+static struct sysfw_id __initdata oaktrail_system_table[] = {
 	{
 		.ident = "OakTrail platform",
 		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "OakTrail platform"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "OakTrail platform"),
 		},
-		.callback = dmi_check_cb
+		.callback = system_check_cb
 	},
-	{ }
+	{}
 };
 
 static int __init oaktrail_init(void)
@@ -323,7 +323,7 @@ static int __init oaktrail_init(void)
 		return -ENODEV;
 	}
 
-	if (!force && !dmi_check_system(oaktrail_dmi_table)) {
+	if (!force && !sysfw_callback(oaktrail_system_table)) {
 		pr_err("Platform not recognized (You could try the module's force-parameter)");
 		return -ENODEV;
 	}
@@ -395,3 +395,4 @@ MODULE_DESCRIPTION("Intel Oaktrail Platform ACPI Extras");
 MODULE_VERSION(DRIVER_VERSION);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("dmi:*:svnIntelCorporation:pnOakTrailplatform:*");
+MODULE_ALIAS("sysfw:*:svnIntelCorporation:pnOakTrailplatform:*");
drivers/platform/x86/msi-laptop.c +63 -52

200 lines not on this page · raw message

drivers/platform/x86/samsung-laptop.c +93 -90

299 lines not on this page · raw message

drivers/platform/x86/sony-laptop.c +8 -8
index bbd182e..b708f04 100644
@@ -52,7 +52,7 @@
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
 #include <linux/err.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/pci.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
@@ -3385,29 +3385,29 @@ static struct acpi_driver sony_pic_driver = {
 		},
 };
 
-static struct dmi_system_id __initdata sonypi_dmi_table[] = {
+static struct sysfw_id __initdata sonypi_id_table[] = {
 	{
 		.ident = "Sony Vaio",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PCG-"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PCG-"),
 		},
 	},
 	{
 		.ident = "Sony Vaio",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int __init sony_laptop_init(void)
 {
 	int result;
 
-	if (!no_spic && dmi_check_system(sonypi_dmi_table)) {
+	if (!no_spic && sysfw_callback(sonypi_id_table)) {
 		result = acpi_bus_register_driver(&sony_pic_driver);
 		if (result) {
 			pr_err("Unable to register SPIC driver\n");
drivers/platform/x86/thinkpad_acpi.c +30 -34

120 lines not on this page · raw message

Signature · 1 line
1.6.5.2
#28 lore raw

PATCH 17/34 drivers/misc changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them

---
 drivers/misc/eeprom/at24.c         |    1 -
 drivers/misc/lis3lv02d/lis3lv02d.c |    1 -
 drivers/misc/pch_phub.c            |   14 ++++++++++++--
 3 files changed, 12 insertions(+), 4 deletions(-)
drivers/misc/eeprom/at24.c +0 -1
index ab1ad41..1e73630 100644
@@ -16,7 +16,6 @@
 #include <linux/delay.h>
 #include <linux/mutex.h>
 #include <linux/sysfs.h>
-#include <linux/mod_devicetable.h>
 #include <linux/log2.h>
 #include <linux/bitops.h>
 #include <linux/jiffies.h>
drivers/misc/lis3lv02d/lis3lv02d.c +0 -1
index b928bc1..c48b955 100644
@@ -24,7 +24,6 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/dmi.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/platform_device.h>
drivers/misc/pch_phub.c +12 -2
index 5fe79df..ecd2cb2 100644
@@ -27,7 +27,7 @@
 #include <linux/mutex.h>
 #include <linux/if_ether.h>
 #include <linux/ctype.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define PHUB_STATUS 0x00		/* Status Register offset */
 #define PHUB_CONTROL 0x04		/* Control Register offset */
@@ -598,6 +598,16 @@ static ssize_t show_pch_mac(struct device *dev, struct device_attribute *attr,
 				mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
 }
 
+static struct sysfw_id pcih_phub_quirk_id[] = {
+	{
+		 .ident = "CM-iTC",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "CM-iTC"),
+		},
+	},
+	{},
+};
+
 static ssize_t store_pch_mac(struct device *dev, struct device_attribute *attr,
 			     const char *buf, size_t count)
 {
@@ -701,7 +711,7 @@ static int __devinit pch_phub_probe(struct pci_dev *pdev,
 					       CLKCFG_CANCLK_MASK);
 
 		/* quirk for CM-iTC board */
-		if (strstr(dmi_get_system_info(DMI_BOARD_NAME), "CM-iTC"))
+		if (sysfw_callback(pcih_phub_quirk_id))
 			pch_phub_read_modify_write_reg(chip,
 						(unsigned int)CLKCFG_REG_OFFSET,
 						CLKCFG_UART_48MHZ | CLKCFG_BAUDDIV |
Signature · 1 line
1.6.5.2
#31 lore raw

PATCH 20/34 drivers/pci changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- add exactmatch functionality

---
 drivers/pci/dmar.c                |   14 ++--
 drivers/pci/hotplug/cpqphp.h      |   81 +--------------
 drivers/pci/hotplug/cpqphp_core.c |  207 +++++--------------------------------
 drivers/pci/intel-iommu.c         |   20 ++--
 drivers/pci/pci-label.c           |   82 +++++++--------
 drivers/pci/pci.h                 |    2 +-
 drivers/pci/pcie/portdrv_pci.c    |   26 +++---
 drivers/pci/quirks.c              |   29 ++++-
 8 files changed, 120 insertions(+), 341 deletions(-)
drivers/pci/dmar.c +7 -7
index 3dc9bef..1f8352a 100644
@@ -34,7 +34,7 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/tboot.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/slab.h>
 #include <asm/iommu_table.h>
 
@@ -367,9 +367,9 @@ dmar_parse_one_rhsa(struct acpi_dmar_header *header)
 		"Your BIOS is broken; RHSA refers to non-existent DMAR unit at %llx\n"
 		"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
 		drhd->reg_base_addr,
-		dmi_get_system_info(DMI_BIOS_VENDOR),
-		dmi_get_system_info(DMI_BIOS_VERSION),
-		dmi_get_system_info(DMI_PRODUCT_VERSION));
+		sysfw_lookup(SYSFW_BIOS_VENDOR),
+		sysfw_lookup(SYSFW_BIOS_VERSION),
+		sysfw_lookup(SYSFW_PRODUCT_VERSION));
 
 	return 0;
 }
@@ -629,9 +629,9 @@ static void warn_invalid_dmar(u64 addr, const char *message)
 		"Your BIOS is broken; DMAR reported at address %llx%s!\n"
 		"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
 		addr, message,
-		dmi_get_system_info(DMI_BIOS_VENDOR),
-		dmi_get_system_info(DMI_BIOS_VERSION),
-		dmi_get_system_info(DMI_PRODUCT_VERSION));
+		sysfw_lookup(SYSFW_BIOS_VENDOR),
+		sysfw_lookup(SYSFW_BIOS_VERSION),
+		sysfw_lookup(SYSFW_PRODUCT_VERSION));
 }
 
 int __init check_zero_address(void)
drivers/pci/hotplug/cpqphp.h +2 -79

99 lines not on this page · raw message

drivers/pci/hotplug/cpqphp_core.c +28 -179

277 lines not on this page · raw message

drivers/pci/intel-iommu.c +10 -10
index f02c34d..9525da1 100644
@@ -38,7 +38,7 @@
 #include <linux/intel-iommu.h>
 #include <linux/syscore_ops.h>
 #include <linux/tboot.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/pci-ats.h>
 #include <asm/cacheflush.h>
 #include <asm/iommu.h>
@@ -2108,9 +2108,9 @@ static int iommu_prepare_identity_map(struct pci_dev *pdev,
 	if (end < start) {
 		WARN(1, "Your BIOS is broken; RMRR ends before it starts!\n"
 			"BIOS vendor: %s; Ver: %s; Product Version: %s\n",
-			dmi_get_system_info(DMI_BIOS_VENDOR),
-			dmi_get_system_info(DMI_BIOS_VERSION),
-		     dmi_get_system_info(DMI_PRODUCT_VERSION));
+			sysfw_lookup(SYSFW_BIOS_VENDOR),
+			sysfw_lookup(SYSFW_BIOS_VERSION),
+		     sysfw_lookup(SYSFW_PRODUCT_VERSION));
 		ret = -EIO;
 		goto error;
 	}
@@ -2119,9 +2119,9 @@ static int iommu_prepare_identity_map(struct pci_dev *pdev,
 		WARN(1, "Your BIOS is broken; RMRR exceeds permitted address width (%d bits)\n"
 		     "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
 		     agaw_to_width(domain->agaw),
-		     dmi_get_system_info(DMI_BIOS_VENDOR),
-		     dmi_get_system_info(DMI_BIOS_VERSION),
-		     dmi_get_system_info(DMI_PRODUCT_VERSION));
+		     sysfw_lookup(SYSFW_BIOS_VENDOR),
+		     sysfw_lookup(SYSFW_BIOS_VERSION),
+		     sysfw_lookup(SYSFW_PRODUCT_VERSION));
 		ret = -EIO;
 		goto error;
 	}
@@ -4005,9 +4005,9 @@ static void __init check_tylersburg_isoch(void)
 	if (!vtisochctrl) {
 		WARN(1, "Your BIOS is broken; DMA routed to ISOCH DMAR unit but no TLB space.\n"
 		     "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
-		     dmi_get_system_info(DMI_BIOS_VENDOR),
-		     dmi_get_system_info(DMI_BIOS_VERSION),
-		     dmi_get_system_info(DMI_PRODUCT_VERSION));
+		     sysfw_lookup(SYSFW_BIOS_VENDOR),
+		     sysfw_lookup(SYSFW_BIOS_VERSION),
+		     sysfw_lookup(SYSFW_PRODUCT_VERSION));
 		iommu_identity_mapping |= IDENTMAP_AZALIA;
 		return;
 	}
drivers/pci/pci-label.c +36 -46

119 lines not on this page · raw message

drivers/pci/pci.h +1 -1
index 3a39bf1..6aff3aa 100644
@@ -11,7 +11,7 @@
 extern int pci_uevent(struct device *dev, struct kobj_uevent_env *env);
 extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
 extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
-#if !defined(CONFIG_DMI) && !defined(CONFIG_ACPI)
+#ifndef CONFIG_ACPI
 static inline void pci_create_firmware_label_files(struct pci_dev *pdev)
 { return; }
 static inline void pci_remove_firmware_label_files(struct pci_dev *pdev)
drivers/pci/pcie/portdrv_pci.c +13 -13
index e0610bd..30ffd66 100644
@@ -14,7 +14,7 @@
 #include <linux/init.h>
 #include <linux/pcieport_if.h>
 #include <linux/aer.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/pci-aspm.h>
 
 #include "portdrv.h"
@@ -330,7 +330,7 @@ static struct pci_driver pcie_portdriver = {
 	.driver.pm 	= PCIE_PORTDRV_PM_OPS,
 };
 
-static int __init dmi_pcie_pme_disable_msi(const struct dmi_system_id *d)
+static int __init id_pcie_pme_disable_msi(const struct sysfw_id *d)
 {
 	pr_notice("%s detected: will not use MSI for PCIe PME signaling\n",
 			d->ident);
@@ -338,20 +338,20 @@ static int __init dmi_pcie_pme_disable_msi(const struct dmi_system_id *d)
 	return 0;
 }
 
-static struct dmi_system_id __initdata pcie_portdrv_dmi_table[] = {
+static struct sysfw_id __initdata pcie_portdrv_id_table[] = {
 	/*
 	 * Boxes that should not use MSI for PCIe PME signaling.
 	 */
 	{
-	 .callback = dmi_pcie_pme_disable_msi,
-	 .ident = "MSI Wind U-100",
-	 .matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR,
-		     		"MICRO-STAR INTERNATIONAL CO., LTD"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "U-100"),
-		     },
-	 },
-	 {}
+		.callback = id_pcie_pme_disable_msi,
+		.ident = "MSI Wind U-100",
+		.matches = {
+				SYSFW_MATCH(SYSFW_SYS_VENDOR,
+					   "MICRO-STAR INTERNATIONAL CO., LTD"),
+				SYSFW_MATCH(SYSFW_PRODUCT_NAME, "U-100"),
+		},
+	},
+	{}
 };
 
 static int __init pcie_portdrv_init(void)
@@ -361,7 +361,7 @@ static int __init pcie_portdrv_init(void)
 	if (pcie_ports_disabled)
 		return pci_register_driver(&pcie_portdriver);
 
-	dmi_check_system(pcie_portdrv_dmi_table);
+	sysfw_callback(pcie_portdrv_id_table);
 
 	retval = pcie_port_bus_register();
 	if (retval) {
drivers/pci/quirks.c +23 -6
index 02145e9..5ff7e9c 100644
@@ -22,7 +22,7 @@
 #include <linux/delay.h>
 #include <linux/acpi.h>
 #include <linux/kallsyms.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/pci-aspm.h>
 #include <linux/ioport.h>
 #include <asm/dma.h>	/* isa_dma_bridge_buggy */
@@ -2343,19 +2343,36 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE,
 			 ht_enable_msi_mapping);
 
+static const struct sysfw_id __initdata nvenet_msi_disable_table[] = {
+	{
+		.ident = "5N32-SLI PREMIUM",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "P5N32-SLI PREMIUM"),
+		},
+		.exactmatch = 1,
+	},
+	{
+		.ident = "P5N32-E SLI",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "P5N32-E SLI"),
+		},
+		.exactmatch = 1,
+	},
+	{}
+};
+
 /* The P5N32-SLI motherboards from Asus have a problem with msi
  * for the MCP55 NIC. It is not yet determined whether the msi problem
  * also affects other devices. As for now, turn off msi for this device.
  */
 static void __devinit nvenet_msi_disable(struct pci_dev *dev)
 {
-	const char *board_name = dmi_get_system_info(DMI_BOARD_NAME);
+	const struct sysfw_id *id;
 
-	if (board_name &&
-	    (strstr(board_name, "P5N32-SLI PREMIUM") ||
-	     strstr(board_name, "P5N32-E SLI"))) {
+	id = sysfw_callback(nvenet_msi_disable_table);
+	if (id) {
 		dev_info(&dev->dev,
-			 "Disabling msi for MCP55 NIC on P5N32-SLI\n");
+			 "Disabling msi for MCP55 NIC on %s\n", id->ident);
 		dev->no_msi = 1;
 	}
 }
Signature · 1 line
1.6.5.2
#35 lore raw

PATCH 23/34 drivers/power changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them

---
 drivers/power/max17042_battery.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/power/max17042_battery.c +0 -1
index c5c8805..58d75aa 100644
@@ -25,7 +25,6 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/i2c.h>
-#include <linux/mod_devicetable.h>
 #include <linux/power_supply.h>
 #include <linux/power/max17042_battery.h>
 
Signature · 1 line
1.6.5.2
#38 lore raw

PATCH 26/34 drivers/tty changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers

---
 drivers/tty/serial/pch_uart.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
drivers/tty/serial/pch_uart.c +12 -4
index 4652109..ab2e2af 100644
@@ -21,7 +21,7 @@
 #include <linux/serial_core.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <linux/dmaengine.h>
 #include <linux/pch_dma.h>
@@ -1386,6 +1386,16 @@ static struct uart_driver pch_uart_driver = {
 	.nr = PCH_UART_NR,
 };
 
+static const struct sysfw_id pcih_uart_quirk_id[] = {
+	{
+		.ident = "CM-iTC",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "CM-iTC"),
+		},
+	},
+	{}
+};
+
 static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 					     const struct pci_device_id *id)
 {
@@ -1397,7 +1407,6 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	int fifosize, base_baud;
 	int port_type;
 	struct pch_uart_driver_data *board;
-	const char *board_name;
 
 	board = &drv_dat[id->driver_data];
 	port_type = board->port_type;
@@ -1413,8 +1422,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	base_baud = 1843200; /* 1.8432MHz */
 
 	/* quirk for CM-iTC board */
-	board_name = dmi_get_system_info(DMI_BOARD_NAME);
-	if (board_name && strstr(board_name, "CM-iTC"))
+	if (sysfw_callback(pcih_uart_quirk_id))
 		base_baud = 192000000; /* 192.0MHz */
 
 	switch (port_type) {
Signature · 1 line
1.6.5.2
#46 lore raw

PATCH 33/34 sound/pci/hda changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers

---
 sound/pci/hda/patch_sigmatel.c |   29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)
sound/pci/hda/patch_sigmatel.c +13 -16
index 7f81cc2..271ea6a 100644
@@ -28,7 +28,7 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
 #include <sound/core.h>
 #include <sound/asoundef.h>
 #include <sound/jack.h>
@@ -4798,26 +4798,23 @@ static void set_hp_led_gpio(struct hda_codec *codec)
 static int find_mute_led_gpio(struct hda_codec *codec, int default_polarity)
 {
 	struct sigmatel_spec *spec = codec->spec;
-	const struct dmi_device *dev = NULL;
+	const char *str;
 
 	if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) {
-		while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
-								NULL, dev))) {
-			if (sscanf(dev->name, "HP_Mute_LED_%d_%d",
-				  &spec->gpio_led_polarity,
-				  &spec->gpio_led) == 2) {
-				spec->gpio_led = 1 << spec->gpio_led;
-				return 1;
-			}
-			if (sscanf(dev->name, "HP_Mute_LED_%d",
-				  &spec->gpio_led_polarity) == 1) {
-				set_hp_led_gpio(codec);
-				return 1;
-			}
+		str = smbios_match_oem_string("HP_Mute_LED_");
+		if (sscanf(str, "HP_Mute_LED_%d_%d", &spec->gpio_led_polarity,
+			   &spec->gpio_led) == 2) {
+			spec->gpio_led = 1 << spec->gpio_led;
+			return 1;
+		}
+		if (sscanf(str, "HP_Mute_LED_%d",
+			   &spec->gpio_led_polarity) == 1) {
+			set_hp_led_gpio(codec);
+			return 1;
 		}
 
 		/*
-		 * Fallback case - if we don't find the DMI strings,
+		 * Fallback case - if we don't find the SMBIOS strings,
 		 * we statically set the GPIO - if not a B-series system.
 		 */
 		if (!hp_blike_system(codec->subsystem_id)) {
Signature · 1 line
1.6.5.2
#41 lore raw

PATCH 28/34 drivers/video changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables

[v2]: Added sysfw MODULE_ALIAS

---
 drivers/video/aty/atyfb_base.c      |   18 +++---
 drivers/video/backlight/kb3886_bl.c |   13 ++--
 drivers/video/efifb.c               |  124 ++++++++++++++++++-----------------
 3 files changed, 80 insertions(+), 75 deletions(-)
drivers/video/aty/atyfb_base.c +9 -9
index d7aaec5..5f0e777 100644
@@ -67,7 +67,7 @@
 #include <linux/wait.h>
 #include <linux/backlight.h>
 #include <linux/reboot.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <asm/io.h>
 #include <linux/uaccess.h>
@@ -3955,17 +3955,17 @@ static struct notifier_block atyfb_reboot_notifier = {
 	.notifier_call = atyfb_reboot_notify,
 };
 
-static const struct dmi_system_id atyfb_reboot_ids[] = {
+static const struct sysfw_id atyfb_reboot_ids[] = {
 	{
 		.ident = "HP OmniBook 500",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "HP OmniBook PC"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "HP OmniBook 500 FA"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Hewlett-Packard"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "HP OmniBook PC"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION,
+				    "HP OmniBook 500 FA"),
 		},
 	},
-
-	{ }
+	{}
 };
 
 static int __init atyfb_init(void)
@@ -3989,7 +3989,7 @@ static int __init atyfb_init(void)
 	if (err1 && err2)
 		return -ENODEV;
 
-	if (dmi_check_system(atyfb_reboot_ids))
+	if (sysfw_callback(atyfb_reboot_ids))
 		register_reboot_notifier(&atyfb_reboot_notifier);
 
 	return 0;
@@ -3997,7 +3997,7 @@ static int __init atyfb_init(void)
 
 static void __exit atyfb_exit(void)
 {
-	if (dmi_check_system(atyfb_reboot_ids))
+	if (sysfw_callback(atyfb_reboot_ids))
 		unregister_reboot_notifier(&atyfb_reboot_notifier);
 
 #ifdef CONFIG_PCI
drivers/video/backlight/kb3886_bl.c +7 -6
index 72dd555..297c649 100644
@@ -19,7 +19,7 @@
 #include <linux/fb.h>
 #include <linux/backlight.h>
 #include <linux/delay.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define KB3886_PARENT 0x64
 #define KB3886_IO 0x60
@@ -78,15 +78,15 @@ static struct kb3886bl_machinfo *bl_machinfo;
 static unsigned long kb3886bl_flags;
 #define KB3886BL_SUSPENDED     0x01
 
-static struct dmi_system_id __initdata kb3886bl_device_table[] = {
+static struct sysfw_id __initdata kb3886bl_device_table[] = {
 	{
 		.ident = "Sahara Touch-iT",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "SDV"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "iTouch T201"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "SDV"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "iTouch T201"),
 		},
 	},
-	{ }
+	{}
 };
 
 static int kb3886bl_send_intensity(struct backlight_device *bd)
@@ -188,7 +188,7 @@ static struct platform_driver kb3886bl_driver = {
 
 static int __init kb3886_init(void)
 {
-	if (!dmi_check_system(kb3886bl_device_table))
+	if (!sysfw_callback(kb3886bl_device_table))
 		return -ENODEV;
 
 	platform_add_devices(devices, ARRAY_SIZE(devices));
@@ -207,3 +207,4 @@ MODULE_AUTHOR("Claudio Nieder <[email protected]>");
 MODULE_DESCRIPTION("Tabletkiosk Sahara Touch-iT Backlight Driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("dmi:*:svnSDV:pniTouchT201:*");
+MODULE_ALIAS("sysfw:*:svnSDV:pniTouchT201:*");
drivers/video/efifb.c +64 -60

189 lines not on this page · raw message

Signature · 1 line
1.6.5.2
#42 lore raw

PATCH 29/34 drivers/w1 changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them

---
 drivers/w1/masters/ds2490.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/w1/masters/ds2490.c +0 -1
index 02bf7bf..56c2f90 100644
@@ -21,7 +21,6 @@
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/mod_devicetable.h>
 #include <linux/usb.h>
 #include <linux/slab.h>
 
Signature · 1 line
1.6.5.2
#45 lore raw

PATCH 32/34 Kernel panic changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers

---
 kernel/panic.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/panic.c +2 -2
index 6923167..7b35089 100644
@@ -22,7 +22,7 @@
 #include <linux/sysrq.h>
 #include <linux/init.h>
 #include <linux/nmi.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #define PANIC_TIMER_STEP 100
 #define PANIC_BLINK_SPD 18
@@ -370,7 +370,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller,
 
 	printk(KERN_WARNING "------------[ cut here ]------------\n");
 	printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
-	board = dmi_get_system_info(DMI_PRODUCT_NAME);
+	board = sysfw_lookup(SYSFW_PRODUCT_NAME);
 	if (board)
 		printk(KERN_WARNING "Hardware name: %s\n", board);
 
Signature · 1 line
1.6.5.2
#39 lore raw

PATCH 27/34 drivers/usb changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- add exactmatch functionality

---
 drivers/usb/host/pci-quirks.c |   19 ++++++++++++++-----
 drivers/usb/host/uhci-hcd.c   |    2 +-
 drivers/usb/host/uhci-pci.c   |   15 +++++++++++----
 3 files changed, 26 insertions(+), 10 deletions(-)
drivers/usb/host/pci-quirks.c +14 -5
index fd93061..ae2a681 100644
@@ -14,7 +14,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/acpi.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include "pci-quirks.h"
 #include "xhci-ext-caps.h"
 
@@ -507,6 +507,18 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
 	iounmap(base);
 }
 
+static const struct sysfw_id __devinitdata ehci_bios_handoff_table[] = {
+	{
+		.ident = "Pegatron Lucid (ExoPC) Tablet",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "EXOPG06411"),
+			SYSFW_MATCH(SYSFW_BIOS_VERSION, "Lucid-CE-133"),
+		},
+		.exactmatch = 1,
+	},
+	{}
+};
+
 static void __devinit ehci_bios_handoff(struct pci_dev *pdev,
 					void __iomem *op_reg_base,
 					u32 cap, u8 offset)
@@ -517,10 +529,7 @@ static void __devinit ehci_bios_handoff(struct pci_dev *pdev,
 	 * seconds trying the handoff on its unused controller.  Skip
 	 * it. */
 	if (pdev->vendor == 0x8086 && pdev->device == 0x283a) {
-		const char *dmi_bn = dmi_get_system_info(DMI_BOARD_NAME);
-		const char *dmi_bv = dmi_get_system_info(DMI_BIOS_VERSION);
-		if (dmi_bn && !strcmp(dmi_bn, "EXOPG06411") &&
-		    dmi_bv && !strcmp(dmi_bv, "Lucid-CE-133"))
+		if (sysfw_callback(ehci_bios_handoff_table))
 			try_handoff = 0;
 	}
 
drivers/usb/host/uhci-hcd.c +1 -1
index fba99b1..1b03b7a 100644
@@ -40,7 +40,7 @@
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
 #include <linux/bitops.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
drivers/usb/host/uhci-pci.c +11 -4
index c300bd2..ef3de10 100644
@@ -88,18 +88,25 @@ static int uhci_pci_resume_detect_interrupts_are_broken(struct uhci_hcd *uhci)
 	return 0;
 }
 
+static const struct sysfw_id bad_Asus_board_id[] = {
+	{
+		.ident = "A7V8X",
+		.matches = {
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "A7V8X"),
+		},
+	},
+	{}
+};
+
 static int uhci_pci_global_suspend_mode_is_broken(struct uhci_hcd *uhci)
 {
 	int port;
-	const char *sys_info;
-	static const char bad_Asus_board[] = "A7V8X";
 
 	/* One of Asus's motherboards has a bug which causes it to
 	 * wake up immediately from suspend-to-RAM if any of the ports
 	 * are connected.  In such cases we will not set EGSM.
 	 */
-	sys_info = dmi_get_system_info(DMI_BOARD_NAME);
-	if (sys_info && !strcmp(sys_info, bad_Asus_board)) {
+	if (sysfw_callback(bad_Asus_board_id)) {
 		for (port = 0; port < uhci->rh_numports; ++port) {
 			if (inw(uhci->io_addr + USBPORTSC1 + port * 2) &
 					USBPORTSC_CCS)
Signature · 1 line
1.6.5.2
#36 lore raw

PATCH 24/34 drivers/rtc changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them

---
 drivers/rtc/rtc-cmos.c |    1 -
 drivers/rtc/rtc-mrst.c |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)
drivers/rtc/rtc-cmos.c +0 -1
index 911e75c..56b9d6d 100644
@@ -34,7 +34,6 @@
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
 #include <linux/platform_device.h>
-#include <linux/mod_devicetable.h>
 #include <linux/log2.h>
 #include <linux/pm.h>
 #include <linux/of.h>
drivers/rtc/rtc-mrst.c +0 -1
index 0cec565..ce8cef4 100644
@@ -27,7 +27,6 @@
  *  * Alarm function is also limited to hr/min/sec.
  */
 
-#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
Signature · 1 line
1.6.5.2
#26 lore raw

PATCH 15/34 drivers/leds changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables

---
 drivers/leds/leds-clevo-mail.c |   78 ++++++++++++++++++----------------------
 drivers/leds/leds-ss4200.c     |   23 +++++-------
 2 files changed, 44 insertions(+), 57 deletions(-)
drivers/leds/leds-clevo-mail.c +35 -43
index a498135..63047de 100644
@@ -1,14 +1,10 @@
-
-#include <linux/module.h>
-
-#include <linux/platform_device.h>
 #include <linux/err.h>
-#include <linux/leds.h>
-
-#include <linux/io.h>
-#include <linux/dmi.h>
-
 #include <linux/i8042.h>
+#include <linux/io.h>
+#include <linux/leds.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/sysfw.h>
 
 #define CLEVO_MAIL_LED_OFF		0x0084
 #define CLEVO_MAIL_LED_BLINK_1HZ	0x008A
@@ -20,11 +16,12 @@ MODULE_LICENSE("GPL");
 
 static unsigned int __initdata nodetect;
 module_param_named(nodetect, nodetect, bool, 0);
-MODULE_PARM_DESC(nodetect, "Skip DMI hardware detection");
+MODULE_PARM_DESC(nodetect, "Skip SMBIOS hardware detection");
 
 static struct platform_device *pdev;
 
-static int __init clevo_mail_led_dmi_callback(const struct dmi_system_id *id)
+static int __init
+clevo_mail_led_smbios_callback(const struct sysfw_id *id)
 {
 	printk(KERN_INFO KBUILD_MODNAME ": '%s' found\n", id->ident);
 	return 1;
@@ -39,55 +36,55 @@ static int __init clevo_mail_led_dmi_callback(const struct dmi_system_id *id)
  * detected as working, but in reality it is not) as low as
  * possible.
  */
-static struct dmi_system_id __initdata mail_led_whitelist[] = {
+static struct sysfw_id __initdata mail_led_whitelist[] = {
 	{
-		.callback = clevo_mail_led_dmi_callback,
+		.callback = clevo_mail_led_smbios_callback,
 		.ident = "Clevo D410J",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "VIA"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "K8N800"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "VT8204B")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "VIA"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "K8N800"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "VT8204B")
 		}
 	},
 	{
-		.callback = clevo_mail_led_dmi_callback,
+		.callback = clevo_mail_led_smbios_callback,
 		.ident = "Clevo M5x0N",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "M5x0N")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "CLEVO Co."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "M5x0N")
 		}
 	},
 	{
-		.callback = clevo_mail_led_dmi_callback,
+		.callback = clevo_mail_led_smbios_callback,
 		.ident = "Positivo Mobile",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "CLEVO Co. "),
-			DMI_MATCH(DMI_BOARD_NAME, "M5X0V "),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Positivo Mobile"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "VT6198")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "CLEVO Co. "),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "M5X0V "),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Positivo Mobile"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "VT6198")
 		}
 	},
 	{
-		.callback = clevo_mail_led_dmi_callback,
+		.callback = clevo_mail_led_smbios_callback,
 		.ident = "Clevo D400P",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Clevo"),
-			DMI_MATCH(DMI_BOARD_NAME, "D400P"),
-			DMI_MATCH(DMI_BOARD_VERSION, "Rev.A"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "0106")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Clevo"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "D400P"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "Rev.A"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "0106")
 		}
 	},
 	{
-		.callback = clevo_mail_led_dmi_callback,
+		.callback = clevo_mail_led_smbios_callback,
 		.ident = "Clevo D410V",
 		.matches = {
-			DMI_MATCH(DMI_BOARD_VENDOR, "Clevo, Co."),
-			DMI_MATCH(DMI_BOARD_NAME, "D400V/D470V"),
-			DMI_MATCH(DMI_BOARD_VERSION, "SS78B"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "Rev. A1")
+			SYSFW_MATCH(SYSFW_BOARD_VENDOR, "Clevo, Co."),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "D400V/D470V"),
+			SYSFW_MATCH(SYSFW_BOARD_VERSION, "SS78B"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "Rev. A1")
 		}
 	},
-	{ }
+	{}
 };
 
 static void clevo_mail_led_set(struct led_classdev *led_cdev,
@@ -176,21 +173,16 @@ static struct platform_driver clevo_mail_led_driver = {
 static int __init clevo_mail_led_init(void)
 {
 	int error = 0;
-	int count = 0;
 
 	/* Check with the help of DMI if we are running on supported hardware */
-	if (!nodetect) {
-		count = dmi_check_system(mail_led_whitelist);
-	} else {
-		count = 1;
+	if (nodetect) {
 		printk(KERN_ERR KBUILD_MODNAME ": Skipping DMI detection. "
 		       "If the driver works on your hardware please "
 		       "report model and the output of dmidecode in tracker "
 		       "at http://sourceforge.net/projects/clevo-mailled/\n");
-	}
-
-	if (!count)
+	} else if (!sysfw_callback(mail_led_whitelist)) {
 		return -ENODEV;
+	}
 
 	pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
 	if (!IS_ERR(pdev)) {
drivers/leds/leds-ss4200.c +9 -14
index 614ebeb..0b6b6fa 100644
@@ -21,13 +21,13 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include <linux/dmi.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/leds.h>
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/sysfw.h>
 #include <linux/types.h>
 #include <linux/uaccess.h>
 
@@ -73,7 +73,7 @@ static const struct pci_device_id ich7_lpc_pci_id[] =
 
 MODULE_DEVICE_TABLE(pci, ich7_lpc_pci_id);
 
-static int __init ss4200_led_dmi_callback(const struct dmi_system_id *id)
+static int __init ss4200_led_smbios_callback(const struct sysfw_id *id)
 {
 	pr_info("detected '%s'\n", id->ident);
 	return 1;
@@ -81,7 +81,7 @@ static int __init ss4200_led_dmi_callback(const struct dmi_system_id *id)
 
 static unsigned int __initdata nodetect;
 module_param_named(nodetect, nodetect, bool, 0);
-MODULE_PARM_DESC(nodetect, "Skip DMI-based hardware detection");
+MODULE_PARM_DESC(nodetect, "Skip SMBIOS-based hardware detection");
 
 /*
  * struct nas_led_whitelist - List of known good models
@@ -92,14 +92,14 @@ MODULE_PARM_DESC(nodetect, "Skip DMI-based hardware detection");
  * detected as working, but in reality it is not) as low as
  * possible.
  */
-static struct dmi_system_id __initdata nas_led_whitelist[] = {
+static struct sysfw_id __initdata nas_led_whitelist[] = {
 	{
-		.callback = ss4200_led_dmi_callback,
+		.callback = ss4200_led_smbios_callback,
 		.ident = "Intel SS4200-E",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "SS4200-E"),
-			DMI_MATCH(DMI_PRODUCT_VERSION, "1.00.00")
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Intel"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "SS4200-E"),
+			SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "1.00.00")
 		}
 	},
 	{}
@@ -504,16 +504,11 @@ static int __init nas_gpio_init(void)
 {
 	int i;
 	int ret = 0;
-	int nr_devices = 0;
 
-	nr_devices = dmi_check_system(nas_led_whitelist);
 	if (nodetect) {
 		pr_info("skipping hardware autodetection\n");
 		pr_info("Please send 'dmidecode' output to [email protected]\n");
-		nr_devices++;
-	}
-
-	if (nr_devices <= 0) {
+	} else if (!sysfw_callback(nas_led_whitelist)) {
 		pr_info("no LED devices found\n");
 		return -ENODEV;
 	}
Signature · 1 line
1.6.5.2
#37 lore raw

PATCH 25/34 drivers/staging changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- 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

[v2]: Re-exported dmi MODULE_ALIAS

---
 drivers/staging/hv/hv_mouse.c      |    1 -
 drivers/staging/hv/hv_timesource.c |   18 +++++++++---------
 drivers/staging/hv/hv_util.c       |   17 ++++++++---------
 drivers/staging/hv/netvsc_drv.c    |   17 ++++++++---------
 drivers/staging/hv/vmbus_drv.c     |    1 -
 5 files changed, 25 insertions(+), 29 deletions(-)
drivers/staging/hv/hv_mouse.c +0 -1
index 359e737..b40c23f 100644
@@ -23,7 +23,6 @@
 #include <linux/hid.h>
 #include <linux/hiddev.h>
 #include <linux/pci.h>
-#include <linux/dmi.h>
 #include <linux/delay.h>
 
 #include "hyperv.h"
drivers/staging/hv/hv_timesource.c +9 -9
index 0efb049..34dc583 100644
@@ -27,7 +27,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pci.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <asm/hyperv.h>
 #include <asm/mshyperv.h>
 #include <asm/hypervisor.h>
@@ -61,19 +61,19 @@ static struct clocksource hyperv_cs = {
 	.shift          = HV_CLOCK_SHIFT,
 };
 
-static const struct dmi_system_id __initconst
-hv_timesource_dmi_table[] __maybe_unused  = {
+static const struct sysfw_id __initconst
+hv_timesource_smbios_table[] __maybe_unused = {
 	{
 		.ident = "Hyper-V",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
-			DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Microsoft Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Virtual Machine"),
 		},
 	},
-	{ },
+	{},
 };
-MODULE_DEVICE_TABLE(dmi, hv_timesource_dmi_table);
+MODULE_DEVICE_TABLE(smbios, hv_timesource_smbios_table);
 
 static const struct pci_device_id __initconst
 hv_timesource_pci_table[] __maybe_unused = {
@@ -89,7 +89,7 @@ static int __init init_hv_clocksource(void)
 		!(ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE))
 		return -ENODEV;
 
-	if (!dmi_check_system(hv_timesource_dmi_table))
+	if (!sysfw_callback(hv_timesource_smbios_table))
 		return -ENODEV;
 
 	pr_info("Registering HyperV clock source\n");
drivers/staging/hv/hv_util.c +8 -9
index c164b54..2d672b8 100644
@@ -26,8 +26,8 @@
 #include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/reboot.h>
-#include <linux/dmi.h>
 #include <linux/pci.h>
+#include <linux/sysfw.h>
 
 #include "hyperv.h"
 #include "hv_kvp.h"
@@ -218,19 +218,18 @@ hv_utils_pci_table[] __maybe_unused = {
 MODULE_DEVICE_TABLE(pci, hv_utils_pci_table);
 
 
-static const struct dmi_system_id __initconst
-hv_utils_dmi_table[] __maybe_unused  = {
+static const struct sysfw_id __initconst hv_utils_id_table[] __maybe_unused = {
 	{
 		.ident = "Hyper-V",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
-			DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Microsoft Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Virtual Machine"),
 		},
 	},
-	{ },
+	{},
 };
-MODULE_DEVICE_TABLE(dmi, hv_utils_dmi_table);
+MODULE_DEVICE_TABLE(sysfw, hv_utils_id_table);
 
 
 static int __init init_hyperv_utils(void)
@@ -241,7 +240,7 @@ static int __init init_hyperv_utils(void)
 		return -ENODEV;
 
 
-	if (!dmi_check_system(hv_utils_dmi_table))
+	if (!sysfw_callback(hv_utils_id_table))
 		return -ENODEV;
 
 	shut_txf_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
drivers/staging/hv/netvsc_drv.c +8 -9
index 7b9c229..0ffc210 100644
@@ -32,8 +32,8 @@
 #include <linux/skbuff.h>
 #include <linux/in.h>
 #include <linux/slab.h>
-#include <linux/dmi.h>
 #include <linux/pci.h>
+#include <linux/sysfw.h>
 #include <net/arp.h>
 #include <net/route.h>
 #include <net/sock.h>
@@ -439,19 +439,18 @@ static void __exit netvsc_drv_exit(void)
 }
 
 
-static const struct dmi_system_id __initconst
-hv_netvsc_dmi_table[] __maybe_unused  = {
+static const struct sysfw_id __initconst hv_netvsc_id_table[] __maybe_unused = {
 	{
 		.ident = "Hyper-V",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
-			DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Microsoft Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Virtual Machine"),
+			SYSFW_MATCH(SYSFW_BOARD_NAME, "Virtual Machine"),
 		},
 	},
-	{ },
+	{},
 };
-MODULE_DEVICE_TABLE(dmi, hv_netvsc_dmi_table);
+MODULE_DEVICE_TABLE(sysfw, hv_netvsc_id_table);
 
 static int __init netvsc_drv_init(void)
 {
@@ -460,7 +459,7 @@ static int __init netvsc_drv_init(void)
 
 	pr_info("initializing....");
 
-	if (!dmi_check_system(hv_netvsc_dmi_table))
+	if (!sysfw_callback(hv_netvsc_id_table))
 		return -ENODEV;
 
 
drivers/staging/hv/vmbus_drv.c +0 -1
index ec1d38c..18e3687 100644
@@ -29,7 +29,6 @@
 #include <linux/interrupt.h>
 #include <linux/sysctl.h>
 #include <linux/pci.h>
-#include <linux/dmi.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
 #include <acpi/acpi_bus.h>
Signature · 1 line
1.6.5.2
#34 lore raw

PATCH 22/34 drivers/pnp changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- 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

---
 drivers/pnp/pnpacpi/core.c |    1 -
 drivers/pnp/pnpbios/core.c |   20 ++++++++++----------
 2 files changed, 10 insertions(+), 11 deletions(-)
drivers/pnp/pnpacpi/core.c +0 -1
index ca84d50..8971996 100644
@@ -22,7 +22,6 @@
 #include <linux/acpi.h>
 #include <linux/pnp.h>
 #include <linux/slab.h>
-#include <linux/mod_devicetable.h>
 #include <acpi/acpi_bus.h>
 
 #include "../base.h"
drivers/pnp/pnpbios/core.c +10 -10
index cfe8685..7a59d1c 100644
@@ -57,11 +57,11 @@
 #include <linux/slab.h>
 #include <linux/completion.h>
 #include <linux/spinlock.h>
-#include <linux/dmi.h>
 #include <linux/delay.h>
 #include <linux/acpi.h>
 #include <linux/freezer.h>
 #include <linux/kthread.h>
+#include <linux/sysfw.h>
 
 #include <asm/page.h>
 #include <asm/desc.h>
@@ -486,29 +486,29 @@ static int __init pnpbios_probe_system(void)
 	return 0;
 }
 
-static int __init exploding_pnp_bios(const struct dmi_system_id *d)
+static int __init exploding_pnp_bios(const struct sysfw_id *d)
 {
 	printk(KERN_WARNING "%s detected. Disabling PnPBIOS\n", d->ident);
 	return 0;
 }
 
-static struct dmi_system_id pnpbios_dmi_table[] __initdata = {
+static struct sysfw_id pnpbios_smbios_table[] __initdata = {
 	{			/* PnPBIOS GPF on boot */
 	 .callback = exploding_pnp_bios,
 	 .ident = "Higraded P14H",
 	 .matches = {
-		     DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
-		     DMI_MATCH(DMI_BIOS_VERSION, "07.00T"),
-		     DMI_MATCH(DMI_SYS_VENDOR, "Higraded"),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "P14H"),
+		     SYSFW_MATCH(SYSFW_BIOS_VENDOR, "American Megatrends Inc."),
+		     SYSFW_MATCH(SYSFW_BIOS_VERSION, "07.00T"),
+		     SYSFW_MATCH(SYSFW_SYS_VENDOR, "Higraded"),
+		     SYSFW_MATCH(SYSFW_PRODUCT_NAME, "P14H"),
 		     },
 	 },
 	{			/* PnPBIOS GPF on boot */
 	 .callback = exploding_pnp_bios,
 	 .ident = "ASUS P4P800",
 	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
-		     DMI_MATCH(DMI_BOARD_NAME, "P4P800"),
+		     SYSFW_MATCH(SYSFW_BOARD_VENDOR, "ASUSTeK Computer Inc."),
+		     SYSFW_MATCH(SYSFW_BOARD_NAME, "P4P800"),
 		     },
 	 },
 	{}
@@ -522,7 +522,7 @@ static int __init pnpbios_init(void)
 	if (check_legacy_ioport(PNPBIOS_BASE))
 		return -ENODEV;
 #endif
-	if (pnpbios_disabled || dmi_check_system(pnpbios_dmi_table) ||
+	if (pnpbios_disabled || sysfw_callback(pnpbios_smbios_table) ||
 	    paravirt_enabled()) {
 		printk(KERN_INFO "PnPBIOS: Disabled\n");
 		return -ENODEV;
Signature · 1 line
1.6.5.2
#29 lore raw

PATCH 18/34 drivers/mtd changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them

---
 drivers/mtd/devices/m25p80.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/mtd/devices/m25p80.c +0 -1
index 35180e4..e418e7e 100644
@@ -25,7 +25,6 @@
 #include <linux/math64.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
-#include <linux/mod_devicetable.h>
 
 #include <linux/mtd/cfi.h>
 #include <linux/mtd/mtd.h>
Signature · 1 line
1.6.5.2
#20 lore raw

PATCH 9/34 drivers/gpio changes for SMBIOS and System Firmware

In reply to Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them

---
 drivers/gpio/basic_mmio_gpio.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/gpio/basic_mmio_gpio.c +0 -1
index 8152e9f..6664e3d 100644
@@ -59,7 +59,6 @@ o        `                     ~~~~\___/~~~~    ` controller in FPGA is ,.`
 #include <linux/gpio.h>
 #include <linux/slab.h>
 #include <linux/platform_device.h>
-#include <linux/mod_devicetable.h>
 #include <linux/basic_mmio_gpio.h>
 
 static void bgpio_write8(void __iomem *reg, unsigned long data)
Signature · 1 line
1.6.5.2
#2 lore raw

Re: [PATCH 01/34] System Firmware Interface

In reply to Prarit Bhargava

Prarit Bhargava <[email protected]> writes:

Wow that's a cc list from hell. Cut down to linux-kernel.

Quoted 2 lines

This patch introduces a general System Firmware interface to the kernel, called sysfw.

Could you expand somewhat WHY you want this. What is wrong with the current code?

As for user space access on x86 "dmidecode"/libdmi works for nearly everyone, doesn't it?

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only
#3 lore raw

Re: [PATCH 01/34] System Firmware Interface

Quoted 3 lines · On Mon, 18 Jul 2011 17:43:08 -0700 Andi Kleen <[email protected]> wrote:

Prarit Bhargava <[email protected]> writes:

Wow that's a cc list from hell. Cut down to linux-kernel.

Which meant I very nearly missed it so you very nearly missed your answer
8)

Quoted 5 lines
Quoted 2 lines

This patch introduces a general System Firmware interface to the kernel, called sysfw.

Could you expand somewhat WHY you want this. What is wrong with the current code?

See the previous discussions

Quoted 2 lines

As for user space access on x86 "dmidecode"/libdmi works for nearly everyone, doesn't it?

"on x86" (and on PC only generally)

There are three core problems

1. DMI in this sense is basically an x86 PC class device hack
2. It is obsoleted and at some point it'll vanish even on PC
3. Every other platform without DMI would benefit from the
interface being generic

So either we carry on hacking other interfaces (often more informative ones) into our dmi glue, and trying to keep up the fakery for every case, or we do what I should have done originally and made the interface a generic way to query firmware/board information that can be extended nicely.

We'll still need a spot of fakery for userspace I suspect.

#4 lore raw

Re: [PATCH 01/34] System Firmware Interface

Quoted 4 lines · Alan Cox

On Mon, 18 Jul 2011 17:43:08 -0700
Andi Kleen <[email protected]> wrote:

Hey Andi,

Quoted 7 lines
Quoted 4 lines

Prarit Bhargava <[email protected]> writes:

Wow that's a cc list from hell. Cut down to linux-kernel.

Which meant I very nearly missed it so you very nearly missed your answer
8)

Sorry everyone -- I was just following what I thought was the proper protocol ... I'll definitely cut down the cc list on the next submission.

Quoted 10 lines
Quoted 7 lines
Quoted 4 lines

This patch introduces a general System Firmware interface to the kernel, called sysfw.

Could you expand somewhat WHY you want this. What is wrong with the current code?

See the previous discussions

There is some additional information I'd like to throw out here as well. SMBIOS also provides information on the system state after the BIOS/EFI is finished and before the kernel has been booted. This has been *invaluable* to me when diagnosing some wonky hardware from OEMs. I want to expand the SMBIOS layer to dump that information out when I need it... but that's all for a later patch. I will note not all SMBIOSes are the same and sometimes the information has not been correct, but when it is correct it has been extremely useful. The problem is that kludging this stuff into the existing dmi layer is a PITA and just makes things messier with adding new dmi "devices" and other junk. It feels like I'm just hacking more code in to an already broken mechanism.

tl;dr: There are some other useful bits of SMBIOS we could take advantage of but the current "dmi" layer is difficult to work with.

Beyond that, what Alan said.

P.

Quoted 20 lines
Quoted 3 lines

As for user space access on x86 "dmidecode"/libdmi works for nearly everyone, doesn't it?

"on x86" (and on PC only generally)

There are three core problems

1. DMI in this sense is basically an x86 PC class device hack
2. It is obsoleted and at some point it'll vanish even on PC
3. Every other platform without DMI would benefit from the
interface being generic

So either we carry on hacking other interfaces (often more informative ones) into our dmi glue, and trying to keep up the fakery for every case, or we do what I should have done originally and made the interface a generic way to query firmware/board information that can be extended nicely.

We'll still need a spot of fakery for userspace I suspect.

#7 lore raw

Re: [PATCH 01/34] System Firmware Interface

In reply to Alan Cox
Quoted 4 lines · Alan Cox
Quoted 2 lines

Could you expand somewhat WHY you want this. What is wrong with the current code?

See the previous discussions

Ok I will put that now as description into all my code submissions @)

Seriously, that REALLY belongs into a patch description.

Quoted 10 lines
Quoted 3 lines

As for user space access on x86 "dmidecode"/libdmi works for nearly everyone, doesn't it?

"on x86" (and on PC only generally)

There are three core problems

1. DMI in this sense is basically an x86 PC class device hack
2. It is obsoleted and at some point it'll vanish even on PC

Huh? What obsoleted it?

Quoted 2 lines

3. Every other platform without DMI would benefit from the
interface being generic

Can you expand on that? The information will be always system specific anyways. Do you really think there's that much commonality?

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.
#5 lore raw

Re: [PATCH 01/34] System Firmware Interface

In reply to Prarit Bhargava

Playing the devils advocate here, but this is really unclear...

Quoted 4 lines

There is some additional information I'd like to throw out here as well. SMBIOS also provides information on the system state after the BIOS/EFI is finished and before the kernel has been booted. This has been *invaluable* to me when diagnosing some wonky hardware from OEMs.

Hmm this is for SMBIOS tables that changes at runtime? Why exactly is the kernel booting a good point to dump that?

Normally the kernel afaik doesn't change SMBIOS as far as I know.

There may be some hotplug events that change it, but they have no particular relation to kernel boot.

Quoted 1 line

I want to expand the SMBIOS layer to dump that information out when I

What information exactly?

And dumping = print to system log?

Quoted 2 lines

tl;dr: There are some other useful bits of SMBIOS we could take advantage of but the current "dmi" layer is difficult to work with.

Like what?

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.
#8 lore raw

Re: [PATCH 01/34] System Firmware Interface

In reply to Andi Kleen
Quoted 11 lines · Andi Kleen
Quoted 5 lines · Alan Cox
Quoted 3 lines

Could you expand somewhat WHY you want this. What is wrong with the current code?

See the previous discussions

Ok I will put that now as description into all my code submissions @)

Seriously, that REALLY belongs into a patch description.

I can certainly do that on the next version. Sorry about that Andi.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

As for user space access on x86 "dmidecode"/libdmi works for nearly everyone, doesn't it?

Quoted 10 lines
Quoted 7 lines

"on x86" (and on PC only generally)

There are three core problems

1. DMI in this sense is basically an x86 PC class device hack
2. It is obsoleted and at some point it'll vanish even on PC

Huh? What obsoleted it?

The DMI specification has not been updated since January of 2003. It has been replaced by SMBIOS.

Quoted 7 lines
Quoted 3 lines

3. Every other platform without DMI would benefit from the
interface being generic

Can you expand on that? The information will be always system specific anyways. Do you really think there's that much commonality?

There seems to be some commonalities. We have other arches checking for model and vendor info.

P.

#9 lore raw

Re: [PATCH 01/34] System Firmware Interface

Quoted 3 lines · Prarit Bhargava

The DMI specification has not been updated since January of 2003. It has been replaced by SMBIOS.

Yes of course, but dmidecode and the current DMI layer implements both anyways, don't they? (ok if you don't count the dynamic interfaces)

The tables are very similar, there are just more entries in SMBIOS.

Quoted 11 lines
Quoted 8 lines
Quoted 4 lines

3. Every other platform without DMI would benefit from the
interface being generic

Can you expand on that? The information will be always system specific anyways. Do you really think there's that much commonality?

There seems to be some commonalities. We have other arches checking for model and vendor info.

That's two fields out of hundreds. Does that need a common layer?

Right now I still fail to see the point of all of this.

At some point I wanted a slightly more expansive sysfs interface for SMBIOS to avoid having to start mcelog as root for reading /dev/mem, but I don't think such a complicated approach is justified for that. What are the other use cases?

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.
#6 lore raw

Re: [PATCH 01/34] System Firmware Interface

In reply to Andi Kleen
Quoted 3 lines · Andi Kleen

Playing the devils advocate here, but this is really unclear...

Sorry, I'll try to be more specific.

Quoted 9 lines
Quoted 5 lines

There is some additional information I'd like to throw out here as well. SMBIOS also provides information on the system state after the BIOS/EFI is finished and before the kernel has been booted. This has been *invaluable* to me when diagnosing some wonky hardware from OEMs.

Hmm this is for SMBIOS tables that changes at runtime? Why exactly is the kernel booting a good point to dump that?

Let me back up :) as I clearly didn't do a good job of explaining this.

I have systems/have had systems in which NO kernel would boot because of faulty hardware. That hardware was identified as bad during the BIOS POST but no information on it could be determined because we didn't make it very far through boot :/. As you know Andi, booting with bad memory or a bad cpu is excruciatingly difficult to diagnose.

The SMBIOS does provide access to a system log in which details on failed hardware (again, failed hardware having been identified by the BIOS) and that information was immensely useful to me during the system boot. (see the Type 15 System Event Log Structure).

Plugging that into the existing "dmi" code was a headache. The code is just not laid out to make expansion of dmi devices easy.

Quoted 7 lines
Quoted 3 lines

I want to expand the SMBIOS layer to dump that information out when I

What information exactly?

And dumping = print to system log?

Yes, to the system log.

Quoted 7 lines
Quoted 4 lines

tl;dr: There are some other useful bits of SMBIOS we could take advantage of but the current "dmi" layer is difficult to work with.

Like what?

Like the above example ;) ... but there are other things like the type of memory in the system from a HW debug point of view become important. My #1 goal is to get the SMBIOS version # exported via sysfs and to get the type 15 stuff output as debug info.

P.

Quoted 3 lines

-Andi

#10 lore raw

Re: [PATCH 01/34] System Firmware Interface

In reply to Andi Kleen
Quoted 11 lines · Andi Kleen
Quoted 3 lines · Prarit Bhargava

The DMI specification has not been updated since January of 2003. It has been replaced by SMBIOS.

Yes of course, but dmidecode and the current DMI layer implements both anyways, don't they? (ok if you don't count the dynamic interfaces)

The tables are very similar, there are just more entries in SMBIOS.

That's not the way I understand it (at least from reviewing the two different specifications). DMI is not SMBIOS. They are two very different things -- we (linux kernel) have bastardized the name DMI and really have been using the SMBIOS tables. It is NOT a DMI implementation.

SMBIOS *CAN* contain a DMI table but saying that SMBIOS is DMI + a few more tables is really a stretch IMO.

Quoted 17 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

3. Every other platform without DMI would benefit from the
interface being generic

Quoted 8 lines
Quoted 5 lines

Can you expand on that? The information will be always system specific anyways. Do you really think there's that much commonality?

There seems to be some commonalities. We have other arches checking for model and vendor info.

That's two fields out of hundreds. Does that need a common layer?

Quoted 7 lines

Right now I still fail to see the point of all of this.

At some point I wanted a slightly more expansive sysfs interface for SMBIOS to avoid having to start mcelog as root for reading /dev/mem, but I don't think such a complicated approach is justified for that. What are the other use cases?

See my previous email re: type 15 structure and trying to jam it into the existing dmi layer.

P.

Quoted 2 lines

-Andi

maintainer Acked-by on v1 27/34
#40 lore raw

Re: [PATCH 27/34] drivers/usb changes for SMBIOS and System Firmware

In reply to Prarit Bhargava
Quoted 7 lines · Prarit Bhargava

As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- add exactmatch functionality

Quoted 7 lines
---
 drivers/usb/host/pci-quirks.c |   19 ++++++++++++++-----
 drivers/usb/host/uhci-hcd.c   |    2 +-
 drivers/usb/host/uhci-pci.c   |   15 +++++++++++----
 3 files changed, 26 insertions(+), 10 deletions(-)
#11 lore raw

Re: [lm-sensors] [PATCH 01/34] System Firmware Interface

In reply to Prarit Bhargava
Quoted 10 lines · Prarit Bhargava

This patch introduces a general System Firmware interface to the kernel, called sysfw.

Inlcluded in this interface is the ability to search a standard set of fields, sysfw_lookup(). The fields are currently based upon the x86 and ia64 SMBIOS fields but exapandable to fields that other arches may introduce. Also included is the ability to search and match against those fields, and run a callback function against the matches, sysfw_callback().

Modify module code to use sysfw instead of old DMI interface.

This is a HUGE patch set. You'd need to have a good reason for such a big and intrusive change, yet I see no such reason explained. I understand that we _can_ abstract system information interfaces, but just because we can doesn't mean we have to. I would at least wait for a second DMI-like interface to be widely implemented and support before any attempt to abstract, otherwise your design is bound to be missing the target. And even then, you'd still need to convince me that there is a need for a unified interface to access both backends at once. I would guess that you know what backend is present on a system when you try to identify it.

At this point, I see the work needed to review your patches, the risk of regressions due to the large size of the patch set, but I don't see any immediate benefit. Thus I am not going to look into it at all, sorry.

Signature · 1 line
Jean Delvare
#12 lore raw

Re: [lm-sensors] [PATCH 01/34] System Firmware Interface

Quoted 13 lines · Jean Delvare
Quoted 11 lines · Prarit Bhargava

This patch introduces a general System Firmware interface to the kernel, called sysfw.

Inlcluded in this interface is the ability to search a standard set of fields, sysfw_lookup(). The fields are currently based upon the x86 and ia64 SMBIOS fields but exapandable to fields that other arches may introduce. Also included is the ability to search and match against those fields, and run a callback function against the matches, sysfw_callback().

Modify module code to use sysfw instead of old DMI interface.

Quoted 11 lines

This is a HUGE patch set. You'd need to have a good reason for such a big and intrusive change, yet I see no such reason explained. I understand that we _can_ abstract system information interfaces, but just because we can doesn't mean we have to. I would at least wait for a second DMI-like interface to be widely implemented and support before any attempt to abstract, otherwise your design is bound to be missing the target. And even then, you'd still need to convince me that there is a need for a unified interface to access both backends at once. I would guess that you know what backend is present on a system when you try to identify it.

It seems to me that the objection to this patchset isn't that I'm rewriting the SMBIOS code, but that I'm adding in an additional abstraction layer to the kernel which as Jean points out, probably isn't going to be correct as it is based on the two Intel arches (x86 and ia64).

After discussing this with a few engineers in the office I'm leaning toward dropping the System Firmware Interface *for now*. I'm more than willing to implement the SMBIOS code in such a way that it should be easier to implement a generic interface at a later date -- I'm still hoping that arm/arm64 will eventually need this interface but they're realistically a year or two out from requiring such a thing.

Alan -- I know you wanted this, and there is merit in doing it but I can't argue with what Jean wrote. Right now we don't have an extensive need for the sysfw stuff in the kernel ...

P.

Acked-by on v1 21/34
#33 lore raw

Re: [PATCH 21/34] drivers/platform changes for SMBIOS and System Firmware

In reply to Prarit Bhargava
Quoted 8 lines · Prarit Bhargava

- Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- add exactmatch functionality
- edit udev notifiers
- cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them

Quoted 4 lines

[v2]: Re-exported dmi MODULE_ALIAS
:

 drivers/platform/x86/fujitsu-laptop.c |   41 ++++----

:

In-so-far as I can tell with a quick inspection, this looks ok for the fujitsu-laptop.c module.

At the risk of looking ill-informed, I assume the DMI infrastructure has been deprecated by the more general sysfw.

Regards
jonathan