Thread (35 messages) flat view 35 messages, 4 authors, 2014-02-17

Re: [PATCH 02/14] HID: uHID: implement .raw_request

From: David Herrmann <hidden>
Date: 2014-02-12 10:19:38
Also in: lkml

Hi

On Mon, Feb 10, 2014 at 6:58 PM, Benjamin Tissoires
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
uHID is missing a SET_REPORT protocol implementation, but as
.hid_get_raw_report() as been removed from struct hid_device,
there were no means to access GET_REPORT in uhid.

Signed-off-by: Benjamin Tissoires <redacted>
---
 drivers/hid/uhid.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c
index b6de903..60acee4 100644
--- a/drivers/hid/uhid.c
+++ b/drivers/hid/uhid.c
@@ -250,6 +250,21 @@ static int uhid_hid_output_report(struct hid_device *hid, __u8 *buf,
        return uhid_hid_output_raw(hid, buf, count, HID_OUTPUT_REPORT);
 }

+static int uhid_raw_request(struct hid_device *hid, unsigned char reportnum,
+                           __u8 *buf, size_t len, unsigned char rtype,
+                           int reqtype)
+{
+       switch (reqtype) {
+       case HID_REQ_GET_REPORT:
+               return uhid_hid_get_raw(hid, reportnum, buf, len, rtype);
+       case HID_REQ_SET_REPORT:
+               /* TODO: implement proper SET_REPORT functionality */
+               return -ENOSYS;
Looks good. I will try to implement it today and send a patch.

Reviewed-by: David Herrmann <redacted>

Thanks
David
quoted hunk ↗ jump to hunk
+       default:
+               return -EIO;
+       }
+}
+
 static struct hid_ll_driver uhid_hid_driver = {
        .start = uhid_hid_start,
        .stop = uhid_hid_stop,
@@ -257,6 +272,7 @@ static struct hid_ll_driver uhid_hid_driver = {
        .close = uhid_hid_close,
        .parse = uhid_hid_parse,
        .output_report = uhid_hid_output_report,
+       .raw_request = uhid_raw_request,
 };

 #ifdef CONFIG_COMPAT
--
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help