diff options
author | markm <markm@FreeBSD.org> | 2004-04-04 16:36:21 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2004-04-04 16:36:21 +0000 |
commit | 6a02d57aea73979b311c1c5b5d59bd5cfe799ad9 (patch) | |
tree | 4951fae855ead6c8f4710eb2cb1cfad7fd8d1e66 /sys/isa | |
parent | f6791efebc55c33e3205742878dd6de8aa754dfb (diff) | |
download | FreeBSD-src-6a02d57aea73979b311c1c5b5d59bd5cfe799ad9.zip FreeBSD-src-6a02d57aea73979b311c1c5b5d59bd5cfe799ad9.tar.gz |
Put a bunch of output that us really only useful in a debug
scenario into #ifdef DEBUG. This makes my cluster with Belkin
KVM switch completely usable, even if the KVM switch and mouse
get a bit confused sometimes.
Without this, when the mouse gets confused, all sorts of crud
gets spammed all over the screen. With this, the mouse may appear
dead for a second or three, but it recovers silently.
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/psm.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/isa/psm.c b/sys/isa/psm.c index a414ba6..f5df88f 100644 --- a/sys/isa/psm.c +++ b/sys/isa/psm.c @@ -2033,7 +2033,9 @@ psmintr(void *arg) getmicrouptime(&now); if ((pb->inputbytes > 0) && timevalcmp(&now, &sc->inputtimeout, >)) { +#if DEBUG log(LOG_DEBUG, "psmintr: delay too long; resetting byte count\n"); +#endif pb->inputbytes = 0; sc->syncerrors = 0; } @@ -2045,7 +2047,7 @@ psmintr(void *arg) if (pb->inputbytes < sc->mode.packetsize) continue; -#if 0 +#if DEBUG log(LOG_DEBUG, "psmintr: %02x %02x %02x %02x %02x %02x\n", pb->ipacket[0], pb->ipacket[1], pb->ipacket[2], pb->ipacket[3], pb->ipacket[4], pb->ipacket[5]); @@ -2054,30 +2056,40 @@ psmintr(void *arg) c = pb->ipacket[0]; if ((c & sc->mode.syncmask[0]) != sc->mode.syncmask[1]) { +#if DEBUG log(LOG_DEBUG, "psmintr: out of sync (%04x != %04x) %d" " cmds since last error.\n", c & sc->mode.syncmask[0], sc->mode.syncmask[1], sc->cmdcount - sc->lasterr); +#endif haderror = 1; sc->lasterr = sc->cmdcount; dropqueue(sc); ++sc->syncerrors; sc->lastinputerr = now; if (sc->syncerrors < sc->mode.packetsize) { +#if DEBUG log(LOG_DEBUG, "psmintr: discard a byte (%d).\n", sc->syncerrors); +#endif --pb->inputbytes; bcopy(&pb->ipacket[1], &pb->ipacket[0], pb->inputbytes); } else if (sc->syncerrors == sc->mode.packetsize) { +#if DEBUG log(LOG_DEBUG, "psmintr: re-enable the mouse.\n"); +#endif pb->inputbytes = 0; disable_aux_dev(sc->kbdc); enable_aux_dev(sc->kbdc); } else if (sc->syncerrors < PSM_SYNCERR_THRESHOLD1) { +#if DEBUG log(LOG_DEBUG, "psmintr: discard a byte (%d).\n", sc->syncerrors); +#endif --pb->inputbytes; bcopy(&pb->ipacket[1], &pb->ipacket[0], pb->inputbytes); } else if (sc->syncerrors >= PSM_SYNCERR_THRESHOLD1) { +#if DEBUG log(LOG_DEBUG, "psmintr: reset the mouse.\n"); +#endif reinitialize(sc, TRUE); } continue; |