diff --git a/sys/arch/i386/isa/pccons.c b/sys/arch/i386/isa/pccons.c index faf9f9aba0eb..189f397a3d7e 100644 --- a/sys/arch/i386/isa/pccons.c +++ b/sys/arch/i386/isa/pccons.c @@ -1,4 +1,4 @@ -/* $NetBSD: pccons.c,v 1.139 2000/03/23 06:39:15 thorpej Exp $ */ +/* $NetBSD: pccons.c,v 1.140 2000/06/05 22:20:56 sommerfeld Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -730,7 +730,7 @@ pcattach(parent, self, aux) do_async_update((void *)1); #if (NPCCONSKBD > 0) - pckbc_set_inputhandler(kbctag, kbcslot, pcinput, sc); + pckbc_set_inputhandler(kbctag, kbcslot, pcinput, sc, sc->sc_dev.dv_xname); #else sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE, IPL_TTY, pcintr, sc); diff --git a/sys/arch/i386/isa/pms.c b/sys/arch/i386/isa/pms.c index 7420f9d1985f..739ea292157b 100644 --- a/sys/arch/i386/isa/pms.c +++ b/sys/arch/i386/isa/pms.c @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.46 1999/12/03 22:48:24 thorpej Exp $ */ +/* $NetBSD: pms.c,v 1.47 2000/06/05 22:20:56 sommerfeld Exp $ */ /*- * Copyright (c) 1994, 1997 Charles M. Hannum. @@ -364,7 +364,7 @@ opms_pckbc_attach(parent, self, aux) sc->sc_state = 0; pckbc_set_inputhandler(sc->sc_kbctag, sc->sc_kbcslot, - opmsinput, sc); + opmsinput, sc, sc->sc_dev.dv_xname); /* no interrupts until enabled */ cmd[0] = PMS_DEV_DISABLE; diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c index 3638fe62ee16..fd987e4ab82a 100644 --- a/sys/dev/ic/pckbc.c +++ b/sys/dev/ic/pckbc.c @@ -1,4 +1,4 @@ -/* $NetBSD: pckbc.c,v 1.2 2000/03/23 07:01:32 thorpej Exp $ */ +/* $NetBSD: pckbc.c,v 1.3 2000/06/05 22:20:54 sommerfeld Exp $ */ /* * Copyright (c) 1998 @@ -47,6 +47,7 @@ #include #include +#include "rnd.h" #include "locators.h" #ifdef __HAVE_NWSCONS /* XXX: this port uses sys/dev/pckbc */ @@ -57,6 +58,9 @@ #if (NPCKBD > 0) #include #endif +#if NRND > 0 +#include +#endif /* descriptor for one device command */ struct pckbc_devcmd { @@ -77,6 +81,9 @@ struct pckbc_slotdata { TAILQ_HEAD(, pckbc_devcmd) freequeue; /* free commands */ #define NCMD 5 struct pckbc_devcmd cmds[NCMD]; +#if NRND > 0 + rndsource_element_t rnd_source; +#endif }; #define CMD_IN_QUEUE(q) (TAILQ_FIRST(&(q)->cmdqueue) != NULL) @@ -285,6 +292,10 @@ pckbc_attach_slot(sc, slot) M_DEVBUF, M_NOWAIT); pckbc_init_slotdata(t->t_slotdata[slot]); } +#if NRND > 0 + rnd_attach_source(&t->t_slotdata[slot]->rnd_source, sc->subname[slot], + RND_TYPE_TTY, 0); +#endif return (found); } @@ -853,11 +864,12 @@ pckbc_enqueue_cmd(self, slot, cmd, len, responselen, sync, respbuf) } void -pckbc_set_inputhandler(self, slot, func, arg) +pckbc_set_inputhandler(self, slot, func, arg, name) pckbc_tag_t self; pckbc_slot_t slot; pckbc_inputfcn func; void *arg; + char *name; { struct pckbc_internal *t = (struct pckbc_internal *)self; struct pckbc_softc *sc = t->t_sc; @@ -869,6 +881,7 @@ pckbc_set_inputhandler(self, slot, func, arg) sc->inputhandler[slot] = func; sc->inputarg[slot] = arg; + sc->subname[slot] = name; } int @@ -907,6 +920,9 @@ pckbcintr(vsc) KBD_DELAY; data = bus_space_read_1(t->t_iot, t->t_ioh_d, 0); +#if NRND > 0 + rnd_add_uint32(&q->rnd_source, (stat<<8)|data); +#endif if (CMD_IN_QUEUE(q) && pckbc_cmdresponse(t, slot, data)) continue; diff --git a/sys/dev/ic/pckbcvar.h b/sys/dev/ic/pckbcvar.h index 5cca6a3194c9..02eb4ffa97d7 100644 --- a/sys/dev/ic/pckbcvar.h +++ b/sys/dev/ic/pckbcvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: pckbcvar.h,v 1.2 2000/03/23 07:01:32 thorpej Exp $ */ +/* $NetBSD: pckbcvar.h,v 1.3 2000/06/05 22:20:55 sommerfeld Exp $ */ /* * Copyright (c) 1998 @@ -72,6 +72,7 @@ struct pckbc_softc { pckbc_inputfcn inputhandler[PCKBC_NSLOTS]; void *inputarg[PCKBC_NSLOTS]; + char *subname[PCKBC_NSLOTS]; void (*intr_establish) __P((struct pckbc_softc *, pckbc_slot_t)); }; @@ -86,7 +87,7 @@ extern struct pckbc_internal pckbc_consdata; extern int pckbc_console_attached; void pckbc_set_inputhandler __P((pckbc_tag_t, pckbc_slot_t, - pckbc_inputfcn, void *)); + pckbc_inputfcn, void *, char *)); void pckbc_flush __P((pckbc_tag_t, pckbc_slot_t)); int pckbc_poll_cmd __P((pckbc_tag_t, pckbc_slot_t, u_char *, int, diff --git a/sys/dev/pckbc/pckbd.c b/sys/dev/pckbc/pckbd.c index de1f5c160477..4c121e610da8 100644 --- a/sys/dev/pckbc/pckbd.c +++ b/sys/dev/pckbc/pckbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: pckbd.c,v 1.23 2000/03/10 06:10:34 thorpej Exp $ */ +/* $NetBSD: pckbd.c,v 1.24 2000/06/05 22:20:57 sommerfeld Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -350,7 +350,7 @@ pckbdattach(parent, self, aux) sc->id->t_sc = sc; pckbc_set_inputhandler(sc->id->t_kbctag, sc->id->t_kbcslot, - pckbd_input, sc); + pckbd_input, sc, sc->sc_dev.dv_xname); a.console = isconsole; diff --git a/sys/dev/pckbc/psm.c b/sys/dev/pckbc/psm.c index 92dd88272c37..bc740c0629a0 100644 --- a/sys/dev/pckbc/psm.c +++ b/sys/dev/pckbc/psm.c @@ -1,4 +1,4 @@ -/* $NetBSD: psm.c,v 1.10 2000/01/08 02:57:23 takemura Exp $ */ +/* $NetBSD: psm.c,v 1.11 2000/06/05 22:20:57 sommerfeld Exp $ */ /*- * Copyright (c) 1994 Charles M. Hannum. @@ -143,7 +143,7 @@ pmsattach(parent, self, aux) sc->oldbuttons = 0; pckbc_set_inputhandler(sc->sc_kbctag, sc->sc_kbcslot, - pmsinput, sc); + pmsinput, sc, sc->sc_dev.dv_xname); a.accessops = &pms_accessops; a.accesscookie = sc; diff --git a/sys/dev/pckbc/psm_intelli.c b/sys/dev/pckbc/psm_intelli.c index 2d475744e395..95d9fe254d93 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.7 2000/01/08 02:57:23 takemura Exp $ */ +/* $NetBSD: psm_intelli.c,v 1.8 2000/06/05 22:20:57 sommerfeld Exp $ */ /*- * Copyright (c) 1994 Charles M. Hannum. @@ -187,7 +187,7 @@ pmsiattach(parent, self, aux) sc->oldbuttons = 0; pckbc_set_inputhandler(sc->sc_kbctag, sc->sc_kbcslot, - pmsiinput, sc); + pmsiinput, sc, sc->sc_dev.dv_xname); a.accessops = &pmsi_accessops; a.accesscookie = sc;