summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-06-10 15:16:24 +0200
committerJiri Kosina <jkosina@suse.cz>2012-06-18 13:42:02 +0200
commit3b3baa82e4306b5160692643fab2fa322ceb94f9 (patch)
tree04885740c41ff3b9f85af8a641d942b4a9b9dd81 /include
parentHID: uhid: forward output request to user-space (diff)
downloadlinux-3b3baa82e4306b5160692643fab2fa322ceb94f9.tar.xz
linux-3b3baa82e4306b5160692643fab2fa322ceb94f9.zip
HID: uhid: forward raw output reports to user-space
Some drivers that use non-standard HID features require raw output reports sent to the device. We now forward these requests directly to user-space so the transport-level driver can correctly send it to the device or handle it correspondingly. There is no way to signal back whether the transmission was successful, moreover, there might be lots of messages coming out from the driver flushing the output-queue. However, there is currently no driver that causes this so we are safe. If some drivers need to transmit lots of data this way, we need a method to synchronize this and can implement another UHID_OUTPUT_SYNC event. 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.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/uhid.h b/include/linux/uhid.h
index 3fa484921010..2c972550a624 100644
--- a/include/linux/uhid.h
+++ b/include/linux/uhid.h
@@ -29,6 +29,7 @@ enum uhid_event_type {
UHID_STOP,
UHID_OPEN,
UHID_CLOSE,
+ UHID_OUTPUT,
UHID_OUTPUT_EV,
UHID_INPUT,
};
@@ -49,11 +50,23 @@ struct uhid_create_req {
#define UHID_DATA_MAX 4096
+enum uhid_report_type {
+ UHID_FEATURE_REPORT,
+ UHID_OUTPUT_REPORT,
+ UHID_INPUT_REPORT,
+};
+
struct uhid_input_req {
__u8 data[UHID_DATA_MAX];
__u16 size;
} __attribute__((__packed__));
+struct uhid_output_req {
+ __u8 data[UHID_DATA_MAX];
+ __u16 size;
+ __u8 rtype;
+} __attribute__((__packed__));
+
struct uhid_output_ev_req {
__u16 type;
__u16 code;
@@ -66,6 +79,7 @@ struct uhid_event {
union {
struct uhid_create_req create;
struct uhid_input_req input;
+ struct uhid_output_req output;
struct uhid_output_ev_req output_ev;
} u;
} __attribute__((__packed__));