提交 2b2bcc76 编写于 作者: M Maximilian Luz 提交者: Jiri Kosina

HID: surface-hid: Fix get-report request

Getting a report (e.g. feature report) from a device requires us to send
a request indicating which report we want to retrieve and then waiting
for the corresponding response containing that report. We already
provide the response structure to the request call, but the request
isn't marked as a request that expects a response. Thus the request
returns before we receive the response and the response buffer indicates
a zero length response due to that.

This essentially means that the get-report calls are broken and will
always indicate that a report of length zero has been read.

Fix this by appropriately marking the request.

Fixes: b05ff100 ("HID: Add support for Surface Aggregator Module HID transport")
Signed-off-by: NMaximilian Luz <luzmaximilian@gmail.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 fb1a79a6
...@@ -143,7 +143,7 @@ static int ssam_hid_get_raw_report(struct surface_hid_device *shid, u8 rprt_id, ...@@ -143,7 +143,7 @@ static int ssam_hid_get_raw_report(struct surface_hid_device *shid, u8 rprt_id,
rqst.target_id = shid->uid.target; rqst.target_id = shid->uid.target;
rqst.instance_id = shid->uid.instance; rqst.instance_id = shid->uid.instance;
rqst.command_id = SURFACE_HID_CID_GET_FEATURE_REPORT; rqst.command_id = SURFACE_HID_CID_GET_FEATURE_REPORT;
rqst.flags = 0; rqst.flags = SSAM_REQUEST_HAS_RESPONSE;
rqst.length = sizeof(rprt_id); rqst.length = sizeof(rprt_id);
rqst.payload = &rprt_id; rqst.payload = &rprt_id;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册