Skip to contentSkip to conversation

Fix ALPS sync loss

PATCH In review Dmitry Torokhov 4 participants 4 messages Feb 8, 2005 – Feb 10, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix ALPS sync loss

Hi,

Here is the promised patch. It turns out protocol validation code was a bit (or rather a byte ;) ) off.

Please let me know if it fixes your touchpad and I believe it would be nice to have it in 2.6.11.

Signature · 37 lines
Dmitry


===================================================================


[email protected], 2005-02-08 18:12:06-05:00, [email protected]
  Input: alps - fix protocol validation rules causing touchpad
         to lose sync if an absolute packet is received after
         a relative packet with negative Y displacement.
  
  Signed-off-by: Dmitry Torokhov <[email protected]>
  


 alps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


===================================================================



diff -Nru a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
--- a/drivers/input/mouse/alps.c	2005-02-08 18:16:27 -05:00
+++ b/drivers/input/mouse/alps.c	2005-02-08 18:16:27 -05:00
@@ -198,8 +198,8 @@
 		return PSMOUSE_BAD_DATA;
 
 	/* Bytes 2 - 6 should have 0 in the highest bit */
-	if (psmouse->pktcnt > 1 && psmouse->pktcnt <= 6 &&
-	    (psmouse->packet[psmouse->pktcnt] & 0x80))
+	if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= 6 &&
+	    (psmouse->packet[psmouse->pktcnt - 1] & 0x80))
 		return PSMOUSE_BAD_DATA;
 
 	if (psmouse->pktcnt == 6) {
#1 lore raw
Quoted 7 lines · Dmitry Torokhov

Hi,

Here is the promised patch. It turns out protocol validation code was a bit (or rather a byte ;) ) off.

Please let me know if it fixes your touchpad and I believe it would be nice to have it in 2.6.11.

Yes, I can't reproduce sync losses that were possible to create with simultaneous use of the pad anf the touchpoint. Patch applied.

Quoted 36 lines

===================================================================

[email protected], 2005-02-08 18:12:06-05:00, [email protected]
Input: alps - fix protocol validation rules causing touchpad
to lose sync if an absolute packet is received after a relative packet with negative Y displacement.

 alps.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

===================================================================

diff -Nru a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c

drivers/input/mouse/alps.c +2 -2
@@ -198,8 +198,8 @@
 		return PSMOUSE_BAD_DATA;
 
 	/* Bytes 2 - 6 should have 0 in the highest bit */
-	if (psmouse->pktcnt > 1 && psmouse->pktcnt <= 6 &&
-	    (psmouse->packet[psmouse->pktcnt] & 0x80))
+	if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= 6 &&
+	    (psmouse->packet[psmouse->pktcnt - 1] & 0x80))
 		return PSMOUSE_BAD_DATA;
 
 	if (psmouse->pktcnt == 6) {
Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#2 lore raw
In reply to Dmitry Torokhov
Quoted 6 lines

From Dmitry Torokhov on Tuesday, 08 February, 2005:
Hi,
Here is the promised patch. It turns out protocol validation code was a bit (or rather a byte ;) ) off.
Please let me know if it fixes your touchpad and I believe it would be nice to have it in 2.6.11.

This patch seems to be working for me too. Thanks a million, Dmitry!
I owe you a beer some time. :)

-Joseph

Quoted 24 lines

===================================================================
[email protected], 2005-02-08 18:12:06-05:00, [email protected]
Input: alps - fix protocol validation rules causing touchpad
to lose sync if an absolute packet is received after a relative packet with negative Y displacement.

alps.c | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)

===================================================================
diff -Nru a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c

drivers/input/mouse/alps.c +2 -2
@@ -198,8 +198,8 @@
 		return PSMOUSE_BAD_DATA;
 
 	/* Bytes 2 - 6 should have 0 in the highest bit */
-	if (psmouse->pktcnt > 1 && psmouse->pktcnt <= 6 &&
-	    (psmouse->packet[psmouse->pktcnt] & 0x80))
+	if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= 6 &&
+	    (psmouse->packet[psmouse->pktcnt - 1] & 0x80))
 		return PSMOUSE_BAD_DATA;
 
 	if (psmouse->pktcnt == 6) {
Signature · 2 lines
Joseph===============================================trelane@digitasaru.net
      Graduate Student in Physics, Freelance Free Software Developer
#3 lore raw
Quoted 10 lines · Joseph Pingenot

From Dmitry Torokhov on Tuesday, 08 February, 2005:

Quoted 5 lines

Hi,
Here is the promised patch. It turns out protocol validation code was a bit (or rather a byte ;) ) off.
Please let me know if it fixes your touchpad and I believe it would be nice to have it in 2.6.11.

This patch seems to be working for me too. Thanks a million, Dmitry!
I owe you a beer some time. :)

You are welcome. I am glad we got your touchpad going.

Signature · 1 line
Dmitry