Skip to content

Commit 196ca4a

Browse files
committed
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.
1 parent 9d927b4 commit 196ca4a

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* util.c: Fix warnings about unused labels when building without
77
-DUSE_MMAP.
88
* dmioem.c: Strip spaces at the end of vendor names.
9+
* dmioem.c: Decode Acer-specific DMI type 170.
910

1011
2015-05-12 Jean Delvare <[email protected]>
1112

dmioem.c

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@
3030
* Globals for vendor-specific decodes
3131
*/
3232

33-
enum DMI_VENDORS { VENDOR_UNKNOWN, VENDOR_HP };
33+
enum DMI_VENDORS
34+
{
35+
VENDOR_UNKNOWN,
36+
VENDOR_HP,
37+
VENDOR_ACER,
38+
};
3439

3540
static enum DMI_VENDORS dmi_vendor = VENDOR_UNKNOWN;
3641

@@ -53,6 +58,8 @@ void dmi_set_vendor(const char *s)
5358

5459
if (strncmp(s, "HP", len) == 0 || strncmp(s, "Hewlett-Packard", len) == 0)
5560
dmi_vendor = VENDOR_HP;
61+
else if (strncmp(s, "Acer", len) == 0)
62+
dmi_vendor = VENDOR_ACER;
5663
}
5764

5865
/*
@@ -123,6 +130,48 @@ static int dmi_decode_hp(const struct dmi_header *h)
123130
return 1;
124131
}
125132

133+
/*
134+
* Acer-specific data structures are decoded here.
135+
*/
136+
137+
static int dmi_decode_acer(const struct dmi_header *h)
138+
{
139+
u8 *data = h->data;
140+
u16 cap;
141+
142+
switch (h->type)
143+
{
144+
case 170:
145+
/*
146+
* Vendor Specific: Acer Hotkey Function
147+
*
148+
* Source: acer-wmi kernel driver
149+
*
150+
* Probably applies to some laptop models of other
151+
* brands, including Fujitsu-Siemens, Medion, Lenovo,
152+
* and eMachines.
153+
*/
154+
printf("Acer Hotkey Function\n");
155+
if (h->length < 0x0F) break;
156+
cap = WORD(data + 0x04);
157+
printf("\tFunction bitmap for Communication Button: 0x%04hx\n", cap);
158+
printf("\t\tWiFi: %s\n", cap & 0x0001 ? "Yes" : "No");
159+
printf("\t\t3G: %s\n", cap & 0x0040 ? "Yes" : "No");
160+
printf("\t\tWiMAX: %s\n", cap & 0x0080 ? "Yes" : "No");
161+
printf("\t\tBluetooth: %s\n", cap & 0x0800 ? "Yes" : "No");
162+
printf("\tFunction bitmap for Application Button: 0x%04hx\n", WORD(data + 0x06));
163+
printf("\tFunction bitmap for Media Button: 0x%04hx\n", WORD(data + 0x08));
164+
printf("\tFunction bitmap for Display Button: 0x%04hx\n", WORD(data + 0x0A));
165+
printf("\tFunction bitmap for Others Button: 0x%04hx\n", WORD(data + 0x0C));
166+
printf("\tCommunication Function Key Number: %d\n", data[0x0E]);
167+
break;
168+
169+
default:
170+
return 0;
171+
}
172+
return 1;
173+
}
174+
126175
/*
127176
* Dispatch vendor-specific entries decoding
128177
* Return 1 if decoding was successful, 0 otherwise
@@ -133,6 +182,8 @@ int dmi_decode_oem(const struct dmi_header *h)
133182
{
134183
case VENDOR_HP:
135184
return dmi_decode_hp(h);
185+
case VENDOR_ACER:
186+
return dmi_decode_acer(h);
136187
default:
137188
return 0;
138189
}

0 commit comments

Comments
 (0)