blob: 8a493e604a77518eecdf22e00685639e77cde980 [file] [log] [blame]
David Herrmannace3d862012-06-10 15:16:14 +02001#ifndef __UHID_H_
2#define __UHID_H_
3
4/*
5 * User-space I/O driver support for HID subsystem
6 * Copyright (c) 2012 David Herrmann
7 */
8
9/*
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)
13 * any later version.
14 */
15
16/*
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.
20 */
21
22#include <linux/input.h>
23#include <linux/types.h>
24
25enum uhid_event_type {
David Herrmannd365c6c2012-06-10 15:16:18 +020026 UHID_CREATE,
27 UHID_DESTROY,
David Herrmannace3d862012-06-10 15:16:14 +020028};
29
David Herrmannd365c6c2012-06-10 15:16:18 +020030struct uhid_create_req {
31 __u8 name[128];
32 __u8 phys[64];
33 __u8 uniq[64];
34 __u8 __user *rd_data;
35 __u16 rd_size;
36
37 __u16 bus;
38 __u32 vendor;
39 __u32 product;
40 __u32 version;
41 __u32 country;
42} __attribute__((__packed__));
43
David Herrmannace3d862012-06-10 15:16:14 +020044struct uhid_event {
45 __u32 type;
David Herrmannd365c6c2012-06-10 15:16:18 +020046
47 union {
48 struct uhid_create_req create;
49 } u;
David Herrmannace3d862012-06-10 15:16:14 +020050} __attribute__((__packed__));
51
52#endif /* __UHID_H_ */