Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame^] | 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 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _UAPI_HIDDEV_H |
| 8 | #define _UAPI_HIDDEV_H |
| 9 | #include <linux/types.h> |
| 10 | struct hiddev_event { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 11 | unsigned hid; |
| 12 | signed int value; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 13 | }; |
| 14 | struct hiddev_devinfo { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 15 | __u32 bustype; |
| 16 | __u32 busnum; |
| 17 | __u32 devnum; |
| 18 | __u32 ifnum; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 19 | __s16 vendor; |
| 20 | __s16 product; |
| 21 | __s16 version; |
| 22 | __u32 num_applications; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | }; |
| 24 | struct hiddev_collection_info { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 25 | __u32 index; |
| 26 | __u32 type; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | __u32 usage; |
| 28 | __u32 level; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 29 | }; |
| 30 | #define HID_STRING_SIZE 256 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | struct hiddev_string_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 32 | __s32 index; |
| 33 | char value[HID_STRING_SIZE]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 34 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | struct hiddev_report_info { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 36 | __u32 report_type; |
| 37 | __u32 report_id; |
| 38 | __u32 num_fields; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | }; |
| 40 | #define HID_REPORT_ID_UNKNOWN 0xffffffff |
| 41 | #define HID_REPORT_ID_FIRST 0x00000100 |
| 42 | #define HID_REPORT_ID_NEXT 0x00000200 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 51 | __u32 report_type; |
| 52 | __u32 report_id; |
| 53 | __u32 field_index; |
| 54 | __u32 maxusage; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 55 | __u32 flags; |
| 56 | __u32 physical; |
| 57 | __u32 logical; |
| 58 | __u32 application; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | __s32 logical_minimum; |
| 60 | __s32 logical_maximum; |
| 61 | __s32 physical_minimum; |
| 62 | __s32 physical_maximum; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 | __u32 unit_exponent; |
| 64 | __u32 unit; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 65 | }; |
| 66 | #define HID_FIELD_CONSTANT 0x001 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 67 | #define HID_FIELD_VARIABLE 0x002 |
| 68 | #define HID_FIELD_RELATIVE 0x004 |
| 69 | #define HID_FIELD_WRAP 0x008 |
| 70 | #define HID_FIELD_NONLINEAR 0x010 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 75 | struct hiddev_usage_ref { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 76 | __u32 report_type; |
| 77 | __u32 report_id; |
| 78 | __u32 field_index; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 79 | __u32 usage_index; |
| 80 | __u32 usage_code; |
| 81 | __s32 value; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 82 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 83 | #define HID_MAX_MULTI_USAGES 1024 |
| 84 | struct hiddev_usage_ref_multi { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 85 | struct hiddev_usage_ref uref; |
| 86 | __u32 num_values; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 87 | __s32 values[HID_MAX_MULTI_USAGES]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 88 | }; |
| 89 | #define HID_FIELD_INDEX_NONE 0xffffffff |
| 90 | #define HID_VERSION 0x010004 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 111 | #define HIDDEV_FLAG_UREF 0x1 |
| 112 | #define HIDDEV_FLAG_REPORT 0x2 |
| 113 | #define HIDDEV_FLAGS 0x3 |
| 114 | #endif |