acpi-interface.rst 4.1 KB

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