Subject: kern/19085: Belkin hates me, PS/2 mouse protocol enhancement.
To: None <gnats-bugs@gnats.netbsd.org>
From: seebs <seebs@vash.cel.plethora.net>
List: netbsd-bugs
Date: 11/17/2002 01:28:15
	Note: There was a bad value `No.' for the field `>Confidential:'.
	It was set to the default value of `yes'.


>Number:         19085
>Category:       kern
>Synopsis:       Belkin switchboxes bust PS/2 mouse probe
>Confidential:   yes
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 16 23:28:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     seebs
>Release:        NetBSD 1.6K
>Organization:
>Environment:
System: NetBSD vash.cel.plethora.net 1.6K NetBSD 1.6K (VASH) #0: Mon Nov 11 13:27:55 MST 2002 seebs@vash.cel.plethora.net:/usr/src/sys/arch/i386/compile/VASH i386
Architecture: i386
Machine: i386
>Description:
	For some reason, my Belkin console switch tends to lose the use of
	my mouse, until something is done to "reset" it.  Once this is done,
	it always sets the mouse in "normal" PS/2 mode... Until I reboot.

	It appears that, if I reprobe the mouse, I might succeed at detecting
	the scroll-wheel, except that the current logic trying to *preserve*
	the correct mouse protocol kicks in and retries until it gets the
	"simple" protocol.

>How-To-Repeat:
	Get an annoying Belkin switchbox.

>Fix:
	This fix makes the pms driver accept a "more advanced" protocol if
	one is offered, so, if you think you have a scroll mouse, and get a
	non-scroll protocol, you recheck, but if you think you have a plain
	mouse, and get a scroll protocol, you accept it.  This should always
	be safe...?

Index: pms.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pckbc/pms.c,v
retrieving revision 1.12
diff -c -r1.12 pms.c
*** pms.c	2002/10/02 16:52:04	1.12
--- pms.c	2002/11/17 07:24:51
***************
*** 455,461 ****
  			    res));
  		sc->protocol = PMS_UNKNOWN;
  		pms_enable(sc);
! 		if (sc->protocol != save_protocol) {
  #if defined(PMSDEBUG) || defined(DIAGNOSTIC)
  			printf("%s: protocol change, sleeping and retrying\n",
  			    sc->sc_dev.dv_xname);
--- 455,461 ----
  			    res));
  		sc->protocol = PMS_UNKNOWN;
  		pms_enable(sc);
! 		if (sc->protocol < save_protocol) {
  #if defined(PMSDEBUG) || defined(DIAGNOSTIC)
  			printf("%s: protocol change, sleeping and retrying\n",
  			    sc->sc_dev.dv_xname);
>Release-Note:
>Audit-Trail:
>Unformatted: