30
30
* Globals for vendor-specific decodes
31
31
*/
32
32
33
- enum DMI_VENDORS { VENDOR_UNKNOWN , VENDOR_HP };
33
+ enum DMI_VENDORS
34
+ {
35
+ VENDOR_UNKNOWN ,
36
+ VENDOR_HP ,
37
+ VENDOR_ACER ,
38
+ };
34
39
35
40
static enum DMI_VENDORS dmi_vendor = VENDOR_UNKNOWN ;
36
41
@@ -53,6 +58,8 @@ void dmi_set_vendor(const char *s)
53
58
54
59
if (strncmp (s , "HP" , len ) == 0 || strncmp (s , "Hewlett-Packard" , len ) == 0 )
55
60
dmi_vendor = VENDOR_HP ;
61
+ else if (strncmp (s , "Acer" , len ) == 0 )
62
+ dmi_vendor = VENDOR_ACER ;
56
63
}
57
64
58
65
/*
@@ -123,6 +130,48 @@ static int dmi_decode_hp(const struct dmi_header *h)
123
130
return 1 ;
124
131
}
125
132
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
+
126
175
/*
127
176
* Dispatch vendor-specific entries decoding
128
177
* Return 1 if decoding was successful, 0 otherwise
@@ -133,6 +182,8 @@ int dmi_decode_oem(const struct dmi_header *h)
133
182
{
134
183
case VENDOR_HP :
135
184
return dmi_decode_hp (h );
185
+ case VENDOR_ACER :
186
+ return dmi_decode_acer (h );
136
187
default :
137
188
return 0 ;
138
189
}
0 commit comments