Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pckbport When E6 signature is checked, ignore presse...



details:   https://anonhg.NetBSD.org/src/rev/3ca60ea156ba
branches:  trunk
changeset: 320018:3ca60ea156ba
user:      uwe <uwe%NetBSD.org@localhost>
date:      Tue Jun 19 21:47:28 2018 +0000

description:
When E6 signature is checked, ignore pressed buttons.

diffstat:

 sys/dev/pckbport/alps.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r e8ca2c5db9b4 -r 3ca60ea156ba sys/dev/pckbport/alps.c
--- a/sys/dev/pckbport/alps.c   Tue Jun 19 21:21:04 2018 +0000
+++ b/sys/dev/pckbport/alps.c   Tue Jun 19 21:47:28 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: alps.c,v 1.6 2018/06/19 21:21:04 uwe Exp $ */
+/* $NetBSD: alps.c,v 1.7 2018/06/19 21:47:28 uwe Exp $ */
 
 /*-
  * Copyright (c) 2017 Ryo ONODERA <ryo%tetera.org@localhost>
@@ -30,7 +30,7 @@
 #include "opt_pms.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.6 2018/06/19 21:21:04 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.7 2018/06/19 21:47:28 uwe Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -165,8 +165,10 @@
                goto err;
 
        /* ALPS input device returns 00-00-64 as E6 signature */
-       if (e6sig[0] != 0x00 || e6sig[1] != 0x00 ||
-               e6sig[2] != 0x64) {
+       if ((e6sig[0] & ~0x07u) != 0x00 || /* ignore buttons */
+           e6sig[1] != 0x00 ||
+           e6sig[2] != 0x64)
+       {
                return EINVAL;
        }
 



Home | Main Index | Thread Index | Old Index