diff options
| author | Mark Murray <markm@FreeBSD.org> | 2004-04-04 16:36:21 +0000 |
|---|---|---|
| committer | Mark Murray <markm@FreeBSD.org> | 2004-04-04 16:36:21 +0000 |
| commit | 44e421c906bea431447e9015c88d35270ce19200 (patch) | |
| tree | 4951fae855ead6c8f4710eb2cb1cfad7fd8d1e66 /sys | |
| parent | 56116dd37c80b0fe27bd4481cd799ccae8781c5e (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/atkbdc/psm.c | 14 | ||||
| -rw-r--r-- | sys/isa/psm.c | 14 |
2 files changed, 26 insertions, 2 deletions
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index a414ba6c413f..f5df88fe64bf 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/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; diff --git a/sys/isa/psm.c b/sys/isa/psm.c index a414ba6c413f..f5df88fe64bf 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; |
