1.. SPDX-License-Identifier: GPL-2.0-or-later
2
3==================
4ACPI WMI interface
5==================
6
7The ACPI WMI interface is a proprietary extension of the ACPI specification made
8by Microsoft to allow hardware vendors to embed WMI (Windows Management Instrumentation)
9objects inside their ACPI firmware. Typical functions implemented over ACPI WMI
10are hotkey events on modern notebooks and configuration of BIOS options.
11
12PNP0C14 ACPI device
13-------------------
14
15Discovery of WMI objects is handled by defining ACPI devices with a PNP ID
16of ``PNP0C14``. These devices will contain a set of ACPI buffers and methods
17used for mapping and execution of WMI methods and/or queries. If there exist
18multiple of such devices, then each device is required to have a
19unique ACPI UID.
20
21_WDG buffer
22-----------
23
24The ``_WDG`` buffer is used to discover WMI objects and is required to be
25static. Its internal structure consists of data blocks with a size of 20 bytes,
26containing the following data:
27
28======= =============== =====================================================
29Offset  Size (in bytes) Content
30======= =============== =====================================================
310x00    16              128 bit Variant 2 object GUID.
320x10    2               2 character method ID or single byte notification ID.
330x12    1               Object instance count.
340x13    1               Object flags.
35======= =============== =====================================================
36
37The WMI object flags control whether the method or notification ID is used:
38
39- 0x1: Data block usage is expensive and must be explicitly enabled/disabled.
40- 0x2: Data block contains WMI methods.
41- 0x4: Data block contains ASCIZ string.
42- 0x8: Data block describes a WMI event, use notification ID instead
43  of method ID.
44
45Each WMI object GUID can appear multiple times inside a system.
46The method/notification ID is used to construct the ACPI method names used for
47interacting with the WMI object.
48
49WQxx ACPI methods
50-----------------
51
52If a data block does not contain WMI methods, then its content can be retrieved
53by this required ACPI method. The last two characters of the ACPI method name
54are the method ID of the data block to query. Their single parameter is an
55integer describing the instance which should be queried. This parameter can be
56omitted if the data block contains only a single instance.
57
58WSxx ACPI methods
59-----------------
60
61Similar to the ``WQxx`` ACPI methods, except that it is optional and takes an
62additional buffer as its second argument. The instance argument also cannot
63be omitted.
64
65WMxx ACPI methods
66-----------------
67
68Used for executing WMI methods associated with a data block. The last two
69characters of the ACPI method name are the method ID of the data block
70containing the WMI methods. Their first parameter is a integer describing the
71instance which methods should be executed. The second parameter is an integer
72describing the WMI method ID to execute, and the third parameter is a buffer
73containing the WMI method parameters. If the data block is marked as containing
74an ASCIZ string, then this buffer should contain an ASCIZ string. The ACPI
75method will return the result of the executed WMI method.
76
77WExx ACPI methods
78-----------------
79
80Used for optionally enabling/disabling WMI events, the last two characters of
81the ACPI method are the notification ID of the data block describing the WMI
82event as hexadecimal value. Their first parameter is an integer with a value
83of 0 if the WMI event should be disabled, other values will enable
84the WMI event.
85
86WCxx ACPI methods
87-----------------
88Similar to the ``WExx`` ACPI methods, except that it controls data collection
89instead of events and thus the last two characters of the ACPI method name are
90the method ID of the data block to enable/disable.
91
92_WED ACPI method
93----------------
94
95Used to retrieve additional WMI event data, its single parameter is a integer
96holding the notification ID of the event.
97