5 * User-space I/O driver support for HID subsystem
6 * Copyright (c) 2012 David Herrmann
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2 of the License, or (at your option)
17 * Public header for user-space communication. We try to keep every structure
18 * aligned but to be safe we also use __attribute__((__packed__)). Therefore,
19 * the communication should be ABI compatible even between architectures.
22 #include <linux/input.h>
23 #include <linux/types.h>
24 #include <linux/hid.h>
26 enum uhid_event_type {
34 UHID_OUTPUT_EV, /* obsolete! */
42 struct uhid_create_req {
54 } __attribute__((__packed__));
56 struct uhid_create2_req {
66 __u8 rd_data[HID_MAX_DESCRIPTOR_SIZE];
67 } __attribute__((__packed__));
69 #define UHID_DATA_MAX 4096
71 enum uhid_report_type {
77 struct uhid_input_req {
78 __u8 data[UHID_DATA_MAX];
80 } __attribute__((__packed__));
82 struct uhid_input2_req {
84 __u8 data[UHID_DATA_MAX];
85 } __attribute__((__packed__));
87 struct uhid_output_req {
88 __u8 data[UHID_DATA_MAX];
91 } __attribute__((__packed__));
93 /* Obsolete! Newer kernels will no longer send these events but instead convert
94 * it into raw output reports via UHID_OUTPUT. */
95 struct uhid_output_ev_req {
99 } __attribute__((__packed__));
101 struct uhid_feature_req {
105 } __attribute__((__packed__));
107 struct uhid_feature_answer_req {
111 __u8 data[UHID_DATA_MAX];
112 } __attribute__((__packed__));
118 struct uhid_create_req create;
119 struct uhid_input_req input;
120 struct uhid_output_req output;
121 struct uhid_output_ev_req output_ev;
122 struct uhid_feature_req feature;
123 struct uhid_feature_answer_req feature_answer;
124 struct uhid_create2_req create2;
125 struct uhid_input2_req input2;
127 } __attribute__((__packed__));
129 #endif /* __UHID_H_ */