Am 27.07.25 um 13:23 schrieb Nikita Krasnov:
Hello again!
Sorry for taking so long. Real life stuff gets in the way :(
On Tue, Jul 22, 2025 at 07:09:37PM +0300 Armin Wolf wrote:
Take a look at https://docs.kernel.org/wmi/driver-development-guide.html.
Thanks! Coupled with articles [1] and [2] this was a very good
introduction to WMI and ACPI.
Please note that the LWN article regarding WMI drivers is quite outdated. Please follow the
WMI driver development guide from the kernel documentation instead.
Sure, but you have to develop a new WMI driver for your device because after looking at the
ACPI tables (SSDT20 in particular) i came to the conclusion that the xiaomi-wmi driver cannot
be used in this case.
Why is that? Is it because xiaomi-wmi is using deprecated GUID-based WMI
interface?
No, it is because your device is using a different WMI interface for delivering events. Device manufacturers
are not exactly known for using the same WMI interfaces for a long time :(.
Btw, it's so weird for me that there are many laptop models, but only
one *-wmi.c file per manufacturer (be it Xiaomi, ThinkPad, MSI or Asus).
Is it because most of the time we write a driver for a specific piece of
hardware that may be reused in different laptop models?
Usually a given WMI interface is used on a wide range of models so that the device manufacturers
do not have to develop a giant number of backends for their control center applications under Windows.
That is why many WMI driver work on a wide range of devices from a given manufacturer.
I suggest that you write a skeleton driver first that basically prints
the content of this buffer to the kernel log using print_hex_dump_bytes().
About that... Would you be okay with me implementing this driver in
Rust? I assume it's you, an ACPI WMI DRIVER maintainer, whose permission
needs to be granted to green-light this?
Personally i have no problem with you writing a WMI driver in Rust, but currently we have
no suitable bindings for the WMI driver API. Additionally i am currently designing a new
WMI driver API that will make it easier to implement the necessary Rust bindings, so the
whole thing might take some time.
Would it be possible for you to implement the WMI driver in C?
Thanks,
Armin Wolf
[1]: https://lwn.net/Articles/391230/
[2]: https://lwn.net/Articles/367630/
--
Nikita Krasnov