diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-11-25 11:39:46 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-11-25 11:39:46 +0000 |
commit | 1f4d78146b59c1500eb9d4c1bf729fa8aded5476 (patch) | |
tree | b4dfd2a4c19a2d18787f567d0e57a2d1bd9e9f4e /sys/dev | |
parent | 408427207106242072529d2ef747a148d7c4485c (diff) |
Ignore repeated data in ukbd_intr(), for keyboards who flood us on a regular
basis even in the absence of keyboard events; Naturetech onboard keyboard
no longer loses keystrokes.
Joint work with kettenis@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/ukbd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c index 5eac2d720ca..70b2e74ca8a 100644 --- a/sys/dev/usb/ukbd.c +++ b/sys/dev/usb/ukbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ukbd.c,v 1.48 2009/10/13 20:56:50 miod Exp $ */ +/* $OpenBSD: ukbd.c,v 1.49 2009/11/25 11:39:45 miod Exp $ */ /* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -192,7 +192,7 @@ struct ukbd_softc { int sc_console_keyboard; /* we are the console keyboard */ char sc_debounce; /* for quirk handling */ - struct timeout sc_delay; /* for quirk handling */ + struct timeout sc_delay; /* for quirk handling */ struct ukbd_data sc_data; /* for quirk handling */ struct hid_location sc_numloc; @@ -529,6 +529,10 @@ ukbd_intr(struct uhidev *addr, void *ibuf, u_int len) memcpy(ud->keycode, (char *)ibuf + sc->sc_keycodeloc.pos / 8, sc->sc_nkeycode); + /* ignore duplicate data */ + if (memcmp(ud, &sc->sc_odata, sizeof *ud) == 0) + return; + if (sc->sc_debounce && !sc->sc_polling) { /* * Some keyboards have a peculiar quirk. They sometimes |