Commit 2da31939 authored by Jiri Kosina's avatar Jiri Kosina Committed by Marcel Holtmann

Bluetooth: Implement raw output support for HIDP layer

Implement raw output callback which is used by hidraw to send raw data to
the underlying device.

Without this patch, the userspace hidraw-based applications can't send
output reports to HID Bluetooth devices.
Reported-and-tested-by: default avatarBrian Gunn <bgunn@solekai.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent fed4c250
...@@ -280,6 +280,13 @@ static int hidp_send_report(struct hidp_session *session, struct hid_report *rep ...@@ -280,6 +280,13 @@ static int hidp_send_report(struct hidp_session *session, struct hid_report *rep
return hidp_queue_report(session, buf, rsize); return hidp_queue_report(session, buf, rsize);
} }
static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count)
{
if (hidp_queue_report(hid->driver_data, data, count))
return -ENOMEM;
return count;
}
static void hidp_idle_timeout(unsigned long arg) static void hidp_idle_timeout(unsigned long arg)
{ {
struct hidp_session *session = (struct hidp_session *) arg; struct hidp_session *session = (struct hidp_session *) arg;
...@@ -785,6 +792,8 @@ static int hidp_setup_hid(struct hidp_session *session, ...@@ -785,6 +792,8 @@ static int hidp_setup_hid(struct hidp_session *session,
hid->dev.parent = hidp_get_device(session); hid->dev.parent = hidp_get_device(session);
hid->ll_driver = &hidp_hid_driver; hid->ll_driver = &hidp_hid_driver;
hid->hid_output_raw_report = hidp_output_raw_report;
err = hid_add_device(hid); err = hid_add_device(hid);
if (err < 0) if (err < 0)
goto failed; goto failed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment