From owner-freebsd-current@FreeBSD.ORG Thu Aug 5 00:57:21 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 3D30A16A4CF; Thu, 5 Aug 2004 00:57:21 +0000 (GMT) Received: from coruscant.rfc1149.org (coruscant.rfc1149.org [217.160.130.147]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6438443D49; Thu, 5 Aug 2004 00:57:20 +0000 (GMT) (envelope-from schwabe@uni-paderborn.de) Received: by coruscant.rfc1149.org (Postfix, from userid 110) id 357203D2C; Thu, 5 Aug 2004 02:57:18 +0200 (CEST) Received: from kamino.rfc1149.org (dsl-213-023-208-247.arcor-ip.net [213.23.208.247]) by coruscant.rfc1149.org (Postfix) with ESMTP id 2A3D73D15; Thu, 5 Aug 2004 02:57:13 +0200 (CEST) Received: by kamino.rfc1149.org (Postfix, from userid 1001) id 317084088; Thu, 5 Aug 2004 02:57:09 +0200 (CEST) To: David Wolfskill From: Arne Schwabe In-Reply-To: <200408042100.i74L0PiQ056577@bunrab.catwhisker.org> (David Wolfskill's message of "Wed, 4 Aug 2004 14:00:25 -0700 (PDT)") References: <200408042100.i74L0PiQ056577@bunrab.catwhisker.org> Date: Thu, 05 Aug 2004 02:57:09 +0200 Message-ID: <867jseieqi.fsf@kamino.rfc1149.org> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on coruscant.rfc1149.org X-Spam-Status: No, hits=-4.1 required=5.0 tests=BAYES_00,RCVD_IN_DSBL, RCVD_IN_SORBS autolearn=no version=2.60 X-Spam-Level: X-Mailman-Approved-At: Thu, 05 Aug 2004 13:47:15 +0000 cc: njl@freebsd.org cc: current@freebsd.org Subject: Re: Challenge getting touchpad to work since src/sys/isa/psm.c 1.71 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: Thu, 05 Aug 2004 00:57:21 -0000 David Wolfskill writes: > Sorry about the delay; right around the time of the commit, I was having > some thermal issues with my laptop (a Dell Inspiron 5000e). I believe > those are fixed now -- it's gone through 5 days, each of which has > involved a "buildworld cycle" for each of -STABLE & -CURRENT, without > incident. > > But I'm now having trouble getting a "touchpad tap" to be recognized as > a press/release of a mouse button in -CURRENT; I believe that the recent > commit to src/sys/isa/psm.c 1.71 is involved. > > I normally run in -STABLE (booted from slice 1), and access the mouse > via moused; the resulting command line is > > /usr/sbin/moused -3 -p /dev/psm0 -t auto > > Thus, in -STABLE, tapping the touchpad is equivalent to a press/release > of the left mouse button (button 1); press/release for the right button > is button 3, and both the left & right button "chorded" are used to > simulate the middle button (button 2). > > Until the above-cited commit, this was also the case in -CURRENT. > > In an attempt to discover a bit more, I fired up moused without the -3 > flag, but with the -f ("foreground") and -d ("debug") flags, so I could > see what the packets were when each event occurred. I see some > differences between any two of them, but I'm managing to fail to see how > those differences map to src/sys/sys/mouse.h's assignments. > > Event First generated packet (hex) > Press/release left button 83 00 00 00 00 00 00 7f > Press/release right button 86 00 00 00 00 00 00 7f > Press/release both buttons 82 00 00 00 00 00 00 7f > Touchpad tap 87 00 00 00 00 00 00 7f > > That leftmost byte is to be mapped by src/sys/sys/mouse.h thus: > > /* button */ > #define MOUSE_BUTTON1DOWN 0x0001 /* left */ > #define MOUSE_BUTTON2DOWN 0x0002 /* middle */ > #define MOUSE_BUTTON3DOWN 0x0004 /* right */ > #define MOUSE_BUTTON4DOWN 0x0008 > #define MOUSE_BUTTON5DOWN 0x0010 > #define MOUSE_BUTTON6DOWN 0x0020 > #define MOUSE_BUTTON7DOWN 0x0040 > #define MOUSE_BUTTON8DOWN 0x0080 > #define MOUSE_MAXBUTTON 31 > #define MOUSE_STDBUTTONS 0x0007 /* buttons 1-3 */ > #define MOUSE_EXTBUTTONS 0x7ffffff8 /* the others (28 of them!) */ > #define MOUSE_BUTTONS (MOUSE_STDBUTTONS | MOUSE_EXTBUTTONS) > > > which seems a little confusing: moused is apparently reporting the > touchpad tap as all 3 buttons being down. > > Perhaps a bit stranger, the device is now probed as having 3 buttons, > vs. the 2 that are seen in -STABLE or that were seen in -CURRENT prior > to the commit. > > Here's a cut/paste of the probe messages from recent -CURRENT, with > PSM_DEBUG=1: > > Aug 4 11:22:31 localhost kernel: psm0: unable to allocate IRQ > Aug 4 11:22:31 localhost kernel: psmcpnp0 irq 12 on acpi0 > Aug 4 11:22:31 localhost kernel: psm0: current command byte:0047 > Aug 4 11:22:31 localhost kernel: Synaptics Touchpad: > Aug 4 11:22:31 localhost kernel: Version: 4.3 > Aug 4 11:22:31 localhost kernel: Model id: 88 58 a1 > Aug 4 11:22:31 localhost kernel: infoRot180: 1 > Aug 4 11:22:31 localhost kernel: infoPortrait: 0 > Aug 4 11:22:31 localhost kernel: infoSensor: 8 > Aug 4 11:22:31 localhost kernel: infoHardware: 44 > Aug 4 11:22:31 localhost kernel: infoNewAbs: 1 > Aug 4 11:22:31 localhost kernel: capPen: 0 > Aug 4 11:22:31 localhost kernel: infoSimplC: 1 > Aug 4 11:22:31 localhost kernel: infoGeometry: 1 > Aug 4 11:22:31 localhost kernel: Capability Bytes: 55 47 55 > Aug 4 11:22:31 localhost kernel: Mode byte set by BIOS: 41 > Aug 4 11:22:31 localhost kernel: psm0: found Synaptics Touchpad > Aug 4 11:22:31 localhost kernel: psm0: irq 12 on atkbdc0 > Aug 4 11:22:31 localhost kernel: psm0: [GIANT-LOCKED] > Aug 4 11:22:31 localhost kernel: psm0: model Synaptics Touchpad, device ID 0-00, 3 buttons > Aug 4 11:22:31 localhost kernel: psm0: config:00000000, flags:00000000, packet size:6 > Aug 4 11:22:31 localhost kernel: psm0: syncmask:c0, syncbits:80 > > > Anyone have clues? I'm not married to the idea of using moused. I > tried running X without moused (telling X to access the mouse directly), > and I managed to get the same behavior. > If you only use X you could use synaptics xfree driver that has its parsing of the touchpad codes, you have to change in freebsd_mouse.h the sysctl definition to match /usr/include/sys/mouse.h. iirc after that: gmake synaptics_drv.o cp synaptics_drv.o /usr/X11R6/lib/X11/modules (I am not sure about the X11 Path) Otherwise you could simply change the line in /sys/isa/psm.c /* If it is a Synaptics, byte 2 is 0x47. */ if (status[1] != 0x47) return (FALSE); to something like !=0x666; so that the synaptics touchpad is recognized as a touchpad. (Behavior like before the patch) When I have time again I will look over the psm synaptics parsing to make it better. Arne