[PATCH 1/2] firmware: dmi_scan: add DMI_OEM_STRING support to dmi_matches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OEM strings are defined by each OEM and they contain customized and
useful OEM information. Supporting it provides more flexible uses of
the dmi_matches function.

Signed-off-by: Alex Hung <alex.hung@xxxxxxxxxxxxx>
---
 drivers/firmware/dmi_scan.c     | 8 ++++++++
 include/linux/mod_devicetable.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 7830419..e534d1b 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -797,11 +797,19 @@ static bool dmi_matches(const struct dmi_system_id *dmi)
 			else if (dmi->matches[i].exact_match &&
 				 !strcmp(dmi_ident[s], dmi->matches[i].substr))
 				continue;
+		} else if (s == DMI_OEM_STRING) {
+			const struct dmi_device *valid;
+
+			valid = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
+						dmi->matches[i].substr, NULL);
+			if (valid)
+				continue;
 		}
 
 		/* No match */
 		return false;
 	}
+
 	return true;
 }
 
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index abb6dc2..5739c4c 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -482,6 +482,7 @@ enum dmi_field {
 	DMI_CHASSIS_VERSION,
 	DMI_CHASSIS_SERIAL,
 	DMI_CHASSIS_ASSET_TAG,
+	DMI_OEM_STRING,
 	DMI_STRING_MAX,
 };
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux