• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI_LINUX_SURFACE_AGGREGATOR_DTX_H
20 #define _UAPI_LINUX_SURFACE_AGGREGATOR_DTX_H
21 #include <linux/ioctl.h>
22 #include <linux/types.h>
23 #define SDTX_CATEGORY_STATUS 0x0000
24 #define SDTX_CATEGORY_RUNTIME_ERROR 0x1000
25 #define SDTX_CATEGORY_HARDWARE_ERROR 0x2000
26 #define SDTX_CATEGORY_UNKNOWN 0xf000
27 #define SDTX_CATEGORY_MASK 0xf000
28 #define SDTX_CATEGORY(value) ((value) & SDTX_CATEGORY_MASK)
29 #define SDTX_STATUS(code) ((code) | SDTX_CATEGORY_STATUS)
30 #define SDTX_ERR_RT(code) ((code) | SDTX_CATEGORY_RUNTIME_ERROR)
31 #define SDTX_ERR_HW(code) ((code) | SDTX_CATEGORY_HARDWARE_ERROR)
32 #define SDTX_UNKNOWN(code) ((code) | SDTX_CATEGORY_UNKNOWN)
33 #define SDTX_SUCCESS(value) (SDTX_CATEGORY(value) == SDTX_CATEGORY_STATUS)
34 #define SDTX_LATCH_CLOSED SDTX_STATUS(0x00)
35 #define SDTX_LATCH_OPENED SDTX_STATUS(0x01)
36 #define SDTX_BASE_DETACHED SDTX_STATUS(0x00)
37 #define SDTX_BASE_ATTACHED SDTX_STATUS(0x01)
38 #define SDTX_DETACH_NOT_FEASIBLE SDTX_ERR_RT(0x01)
39 #define SDTX_DETACH_TIMEDOUT SDTX_ERR_RT(0x02)
40 #define SDTX_ERR_FAILED_TO_OPEN SDTX_ERR_HW(0x01)
41 #define SDTX_ERR_FAILED_TO_REMAIN_OPEN SDTX_ERR_HW(0x02)
42 #define SDTX_ERR_FAILED_TO_CLOSE SDTX_ERR_HW(0x03)
43 #define SDTX_DEVICE_TYPE_HID 0x0100
44 #define SDTX_DEVICE_TYPE_SSH 0x0200
45 #define SDTX_DEVICE_TYPE_MASK 0x0f00
46 #define SDTX_DEVICE_TYPE(value) ((value) & SDTX_DEVICE_TYPE_MASK)
47 #define SDTX_BASE_TYPE_HID(id) ((id) | SDTX_DEVICE_TYPE_HID)
48 #define SDTX_BASE_TYPE_SSH(id) ((id) | SDTX_DEVICE_TYPE_SSH)
49 enum sdtx_device_mode {
50   SDTX_DEVICE_MODE_TABLET = 0x00,
51   SDTX_DEVICE_MODE_LAPTOP = 0x01,
52   SDTX_DEVICE_MODE_STUDIO = 0x02,
53 };
54 struct sdtx_event {
55   __u16 length;
56   __u16 code;
57   __u8 data[];
58 } __attribute__((__packed__));
59 enum sdtx_event_code {
60   SDTX_EVENT_REQUEST = 1,
61   SDTX_EVENT_CANCEL = 2,
62   SDTX_EVENT_BASE_CONNECTION = 3,
63   SDTX_EVENT_LATCH_STATUS = 4,
64   SDTX_EVENT_DEVICE_MODE = 5,
65 };
66 struct sdtx_base_info {
67   __u16 state;
68   __u16 base_id;
69 } __attribute__((__packed__));
70 #define SDTX_IOCTL_EVENTS_ENABLE _IO(0xa5, 0x21)
71 #define SDTX_IOCTL_EVENTS_DISABLE _IO(0xa5, 0x22)
72 #define SDTX_IOCTL_LATCH_LOCK _IO(0xa5, 0x23)
73 #define SDTX_IOCTL_LATCH_UNLOCK _IO(0xa5, 0x24)
74 #define SDTX_IOCTL_LATCH_REQUEST _IO(0xa5, 0x25)
75 #define SDTX_IOCTL_LATCH_CONFIRM _IO(0xa5, 0x26)
76 #define SDTX_IOCTL_LATCH_HEARTBEAT _IO(0xa5, 0x27)
77 #define SDTX_IOCTL_LATCH_CANCEL _IO(0xa5, 0x28)
78 #define SDTX_IOCTL_GET_BASE_INFO _IOR(0xa5, 0x29, struct sdtx_base_info)
79 #define SDTX_IOCTL_GET_DEVICE_MODE _IOR(0xa5, 0x2a, __u16)
80 #define SDTX_IOCTL_GET_LATCH_STATUS _IOR(0xa5, 0x2b, __u16)
81 #endif
82