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 __UHID_H_ 20 #define __UHID_H_ 21 #include <linux/input.h> 22 #include <linux/types.h> 23 #include <linux/hid.h> 24 enum uhid_event_type { 25 __UHID_LEGACY_CREATE, 26 UHID_DESTROY, 27 UHID_START, 28 UHID_STOP, 29 UHID_OPEN, 30 UHID_CLOSE, 31 UHID_OUTPUT, 32 __UHID_LEGACY_OUTPUT_EV, 33 __UHID_LEGACY_INPUT, 34 UHID_GET_REPORT, 35 UHID_GET_REPORT_REPLY, 36 UHID_CREATE2, 37 UHID_INPUT2, 38 UHID_SET_REPORT, 39 UHID_SET_REPORT_REPLY, 40 }; 41 struct uhid_create2_req { 42 __u8 name[128]; 43 __u8 phys[64]; 44 __u8 uniq[64]; 45 __u16 rd_size; 46 __u16 bus; 47 __u32 vendor; 48 __u32 product; 49 __u32 version; 50 __u32 country; 51 __u8 rd_data[HID_MAX_DESCRIPTOR_SIZE]; 52 } __attribute__((__packed__)); 53 enum uhid_dev_flag { 54 UHID_DEV_NUMBERED_FEATURE_REPORTS = (1ULL << 0), 55 UHID_DEV_NUMBERED_OUTPUT_REPORTS = (1ULL << 1), 56 UHID_DEV_NUMBERED_INPUT_REPORTS = (1ULL << 2), 57 }; 58 struct uhid_start_req { 59 __u64 dev_flags; 60 }; 61 #define UHID_DATA_MAX 4096 62 enum uhid_report_type { 63 UHID_FEATURE_REPORT, 64 UHID_OUTPUT_REPORT, 65 UHID_INPUT_REPORT, 66 }; 67 struct uhid_input2_req { 68 __u16 size; 69 __u8 data[UHID_DATA_MAX]; 70 } __attribute__((__packed__)); 71 struct uhid_output_req { 72 __u8 data[UHID_DATA_MAX]; 73 __u16 size; 74 __u8 rtype; 75 } __attribute__((__packed__)); 76 struct uhid_get_report_req { 77 __u32 id; 78 __u8 rnum; 79 __u8 rtype; 80 } __attribute__((__packed__)); 81 struct uhid_get_report_reply_req { 82 __u32 id; 83 __u16 err; 84 __u16 size; 85 __u8 data[UHID_DATA_MAX]; 86 } __attribute__((__packed__)); 87 struct uhid_set_report_req { 88 __u32 id; 89 __u8 rnum; 90 __u8 rtype; 91 __u16 size; 92 __u8 data[UHID_DATA_MAX]; 93 } __attribute__((__packed__)); 94 struct uhid_set_report_reply_req { 95 __u32 id; 96 __u16 err; 97 } __attribute__((__packed__)); 98 enum uhid_legacy_event_type { 99 UHID_CREATE = __UHID_LEGACY_CREATE, 100 UHID_OUTPUT_EV = __UHID_LEGACY_OUTPUT_EV, 101 UHID_INPUT = __UHID_LEGACY_INPUT, 102 UHID_FEATURE = UHID_GET_REPORT, 103 UHID_FEATURE_ANSWER = UHID_GET_REPORT_REPLY, 104 }; 105 struct uhid_create_req { 106 __u8 name[128]; 107 __u8 phys[64]; 108 __u8 uniq[64]; 109 __u8 __user * rd_data; 110 __u16 rd_size; 111 __u16 bus; 112 __u32 vendor; 113 __u32 product; 114 __u32 version; 115 __u32 country; 116 } __attribute__((__packed__)); 117 struct uhid_input_req { 118 __u8 data[UHID_DATA_MAX]; 119 __u16 size; 120 } __attribute__((__packed__)); 121 struct uhid_output_ev_req { 122 __u16 type; 123 __u16 code; 124 __s32 value; 125 } __attribute__((__packed__)); 126 struct uhid_feature_req { 127 __u32 id; 128 __u8 rnum; 129 __u8 rtype; 130 } __attribute__((__packed__)); 131 struct uhid_feature_answer_req { 132 __u32 id; 133 __u16 err; 134 __u16 size; 135 __u8 data[UHID_DATA_MAX]; 136 } __attribute__((__packed__)); 137 struct uhid_event { 138 __u32 type; 139 union { 140 struct uhid_create_req create; 141 struct uhid_input_req input; 142 struct uhid_output_req output; 143 struct uhid_output_ev_req output_ev; 144 struct uhid_feature_req feature; 145 struct uhid_get_report_req get_report; 146 struct uhid_feature_answer_req feature_answer; 147 struct uhid_get_report_reply_req get_report_reply; 148 struct uhid_create2_req create2; 149 struct uhid_input2_req input2; 150 struct uhid_set_report_req set_report; 151 struct uhid_set_report_reply_req set_report_reply; 152 struct uhid_start_req start; 153 } u; 154 } __attribute__((__packed__)); 155 #endif 156