diff options
| author | explorer <explorer@NetBSD.org> | 1997-10-19 11:45:33 +0000 |
|---|---|---|
| committer | explorer <explorer@NetBSD.org> | 1997-10-19 11:45:33 +0000 |
| commit | ebf03fd00cdfdfd2cfa6abccdfb44cef10f92a49 (patch) | |
| tree | 47b62f3272624bed17f4beae1e20febf593a68a3 /sys/dev/ic/com.c | |
| parent | 2a18497c3f134cd13c2cd7721e1e1c9458605ee5 (diff) | |
Add hooks for entropy collection. Right now, you must place
options RND_COM
in your kernel config file (along with the
pseudo-device rnd
line) to enable this. If results are positive, I will make this enabled
by default.
Diffstat (limited to 'sys/dev/ic/com.c')
| -rw-r--r-- | sys/dev/ic/com.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index ba253fa4d19..a569913df4b 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.114 1997/10/18 23:11:45 is Exp $ */ +/* $NetBSD: com.c,v 1.115 1997/10/19 11:45:33 explorer Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996, 1997 @@ -71,6 +71,12 @@ /* * COM driver, uses National Semiconductor NS16450/NS16550AF UART */ + +#include "rnd.h" +#if NRND > 0 && defined(RND_COM) +#include <sys/rnd.h> +#endif + #include <sys/param.h> #include <sys/systm.h> #include <sys/ioctl.h> @@ -454,6 +460,11 @@ com_attach_subr(sc) #ifdef __GENERIC_SOFT_INTERRUPTS sc->sc_si = softintr_establish(IPL_SOFTSERIAL, comsoft, sc); #endif + +#if NRND > 0 && defined(RND_COM) + rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, + RND_TYPE_TTY); +#endif } int @@ -1607,6 +1618,11 @@ comintr(arg) } #endif #endif + +#if NRND > 0 && defined(RND_COM) + rnd_add_uint32(&sc->rnd_source, iir | lsr); +#endif + return (1); } |
