aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-06-10 15:16:19 +0200
committerPawit Pornkitprasan <p.pawit@gmail.com>2012-12-05 23:04:10 +0700
commit8b32afb36dd38aea4e7ce3cfda58d6ec9a45e3fc (patch)
treeec916770d30bcdc8dd34ab1cfe45b9914359f796 /include
parentf4c5ebe1b081247b21a856eb011764763e231188 (diff)
downloadkernel_samsung_aries-8b32afb36dd38aea4e7ce3cfda58d6ec9a45e3fc.zip
kernel_samsung_aries-8b32afb36dd38aea4e7ce3cfda58d6ec9a45e3fc.tar.gz
kernel_samsung_aries-8b32afb36dd38aea4e7ce3cfda58d6ec9a45e3fc.tar.bz2
HID: uhid: allow feeding input data into uhid devices
This adds a new event type UHID_INPUT which allows user-space to feed raw HID reports into the HID subsystem. We copy the data into kernel memory and directly feed it into the HID core. There is no error handling of the events couldn't be parsed so user-space should consider all events successfull unless read() returns an error. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include')
-rw-r--r--include/linux/uhid.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/uhid.h b/include/linux/uhid.h
index 8a493e6..6eb42be 100644
--- a/include/linux/uhid.h
+++ b/include/linux/uhid.h
@@ -25,6 +25,7 @@
enum uhid_event_type {
UHID_CREATE,
UHID_DESTROY,
+ UHID_INPUT,
};
struct uhid_create_req {
@@ -41,11 +42,19 @@ struct uhid_create_req {
__u32 country;
} __attribute__((__packed__));
+#define UHID_DATA_MAX 4096
+
+struct uhid_input_req {
+ __u8 data[UHID_DATA_MAX];
+ __u16 size;
+} __attribute__((__packed__));
+
struct uhid_event {
__u32 type;
union {
struct uhid_create_req create;
+ struct uhid_input_req input;
} u;
} __attribute__((__packed__));