diff options
| author | jmcneill <jmcneill@NetBSD.org> | 2002-02-27 00:30:07 +0000 |
|---|---|---|
| committer | jmcneill <jmcneill@NetBSD.org> | 2002-02-27 00:30:07 +0000 |
| commit | cc72a549337da2ab2fc7aab9ecedd18d6d7fd09c (patch) | |
| tree | 18800b827b460bfbf2497d695e6dc10e56b45955 /sys/dev/pckbc | |
| parent | 5424a781c8ebabb6fba5c0d7cd2cda9c85066d31 (diff) | |
Add constraints to allow for disabling PS/2 mouse powerhooks. As requested
by Chuck Cranor.
To disable powerhooks with the pms and pmsi drivers, respectively:
options PMS_DISABLE_POWERHOOK
options PMSI_DISABLE_POWERHOOK
Diffstat (limited to 'sys/dev/pckbc')
| -rw-r--r-- | sys/dev/pckbc/psm.c | 13 | ||||
| -rw-r--r-- | sys/dev/pckbc/psm_intelli.c | 14 |
2 files changed, 22 insertions, 5 deletions
diff --git a/sys/dev/pckbc/psm.c b/sys/dev/pckbc/psm.c index 0f5782642cf..b5828e2a936 100644 --- a/sys/dev/pckbc/psm.c +++ b/sys/dev/pckbc/psm.c @@ -1,4 +1,4 @@ -/* $NetBSD: psm.c,v 1.13 2001/11/13 07:24:43 lukem Exp $ */ +/* $NetBSD: psm.c,v 1.14 2002/02/27 00:30:07 jmcneill Exp $ */ /*- * Copyright (c) 1994 Charles M. Hannum. @@ -24,7 +24,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: psm.c,v 1.13 2001/11/13 07:24:43 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: psm.c,v 1.14 2002/02/27 00:30:07 jmcneill Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -47,7 +47,9 @@ struct pms_softc { /* driver status information */ int sc_kbcslot; int sc_enabled; /* input enabled? */ +#ifndef PMS_DISABLE_POWERHOOK void *sc_powerhook; /* cookie from power hook */ +#endif /* !PMS_DISABLE_POWERHOOK */ int inputstate; u_int buttons, oldbuttons; /* mouse button status */ signed char dx; @@ -68,7 +70,9 @@ static void do_disable __P((struct pms_softc *)); int pms_enable __P((void *)); int pms_ioctl __P((void *, u_long, caddr_t, int, struct proc *)); void pms_disable __P((void *)); +#ifndef PMS_DISABLE_POWERHOOK void pms_power __P((int, void *)); +#endif /* !PMS_DISABLE_POWERHOOK */ const struct wsmouse_accessops pms_accessops = { pms_enable, @@ -170,7 +174,9 @@ pmsattach(parent, self, aux) printf("pmsattach: disable error\n"); pckbc_slot_enable(sc->sc_kbctag, sc->sc_kbcslot, 0); +#ifndef PMS_DISABLE_POWERHOOK sc->sc_powerhook = powerhook_establish(pms_power, sc); +#endif /* !PMS_DISABLE_POWERHOOK */ } static void @@ -258,6 +264,7 @@ pms_disable(v) sc->sc_enabled = 0; } +#ifndef PMS_DISABLE_POWERHOOK void pms_power(why, v) int why; @@ -280,7 +287,7 @@ pms_power(why, v) break; } } - +#endif /* !PMS_DISABLE_POWERHOOK */ int pms_ioctl(v, cmd, data, flag, p) diff --git a/sys/dev/pckbc/psm_intelli.c b/sys/dev/pckbc/psm_intelli.c index 132318ae43a..f931f613fb2 100644 --- a/sys/dev/pckbc/psm_intelli.c +++ b/sys/dev/pckbc/psm_intelli.c @@ -1,4 +1,4 @@ -/* $NetBSD: psm_intelli.c,v 1.11 2002/01/25 14:53:43 jmcneill Exp $ */ +/* $NetBSD: psm_intelli.c,v 1.12 2002/02/27 00:30:07 jmcneill Exp $ */ /*- * Copyright (c) 1994 Charles M. Hannum. @@ -24,7 +24,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: psm_intelli.c,v 1.11 2002/01/25 14:53:43 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: psm_intelli.c,v 1.12 2002/02/27 00:30:07 jmcneill Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -47,7 +47,9 @@ struct pmsi_softc { /* driver status information */ int sc_kbcslot; int sc_enabled; /* input enabled? */ +#ifndef PMSI_DISABLE_POWERHOOK void *sc_powerhook; /* cookie from power hook */ +#endif /* !PMSI_DISABLE_POWERHOOK */ int inputstate; u_int buttons, oldbuttons; /* mouse button status */ signed char dx, dy; @@ -69,7 +71,9 @@ static void do_disable __P((struct pmsi_softc *)); int pmsi_enable __P((void *)); int pmsi_ioctl __P((void *, u_long, caddr_t, int, struct proc *)); void pmsi_disable __P((void *)); +#ifndef PMSI_DISABLE_POWERHOOK void pmsi_power __P((int, void *)); +#endif /* !PMSI_DISABLE_POWERHOOK */ const struct wsmouse_accessops pmsi_accessops = { pmsi_enable, @@ -215,7 +219,9 @@ pmsiattach(parent, self, aux) printf("pmsiattach: disable error\n"); pckbc_slot_enable(sc->sc_kbctag, sc->sc_kbcslot, 0); +#ifndef PMSI_DISABLE_POWERHOOK sc->sc_powerhook = powerhook_establish(pmsi_power, sc); +#endif /* !PMSI_DISABLE_POWERHOOK */ } @@ -236,8 +242,10 @@ do_enable(sc) if (res) printf("pmsi_enable: command error\n"); +#ifndef PMSI_DISABLE_POWERHOOK if (sc->sc_powerhook == NULL) return; +#endif /* !PMSI_DISABLE_POWERHOOK */ if ((res = pmsi_setintellimode(sc->sc_kbctag, sc->sc_kbcslot))) { #ifdef DEBUG @@ -391,6 +399,7 @@ int data; return; } +#ifndef PMSI_DISABLE_POWERHOOK void pmsi_power(why, v) int why; @@ -417,3 +426,4 @@ pmsi_power(why, v) break; } } +#endif /* !PMSI_DISABLE_POWERHOOK */ |
