Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pckbport If the first byte of E7 signature is not 0x...



details:   https://anonhg.NetBSD.org/src/rev/b098051cf9f0
branches:  trunk
changeset: 320020:b098051cf9f0
user:      uwe <uwe%NetBSD.org@localhost>
date:      Tue Jun 19 22:53:17 2018 +0000

description:
If the first byte of E7 signature is not 0x73, it's not an ALPS
device, so don't complain we failed to initialize it.  Still need a
reset, b/c the E7 check will be interpreted as normal commands by a
normal device.

diffstat:

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

diffs (47 lines):

diff -r 937c2b24d3cd -r b098051cf9f0 sys/dev/pckbport/alps.c
--- a/sys/dev/pckbport/alps.c   Tue Jun 19 22:44:33 2018 +0000
+++ b/sys/dev/pckbport/alps.c   Tue Jun 19 22:53:17 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: alps.c,v 1.7 2018/06/19 21:47:28 uwe Exp $ */
+/* $NetBSD: alps.c,v 1.8 2018/06/19 22:53:17 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.7 2018/06/19 21:47:28 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.8 2018/06/19 22:53:17 uwe Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -169,7 +169,7 @@
            e6sig[1] != 0x00 ||
            e6sig[2] != 0x64)
        {
-               return EINVAL;
+               return ENODEV;
        }
 
        aprint_debug_dev(psc->sc_dev,
@@ -218,6 +218,9 @@
                "ALPS PS/2 E7 signature: 0x%X 0x%X 0x%X\n",
                e7sig[0], e7sig[1], e7sig[2]);
 
+       if (e7sig[0] != 0x73)
+               return ENODEV;
+
        return 0;
 err:
        aprint_error_dev(psc->sc_dev, "Failed to get E7 signature.\n");
@@ -754,7 +757,8 @@
        cmd[0] = PMS_RESET;
        (void)pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd,
            1, 2, resp, 1);
-       aprint_verbose_dev(psc->sc_dev, "Failed to initialize an ALPS device.\n");
+       if (res != ENODEV)
+               aprint_verbose_dev(psc->sc_dev, "Failed to initialize an ALPS device.\n");
        return res;
 }
 



Home | Main Index | Thread Index | Old Index