diff options
| author | Armin Wolf <W_Armin@gmx.de> | 2026-01-16 21:41:10 +0100 |
|---|---|---|
| committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2026-01-20 15:47:51 +0200 |
| commit | b990a06f7ec6dc3ceecd8015c3b421690f267122 (patch) | |
| tree | ce0588a06555f46bfb73e3c809aa6797e54f58e1 /include | |
| parent | 29dfba69c3ddb7945cd772042c6a9ce770c1ba22 (diff) | |
platform/wmi: Add helper functions for WMI string conversions
WMI strings are encoded using UTF16-LE characters, forcing WMI drivers
to manually convert them to/from standard UTF8 strings. Add a two
helper functions for those tasks.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20260116204116.4030-4-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/wmi.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/wmi.h b/include/linux/wmi.h index 81f24d238a2c..75cb0c7cfe57 100644 --- a/include/linux/wmi.h +++ b/include/linux/wmi.h @@ -62,6 +62,11 @@ struct wmi_string { __le16 chars[]; } __packed; +ssize_t wmi_string_to_utf8s(const struct wmi_string *str, u8 *dst, size_t length); + +ssize_t wmi_string_from_utf8s(struct wmi_string *str, size_t max_chars, const u8 *src, + size_t src_length); + int wmidev_invoke_method(struct wmi_device *wdev, u8 instance, u32 method_id, const struct wmi_buffer *in, struct wmi_buffer *out); |
