From owner-freebsd-bugs@FreeBSD.ORG Thu Oct 1 08:10:01 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54AA1065672 for ; Thu, 1 Oct 2009 08:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B13E18FC21 for ; Thu, 1 Oct 2009 08:10:01 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n918A1E4049813 for ; Thu, 1 Oct 2009 08:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n918A1Sg049812; Thu, 1 Oct 2009 08:10:01 GMT (envelope-from gnats) Resent-Date: Thu, 1 Oct 2009 08:10:01 GMT Resent-Message-Id: <200910010810.n918A1Sg049812@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, David Horn Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35ECC106568D for ; Thu, 1 Oct 2009 08:07:23 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 234AF8FC15 for ; Thu, 1 Oct 2009 08:07:23 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n9187MAe032355 for ; Thu, 1 Oct 2009 08:07:22 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n9187MK7032354; Thu, 1 Oct 2009 08:07:22 GMT (envelope-from nobody) Message-Id: <200910010807.n9187MK7032354@www.freebsd.org> Date: Thu, 1 Oct 2009 08:07:22 GMT From: David Horn To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/139272: [patch] [psm] disable synaptics mouse taps X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2009 08:10:01 -0000 >Number: 139272 >Category: kern >Synopsis: [patch] [psm] disable synaptics mouse taps >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Oct 01 08:10:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: David Horn >Release: 8.0 RC r197621 >Organization: >Environment: FreeBSD xxxxxxx 8.0-RC1 FreeBSD 8.0-RC1 #21 r197621M: Thu Oct 1 02:39:15 EDT 2009 dhorn@xxxxxxxxxxxx:/usr/obj/usr/src/sys/GENERIC amd64 >Description: The attached patch adds support for disabling or enabling mouse taps on synaptics touch pads (when running in generic mouse mode) using a loader tunable. On my particular machine, disabling mouse taps is required since the location of the touchpad makes accidental touches of the mouse pad inevitable. >How-To-Repeat: >Fix: See patch Patch attached with submission follows: Index: share/man/man4/psm.4 =================================================================== --- share/man/man4/psm.4 (revision 197621) +++ share/man/man4/psm.4 (working copy) @@ -359,6 +359,33 @@ This will enable .Nm to handle packets from guest devices (sticks) and extra buttons. + +If you wish to disable Synaptics touchpad tap events (mouse taps), +set +.Va hw.psm.force_tap_events +to +.Em 2 +at boot time. This only affects Generic +.Nm +mouse support +(i.e. not when Extended Synaptics support is enabled) + +Boot-time +.Nm +device debugging is available using the +.Va debug.psm.loglevel +tunable. + +These tunables can be set in /boot/loader.conf as /etc/sysctl.conf +executes too late in the boot process. (e.g. hw.psm.force_tap_events="2") +.Sh SYSCTL VARIABLES +Once Extended Synaptics support is enabled, many additional sysctl variables +become available to customize the behavior of the touchpad. See sysctl -d +.Va hw.psm +after booting with Extended support enabled. +Debug logging can be controlled using the +.Va debug.psm.loglevel +knob. .Sh IOCTLS There are a few .Xr ioctl 2 Index: sys/dev/atkbdc/psm.c =================================================================== --- sys/dev/atkbdc/psm.c (revision 197621) +++ sys/dev/atkbdc/psm.c (working copy) @@ -346,6 +346,9 @@ static int synaptics_support = 0; TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support); +static int force_tap_events = 0; +TUNABLE_INT("hw.psm.force_tap_events", &force_tap_events); + static int verbose = PSM_DEBUG; TUNABLE_INT("debug.psm.loglevel", &verbose); @@ -509,10 +512,24 @@ enable_aux_dev(KBDC kbdc) { int res; - + int cval = 0x00; + res = send_aux_command(kbdc, PSMC_ENABLE_DEV); VLOG(2, (LOG_DEBUG, "psm: ENABLE_DEV return code:%04x\n", res)); - + + /* and set synaptics touchpad tap mode only if tunable is set + - value of 1 will force tap events + - value of 2 will force no tap events + - value of 0 will not change currect state + This only works under standard mouse emulation mode, + ignored in enhanced synaptics mode */ + if (force_tap_events > 0) { + if (force_tap_events == 2) + cval |= 0x04; + mouse_ext_command(kbdc, cval); + set_mouse_sampling_rate(kbdc, 20); + VLOG(2, (LOG_DEBUG, "psm: set force_tap_events command byte value to:%02x \n", cval)); + } return (res == PSM_ACK); } @@ -2267,6 +2284,8 @@ static int tap_timeout = PSM_TAP_TIMEOUT; SYSCTL_INT(_hw_psm, OID_AUTO, tap_timeout, CTLFLAG_RW, &tap_timeout, 0, "Tap timeout for touchpads"); +SYSCTL_INT(_hw_psm, OID_AUTO, force_tap_events, CTLFLAG_RW, &force_tap_events, 0, + "Force tap events 0=no change 1=force events on 2=force events off"); static void psmintr(void *arg) >Release-Note: >Audit-Trail: >Unformatted: