Merge tag 'xtensa-20180225' of git://github.com/jcmvbkbc/linux-xtensa
[cris-mirror.git] / include / uapi / linux / wmi.h
blob7a92e9e3d1c014cbbda526fe0cfa416f962d9e69
1 /*
2 * User API methods for ACPI-WMI mapping driver
4 * Copyright (C) 2017 Dell, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10 #ifndef _UAPI_LINUX_WMI_H
11 #define _UAPI_LINUX_WMI_H
13 #include <linux/ioctl.h>
14 #include <linux/types.h>
16 /* WMI bus will filter all WMI vendor driver requests through this IOC */
17 #define WMI_IOC 'W'
19 /* All ioctl requests through WMI should declare their size followed by
20 * relevant data objects
22 struct wmi_ioctl_buffer {
23 __u64 length;
24 __u8 data[];
27 /* This structure may be modified by the firmware when we enter
28 * system management mode through SMM, hence the volatiles
30 struct calling_interface_buffer {
31 __u16 cmd_class;
32 __u16 cmd_select;
33 volatile __u32 input[4];
34 volatile __u32 output[4];
35 } __packed;
37 struct dell_wmi_extensions {
38 __u32 argattrib;
39 __u32 blength;
40 __u8 data[];
41 } __packed;
43 struct dell_wmi_smbios_buffer {
44 __u64 length;
45 struct calling_interface_buffer std;
46 struct dell_wmi_extensions ext;
47 } __packed;
49 /* Whitelisted smbios class/select commands */
50 #define CLASS_TOKEN_READ 0
51 #define CLASS_TOKEN_WRITE 1
52 #define SELECT_TOKEN_STD 0
53 #define SELECT_TOKEN_BAT 1
54 #define SELECT_TOKEN_AC 2
55 #define CLASS_FLASH_INTERFACE 7
56 #define SELECT_FLASH_INTERFACE 3
57 #define CLASS_ADMIN_PROP 10
58 #define SELECT_ADMIN_PROP 3
59 #define CLASS_INFO 17
60 #define SELECT_RFKILL 11
61 #define SELECT_APP_REGISTRATION 3
62 #define SELECT_DOCK 22
64 /* whitelisted tokens */
65 #define CAPSULE_EN_TOKEN 0x0461
66 #define CAPSULE_DIS_TOKEN 0x0462
67 #define WSMT_EN_TOKEN 0x04EC
68 #define WSMT_DIS_TOKEN 0x04ED
70 /* Dell SMBIOS calling IOCTL command used by dell-smbios-wmi */
71 #define DELL_WMI_SMBIOS_CMD _IOWR(WMI_IOC, 0, struct dell_wmi_smbios_buffer)
73 #endif