diff options
| author | tls <tls@NetBSD.org> | 2012-02-02 19:42:57 +0000 |
|---|---|---|
| committer | tls <tls@NetBSD.org> | 2012-02-02 19:42:57 +0000 |
| commit | cc9ee3de3e25ef31d3a97dc35bedc36945e35d2a (patch) | |
| tree | 06a2889eb6b4b02bc8b8bba6b5cc3f9b1938d18b /sys/dev/ic/lemac.c | |
| parent | f622122a62827e27b444c2f95632d61f73357ced (diff) | |
Entropy-pool implementation move and cleanup.
1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.
2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.
3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.
4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.
5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.
ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
Diffstat (limited to 'sys/dev/ic/lemac.c')
| -rw-r--r-- | sys/dev/ic/lemac.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/dev/ic/lemac.c b/sys/dev/ic/lemac.c index 62fce6e7063..ff92829d4a0 100644 --- a/sys/dev/ic/lemac.c +++ b/sys/dev/ic/lemac.c @@ -1,4 +1,4 @@ -/* $NetBSD: lemac.c,v 1.39 2010/11/13 13:52:01 uebayasi Exp $ */ +/* $NetBSD: lemac.c,v 1.40 2012/02/02 19:43:03 tls Exp $ */ /*- * Copyright (c) 1994, 1995, 1997 Matt Thomas <matt@3am-software.com> @@ -34,10 +34,9 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.39 2010/11/13 13:52:01 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.40 2012/02/02 19:43:03 tls Exp $"); #include "opt_inet.h" -#include "rnd.h" #include <sys/param.h> #include <sys/systm.h> @@ -48,9 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.39 2010/11/13 13:52:01 uebayasi Exp $"); #include <sys/errno.h> #include <sys/malloc.h> #include <sys/device.h> -#if NRND > 0 #include <sys/rnd.h> -#endif #include <net/if.h> #include <net/if_types.h> @@ -955,10 +952,8 @@ lemac_intr( LEMAC_OUTB(sc, LEMAC_REG_CTL, LEMAC_INB(sc, LEMAC_REG_CTL) ^ LEMAC_CTL_LED); LEMAC_INTR_ENABLE(sc); /* Unmask interrupts */ -#if NRND > 0 if (cs_value) rnd_add_uint32(&sc->rnd_source, cs_value); -#endif return 1; } @@ -1016,10 +1011,8 @@ lemac_ifattach( if_attach(ifp); ether_ifattach(ifp, sc->sc_enaddr); -#if NRND > 0 rnd_attach_source(&sc->rnd_source, device_xname(&sc->sc_dv), RND_TYPE_NET, 0); -#endif ifmedia_init(&sc->sc_ifmedia, 0, lemac_ifmedia_change, |
