cpp-d1064d
[cross.git] / i686-linux-gnu-4.7 / usr / include / linux / wmi.h
1 /*
2  *  User API methods for ACPI-WMI mapping driver
3  *
4  *  Copyright (C) 2017 Dell, Inc.
5  *
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 _LINUX_WMI_H
11 #define _LINUX_WMI_H
12
13 #include <linux/ioctl.h>
14 #include <linux/types.h>
15
16 /* WMI bus will filter all WMI vendor driver requests through this IOC */
17 #define WMI_IOC 'W'
18
19 /* All ioctl requests through WMI should declare their size followed by
20  * relevant data objects
21  */
22 struct wmi_ioctl_buffer {
23         __u64   length;
24         __u8    data[];
25 };
26
27 /* This structure may be modified by the firmware when we enter
28  * system management mode through SMM, hence the volatiles
29  */
30 struct calling_interface_buffer {
31         __u16 cmd_class;
32         __u16 cmd_select;
33         __volatile__ __u32 input[4];
34         __volatile__ __u32 output[4];
35 } __attribute__((packed));
36
37 struct dell_wmi_extensions {
38         __u32 argattrib;
39         __u32 blength;
40         __u8 data[];
41 } __attribute__((packed));
42
43 struct dell_wmi_smbios_buffer {
44         __u64 length;
45         struct calling_interface_buffer std;
46         struct dell_wmi_extensions      ext;
47 } __attribute__((packed));
48
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
63
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
69
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)
72
73 #endif