From owner-freebsd-current@FreeBSD.ORG Sun Jan 4 08:19:47 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA3FC16A4CE for ; Sun, 4 Jan 2004 08:19:47 -0800 (PST) Received: from astra.telenet-ops.be (astra.telenet-ops.be [195.130.132.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83D1243D3F for ; Sun, 4 Jan 2004 08:19:45 -0800 (PST) (envelope-from philip@paeps.cx) Received: from localhost (localhost.localdomain [127.0.0.1]) by astra.telenet-ops.be (Postfix) with SMTP id 6F72537F84 for ; Sun, 4 Jan 2004 17:19:44 +0100 (MET) Received: from erda.home.paeps.cx (D576865A.kabel.telenet.be [213.118.134.90]) by astra.telenet-ops.be (Postfix) with ESMTP id E60BB37F7D for ; Sun, 4 Jan 2004 17:19:43 +0100 (MET) Received: from loge.home.paeps.cx (loge.home.paeps.cx [10.0.0.4]) by erda.home.paeps.cx (Postfix) with ESMTP id AF14920A7 for ; Sun, 4 Jan 2004 17:19:43 +0100 (CET) Received: by loge.home.paeps.cx (Postfix, from userid 1001) id EC11D15; Sun, 4 Jan 2004 17:19:42 +0100 (CET) Date: Sun, 4 Jan 2004 17:19:42 +0100 From: Philip Paeps To: David Gilbert Message-ID: <20040104161942.GE3628@loge.home.paeps.cx> References: <16373.49080.401073.12711@canoe.dclg.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16373.49080.401073.12711@canoe.dclg.ca> X-Date-in-Rome: pridie Nonas Ianuarias MMDCCLVII ab Urbe Condida X-PGP-Fingerprint: FA74 3C27 91A6 79D5 F6D3 FC53 BF4B D0E6 049D B879 X-Message-Flag: Get a proper mailclient! Mutt: User-Agent: Mutt/1.5.5.1i cc: freebsd-current@freebsd.org Subject: Re: new psm patch. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jan 2004 16:19:47 -0000 On 2004-01-02 14:00:08 (-0500), David Gilbert wrote: > I was applying the psm patch posted here recently. Not the one that was for > the Xserver, but the one that was for the moused operation. It didn't apply > cleanly. Included is a patch that applies to current with the same effect. > I would like to see discussion towards including this in -CURRENT as > touchpad support is a hot laptop topic. Very nice :-) > As a note to the origional author, it seems that 'ipacket' is now referenced > by 'pb' rather than 'sc' in the driver. It looks like ipacket was a member > of the sc structure but now is a sub-member. Someone recently added some buffering code to psm, I updated my local patch, but hadn't had time to furture develop it. > + { MOUSE_MODEL_SYNAPTICS, /* Synaptics TouchPad */ > + 0xc0, MOUSE_PS2SYNAP_PACKETSIZE, enable_synaptics, }, This will catch every Synaptics pad on the market, not only the ones with the 'new' absolute packet format, and not all of them support all features :-/ In fact 'older' (not that old) pads will fail spectacularly on some features. > + /* Sanity check for out of sync packets. */ > + if ((pb->ipacket[0] & 0xc8) != 0x80 || (pb->ipacket[3] & 0xc8) != 0xc0) > + continue; There are some other formats of packets that need to be taken into account. I did a check for the different bits in my enable_synaptics function, and then did different sanity checks if different bits were available (following the 'interfacing guide' from Synaptics): /* New packet format with 'W'-bit */ if (sc->flags & PSM_SYN_HAVE_CAPEXT) { if ((pb->ipacket[0] & 0xc8) != 0x80) { printf("psmintr: wanted 0x80 got 0x%02x\n", (pb->ipacket[0] & 0xc8)); continue; } if ((pb->ipacket[3] & 0xc8) != 0xc0) { printf("psmintr: wanted 0xc0 got 0x%02x\n", (pb->ipacket[3] & 0xc8)); continue; } } /* New packet format without 'W'-bit */ else if (sc->flags & PSM_SYN_HAVE_NEWABS) { if ((pb->ipacket[0] & 0xc8) != 0x80) { printf("psmintr: wanted 0x80 got 0x%02x\n", (pb->ipacket[0] & 0xc8)); continue; } if ((pb->ipacket[3] & 0xc8) != 0xc0) { printf("psmintr: wanted 0xc0 got 0x%02x\n", (pb->ipacket[3] & 0xc8)); continue; } if ((pb->ipacket[0] & 0x0f) != (pb->ipacket[3] & 0x0f)) { printf("psmintr: wanted 0x%02x got 0x%02x\n", (pb->ipacket[0] & 0x0f), (pb->ipacket[3] & 0x0f)); continue; } } /* Old (<3.2) packet format */ else { if ((pb->ipacket[0] & 0xc0) != 0xc0) { printf("psmintr: wanted 0xc0 got 0x%02x\n", (pb->ipacket[0] & 0xc0)); continue; } if ((pb->ipacket[1] & 0x60) != 0x00) { printf("psmintr: wanted 0x00 got 0x%02x\n", (pb->ipacket[1] & 0x60)); continue; } if ((pb->ipacket[3] & 0xc0) != 0x80) { printf("psmintr: wanted 0x80 got 0x%02x\n", (pb->ipacket[3] & 0xc0)); continue; } if ((pb->ipacket[4] & 0x60) != 0x00) { printf("psmintr: wanted 0x00 got 0x%02x\n", (pb->ipacket[4] & 0x60)); continue; } } Or something along those lines. > +#define SYN_BIT_ABSOLUTE_MODE 0x80 > +#define SYN_BIT_HIGH_RATE 0x40 > +#define SYN_BIT_SLEEP_MODE 0x08 > +#define SYN_BIT_DISABLE_GESTURE 0x04 > +#define SYN_BIT_W_MODE 0x01 You could use those bits for the check. I'll go test your patch now, and fiddle with it a bit :-) Thanks :-) - Philip -- Philip Paeps Please don't CC me, I am subscribed to the list. BOFH Excuse #283: Lawn mower blade in your fan need sharpening