Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Nov 1996 08:24:46 -0500
From:      "Louis A. Mamakos" <louie@TransSys.COM>
To:        Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
Cc:        sos@freebsd.org, nate@mt.sri.com, current@freebsd.org
Subject:   Re: FreeBSD-3.0-current PS/2 mouse driver change 
Message-ID:  <199611301324.IAA23225@whizzo.transsys.com>
In-Reply-To: Your message of "Fri, 29 Nov 1996 17:23:09 %2B0900." <199611290823.RAA23794@zodiac.mech.utsunomiya-u.ac.jp> 
References:  <199611270804.JAA00372@ravenock.cybercity.dk>  <199611271331.IAA01084@whizzo.transsys.com> <199611272318.IAA09541@zodiac.mech.utsunomiya-u.ac.jp> <199611280420.XAA08667@whizzo.transsys.com> <199611290823.RAA23794@zodiac.mech.utsunomiya-u.ac.jp>

next in thread | previous in thread | raw e-mail | index | archive | help

> 
> I intended to put a code, for debugging purpose, to log the
> synchronization problem when it is detected by checking that bit, so
> that we can know the mouse interrupt may or may not be lost under
> certain conditions. 

Sounds good to me.

> As I have written, I will turn off the bit checking by default in the
> next set of patches to the `psm' driver.  But, I may leave the bit
> checking and out-of-sync logging code in the driver as a
> configuration/debugging option. Will this be reasonable?

This sounds like a good idea, though it only fixes half of the problem
for me with the Alps Glidepoint.  

The problem is that the new driver seems to parse the serial data from
the mouse using a little state machine in psmintr(), and when a
complete sequence is recevied, queues a mouse event with a virtualized
state of the mouse buttons as translated from the butmap[] array.

Then, later, in psmread(), a mouse event is dequeued and then it's
de-virtualized back to a PS/2 mouse format by mkps2() before being
returned to the user via the uiomove().

Since there is no virtual representation for the "tap" gesture of the
glidepoint, it gets lost in the virtualization/de-virtualization step.
On the Glidepoint pointing device, the tap gesture is indicated by
having the normally always "1" bit in the first byte of the mouse
message be set to 0.  This is the same bit (MOUSE_PS2_SYNC) which is
used as the synchronization marker.

The kludge that I came up with was this code:

            if ((sc->ipacket[0] & MOUSE_PS2_SYNC) == 0) {
                sc->button |= BUT1STAT;
                ms->button |= BUT1STAT;
            }

near the end of psmintr() to set assert button 1 depressed when the
tap gesture is indicated.  This is essentially the change that I made
to /usr/sbin/moused (and before that, in the X server).

This would seem to encode too much "policy" into the kernel driver.
The new XFree86 release claim support of the glidepoint and causes the
"tap" gesture to be noted as logical 4th button.  It's then an
excercise for the student to figure out how to do something useful
with it :-)

It feels like the changes in psm.c are to support some future
architecture where there is a generic mouse interface to applications,
with the kernel drivers handling the decoding of the mouse data
stream.  Personally, I think that's putting too much code in a kernel
device driver, given that the moused based solution works really well
and is easier to change with less dangerous consequences.

Anyway, that's my two cents.

louie






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611301324.IAA23225>