summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkhali <khali>2015-05-13 08:04:50 +0000
committerkhali <khali>2015-05-13 08:04:50 +0000
commite12c754bd8efe3c6e4297b9f5dc7df26e5f8ac80 (patch)
tree6863e7eb539fbc61e1076806aba9f615243b99d0
parentc954f0b69dd5320279bc81a0f8d2e8325311d1e2 (diff)
downloaddmidecode-e12c754bd8efe3c6e4297b9f5dc7df26e5f8ac80.tar.gz
dmioem: Decode Acer-specific DMI type 170
Some information about OEM DMI type 170 for Acer machines is available from the acer-wmi kernel driver. Include the available information in the output of dmidecode.
-rw-r--r--CHANGELOG1
-rw-r--r--dmioem.c53
2 files changed, 53 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 7236101..6af286f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,7 @@
* util.c: Fix warnings about unused labels when building without
-DUSE_MMAP.
* dmioem.c: Strip spaces at the end of vendor names.
+ * dmioem.c: Decode Acer-specific DMI type 170.
2015-05-12 Jean Delvare <jdelvare@suse.de>
diff --git a/dmioem.c b/dmioem.c
index bbc2fa3..1a2aa2f 100644
--- a/dmioem.c
+++ b/dmioem.c
@@ -30,7 +30,12 @@
* Globals for vendor-specific decodes
*/
-enum DMI_VENDORS { VENDOR_UNKNOWN, VENDOR_HP };
+enum DMI_VENDORS
+{
+ VENDOR_UNKNOWN,
+ VENDOR_HP,
+ VENDOR_ACER,
+};
static enum DMI_VENDORS dmi_vendor = VENDOR_UNKNOWN;
@@ -53,6 +58,8 @@ void dmi_set_vendor(const char *s)
if (strncmp(s, "HP", len) == 0 || strncmp(s, "Hewlett-Packard", len) == 0)
dmi_vendor = VENDOR_HP;
+ else if (strncmp(s, "Acer", len) == 0)
+ dmi_vendor = VENDOR_ACER;
}
/*
@@ -124,6 +131,48 @@ static int dmi_decode_hp(const struct dmi_header *h)
}
/*
+ * Acer-specific data structures are decoded here.
+ */
+
+static int dmi_decode_acer(const struct dmi_header *h)
+{
+ u8 *data = h->data;
+ u16 cap;
+
+ switch (h->type)
+ {
+ case 170:
+ /*
+ * Vendor Specific: Acer Hotkey Function
+ *
+ * Source: acer-wmi kernel driver
+ *
+ * Probably applies to some laptop models of other
+ * brands, including Fujitsu-Siemens, Medion, Lenovo,
+ * and eMachines.
+ */
+ printf("Acer Hotkey Function\n");
+ if (h->length < 0x0F) break;
+ cap = WORD(data + 0x04);
+ printf("\tFunction bitmap for Communication Button: 0x%04hx\n", cap);
+ printf("\t\tWiFi: %s\n", cap & 0x0001 ? "Yes" : "No");
+ printf("\t\t3G: %s\n", cap & 0x0040 ? "Yes" : "No");
+ printf("\t\tWiMAX: %s\n", cap & 0x0080 ? "Yes" : "No");
+ printf("\t\tBluetooth: %s\n", cap & 0x0800 ? "Yes" : "No");
+ printf("\tFunction bitmap for Application Button: 0x%04hx\n", WORD(data + 0x06));
+ printf("\tFunction bitmap for Media Button: 0x%04hx\n", WORD(data + 0x08));
+ printf("\tFunction bitmap for Display Button: 0x%04hx\n", WORD(data + 0x0A));
+ printf("\tFunction bitmap for Others Button: 0x%04hx\n", WORD(data + 0x0C));
+ printf("\tCommunication Function Key Number: %d\n", data[0x0E]);
+ break;
+
+ default:
+ return 0;
+ }
+ return 1;
+}
+
+/*
* Dispatch vendor-specific entries decoding
* Return 1 if decoding was successful, 0 otherwise
*/
@@ -133,6 +182,8 @@ int dmi_decode_oem(const struct dmi_header *h)
{
case VENDOR_HP:
return dmi_decode_hp(h);
+ case VENDOR_ACER:
+ return dmi_decode_acer(h);
default:
return 0;
}