NetBSD Problem Report #42111

From www@NetBSD.org  Tue Sep 22 17:19:02 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id E494F63C072
	for <gnats-bugs@gnats.netbsd.org>; Tue, 22 Sep 2009 17:19:02 +0000 (UTC)
Message-Id: <20090922171902.9334363B850@www.NetBSD.org>
Date: Tue, 22 Sep 2009 17:19:02 +0000 (UTC)
From: djb.netbsd@gmail.com
Reply-To: djb.netbsd@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Old Compaq Presario: Synaptics touchpad doesn't work
X-Send-Pr-Version: www-1.0

>Number:         42111
>Category:       kern
>Synopsis:       Old Compaq Presario: Synaptics touchpad doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 22 17:20:00 +0000 2009
>Originator:     Dave J. Barnes
>Release:        NetBSD 5.0.1
>Organization:
Eng Consultant
>Environment:
NetBSD djb-cp 5.0.1 NetBSD 5.0.1 (GENERIC) #0: Thu Jul 30 01:39:11 UTC 2009  builds@b8.netbsd.org:/home/builds/ab/netbsd-5-0-1-RELEASE/i386/200907292356Z-obj/home/builds/ab/netbsd-5-0-1-RELEASE/src/sys/arch/i386/compile/GENERIC i386

>Description:
Compaq Presario 1692 (and possibly others) - Synaptics touchpad doesn't work.

Debugging showed that byte 0 and byte 3 were incorrect.  Aditional testing shopwed that the keyboard controller was tampering with bit 3 and bit 6 of byte 0 and byte 3.  The "Synaptics Touchpad Interfacing Guide", second edition, page 45, warns that the keyboard controller may tamper with bit 3.  It appears that the keyboard controller in the Compaq Presario 1692 (and probably others as well) tampers with bit 6 too.

The following tests on the data packet in dev/pckbport/synaptics.c are affected:

		if ((data & 0xc8) != 0x80) {
		if ((data & 8) == 8) {

		if ((psc->packet[0] & 0xfc) == 0x84 &&
		    (psc->packet[3] & 0xcc) == 0xc4) {




>How-To-Repeat:
GENERIC kernel doesn't work.
>Fix:
Fix the tests to ignore bit 3 and bit 6. Side effect would be that the
test for syncing up with the touchpad protocol are not as robust.

-----------------------------
--- dev/pckbport/synaptics.c.orig	2009-09-22 11:44:42.000000000 -0500
+++ dev/pckbport/synaptics.c	2009-09-22 11:55:19.000000000 -0500
@@ -771,7 +771,8 @@

 	switch (psc->inputstate) {
 	case 0:
-		if ((data & 0xc8) != 0x80) {
+/* Can't depend on the state of bit 3 in message. Bit 6 should be 0 here. */
+		if ((data & 0xc0) != 0x80) {
 #ifdef SYNAPTICSDEBUG
 			aprint_normal_dev(psc->sc_dev,
 			    "pms_input: 0x%02x out of sync\n", data);
@@ -781,7 +782,11 @@
 		/*FALLTHROUGH*/

 	case 3:
-		if ((data & 8) == 8) {
+/* 
+ *  Can't depend on the state of bit 3.  While bit 6 should be 1 here some keyboard controllers edit
+ *   bit 6 to 0. 
+ */
+		if ((data & 0x80) != 0x80) {
 #ifdef SYNAPTICSDEBUG
 			aprint_normal_dev(psc->sc_dev,
 			    "pms_input: 0x%02x dropped in relative mode, reset\n", data);
@@ -801,8 +806,9 @@
 		 */
 		psc->inputstate = 0;

-		if ((psc->packet[0] & 0xfc) == 0x84 &&
-		    (psc->packet[3] & 0xcc) == 0xc4) {
+/* Can't depend on the state of bit 3 or bit 6 here either. */
+		if ((psc->packet[0] & 0xb4) == 0x84 &&
+		    (psc->packet[3] & 0x44) == 0x44) {
 			/* PS/2 passthrough */
 			pms_synaptics_passthrough(psc);
 		} else {

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.