Skip to contentSkip to conversation

Fix ALPS sync loss

PATCH Pete Zaitcev 1 participant 1 message Feb 10, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Review line 203

Quoted 13 lines · Dmitry Torokhov

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

+++ b/drivers/input/mouse/alps.c 2005-02-08 18:16:27 -05:00

(quoted diff) +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;

This seems to work here, no more dead pad.

-- Pete