diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-07-29 17:14:24 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-08-25 03:28:08 -0500 |
commit | 11c221553080408b203a00b91ad5f647dfb218d1 (patch) | |
tree | ba4aa924ec09d7775ba887fbdaeaee45cff191b0 /include/uapi/linux/uhid.h | |
parent | 7c4003bc367d5ff1cbce579a883f17698a9a6da2 (diff) | |
download | linux-stable-11c221553080408b203a00b91ad5f647dfb218d1.tar.gz linux-stable-11c221553080408b203a00b91ad5f647dfb218d1.tar.bz2 linux-stable-11c221553080408b203a00b91ad5f647dfb218d1.zip |
HID: uhid: implement SET_REPORT
We so far lacked support for hid_hw_raw_request(..., HID_REQ_SET_REPORT);
Add support for it and simply forward the request to user-space. Note that
SET_REPORT is synchronous, just like GET_REPORT, even though it does not
provide any data back besides an error code.
If a transport layer does SET_REPORT asynchronously, they can just ACK it
immediately by writing an uhid_set_report_reply to uhid.
This patch re-uses the synchronous uhid-report infrastructure to query
user-space. Note that this means you cannot run SET_REPORT and GET_REPORT
in parallel. However, that has always been a restriction of HID and due to
its blocking nature, this is just fine. Maybe some future transport layer
supports parallel requests (very unlikely), however, until then lets not
over-complicate things and avoid request-lookup-tables.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/uapi/linux/uhid.h')
-rw-r--r-- | include/uapi/linux/uhid.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h index 116536eeae62..62aac0e4edf3 100644 --- a/include/uapi/linux/uhid.h +++ b/include/uapi/linux/uhid.h @@ -37,6 +37,8 @@ enum uhid_event_type { UHID_GET_REPORT_REPLY, UHID_CREATE2, UHID_INPUT2, + UHID_SET_REPORT, + UHID_SET_REPORT_REPLY, }; struct uhid_create2_req { @@ -84,6 +86,19 @@ struct uhid_get_report_reply_req { __u8 data[UHID_DATA_MAX]; } __attribute__((__packed__)); +struct uhid_set_report_req { + __u32 id; + __u8 rnum; + __u8 rtype; + __u16 size; + __u8 data[UHID_DATA_MAX]; +} __attribute__((__packed__)); + +struct uhid_set_report_reply_req { + __u32 id; + __u16 err; +} __attribute__((__packed__)); + /* * Compat Layer * All these commands and requests are obsolete. You should avoid using them in @@ -165,6 +180,8 @@ struct uhid_event { struct uhid_get_report_reply_req get_report_reply; struct uhid_create2_req create2; struct uhid_input2_req input2; + struct uhid_set_report_req set_report; + struct uhid_set_report_reply_req set_report_reply; } u; } __attribute__((__packed__)); |