122851890Sopenharmony_ci/****************************************************************************
222851890Sopenharmony_ci ****************************************************************************
322851890Sopenharmony_ci ***
422851890Sopenharmony_ci ***   This header was automatically generated from a Linux kernel header
522851890Sopenharmony_ci ***   of the same name, to make information necessary for userspace to
622851890Sopenharmony_ci ***   call into the kernel available to libc.  It contains only constants,
722851890Sopenharmony_ci ***   structures, and macros generated from the original header, and thus,
822851890Sopenharmony_ci ***   contains no copyrightable information.
922851890Sopenharmony_ci ***
1022851890Sopenharmony_ci ***   To edit the content of this header, modify the corresponding
1122851890Sopenharmony_ci ***   source file (e.g. under external/kernel-headers/original/) then
1222851890Sopenharmony_ci ***   run bionic/libc/kernel/tools/update_all.py
1322851890Sopenharmony_ci ***
1422851890Sopenharmony_ci ***   Any manual change here will be lost the next time this script will
1522851890Sopenharmony_ci ***   be run. You've been warned!
1622851890Sopenharmony_ci ***
1722851890Sopenharmony_ci ****************************************************************************
1822851890Sopenharmony_ci ****************************************************************************/
1922851890Sopenharmony_ci#ifndef __UHID_H_
2022851890Sopenharmony_ci#define __UHID_H_
2122851890Sopenharmony_ci#include <linux/input.h>
2222851890Sopenharmony_ci#include <linux/types.h>
2322851890Sopenharmony_ci#include <linux/hid.h>
2422851890Sopenharmony_cienum uhid_event_type {
2522851890Sopenharmony_ci  __UHID_LEGACY_CREATE,
2622851890Sopenharmony_ci  UHID_DESTROY,
2722851890Sopenharmony_ci  UHID_START,
2822851890Sopenharmony_ci  UHID_STOP,
2922851890Sopenharmony_ci  UHID_OPEN,
3022851890Sopenharmony_ci  UHID_CLOSE,
3122851890Sopenharmony_ci  UHID_OUTPUT,
3222851890Sopenharmony_ci  __UHID_LEGACY_OUTPUT_EV,
3322851890Sopenharmony_ci  __UHID_LEGACY_INPUT,
3422851890Sopenharmony_ci  UHID_GET_REPORT,
3522851890Sopenharmony_ci  UHID_GET_REPORT_REPLY,
3622851890Sopenharmony_ci  UHID_CREATE2,
3722851890Sopenharmony_ci  UHID_INPUT2,
3822851890Sopenharmony_ci  UHID_SET_REPORT,
3922851890Sopenharmony_ci  UHID_SET_REPORT_REPLY,
4022851890Sopenharmony_ci};
4122851890Sopenharmony_cistruct uhid_create2_req {
4222851890Sopenharmony_ci  __u8 name[128];
4322851890Sopenharmony_ci  __u8 phys[64];
4422851890Sopenharmony_ci  __u8 uniq[64];
4522851890Sopenharmony_ci  __u16 rd_size;
4622851890Sopenharmony_ci  __u16 bus;
4722851890Sopenharmony_ci  __u32 vendor;
4822851890Sopenharmony_ci  __u32 product;
4922851890Sopenharmony_ci  __u32 version;
5022851890Sopenharmony_ci  __u32 country;
5122851890Sopenharmony_ci  __u8 rd_data[HID_MAX_DESCRIPTOR_SIZE];
5222851890Sopenharmony_ci} __attribute__((__packed__));
5322851890Sopenharmony_cienum uhid_dev_flag {
5422851890Sopenharmony_ci  UHID_DEV_NUMBERED_FEATURE_REPORTS = (1ULL << 0),
5522851890Sopenharmony_ci  UHID_DEV_NUMBERED_OUTPUT_REPORTS = (1ULL << 1),
5622851890Sopenharmony_ci  UHID_DEV_NUMBERED_INPUT_REPORTS = (1ULL << 2),
5722851890Sopenharmony_ci};
5822851890Sopenharmony_cistruct uhid_start_req {
5922851890Sopenharmony_ci  __u64 dev_flags;
6022851890Sopenharmony_ci};
6122851890Sopenharmony_ci#define UHID_DATA_MAX 4096
6222851890Sopenharmony_cienum uhid_report_type {
6322851890Sopenharmony_ci  UHID_FEATURE_REPORT,
6422851890Sopenharmony_ci  UHID_OUTPUT_REPORT,
6522851890Sopenharmony_ci  UHID_INPUT_REPORT,
6622851890Sopenharmony_ci};
6722851890Sopenharmony_cistruct uhid_input2_req {
6822851890Sopenharmony_ci  __u16 size;
6922851890Sopenharmony_ci  __u8 data[UHID_DATA_MAX];
7022851890Sopenharmony_ci} __attribute__((__packed__));
7122851890Sopenharmony_cistruct uhid_output_req {
7222851890Sopenharmony_ci  __u8 data[UHID_DATA_MAX];
7322851890Sopenharmony_ci  __u16 size;
7422851890Sopenharmony_ci  __u8 rtype;
7522851890Sopenharmony_ci} __attribute__((__packed__));
7622851890Sopenharmony_cistruct uhid_get_report_req {
7722851890Sopenharmony_ci  __u32 id;
7822851890Sopenharmony_ci  __u8 rnum;
7922851890Sopenharmony_ci  __u8 rtype;
8022851890Sopenharmony_ci} __attribute__((__packed__));
8122851890Sopenharmony_cistruct uhid_get_report_reply_req {
8222851890Sopenharmony_ci  __u32 id;
8322851890Sopenharmony_ci  __u16 err;
8422851890Sopenharmony_ci  __u16 size;
8522851890Sopenharmony_ci  __u8 data[UHID_DATA_MAX];
8622851890Sopenharmony_ci} __attribute__((__packed__));
8722851890Sopenharmony_cistruct uhid_set_report_req {
8822851890Sopenharmony_ci  __u32 id;
8922851890Sopenharmony_ci  __u8 rnum;
9022851890Sopenharmony_ci  __u8 rtype;
9122851890Sopenharmony_ci  __u16 size;
9222851890Sopenharmony_ci  __u8 data[UHID_DATA_MAX];
9322851890Sopenharmony_ci} __attribute__((__packed__));
9422851890Sopenharmony_cistruct uhid_set_report_reply_req {
9522851890Sopenharmony_ci  __u32 id;
9622851890Sopenharmony_ci  __u16 err;
9722851890Sopenharmony_ci} __attribute__((__packed__));
9822851890Sopenharmony_cienum uhid_legacy_event_type {
9922851890Sopenharmony_ci  UHID_CREATE = __UHID_LEGACY_CREATE,
10022851890Sopenharmony_ci  UHID_OUTPUT_EV = __UHID_LEGACY_OUTPUT_EV,
10122851890Sopenharmony_ci  UHID_INPUT = __UHID_LEGACY_INPUT,
10222851890Sopenharmony_ci  UHID_FEATURE = UHID_GET_REPORT,
10322851890Sopenharmony_ci  UHID_FEATURE_ANSWER = UHID_GET_REPORT_REPLY,
10422851890Sopenharmony_ci};
10522851890Sopenharmony_cistruct uhid_create_req {
10622851890Sopenharmony_ci  __u8 name[128];
10722851890Sopenharmony_ci  __u8 phys[64];
10822851890Sopenharmony_ci  __u8 uniq[64];
10922851890Sopenharmony_ci  __u8 __user * rd_data;
11022851890Sopenharmony_ci  __u16 rd_size;
11122851890Sopenharmony_ci  __u16 bus;
11222851890Sopenharmony_ci  __u32 vendor;
11322851890Sopenharmony_ci  __u32 product;
11422851890Sopenharmony_ci  __u32 version;
11522851890Sopenharmony_ci  __u32 country;
11622851890Sopenharmony_ci} __attribute__((__packed__));
11722851890Sopenharmony_cistruct uhid_input_req {
11822851890Sopenharmony_ci  __u8 data[UHID_DATA_MAX];
11922851890Sopenharmony_ci  __u16 size;
12022851890Sopenharmony_ci} __attribute__((__packed__));
12122851890Sopenharmony_cistruct uhid_output_ev_req {
12222851890Sopenharmony_ci  __u16 type;
12322851890Sopenharmony_ci  __u16 code;
12422851890Sopenharmony_ci  __s32 value;
12522851890Sopenharmony_ci} __attribute__((__packed__));
12622851890Sopenharmony_cistruct uhid_feature_req {
12722851890Sopenharmony_ci  __u32 id;
12822851890Sopenharmony_ci  __u8 rnum;
12922851890Sopenharmony_ci  __u8 rtype;
13022851890Sopenharmony_ci} __attribute__((__packed__));
13122851890Sopenharmony_cistruct uhid_feature_answer_req {
13222851890Sopenharmony_ci  __u32 id;
13322851890Sopenharmony_ci  __u16 err;
13422851890Sopenharmony_ci  __u16 size;
13522851890Sopenharmony_ci  __u8 data[UHID_DATA_MAX];
13622851890Sopenharmony_ci} __attribute__((__packed__));
13722851890Sopenharmony_cistruct uhid_event {
13822851890Sopenharmony_ci  __u32 type;
13922851890Sopenharmony_ci  union {
14022851890Sopenharmony_ci    struct uhid_create_req create;
14122851890Sopenharmony_ci    struct uhid_input_req input;
14222851890Sopenharmony_ci    struct uhid_output_req output;
14322851890Sopenharmony_ci    struct uhid_output_ev_req output_ev;
14422851890Sopenharmony_ci    struct uhid_feature_req feature;
14522851890Sopenharmony_ci    struct uhid_get_report_req get_report;
14622851890Sopenharmony_ci    struct uhid_feature_answer_req feature_answer;
14722851890Sopenharmony_ci    struct uhid_get_report_reply_req get_report_reply;
14822851890Sopenharmony_ci    struct uhid_create2_req create2;
14922851890Sopenharmony_ci    struct uhid_input2_req input2;
15022851890Sopenharmony_ci    struct uhid_set_report_req set_report;
15122851890Sopenharmony_ci    struct uhid_set_report_reply_req set_report_reply;
15222851890Sopenharmony_ci    struct uhid_start_req start;
15322851890Sopenharmony_ci  } u;
15422851890Sopenharmony_ci} __attribute__((__packed__));
15522851890Sopenharmony_ci#endif
156