Skip to contentSkip to conversation

Bluetooth: implement raw output for hidp

PATCH RESEND Superseded Jiri Kosina 2 participants 4 messages Dec 3, 2009 – Dec 7, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 Bluetooth: implement raw output for hidp

Implment 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.

---

 net/bluetooth/hidp/core.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
net/bluetooth/hidp/core.c +9 -0
index 49d8495..5697500 100644
@@ -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 lore raw

PATCH RESEND 1/1 Bluetooth: implement raw output for hidp

Implment 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.

---

added akpm to CC.

 net/bluetooth/hidp/core.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
net/bluetooth/hidp/core.c +9 -0
index 49d8495..5697500 100644
@@ -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;
maintainer
#2 lore raw

Hi Jiri,

Quoted 5 lines

Implment 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.

that is in the bluetooth-next and net-next tree already. Linus should be pulling it any time soon.

Regards

Marcel

#3 lore raw
Quoted 8 lines · Marcel Holtmann
Quoted 5 lines

Implment 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.

that is in the bluetooth-next and net-next tree already. Linus should be pulling it any time soon.

Hi Marcel,

ah, I have been looking into wrong tree (bluetooth-2.6 instead of bluetooth-next-2.6).

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.