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_HIDDEV_H
20  #define _UAPI_HIDDEV_H
21  #include <linux/types.h>
22  struct hiddev_event {
23    unsigned hid;
24    signed int value;
25  };
26  struct hiddev_devinfo {
27    __u32 bustype;
28    __u32 busnum;
29    __u32 devnum;
30    __u32 ifnum;
31    __s16 vendor;
32    __s16 product;
33    __s16 version;
34    __u32 num_applications;
35  };
36  struct hiddev_collection_info {
37    __u32 index;
38    __u32 type;
39    __u32 usage;
40    __u32 level;
41  };
42  #define HID_STRING_SIZE 256
43  struct hiddev_string_descriptor {
44    __s32 index;
45    char value[HID_STRING_SIZE];
46  };
47  struct hiddev_report_info {
48    __u32 report_type;
49    __u32 report_id;
50    __u32 num_fields;
51  };
52  #define HID_REPORT_ID_UNKNOWN 0xffffffff
53  #define HID_REPORT_ID_FIRST 0x00000100
54  #define HID_REPORT_ID_NEXT 0x00000200
55  #define HID_REPORT_ID_MASK 0x000000ff
56  #define HID_REPORT_ID_MAX 0x000000ff
57  #define HID_REPORT_TYPE_INPUT 1
58  #define HID_REPORT_TYPE_OUTPUT 2
59  #define HID_REPORT_TYPE_FEATURE 3
60  #define HID_REPORT_TYPE_MIN 1
61  #define HID_REPORT_TYPE_MAX 3
62  struct hiddev_field_info {
63    __u32 report_type;
64    __u32 report_id;
65    __u32 field_index;
66    __u32 maxusage;
67    __u32 flags;
68    __u32 physical;
69    __u32 logical;
70    __u32 application;
71    __s32 logical_minimum;
72    __s32 logical_maximum;
73    __s32 physical_minimum;
74    __s32 physical_maximum;
75    __u32 unit_exponent;
76    __u32 unit;
77  };
78  #define HID_FIELD_CONSTANT 0x001
79  #define HID_FIELD_VARIABLE 0x002
80  #define HID_FIELD_RELATIVE 0x004
81  #define HID_FIELD_WRAP 0x008
82  #define HID_FIELD_NONLINEAR 0x010
83  #define HID_FIELD_NO_PREFERRED 0x020
84  #define HID_FIELD_NULL_STATE 0x040
85  #define HID_FIELD_VOLATILE 0x080
86  #define HID_FIELD_BUFFERED_BYTE 0x100
87  struct hiddev_usage_ref {
88    __u32 report_type;
89    __u32 report_id;
90    __u32 field_index;
91    __u32 usage_index;
92    __u32 usage_code;
93    __s32 value;
94  };
95  #define HID_MAX_MULTI_USAGES 1024
96  struct hiddev_usage_ref_multi {
97    struct hiddev_usage_ref uref;
98    __u32 num_values;
99    __s32 values[HID_MAX_MULTI_USAGES];
100  };
101  #define HID_FIELD_INDEX_NONE 0xffffffff
102  #define HID_VERSION 0x010004
103  #define HIDIOCGVERSION _IOR('H', 0x01, int)
104  #define HIDIOCAPPLICATION _IO('H', 0x02)
105  #define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo)
106  #define HIDIOCGSTRING _IOR('H', 0x04, struct hiddev_string_descriptor)
107  #define HIDIOCINITREPORT _IO('H', 0x05)
108  #define HIDIOCGNAME(len) _IOC(_IOC_READ, 'H', 0x06, len)
109  #define HIDIOCGREPORT _IOW('H', 0x07, struct hiddev_report_info)
110  #define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info)
111  #define HIDIOCGREPORTINFO _IOWR('H', 0x09, struct hiddev_report_info)
112  #define HIDIOCGFIELDINFO _IOWR('H', 0x0A, struct hiddev_field_info)
113  #define HIDIOCGUSAGE _IOWR('H', 0x0B, struct hiddev_usage_ref)
114  #define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref)
115  #define HIDIOCGUCODE _IOWR('H', 0x0D, struct hiddev_usage_ref)
116  #define HIDIOCGFLAG _IOR('H', 0x0E, int)
117  #define HIDIOCSFLAG _IOW('H', 0x0F, int)
118  #define HIDIOCGCOLLECTIONINDEX _IOW('H', 0x10, struct hiddev_usage_ref)
119  #define HIDIOCGCOLLECTIONINFO _IOWR('H', 0x11, struct hiddev_collection_info)
120  #define HIDIOCGPHYS(len) _IOC(_IOC_READ, 'H', 0x12, len)
121  #define HIDIOCGUSAGES _IOWR('H', 0x13, struct hiddev_usage_ref_multi)
122  #define HIDIOCSUSAGES _IOW('H', 0x14, struct hiddev_usage_ref_multi)
123  #define HIDDEV_FLAG_UREF 0x1
124  #define HIDDEV_FLAG_REPORT 0x2
125  #define HIDDEV_FLAGS 0x3
126  #endif
127