forked from entrope/linux-magicmouse
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path0001-Bluetooth-Implement-raw-output-support-for-HIDP-laye.patch
48 lines (41 loc) · 1.56 KB
/
0001-Bluetooth-Implement-raw-output-support-for-HIDP-laye.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From ea74d673e78dff66051b28f70f786d601fb9f939 Mon Sep 17 00:00:00 2001
From: Jiri Kosina <[email protected]>
Date: Thu, 26 Nov 2009 16:20:56 +0100
Subject: [PATCH 1/9] 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: Brian Gunn <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
---
net/bluetooth/hidp/core.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 49d8495..5697500 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -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;
@@ -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;
--
1.6.5.6