From stephen@cauchy.math.missouri.edu  Tue Aug  1 17:30:45 2000
Return-Path: <stephen@cauchy.math.missouri.edu>
Received: from cauchy.math.missouri.edu (cauchy.math.missouri.edu [128.206.49.166])
	by hub.freebsd.org (Postfix) with ESMTP id 7229E37BF88
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  1 Aug 2000 17:30:43 -0700 (PDT)
	(envelope-from stephen@cauchy.math.missouri.edu)
Received: (from stephen@localhost)
	by cauchy.math.missouri.edu (8.9.3/8.9.1) id TAA34138;
	Tue, 1 Aug 2000 19:30:41 -0500 (CDT)
Message-Id: <200008020030.TAA34138@cauchy.math.missouri.edu>
Date: Tue, 1 Aug 2000 19:30:41 -0500 (CDT)
From: Stephen Montgomery-Smith <stephen@cauchy.math.missouri.edu>
Reply-To: stephen@math.missouri.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: Configuring a synaptics touchpad
X-Send-Pr-Version: 3.2

>Number:         20352
>Category:       kern
>Synopsis:       Configuring a synaptics touchpad
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yokota
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          wish
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 01 17:40:01 PDT 2000
>Closed-Date:    Thu Aug 26 03:32:50 GMT 2004
>Last-Modified:  Thu Aug 26 03:32:50 GMT 2004
>Originator:     Stephen Montgomery-Smith
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
University of Missouri
>Environment:

Trying to configure a synaptics touchpad so that for example
tapping the pad is not the same as a mouse button press.

>Description:

I have a laptop with a synaptics touchpad.  I dislike the
fact that tapping the mousepad is like pressing a mouse button.

So I attempted to port the program tpconfig available at
http://www.compass.com/synaptics/

It seems to require a device that is the raw mouse, which as far
as I can figure is not available on FreeBSD (it uses /dev/psaux
on Linux).

>How-To-Repeat:

>Fix:

I was able to provide a new ioctl for the psm device that was
sufficient to get tpconfig to work.  Lets face it, I didn't
know what I was doing - I just ramaged around the code and
scrounged something together.  But it really seems to serve
my purposes.

Maybe it could be done better.  Or maybe other people just
don't care for it - I put a feeler out on freebsd-mobile and
noone else seemed to care.

Or maybe there is something already there that will do what
I want.

But if you should choose to add something like this to the
kernel, I will port tpconfig to the ports collection.

Here is what I did:


--- sys-orig/i386/include/mouse.h	Fri Jul 28 20:12:17 2000
+++ sys/i386/include/mouse.h	Mon Jul 31 02:28:35 2000
@@ -40,6 +40,7 @@
 #define MOUSE_SETVARS		_IOW('M', 7, mousevar_t)
 #define MOUSE_READSTATE		_IOWR('M', 8, mousedata_t)
 #define MOUSE_READDATA		_IOWR('M', 9, mousedata_t)
+#define MOUSE_SENDREADCMD	_IOWR('M', 14, mousedata_t)
 
 #if notyet
 #define MOUSE_SETRESOLUTION	_IOW('M', 10, int)



--- sys-orig/isa/psm.c	Mon Jul 31 12:10:50 2000
+++ sys/isa/psm.c	Tue Aug  1 19:18:49 2000
@@ -1546,6 +1546,32 @@
     /* Perform IOCTL command */
     switch (cmd) {
 
+    case MOUSE_SENDREADCMD:
+	data = (mousedata_t *)addr;
+	if (data->len > sizeof(data->buf)/sizeof(data->buf[0]))
+	    return EINVAL;
+
+	error = block_mouse_data(sc, &command_byte);
+	if (error) 
+            return error;
+	for (s=0; s<data->len && !error; s++) {
+            if ((send_aux_command(sc->kbdc, data->buf[s])) != PSM_ACK)
+        	error = EIO;
+	}
+	if (!error) {
+    	    for (s = 0; s < sizeof(data->buf)/sizeof(data->buf[0]); s++) {
+        	data->buf[s] = read_aux_data(sc->kbdc);
+		if (data->buf[s] < 0)
+	    	    break;
+	    }
+	    if (s==sizeof(data->buf)/sizeof(data->buf[0]))
+		error = EIO;
+	    else
+		data->len=s;
+	}
+	unblock_mouse_data(sc, command_byte);
+	break;
+
     case OLD_MOUSE_GETHWINFO:
 	s = spltty();
         ((old_mousehw_t *)addr)->buttons = sc->hw.buttons;



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->yokota 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Wed Aug 2 01:18:27 PDT 2000 
Responsible-Changed-Why:  
Over to Syscons-san. :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20352 

From: Stephen Montgomery-Smith <stephen@math.missouri.edu>
To: freebsd-gnats-submit@FreeBSD.org, stephen@math.missouri.edu
Cc:  
Subject: Re: kern/20352: Configuring a synaptics touchpad
Date: Sun, 24 Sep 2000 12:23:58 -0500

 I have now made the port for the program tpconfig that uses this
 PR.  Look at
 http://www.freebsd.org/cgi/query-pr.cgi?pr=21520
 
 Stephen Montgomery-Smith
 

From: Stephen Montgomery-Smith <stephen@math.missouri.edu>
To: freebsd-gnats-submit@FreeBSD.org, stephen@math.missouri.edu
Cc:  
Subject: Re: kern/20352: Configuring a synaptics touchpad
Date: Fri, 12 Jan 2001 21:44:35 -0600

 The PR http://www.freebsd.org/cgi/query-pr.cgi?pr=21520
 is out of date (because noone has looked at it, and it
 was quite a time ago).  Now there is a new port submitted
 for tpconfig at
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=24299
 
 -- 
 Stephen Montgomery-Smith
 stephen@math.missouri.edu
 http://www.math.missouri.edu/~stephen
 

From: "Belan, Nicolas" <Nicolas.Belan@eads-telecom.com>
To: freebsd-gnats-submit@FreeBSD.org, stephen@math.missouri.edu
Cc:  
Subject: Re: kern/20352: Configuring a synaptics touchpad
Date: Wed, 03 Sep 2003 17:55:53 +0200

 Hi,
 
 I have just tried this patch on a FreeBSD-5.1-RELEASE version (because 
 my touchpad was not working).
 
 It works almost fine , except that you should also replace (for the 5.1 
 version) /usr/include/sys/mouse.h to handle the
 new ioctl !
 
 My touchpad (FYI) is used via is a Gericom Siver Seraph XL ...
 
 BUT, (there is always a BUT), if I plug an external PS/2 mouse onto my 
 notebook (rear PS/2 - keyboard),
 the mouse is still "crazy" ...
 
 I use the PR 24299 (modifying include of mouse.h of tpconfig.c) to make 
 my touchpad working properly ...
 
 Thanks for you work ! (and if you have any idea for my external mouse  
 ?! ...)
 
 Nicolas Belan

From: Mark Linimon <linimon@lonesome.com>
To: freebsd-gnats-submit@FreeBSD.org, stephen@math.missouri.edu
Cc:  
Subject: Re: kern/20352: Configuring a synaptics touchpad
Date: Mon, 10 Nov 2003 02:56:51 +0000

 Was there ever any action taken on this PR?  The ports PR
 that depends on it now has the dubious honor of being the
 oldest "new port" PR in GNATS.
 
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Thu Aug 26 03:31:58 GMT 2004 
State-Changed-Why:  
A rework of the code for Synaptics touchpads was committed within 
the last month or two and probably obsoletes this (antique) PR. 
However, thanks for the submission. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20352 
>Unformatted:
 Stephen Montgomery-Smith
