1655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/**************************************************************************** 2655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng **************************************************************************** 3655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 4655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** This header was automatically generated from a Linux kernel header 5655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** of the same name, to make information necessary for userspace to 6655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** call into the kernel available to libc. It contains only constants, 7655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** structures, and macros generated from the original header, and thus, 8655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** contains no copyrightable information. 9655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 10655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** To edit the content of this header, modify the corresponding 11655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** source file (e.g. under external/kernel-headers/original/) then 12655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** run bionic/libc/kernel/tools/update_all.py 13655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 14655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** Any manual change here will be lost the next time this script will 15655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** be run. You've been warned! 16655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 17655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng **************************************************************************** 18655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ****************************************************************************/ 19655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#ifndef _UAPI_HIDDEV_H 20655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define _UAPI_HIDDEV_H 21655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#include <linux/types.h> 22655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct hiddev_event { 23d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao unsigned hid; 24d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao signed int value; 25655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 26655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct hiddev_devinfo { 27d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 bustype; 28d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 busnum; 29d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 devnum; 30d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 ifnum; 31d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s16 vendor; 32d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s16 product; 33d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s16 version; 34d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 num_applications; 35655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 36655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct hiddev_collection_info { 37d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 index; 38d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 type; 39d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 usage; 40d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 level; 41655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 42655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_STRING_SIZE 256 43655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct hiddev_string_descriptor { 44d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s32 index; 45d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao char value[HID_STRING_SIZE]; 46655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 47655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct hiddev_report_info { 48d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 report_type; 49d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 report_id; 50d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 num_fields; 51655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 52655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_REPORT_ID_UNKNOWN 0xffffffff 53655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_REPORT_ID_FIRST 0x00000100 54655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_REPORT_ID_NEXT 0x00000200 55655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_REPORT_ID_MASK 0x000000ff 56655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_REPORT_ID_MAX 0x000000ff 57655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_REPORT_TYPE_INPUT 1 58655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_REPORT_TYPE_OUTPUT 2 59655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_REPORT_TYPE_FEATURE 3 60655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_REPORT_TYPE_MIN 1 61655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_REPORT_TYPE_MAX 3 62655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct hiddev_field_info { 63d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 report_type; 64d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 report_id; 65d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 field_index; 66d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 maxusage; 67d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 flags; 68d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 physical; 69d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 logical; 70d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 application; 71d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s32 logical_minimum; 72d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s32 logical_maximum; 73d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s32 physical_minimum; 74d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s32 physical_maximum; 75d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 unit_exponent; 76d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 unit; 77655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 78655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_FIELD_CONSTANT 0x001 79655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_FIELD_VARIABLE 0x002 80655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_FIELD_RELATIVE 0x004 81655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_FIELD_WRAP 0x008 82655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_FIELD_NONLINEAR 0x010 83655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_FIELD_NO_PREFERRED 0x020 84655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_FIELD_NULL_STATE 0x040 85655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_FIELD_VOLATILE 0x080 86655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_FIELD_BUFFERED_BYTE 0x100 87655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct hiddev_usage_ref { 88d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 report_type; 89d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 report_id; 90d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 field_index; 91d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 usage_index; 92d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 usage_code; 93d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s32 value; 94655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 95655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_MAX_MULTI_USAGES 1024 96655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct hiddev_usage_ref_multi { 97d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao struct hiddev_usage_ref uref; 98d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u32 num_values; 99d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __s32 values[HID_MAX_MULTI_USAGES]; 100655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng}; 101655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_FIELD_INDEX_NONE 0xffffffff 102655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HID_VERSION 0x010004 103655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGVERSION _IOR('H', 0x01, int) 104655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCAPPLICATION _IO('H', 0x02) 105655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo) 106655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGSTRING _IOR('H', 0x04, struct hiddev_string_descriptor) 107655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCINITREPORT _IO('H', 0x05) 108655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGNAME(len) _IOC(_IOC_READ, 'H', 0x06, len) 109655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGREPORT _IOW('H', 0x07, struct hiddev_report_info) 110655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info) 111655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGREPORTINFO _IOWR('H', 0x09, struct hiddev_report_info) 112655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGFIELDINFO _IOWR('H', 0x0A, struct hiddev_field_info) 113655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGUSAGE _IOWR('H', 0x0B, struct hiddev_usage_ref) 114655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref) 115655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGUCODE _IOWR('H', 0x0D, struct hiddev_usage_ref) 116655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGFLAG _IOR('H', 0x0E, int) 117655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCSFLAG _IOW('H', 0x0F, int) 118655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGCOLLECTIONINDEX _IOW('H', 0x10, struct hiddev_usage_ref) 119655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGCOLLECTIONINFO _IOWR('H', 0x11, struct hiddev_collection_info) 120655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGPHYS(len) _IOC(_IOC_READ, 'H', 0x12, len) 121655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCGUSAGES _IOWR('H', 0x13, struct hiddev_usage_ref_multi) 122655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDIOCSUSAGES _IOW('H', 0x14, struct hiddev_usage_ref_multi) 123655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDDEV_FLAG_UREF 0x1 124655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDDEV_FLAG_REPORT 0x2 125655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define HIDDEV_FLAGS 0x3 126655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#endif 127