git: 98b3658c4e8a - stable/13 - hkbd: Fix handling of keyboard ErrorRollOver reports

Vladimir Kondratyev wulf at FreeBSD.org
Tue Feb 23 23:43:14 UTC 2021


The branch stable/13 has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=98b3658c4e8a3760a2e4f71a8a4a3dec2d55065a

commit 98b3658c4e8a3760a2e4f71a8a4a3dec2d55065a
Author:     Vladimir Kondratyev <wulf at FreeBSD.org>
AuthorDate: 2021-02-13 18:18:07 +0000
Commit:     Vladimir Kondratyev <wulf at FreeBSD.org>
CommitDate: 2021-02-23 23:41:49 +0000

    hkbd: Fix handling of keyboard ErrorRollOver reports
    
    Ignore fantom keyboard state reports entirelly rather than ignore
    RollOver states for each key separatelly.  Latter results in spurious
    release/push pairs of events on each fantom keyboard state report.
    
    Reported by:    Jan Martin Mikkelsen <janm_AT_transactionware_DOT_com>
    Submitted by:   Jan Martin Mikkelsen (initial version)
    PR:             253249
    MFC after:      1 week
    
    (cherry picked from commit 812c59ed614df94380e0b1f9ff4a3d15b78ce1bf)
---
 sys/dev/hid/hkbd.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c
index 6f4b71dd49b6..89325f9b2499 100644
--- a/sys/dev/hid/hkbd.c
+++ b/sys/dev/hid/hkbd.c
@@ -715,11 +715,16 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len)
 				uint32_t key =
 				    hid_get_data(buf + offset, len - offset,
 				    &sc->sc_loc_key[i]);
+				if (key == KEY_ERROR) {
+					DPRINTF("KEY_ERROR\n");
+					sc->sc_ndata = sc->sc_odata;
+					return;	/* ignore */
+				}
 				if (modifiers & MOD_FN)
 					key = hkbd_apple_fn(key);
 				if (sc->sc_flags & HKBD_FLAG_APPLE_SWAP)
 					key = hkbd_apple_swap(key);
-				if (key == KEY_NONE || key == KEY_ERROR || key >= HKBD_NKEYCODE)
+				if (key == KEY_NONE || key >= HKBD_NKEYCODE)
 					continue;
 				/* set key in bitmap */
 				sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64);


More information about the dev-commits-src-all mailing list