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