Subject: kern/3684: ps/2 mouse disconnect/reconnect and GlidePoint tapping support
To: None <gnats-bugs@gnats.netbsd.org>
From: None <koji@math.human.nagoya-u.ac.jp>
List: netbsd-bugs
Date: 05/30/1997 03:12:12
>Number:         3684
>Category:       kern
>Synopsis:       ps/2 mouse disconnect/reconnect and GlidePoint tapping support
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu May 29 14:35:01 1997
>Last-Modified:
>Originator:     Koji Imada - je4owb/2
>Organization:
Mathematics Group of Graduate School of Human
	Infomatics, Nagoya University, Japan.
>Release:        970523
>Environment:
	
System: NetBSD bimota 1.2E NetBSD 1.2E (BIMOTA) #30: Tue May 13 23:32:51 JST 1997 koji@ducati:/mnt2/NetBSD/work/src-ufs-mod/sys/arch/i386/compile/BIMOTA i386


>Description:
	In current implementation, I can`t disconnect and recoonect
	ps/2 mouse during opening pms*. So I must restart X to use it
	again onse disconnected.

	And GlidePoint tapping feature is not supported in current
	implementation.

	I have modified pms driver for these problem on NetBSD/i386.
>How-To-Repeat:
	First, use ps/2 mouse and start X, then disconnect ps/2 mouse.

	Just move mouse, but your pointer never moves.
>Fix:
q
	Apply following patch

Index: sys/arch/i386/isa/pms.c
===================================================================
RCS file: /mnt2/NetBSD/cvsroot/netbsd/sys/arch/i386/isa/pms.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- pms.c	1997/04/01 07:22:29	1.1.1.2
+++ pms.c	1997/05/29 18:02:00	1.2
@@ -390,6 +390,7 @@
 #define PS2LBUTMASK 0x01
 #define PS2RBUTMASK 0x02
 #define PS2MBUTMASK 0x04
+#define PS2BUTMASK 0x0f
 
 int
 pmsintr(arg)
@@ -412,6 +413,16 @@
 
 	case 0:
 		buttons = inb(PMS_DATA);
+		/* Re-enable if mouse is disconnected and reconnected. */
+		if (buttons == 0xaa) {
+			pms_dev_cmd(PMS_DEV_ENABLE);
+			break;
+		}
+
+		/* For GlidePoint tapping feature. treat as LBUTTON */
+		if ((buttons & PS2BUTMASK) == 0)
+			buttons |= PS2LBUTMASK;
+
 		if ((buttons & 0xc0) == 0)
 			++state;
 		break;

>Audit-Trail:
>Unformatted: