Subject: PS/2 driver fix
To: None <port-i386@netbsd.org>
From: Peter Seebach <seebs@plethora.net>
List: port-i386
Date: 03/08/2002 14:41:27
I have a new version of psm.c with the following qualities:

1.  Works with scroll mice.
2.  Supports 5-button mice.
3.  If you change protocols, or miss part of a packet, it seems to recover
after a few tries.  It tries rotating through protocols.  If the mouse got
reset to non-scroll behavior, the scroll wheel won't come back.

I have plans to try to fix the last bug, but this is tricky, because this
basically requires me to redo the *entire* negotiation sequence (figure
about 15-20 commands, with responses), and the only remotely plausible
suggestion I've seen has been to build a giant state machine in the interrupt
handler - which sounds awful to me.

In an ideal world, I would find a hook to let me tell the kernel to, when it
gets a moment, re-do the mouse's "attach" routine, in some way, but I don't
know what the mechanism would be.

For those looking at the code, where I'm bumping sc->protocol, we'd need to
call do_enable(); I think that's it.

Current source (built from yesterday's -current and a bunch of hacking) is
at
	http://guild.plethora.net/~seebs/psm.c

I would welcome feedback or suggestions.  If I can debug this, or convince
myself that the bug can't be fixed, I'll send-pr it.

-s