* bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch
@ 2009-08-06 22:44 Andrew Morton
2009-08-06 23:05 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Lamarque Vieira Souza
2009-08-07 1:53 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Lamarque Vieira Souza
0 siblings, 2 replies; 5+ messages in thread
From: Andrew Morton @ 2009-08-06 22:44 UTC (permalink / raw)
To: Lamarque V. Souza; +Cc: Marcel Holtmann, linux-bluetooth
So I'm still sitting on this patch because it fixes a real problem,
only it fixes it in the wrong way.
I will continue to sit on the patch (potentially for years) as a
reminder that the underlying issue remains unfixed.
Someone please save me from this!
From: Lamarque Vieira Souza <lamarque@gmail.com>
Work around one problem with my Acer Bluetooth Optical Rechargeable Mouse
where the cursor gets stuck at screen's upper-left corner.
Even my notebook's touchpad is not able to move cursor when the bluetooth
mouse is connected to my Acer Ferrari 4005 notebook.
Using input session instead of hid session solves this problem although
the cursor still moves a little sluggishly with the bluetooth mouse,
cursor moves correctly using the touchpad.
My bluetooth mouse used to work well (no sluggish) until kernel 2.6.21,
since then the problems are getting worse with each kernel release (it got
sluggish in 2.6.22 and this this upper-left corner problem appeared in
2.6.28 or 2.6.27).
The patch adds a general quirk handling framework to the HIDP core and
then uses this framework to implement a quirk for this device.
[akpm@linux-foundation.org: use ARRAY_SIZE()-based search]
Signed-off-by: Lamarque V. Souza <lamarque@gmail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Dave Young <hidave.darkstar@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
net/bluetooth/hidp/core.c | 39 +++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
diff -puN net/bluetooth/hidp/core.c~bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse net/bluetooth/hidp/core.c
--- a/net/bluetooth/hidp/core.c~bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse
+++ a/net/bluetooth/hidp/core.c
@@ -73,6 +73,41 @@ static unsigned char hidp_keycode[256] =
static unsigned char hidp_mkeyspat[] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 };
+/* HIDP device quirks */
+enum {
+ HIDP_QUIRK_USE_INPUT_SESSION
+};
+
+struct quirk_id {
+ __u16 vendor;
+ __u16 product;
+ unsigned long quirks;
+};
+
+static const struct quirk_id hidp_quirks[] = {
+ {
+ /* Lamarque: Acer Bluetooth Optical Rechargeable Mouse
+ * does not work properly with hid session since 2.6.27. */
+ .vendor = 0x0458,
+ .product = 0x0058,
+ .quirks = 1 << HIDP_QUIRK_USE_INPUT_SESSION
+ },
+};
+
+static int quirk_test_bit(__u16 vendor, __u16 product, int quirk)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(hidp_quirks); i++) {
+ const struct quirk_id *q = hidp_quirks + i;
+
+ if (q->vendor == vendor && q->product == product)
+ return test_bit(quirk, &q->quirks);
+ }
+
+ return 0;
+}
+
static struct hidp_session *__hidp_get_session(bdaddr_t *bdaddr)
{
struct hidp_session *session;
@@ -833,7 +868,9 @@ int hidp_add_connection(struct hidp_conn
session->flags = req->flags & (1 << HIDP_BLUETOOTH_VENDOR_ID);
session->idle_to = req->idle_to;
- if (req->rd_size > 0) {
+ if (req->rd_size > 0 &&
+ !quirk_test_bit(req->vendor, req->product,
+ HIDP_QUIRK_USE_INPUT_SESSION)) {
err = hidp_setup_hid(session, req);
if (err && err != -ENODEV)
goto err_skb;
_
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch
2009-08-06 22:44 bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Andrew Morton
@ 2009-08-06 23:05 ` Lamarque Vieira Souza
2009-08-07 0:39 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Marcel Holtmann
2009-08-07 1:53 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Lamarque Vieira Souza
1 sibling, 1 reply; 5+ messages in thread
From: Lamarque Vieira Souza @ 2009-08-06 23:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: Marcel Holtmann, linux-bluetooth
Hi all,
Well, I need this patch or my bluetooth mouse is completly useless to me. If
Marcel could show me how I can solve this problem in right way I can update
the patch. As I said in another e-mail, I do not see anywhere else I can make
the driver use input session instead of hid session beside hidp/core.c. I have
tried to add a HID quirk in HID subsystem, but I have failed to find a place
to change the input session types. Anyway, as far as I can see this is not a
HID quirk, it is a quirk to avoid using HID session, so I do not see why I
must use a HID quirk as Marcel suggested.
Em Quinta-feira 06 Agosto 2009, Andrew Morton escreveu:
> So I'm still sitting on this patch because it fixes a real problem,
> only it fixes it in the wrong way.
>
> I will continue to sit on the patch (potentially for years) as a
> reminder that the underlying issue remains unfixed.
>
>
> Someone please save me from this!
>
>
> From: Lamarque Vieira Souza <lamarque@gmail.com>
>
> Work around one problem with my Acer Bluetooth Optical Rechargeable Mouse
> where the cursor gets stuck at screen's upper-left corner.
>
> Even my notebook's touchpad is not able to move cursor when the bluetooth
> mouse is connected to my Acer Ferrari 4005 notebook.
>
> Using input session instead of hid session solves this problem although
> the cursor still moves a little sluggishly with the bluetooth mouse,
> cursor moves correctly using the touchpad.
>
> My bluetooth mouse used to work well (no sluggish) until kernel 2.6.21,
> since then the problems are getting worse with each kernel release (it got
> sluggish in 2.6.22 and this this upper-left corner problem appeared in
> 2.6.28 or 2.6.27).
>
> The patch adds a general quirk handling framework to the HIDP core and
> then uses this framework to implement a quirk for this device.
>
> [akpm@linux-foundation.org: use ARRAY_SIZE()-based search]
> Signed-off-by: Lamarque V. Souza <lamarque@gmail.com>
> Cc: Marcel Holtmann <marcel@holtmann.org>
> Cc: Dave Young <hidave.darkstar@gmail.com>
> Cc: Jiri Kosina <jkosina@suse.cz>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> net/bluetooth/hidp/core.c | 39 +++++++++++++++++++++++++++++++++++-
> 1 file changed, 38 insertions(+), 1 deletion(-)
>
> diff -puN
> net/bluetooth/hidp/core.c~bluetooth-fix-for-acer-bluetooth-optical-recharge
>able-mouse net/bluetooth/hidp/core.c ---
> a/net/bluetooth/hidp/core.c~bluetooth-fix-for-acer-bluetooth-optical-rechar
>geable-mouse +++ a/net/bluetooth/hidp/core.c
> @@ -73,6 +73,41 @@ static unsigned char hidp_keycode[256] =
>
> static unsigned char hidp_mkeyspat[] = { 0x01, 0x01, 0x01, 0x01, 0x01,
> 0x01 };
>
> +/* HIDP device quirks */
> +enum {
> + HIDP_QUIRK_USE_INPUT_SESSION
> +};
> +
> +struct quirk_id {
> + __u16 vendor;
> + __u16 product;
> + unsigned long quirks;
> +};
> +
> +static const struct quirk_id hidp_quirks[] = {
> + {
> + /* Lamarque: Acer Bluetooth Optical Rechargeable Mouse
> + * does not work properly with hid session since 2.6.27. */
> + .vendor = 0x0458,
> + .product = 0x0058,
> + .quirks = 1 << HIDP_QUIRK_USE_INPUT_SESSION
> + },
> +};
> +
> +static int quirk_test_bit(__u16 vendor, __u16 product, int quirk)
> +{
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(hidp_quirks); i++) {
> + const struct quirk_id *q = hidp_quirks + i;
> +
> + if (q->vendor == vendor && q->product == product)
> + return test_bit(quirk, &q->quirks);
> + }
> +
> + return 0;
> +}
> +
> static struct hidp_session *__hidp_get_session(bdaddr_t *bdaddr)
> {
> struct hidp_session *session;
> @@ -833,7 +868,9 @@ int hidp_add_connection(struct hidp_conn
> session->flags = req->flags & (1 << HIDP_BLUETOOTH_VENDOR_ID);
> session->idle_to = req->idle_to;
>
> - if (req->rd_size > 0) {
> + if (req->rd_size > 0 &&
> + !quirk_test_bit(req->vendor, req->product,
> + HIDP_QUIRK_USE_INPUT_SESSION)) {
> err = hidp_setup_hid(session, req);
> if (err && err != -ENODEV)
> goto err_skb;
> _
--
Lamarque V. Souza
http://www.geographicguide.com/brazil.htm
Linux User #57137 - http://counter.li.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch
2009-08-06 23:05 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Lamarque Vieira Souza
@ 2009-08-07 0:39 ` Marcel Holtmann
2009-08-07 1:09 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Lamarque Vieira Souza
0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2009-08-07 0:39 UTC (permalink / raw)
To: Lamarque Vieira Souza; +Cc: Andrew Morton, linux-bluetooth
Hi Lamarque,
first of all this is not a top-posting mailing list. Use proper quoting
like everybody else.
> Well, I need this patch or my bluetooth mouse is completly useless to me. If
> Marcel could show me how I can solve this problem in right way I can update
> the patch. As I said in another e-mail, I do not see anywhere else I can make
> the driver use input session instead of hid session beside hidp/core.c. I have
> tried to add a HID quirk in HID subsystem, but I have failed to find a place
> to change the input session types. Anyway, as far as I can see this is not a
> HID quirk, it is a quirk to avoid using HID session, so I do not see why I
> must use a HID quirk as Marcel suggested.
And second of all this should be solved via the HID subsystem. Since you
clearly have a problem with the HID mode of your mouse. You are just
hacking around the real issue. And I am not accepting this patch. Mail
your problem to the input mailing list:
HID CORE LAYER
M: Jiri Kosina <jkosina@suse.cz>
L: linux-input@vger.kernel.org
Regards
Marcel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch
2009-08-07 0:39 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Marcel Holtmann
@ 2009-08-07 1:09 ` Lamarque Vieira Souza
0 siblings, 0 replies; 5+ messages in thread
From: Lamarque Vieira Souza @ 2009-08-07 1:09 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: Andrew Morton, linux-bluetooth
Em Quinta-feira 06 Agosto 2009, Marcel Holtmann escreveu:
> Hi Lamarque,
Hi,
> first of all this is not a top-posting mailing list. Use proper quoting
> like everybody else.
Sorry for the long quoting.
> And second of all this should be solved via the HID subsystem. Since you
> clearly have a problem with the HID mode of your mouse. You are just
> hacking around the real issue. And I am not accepting this patch. Mail
> your problem to the input mailing list:
Ok, I will do it.
--
Lamarque V. Souza
http://www.geographicguide.com/brazil.htm
Linux User #57137 - http://counter.li.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch
2009-08-06 22:44 bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Andrew Morton
2009-08-06 23:05 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Lamarque Vieira Souza
@ 2009-08-07 1:53 ` Lamarque Vieira Souza
1 sibling, 0 replies; 5+ messages in thread
From: Lamarque Vieira Souza @ 2009-08-07 1:53 UTC (permalink / raw)
To: Andrew Morton, linux-bluetooth
Andrew,
I would like to thank you for your patience in helping me. In two years you
are the first person in linux-bluetooth mailing list that spent some time to
help me, I am your fan :-). Thank you again.
--
Lamarque V. Souza
http://www.geographicguide.com/brazil.htm
Linux User #57137 - http://counter.li.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-08-07 1:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-06 22:44 bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Andrew Morton
2009-08-06 23:05 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Lamarque Vieira Souza
2009-08-07 0:39 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Marcel Holtmann
2009-08-07 1:09 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Lamarque Vieira Souza
2009-08-07 1:53 ` bluetooth-fix-for-acer-bluetooth-optical-rechargeable-mouse.patch Lamarque Vieira Souza
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox