Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pckbc This file no longer used.
details: https://anonhg.NetBSD.org/src/rev/4f93e6676f39
branches: trunk
changeset: 525836:4f93e6676f39
user: ad <ad%NetBSD.org@localhost>
date: Thu Apr 18 13:41:35 2002 +0000
description:
This file no longer used.
diffstat:
sys/dev/pckbc/psm_intelli.c | 429 --------------------------------------------
1 files changed, 0 insertions(+), 429 deletions(-)
diffs (truncated from 433 to 300 lines):
diff -r d77daea115ff -r 4f93e6676f39 sys/dev/pckbc/psm_intelli.c
--- a/sys/dev/pckbc/psm_intelli.c Thu Apr 18 13:33:01 2002 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,429 +0,0 @@
-/* $NetBSD: psm_intelli.c,v 1.13 2002/03/17 19:41:01 atatat Exp $ */
-
-/*-
- * Copyright (c) 1994 Charles M. Hannum.
- * Copyright (c) 1992, 1993 Erik Forsberg.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
- * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: psm_intelli.c,v 1.13 2002/03/17 19:41:01 atatat Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-#include <sys/ioctl.h>
-
-#include <machine/bus.h>
-
-#include <dev/ic/pckbcvar.h>
-
-#include <dev/pckbc/psmreg.h>
-
-#include <dev/wscons/wsconsio.h>
-#include <dev/wscons/wsmousevar.h>
-
-struct pmsi_softc { /* driver status information */
- struct device sc_dev;
-
- pckbc_tag_t sc_kbctag;
- 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;
-
- struct device *sc_wsmousedev;
-};
-
-int pmsiprobe __P((struct device *, struct cfdata *, void *));
-void pmsiattach __P((struct device *, struct device *, void *));
-void pmsiinput __P((void *, int));
-
-struct cfattach pmsi_ca = {
- sizeof(struct pmsi_softc), pmsiprobe, pmsiattach,
-};
-
-static void do_enable __P((struct pmsi_softc *));
-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,
- pmsi_ioctl,
- pmsi_disable,
-};
-
-static int pmsi_setintellimode __P((pckbc_tag_t, pckbc_slot_t));
-
-static int
-pmsi_setintellimode(tag, slot)
- pckbc_tag_t tag;
- pckbc_slot_t slot;
-{
- u_char cmd[2], resp[1];
- int i, res;
- static u_char rates[] = {200, 100, 80};
-
- cmd[0] = PMS_SET_SAMPLE;
- for (i = 0; i < 3; i++) {
- cmd[1] = rates[i];
- res = pckbc_poll_cmd(tag, slot, cmd, 2, 0, 0, 0);
- if (res)
- return (res);
- }
-
- cmd[0] = PMS_SEND_DEV_ID;
- res = pckbc_poll_cmd(tag, slot, cmd, 1, 1, resp, 0);
- if (res)
- return (res);
- if (resp[0] != 3)
- return (ENXIO);
-
- return (0);
-}
-
-int
-pmsiprobe(parent, match, aux)
- struct device *parent;
- struct cfdata *match;
- void *aux;
-{
- struct pckbc_attach_args *pa = aux;
- u_char cmd[1], resp[2];
- int res;
-
- if (pa->pa_slot != PCKBC_AUX_SLOT)
- return (0);
-
- /* Flush any garbage. */
- pckbc_flush(pa->pa_tag, pa->pa_slot);
-
- /* reset the device */
- cmd[0] = PMS_RESET;
- res = pckbc_poll_cmd(pa->pa_tag, pa->pa_slot, cmd, 1, 2, resp, 1);
- if (res) {
-#ifdef DEBUG
- printf("pmsiprobe: reset error %d\n", res);
-#endif
- return (0);
- }
- if (resp[0] != PMS_RSTDONE) {
- printf("pmsiprobe: reset response 0x%x\n", resp[0]);
- return (0);
- }
-
- /* get type number (0 = mouse) */
- if (resp[1] != 0) {
-#ifdef DEBUG
- printf("pmsiprobe: type 0x%x\n", resp[1]);
-#endif
- return (0);
- }
-
- if ((res = pmsi_setintellimode(pa->pa_tag, pa->pa_slot))) {
-#ifdef DEBUG
- printf("pmsiprobe: intellimode -> %d\n", res);
-#endif
- return (0);
- }
-
- return (20);
-}
-
-void
-pmsiattach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- struct pmsi_softc *sc = (void *)self;
- struct pckbc_attach_args *pa = aux;
- struct wsmousedev_attach_args a;
- u_char cmd[1], resp[2];
- int res;
-
- sc->sc_kbctag = pa->pa_tag;
- sc->sc_kbcslot = pa->pa_slot;
-
- printf("\n");
-
- /* Flush any garbage. */
- pckbc_flush(pa->pa_tag, pa->pa_slot);
-
- /* reset the device */
- cmd[0] = PMS_RESET;
- res = pckbc_poll_cmd(pa->pa_tag, pa->pa_slot, cmd, 1, 2, resp, 1);
-#ifdef DEBUG
- if (res || resp[0] != PMS_RSTDONE || resp[1] != 0) {
- printf("pmsiattach: reset error\n");
- return;
- }
-#endif
- res = pmsi_setintellimode(pa->pa_tag, pa->pa_slot);
-#ifdef DEBUG
- if (res) {
- printf("pmsiattach: error setting intelli mode\n");
- return;
- }
-#endif
-
- /* Other initialization was done by pmsiprobe. */
- sc->inputstate = 0;
- sc->oldbuttons = 0;
-
- pckbc_set_inputhandler(sc->sc_kbctag, sc->sc_kbcslot,
- pmsiinput, sc, sc->sc_dev.dv_xname);
-
- a.accessops = &pmsi_accessops;
- a.accesscookie = sc;
-
- /*
- * Attach the wsmouse, saving a handle to it.
- * Note that we don't need to check this pointer against NULL
- * here or in pmsintr, because if this fails pms_enable() will
- * never be called, so pmsiinput() will never be called.
- */
- sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint);
-
- /* no interrupts until enabled */
- cmd[0] = PMS_DEV_DISABLE;
- res = pckbc_poll_cmd(pa->pa_tag, pa->pa_slot, cmd, 1, 0, 0, 0);
- if (res)
- 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 */
-}
-
-
-static void
-do_enable(sc)
- struct pmsi_softc *sc;
-{
- u_char cmd[1];
- int res;
-
- sc->inputstate = 0;
- sc->oldbuttons = 0;
-
- pckbc_slot_enable(sc->sc_kbctag, sc->sc_kbcslot, 1);
-
- cmd[0] = PMS_DEV_ENABLE;
- res = pckbc_enqueue_cmd(sc->sc_kbctag, sc->sc_kbcslot, cmd, 1, 0, 1, 0);
- 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
- printf("pmsi_enable: intellimode -> %d\n", res);
-#endif
- }
-
- return;
-}
-
-int
-pmsi_enable(v)
- void *v;
-{
- struct pmsi_softc *sc = v;
-
- if (sc->sc_enabled)
- return EBUSY;
-
- sc->sc_enabled = 1;
-
- do_enable(sc);
-
- return 0;
-}
-
-static void
-do_disable(sc)
- struct pmsi_softc *sc;
-{
- u_char cmd[1];
- int res;
-
- cmd[0] = PMS_DEV_DISABLE;
- res = pckbc_enqueue_cmd(sc->sc_kbctag, sc->sc_kbcslot, cmd, 1, 0, 1, 0);
- if (res)
- printf("pmsi_disable: command error\n");
-
- pckbc_slot_enable(sc->sc_kbctag, sc->sc_kbcslot, 0);
-}
-
-void
-pmsi_disable(v)
- void *v;
-{
- struct pmsi_softc *sc = v;
-
- do_disable(sc);
Home |
Main Index |
Thread Index |
Old Index