linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] bluetooth: hidp+hidraw write support
@ 2009-09-10 17:40 SephirXV
  2009-09-10 17:50 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: SephirXV @ 2009-09-10 17:40 UTC (permalink / raw)
  To: linux-bluetooth

From: Christopher Olson <sephirxv@gmail.com>

somewhere before .28, non-compliant HIDP devices would connect, and
could be read from, but writing to the device had no effect.

Signed-off-by: Christopher Olson <sephirxv@gmail.com>

---

--- net/bluetooth/hidp/core.c   2009-09-10 09:32:20.000000000 -0500
+++ net/bluetooth/hidp/core.c.2 2009-09-10 09:41:37.000000000 -0500
@@ -40,6 +40,7 @@

 #include <linux/input.h>
 #include <linux/hid.h>
+#include <linux/hidraw.h>

 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
@@ -513,6 +514,11 @@ static void hidp_process_transmit(struct
                kfree_skb(skb);
        }
 }
+
+static int hidp_output_raw_report(struct hid_device *hid, __u8 *buf,
size_t count)
+{
+        return hidp_send_ctrl_message(hid->driver_data, buf[0], buf +
1, count - 1);
+}

 static int hidp_session(void *arg)
 {
@@ -781,6 +787,7 @@ static int hidp_setup_hid(struct hidp_se

        hid->dev.parent = hidp_get_device(session);
        hid->ll_driver = &hidp_hid_driver;
+       hid->hid_output_raw_report = hidp_output_raw_report;

        ret = hid_add_device(hid);
        if (ret)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/3] bluetooth: hidp+hidraw write support
  2009-09-10 17:40 [PATCH 2/3] bluetooth: hidp+hidraw write support SephirXV
@ 2009-09-10 17:50 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2009-09-10 17:50 UTC (permalink / raw)
  To: SephirXV; +Cc: linux-bluetooth

Hi Christopher,

> somewhere before .28, non-compliant HIDP devices would connect, and
> could be read from, but writing to the device had no effect.

this is not a proper commit message. Don't care about "somewhere", just
explain what this patch is fixing or what feature it adds.

> Signed-off-by: Christopher Olson <sephirxv@gmail.com>
> 
> ---
> 
> --- net/bluetooth/hidp/core.c   2009-09-10 09:32:20.000000000 -0500
> +++ net/bluetooth/hidp/core.c.2 2009-09-10 09:41:37.000000000 -0500
> @@ -40,6 +40,7 @@
> 
>  #include <linux/input.h>
>  #include <linux/hid.h>
> +#include <linux/hidraw.h>
> 
>  #include <net/bluetooth/bluetooth.h>
>  #include <net/bluetooth/hci_core.h>
> @@ -513,6 +514,11 @@ static void hidp_process_transmit(struct
>                 kfree_skb(skb);
>         }
>  }
> +
> +static int hidp_output_raw_report(struct hid_device *hid, __u8 *buf,
> size_t count)
> +{
> +        return hidp_send_ctrl_message(hid->driver_data, buf[0], buf +
> 1, count - 1);
> +}

Please just create the SKB, copy the data, queue it and schedule it.
This buf[0] and buf + 1. Is pointless and just confusing.

And while at it change the send_ctrl_message to only accept the header
parameter since we are not even using data and size at all.

Regards

Marcel



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-10 17:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-10 17:40 [PATCH 2/3] bluetooth: hidp+hidraw write support SephirXV
2009-09-10 17:50 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).