Skip to content

Commit

Permalink
Bluetooth: Implement raw output support for HIDP layer
Browse files Browse the repository at this point in the history
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: Brian Gunn <bgunn@solekai.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Jiri Kosina authored and Marcel Holtmann committed Dec 3, 2009
1 parent fed4c25 commit 2da3193
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions net/bluetooth/hidp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ static int hidp_send_report(struct hidp_session *session, struct hid_report *rep
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)
{
struct hidp_session *session = (struct hidp_session *) arg;
Expand Down Expand Up @@ -785,6 +792,8 @@ static int hidp_setup_hid(struct hidp_session *session,
hid->dev.parent = hidp_get_device(session);
hid->ll_driver = &hidp_hid_driver;

hid->hid_output_raw_report = hidp_output_raw_report;

err = hid_add_device(hid);
if (err < 0)
goto failed;
Expand Down

0 comments on commit 2da3193

Please sign in to comment.