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.
This commit is contained in:
tls 2012-02-02 19:42:57 +00:00
parent d647fec80c
commit 7b0b7dedd9
202 changed files with 721 additions and 1426 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rndctl.c,v 1.23 2011/12/17 13:18:20 apb Exp $ */
/* $NetBSD: rndctl.c,v 1.24 2012/02/02 19:42:57 tls Exp $ */
/*-
* Copyright (c) 1997 Michael Graff.
@ -33,7 +33,7 @@
#include <sha1.h>
#ifndef lint
__RCSID("$NetBSD: rndctl.c,v 1.23 2011/12/17 13:18:20 apb Exp $");
__RCSID("$NetBSD: rndctl.c,v 1.24 2012/02/02 19:42:57 tls Exp $");
#endif
@ -62,6 +62,10 @@ static const arg_t source_types[] = {
{ "tape", RND_TYPE_TAPE },
{ "tty", RND_TYPE_TTY },
{ "rng", RND_TYPE_RNG },
{ "skew", RND_TYPE_SKEW },
{ "env", RND_TYPE_ENV },
{ "vm", RND_TYPE_VM },
{ "power", RND_TYPE_POWER },
{ NULL, 0 }
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: arckbd.c,v 1.21 2011/11/19 22:51:18 tls Exp $ */
/* $NetBSD: arckbd.c,v 1.22 2012/02/02 19:42:57 tls Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 Ben Harris
* All rights reserved.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: arckbd.c,v 1.21 2011/11/19 22:51:18 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: arckbd.c,v 1.22 2012/02/02 19:42:57 tls Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -70,10 +70,8 @@ __KERNEL_RCSID(0, "$NetBSD: arckbd.c,v 1.21 2011/11/19 22:51:18 tls Exp $");
#include "wskbd.h"
#include "wsmouse.h"
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
/* #define ARCKBD_DEBUG */
@ -138,9 +136,7 @@ struct arckbd_softc {
struct evcnt sc_xev;
struct irq_handler *sc_rirq;
struct evcnt sc_rev;
#if NRND > 0
krndsource_t sc_rnd_source;
#endif
};
#define AKF_WANTKBD 0x01
@ -223,10 +219,8 @@ arckbd_attach(device_t parent, device_t self, void *aux)
aprint_normal("\n");
#if NRND > 0
rnd_attach_source(&sc->sc_rnd_source, device_xname(self),
RND_TYPE_TTY, 0);
#endif
wskbdargs.console = 1; /* XXX FIXME */
wskbdargs.keymap = &sc->sc_mapdata;
@ -460,13 +454,9 @@ arckbd_rint(void *cookie)
static void
arckbd_mousemoved(device_t self, int byte1, int byte2)
{
#if NRND > 0 || NWSMOUSE > 0
struct arckbd_softc *sc = device_private(self);
#endif
#if NRND > 0
rnd_add_uint32(&sc->sc_rnd_source, byte1);
#endif
#if NWSMOUSE > 0
if (sc->sc_wsmousedev != NULL) {
int dx, dy;
@ -489,9 +479,7 @@ arckbd_keyupdown(device_t self, int byte1, int byte2)
u_int type;
int value;
#if NRND > 0
rnd_add_uint32(&sc->sc_rnd_source, byte1);
#endif
if ((byte1 & 0x0f) == 7) {
/* Mouse button event */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_cs.c,v 1.7 2011/07/19 15:59:52 dyoung Exp $ */
/* $NetBSD: if_cs.c,v 1.8 2012/02/02 19:42:57 tls Exp $ */
/*
* Copyright (c) 2004 Christopher Gilbert
@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_cs.c,v 1.7 2011/07/19 15:59:52 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_cs.c,v 1.8 2012/02/02 19:42:57 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -66,10 +66,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_cs.c,v 1.7 2011/07/19 15:59:52 dyoung Exp $");
#include <sys/device.h>
#include <sys/bus.h>
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_ether.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: fdc_sableio.c,v 1.11 2011/07/01 19:19:50 dyoung Exp $ */
/* $NetBSD: fdc_sableio.c,v 1.12 2012/02/02 19:42:57 tls Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -31,16 +31,14 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: fdc_sableio.c,v 1.11 2011/07/01 19:19:50 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: fdc_sableio.c,v 1.12 2012/02/02 19:42:57 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/callout.h>
#include <sys/device.h>
#include <sys/buf.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <sys/bus.h>
#include <machine/intr.h>

View File

@ -1,5 +1,5 @@
/* $Id: at91dbgu.c,v 1.7 2011/11/04 17:23:05 aymeric Exp $ */
/* $NetBSD: at91dbgu.c,v 1.7 2011/11/04 17:23:05 aymeric Exp $ */
/* $Id: at91dbgu.c,v 1.8 2012/02/02 19:42:57 tls Exp $ */
/* $NetBSD: at91dbgu.c,v 1.8 2012/02/02 19:42:57 tls Exp $ */
/*
*
@ -83,13 +83,13 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.7 2011/11/04 17:23:05 aymeric Exp $");
__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.8 2012/02/02 19:42:57 tls Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
#include "rnd.h"
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
#include <sys/rnd.h>
#endif
@ -277,7 +277,7 @@ at91dbgu_attach(device_t parent, device_t self, void *aux)
sc->sc_si = softint_establish(SOFTINT_SERIAL, at91dbgu_soft, sc);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_TTY, 0);
#endif
@ -1138,7 +1138,7 @@ dbgu_intr(void* arg)
/* Wake up the poller. */
softint_schedule(sc->sc_si);
#if 0
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_add_uint32(&sc->rnd_source, imr ^ sr ^ c);
#endif
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: at91dbguvar.h,v 1.4 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: at91dbguvar.h,v 1.5 2012/02/02 19:42:57 tls Exp $ */
/*-
* Copyright (c) 2007 Embedtronics Oy
@ -81,7 +81,7 @@ struct at91dbgu_softc {
int (*disable)(struct at91dbgu_softc *);
int enabled;
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
krndsource_t rnd_source;
#endif
};

View File

@ -1,5 +1,5 @@
/* $Id: at91usart.c,v 1.5 2011/07/01 19:31:17 dyoung Exp $ */
/* $NetBSD: at91usart.c,v 1.5 2011/07/01 19:31:17 dyoung Exp $ */
/* $Id: at91usart.c,v 1.6 2012/02/02 19:42:57 tls Exp $ */
/* $NetBSD: at91usart.c,v 1.6 2012/02/02 19:42:57 tls Exp $ */
/*
* Copyright (c) 2007 Embedtronics Oy. All rights reserved.
@ -77,13 +77,13 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: at91usart.c,v 1.5 2011/07/01 19:31:17 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: at91usart.c,v 1.6 2012/02/02 19:42:57 tls Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
#include "rnd.h"
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
#include <sys/rnd.h>
#endif
@ -303,7 +303,7 @@ at91usart_attach_subr(struct at91usart_softc *sc, struct at91bus_attach_args *sa
sc->sc_si = softint_establish(SOFTINT_SERIAL, at91usart_soft, sc);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_TTY, 0);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: at91usartvar.h,v 1.4 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: at91usartvar.h,v 1.5 2012/02/02 19:42:57 tls Exp $ */
/*-
* Copyright (c) 2007 Embedtronics Oy. All rights reserved.
@ -85,7 +85,7 @@ struct at91usart_softc {
int (*disable)(struct at91usart_softc *);
int enabled;
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
krndsource_t rnd_source;
#endif
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: epcom.c,v 1.21 2011/07/01 19:31:17 dyoung Exp $ */
/* $NetBSD: epcom.c,v 1.22 2012/02/02 19:42:57 tls Exp $ */
/*
* Copyright (c) 1998, 1999, 2001, 2002, 2004 The NetBSD Foundation, Inc.
* All rights reserved.
@ -73,14 +73,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.21 2011/07/01 19:31:17 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.22 2012/02/02 19:42:57 tls Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
#include "epcom.h"
#include "rnd.h"
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
#include <sys/rnd.h>
#endif
@ -237,7 +237,7 @@ epcom_attach_subr(struct epcom_softc *sc)
sc->sc_si = softint_establish(SOFTINT_SERIAL, epcomsoft, sc);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_TTY, 0);
#endif
@ -1132,7 +1132,7 @@ epcomintr(void* arg)
softint_schedule(sc->sc_si);
#if 0 /* XXX: broken */
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_add_uint32(&sc->rnd_source, intr ^ flagr);
#endif
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: epcomvar.h,v 1.5 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: epcomvar.h,v 1.6 2012/02/02 19:42:58 tls Exp $ */
/*-
* Copyright (c) 2004 Jesse Off
*
@ -82,7 +82,7 @@ struct epcom_softc {
int (*disable)(struct epcom_softc *);
int enabled;
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
krndsource_t rnd_source;
#endif
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: imxuart.c,v 1.8 2011/04/24 16:26:54 rmind Exp $ */
/* $NetBSD: imxuart.c,v 1.9 2012/02/02 19:42:58 tls Exp $ */
/*
* Copyright (c) 2009, 2010 Genetec Corporation. All rights reserved.
@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.8 2011/04/24 16:26:54 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.9 2012/02/02 19:42:58 tls Exp $");
#include "opt_imxuart.h"
#include "opt_ddb.h"
@ -108,7 +108,7 @@ __KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.8 2011/04/24 16:26:54 rmind Exp $");
#include "opt_imx.h"
#include "rnd.h"
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
#include <sys/rnd.h>
#endif
@ -493,7 +493,7 @@ imxuart_attach_common(device_t parent, device_t self,
sc->sc_si = softint_establish(SOFTINT_SERIAL, imxusoft, sc);
#if NRND > 0 && defined(RND_IMXUART)
#ifdef RND_COM
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_TTY, 0);
#endif
@ -647,7 +647,7 @@ imxuart_detach(device_t self, int flags)
/* Unhook the soft interrupt handler. */
softint_disestablish(sc->sc_si);
#if NRND > 0 && defined(RND_IMXU)
#ifdef RND_COM
/* Unhook the entropy source. */
rnd_detach_source(&sc->rnd_source);
#endif
@ -1882,7 +1882,7 @@ imxuintr(void *arg)
/* Wake up the poller. */
softint_schedule(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_add_uint32(&sc->rnd_source, iir | lsr);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixp12x0_com.c,v 1.39 2011/07/01 20:27:50 dyoung Exp $ */
/* $NetBSD: ixp12x0_com.c,v 1.40 2012/02/02 19:42:58 tls Exp $ */
/*
* Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
* All rights reserved.
@ -66,13 +66,13 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.39 2011/07/01 20:27:50 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.40 2012/02/02 19:42:58 tls Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
#include "rnd.h"
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
#include <sys/rnd.h>
#endif
@ -236,7 +236,7 @@ ixpcom_attach_subr(struct ixpcom_softc *sc)
sc->sc_si = softint_establish(SOFTINT_SERIAL, ixpcomsoft, sc);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_TTY, 0);
#endif
@ -1173,7 +1173,7 @@ ixpcomintr(void* arg)
/* Wake up the poller. */
softint_schedule(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_add_uint32(&sc->rnd_source, iir | lsr);
#endif
return (1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sscom.c,v 1.34 2012/01/30 03:28:33 nisimura Exp $ */
/* $NetBSD: sscom.c,v 1.35 2012/02/02 19:42:58 tls Exp $ */
/*
* Copyright (c) 2002, 2003 Fujitsu Component Limited
@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.34 2012/01/30 03:28:33 nisimura Exp $");
__KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.35 2012/02/02 19:42:58 tls Exp $");
#include "opt_sscom.h"
#include "opt_ddb.h"
@ -107,7 +107,7 @@ __KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.34 2012/01/30 03:28:33 nisimura Exp $");
#include "opt_lockdebug.h"
#include "rnd.h"
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
#include <sys/rnd.h>
#endif
@ -494,10 +494,8 @@ sscom_attach_subr(struct sscom_softc *sc)
sc->sc_si = softint_establish(SOFTINT_SERIAL, sscomsoft, sc);
#if NRND > 0 && defined(RND_COM)
rnd_attach_source(&sc->rnd_source, sc->sc_dev->dv_xname,
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_TTY, 0);
#endif
/* if there are no enable/disable functions, assume the device
is always enabled */
@ -1727,7 +1725,7 @@ sscomrxintr(void *arg)
/* Wake up the poller. */
softint_schedule(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_add_uint32(&sc->rnd_source, iir | rsr);
#endif
@ -1792,7 +1790,7 @@ sscomtxintr(void *arg)
/* Wake up the poller. */
softint_schedule(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_add_uint32(&sc->rnd_source, iir | rsr);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: sscom_var.h,v 1.10 2012/01/30 03:28:33 nisimura Exp $ */
/* $NetBSD: sscom_var.h,v 1.11 2012/02/02 19:42:58 tls Exp $ */
/*
* Copyright (c) 2002, 2003 Fujitsu Component Limited
@ -174,7 +174,7 @@ struct sscom_softc {
pps_params_t ppsparam;
#endif
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
krndsource_t rnd_source;
#endif
#if (defined(MULTIPROCESSOR) || defined(LOCKDEBUG)) && defined(SSCOM_MPLOCK)

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa1111_kbc.c,v 1.13 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: sa1111_kbc.c,v 1.14 2012/02/02 19:42:58 tls Exp $ */
/*
* Copyright (c) 2004 Ben Harris.
@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sa1111_kbc.c,v 1.13 2011/11/19 22:51:19 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: sa1111_kbc.c,v 1.14 2012/02/02 19:42:58 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -71,6 +71,7 @@ __KERNEL_RCSID(0, "$NetBSD: sa1111_kbc.c,v 1.13 2011/11/19 22:51:19 tls Exp $");
#include <sys/errno.h>
#include <sys/queue.h>
#include <sys/bus.h>
#include <sys/rnd.h>
#include <arm/sa11x0/sa1111_reg.h>
#include <arm/sa11x0/sa1111_var.h>
@ -78,7 +79,6 @@ __KERNEL_RCSID(0, "$NetBSD: sa1111_kbc.c,v 1.13 2011/11/19 22:51:19 tls Exp $");
#include <dev/pckbport/pckbportvar.h> /* for prototypes */
#include "pckbd.h"
#include "rnd.h"
#include "locators.h"
struct sackbc_softc {
@ -95,9 +95,7 @@ struct sackbc_softc {
int poll_stat; /* data read from inr handler if polling */
int poll_data; /* status read from intr handler if polling */
#if NRND > 0
krndsource_t rnd_source;
#endif
pckbport_tag_t pt;
};
@ -171,9 +169,7 @@ sackbc_rxint(void *cookie)
if (stat & KBDSTAT_RXF) {
code = bus_space_read_4(sc->iot, sc->ioh, SACCKBD_DATA);
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, (stat<<8)|data);
#endif
if (sc->polling) {
sc->poll_data = code;
@ -279,10 +275,8 @@ sackbc_attach(device_t parent, device_t self, void *aux)
if (child == NULL)
continue;
sc->slot = slot;
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(child),
RND_TYPE_TTY, 0);
#endif
/* only one of KBD_SLOT or AUX_SLOT is used. */
break;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x0_com.c,v 1.49 2011/07/01 20:31:39 dyoung Exp $ */
/* $NetBSD: sa11x0_com.c,v 1.50 2012/02/02 19:42:58 tls Exp $ */
/*-
* Copyright (c) 1998, 1999, 2001 The NetBSD Foundation, Inc.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.49 2011/07/01 20:31:39 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.50 2012/02/02 19:42:58 tls Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@ -74,7 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.49 2011/07/01 20:31:39 dyoung Exp $
#include "opt_lockdebug.h"
#include "rnd.h"
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
#include <sys/rnd.h>
#endif
@ -330,7 +330,7 @@ sacom_attach_subr(struct sacom_softc *sc)
sc->sc_si = softint_establish(SOFTINT_SERIAL, sacomsoft, sc);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_TTY, 0);
#endif
@ -380,7 +380,7 @@ sacom_detach(device_t dev, int flags)
/* Unhook the soft interrupt handler. */
softint_disestablish(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
/* Unhook the entropy source. */
rnd_detach_source(&sc->rnd_source);
#endif
@ -1393,7 +1393,7 @@ sacomintr(void *arg)
/* Wake up the poller. */
softint_schedule(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_add_uint32(&sc->rnd_source, iir | lsr);
#endif
return 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixp425_if_npe.c,v 1.21 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: ixp425_if_npe.c,v 1.22 2012/02/02 19:42:58 tls Exp $ */
/*-
* Copyright (c) 2006 Sam Leffler. All rights reserved.
@ -28,7 +28,7 @@
#if 0
__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $");
#endif
__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.21 2011/11/19 22:51:19 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.22 2012/02/02 19:42:58 tls Exp $");
/*
* Intel XScale NPE Ethernet driver.
@ -47,8 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.21 2011/11/19 22:51:19 tls Exp $
* XXX NPE-C port doesn't work yet
*/
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@ -70,9 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.21 2011/11/19 22:51:19 tls Exp $
#include <net/bpf.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <arm/xscale/ixp425reg.h>
#include <arm/xscale/ixp425var.h>
@ -126,9 +122,7 @@ struct npe_softc {
bus_dmamap_t sc_stats_map;
bus_addr_t sc_stats_phys; /* phys addr of sc_stats */
int sc_if_flags; /* keep last if_flags */
#if NRND > 0
krndsource_t rnd_source; /* random source */
#endif
};
/*
@ -338,10 +332,8 @@ npe_attach(struct device *parent, struct device *self, void *arg)
if_attach(ifp);
ether_ifattach(ifp, sc->sc_enaddr);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_NET, 0);
#endif
/* callback function to reset MAC */
isc->macresetcbfunc = npeinit_resetcb;
@ -838,10 +830,7 @@ npe_txdone(int qid, void *arg)
sc = npes[NPE_QM_Q_NPE(entry)];
DPRINTF(sc, "%s: entry 0x%x NPE %u port %u\n",
__func__, entry, NPE_QM_Q_NPE(entry), NPE_QM_Q_PORT(entry));
#if NRND > 0
if (RND_ENABLED(&sc->rnd_source))
rnd_add_uint32(&sc->rnd_source, entry);
#endif
rnd_add_uint32(&sc->rnd_source, entry);
npe = P2V(NPE_QM_Q_ADDR(entry), &sc->txdma);
m_freem(npe->ix_m);
@ -931,10 +920,7 @@ npe_rxdone(int qid, void *arg)
DPRINTF(sc, "%s: entry 0x%x neaddr 0x%x ne_len 0x%x\n",
__func__, entry, npe->ix_neaddr, npe->ix_hw->ix_ne[0].len);
#if NRND > 0
if (RND_ENABLED(&sc->rnd_source))
rnd_add_uint32(&sc->rnd_source, entry);
#endif
rnd_add_uint32(&sc->rnd_source, entry);
/*
* Allocate a new mbuf to replenish the rx buffer.
* If doing so fails we drop the rx'd frame so we

View File

@ -1,4 +1,4 @@
/* $NetBSD: ace_ebus.c,v 1.3 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: ace_ebus.c,v 1.4 2012/02/02 19:42:58 tls Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -31,9 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.3 2011/11/19 22:51:19 tls Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.4 2012/02/02 19:42:58 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -56,9 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: ace_ebus.c,v 1.3 2011/11/19 22:51:19 tls Exp $");
#include <sys/lock.h>
#include <sys/queue.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <machine/intr.h>
#include <machine/bus.h>
@ -192,9 +188,7 @@ struct ace_softc {
int hw_busy;
int retries; /* number of xfer retry */
#if NRND > 0
krndsource_t rnd_source;
#endif
};
int ace_ebus_match(device_t, cfdata_t, void *);
@ -1467,7 +1461,7 @@ sysace_send_config(struct ace_softc *sc, uint32_t *Data, unsigned int nBytes)
* Rest of code lifted with mods from the dev\ata\wd.c driver
*/
/* $NetBSD: ace_ebus.c,v 1.3 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: ace_ebus.c,v 1.4 2012/02/02 19:42:58 tls Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@ -1644,10 +1638,8 @@ aceattach(struct ace_softc *ace)
*/
disk_attach(&ace->sc_dk);
#if NRND > 0
rnd_attach_source(&ace->rnd_source, device_xname(ace->sc_dev),
RND_TYPE_DISK, 0);
#endif
}
@ -1703,10 +1695,8 @@ acedetach(struct device *self, int flags)
/* Detach disk. */
disk_detach(&sc->sc_dk);
#if NRND > 0
/* Unhook the entropy source. */
rnd_detach_source(&sc->rnd_source);
#endif
#if 0
sc->drvp->drive_flags = 0; /* no drive any more here */
@ -1901,9 +1891,7 @@ retry: /* Just reset and retry. Can we do more ? */
}
disk_unbusy(&ace->sc_dk, (bp->b_bcount - bp->b_resid),
(bp->b_flags & B_READ));
#if NRND > 0
rnd_add_uint32(&ace->rnd_source, bp->b_blkno);
#endif
biodone(bp);
ace->openings++;
acestart(ace);

View File

@ -1,4 +1,4 @@
/* $NetBSD: flash_ebus.c,v 1.3 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: flash_ebus.c,v 1.4 2012/02/02 19:42:59 tls Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.3 2011/11/19 22:51:19 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.4 2012/02/02 19:42:59 tls Exp $");
/* Driver for the Intel 28F320/640/128 (J3A150) StrataFlash memory device
* Extended to include the Intel JS28F256P30T95.
@ -61,9 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.3 2011/11/19 22:51:19 tls Exp $");
#include <sys/lock.h>
#include <sys/queue.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include "locators.h"
#include <prop/proplib.h>
@ -201,9 +199,7 @@ struct eflash_softc {
int retries; /* number of xfer retry */
#if NRND > 0
krndsource_t rnd_source;
#endif
/* flash-specific state */
struct _Flash *sc_dp;
@ -1306,7 +1302,7 @@ static int eflash_write_at (struct eflash_softc *sc,
/* Rest of code lifted with mods from the dev\ata\wd.c driver
*/
/* $NetBSD: flash_ebus.c,v 1.3 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: flash_ebus.c,v 1.4 2012/02/02 19:42:59 tls Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@ -1458,10 +1454,8 @@ eflashattach(struct eflash_softc *sc)
*/
disk_attach(&sc->sc_dk);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_DISK, 0);
#endif
}
@ -1520,10 +1514,8 @@ eflashdetach(struct device *self, int flags)
/* Detach disk. */
disk_detach(&sc->sc_dk);
#if NRND > 0
/* Unhook the entropy source. */
rnd_detach_source(&sc->rnd_source);
#endif
/*sc->drvp->drive_flags = 0; -- no drive any more here */
@ -1828,9 +1820,7 @@ retry: /* Just reset and retry. Can we do more ? */
}
disk_unbusy(&sc->sc_dk, (bp->b_bcount - bp->b_resid),
(bp->b_flags & B_READ));
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, bp->b_blkno);
#endif
biodone(bp);
sc->openings++;
eflashstart(sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_le_ebus.c,v 1.3 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: if_le_ebus.c,v 1.4 2012/02/02 19:42:59 tls Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -31,11 +31,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.3 2011/11/19 22:51:19 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.4 2012/02/02 19:42:59 tls Exp $");
#include "opt_inet.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -60,9 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.3 2011/11/19 22:51:19 tls Exp $");
#include <net/bpf.h>
#include <net/bpfdesc.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <emips/ebus/ebusvar.h>
#include <emips/emips/machdep.h>
@ -114,9 +112,7 @@ struct enic_softc {
uint8_t sc_enaddr[ETHER_ADDR_LEN];
uint8_t sc_pad[2];
#if NRND > 0
krndsource_t rnd_source;
#endif
};
void enic_reset(struct ifnet *);
@ -226,10 +222,8 @@ enic_attach(device_t parent, device_t self, void *aux)
if (sc->sc_sh == NULL)
panic("enic_attach: cannot establish shutdown hook");
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
ebus_intr_establish(parent, (void *)ia->ia_cookie, IPL_NET,
enic_intr, sc);
@ -708,9 +702,7 @@ enic_intr(void *cookie, void *f)
isr = sc->sc_regs->Control;
}
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, isr);
#endif
return 1;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: plcom.c,v 1.32 2011/04/24 16:26:55 rmind Exp $ */
/* $NetBSD: plcom.c,v 1.33 2012/02/02 19:42:59 tls Exp $ */
/*-
* Copyright (c) 2001 ARM Ltd
@ -94,7 +94,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.32 2011/04/24 16:26:55 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.33 2012/02/02 19:42:59 tls Exp $");
#include "opt_plcom.h"
#include "opt_ddb.h"
@ -103,7 +103,7 @@ __KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.32 2011/04/24 16:26:55 rmind Exp $");
#include "opt_multiprocessor.h"
#include "rnd.h"
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
#include <sys/rnd.h>
#endif
@ -436,7 +436,7 @@ plcom_attach_subr(struct plcom_softc *sc)
sc->sc_si = softint_establish(SOFTINT_SERIAL, plcomsoft, sc);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_TTY, 0);
#endif
@ -499,7 +499,7 @@ plcom_detach(struct device *self, int flags)
/* Unhook the soft interrupt handler. */
softint_disestablish(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
/* Unhook the entropy source. */
rnd_detach_source(&sc->rnd_source);
#endif
@ -1935,7 +1935,7 @@ plcomintr(void *arg)
/* Wake up the poller. */
softint_schedule(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_add_uint32(&sc->rnd_source, iir | rsr);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: plcomvar.h,v 1.7 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: plcomvar.h,v 1.8 2012/02/02 19:42:59 tls Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -36,7 +36,7 @@
#include "opt_plcom.h"
#include "opt_kgdb.h"
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
#include <sys/rnd.h>
#endif
@ -133,7 +133,7 @@ struct plcom_softc {
pps_info_t ppsinfo;
pps_params_t ppsparam;
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
krndsource_t rnd_source;
#endif
struct simplelock sc_lock;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_cs_smdk24x0.c,v 1.4 2011/07/01 20:44:21 dyoung Exp $ */
/* $NetBSD: if_cs_smdk24x0.c,v 1.5 2012/02/02 19:42:59 tls Exp $ */
/*
* Copyright (c) 2003 Genetec corporation. All rights reserved.
@ -72,17 +72,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_cs_smdk24x0.c,v 1.4 2011/07/01 20:44:21 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_cs_smdk24x0.c,v 1.5 2012/02/02 19:42:59 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/socket.h>
#include <sys/device.h>
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_ether.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_cs_mainbus.c,v 1.6 2011/06/20 05:15:59 matt Exp $ */
/* $NetBSD: if_cs_mainbus.c,v 1.7 2012/02/02 19:42:59 tls Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_cs_mainbus.c,v 1.6 2011/06/20 05:15:59 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_cs_mainbus.c,v 1.7 2012/02/02 19:42:59 tls Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -38,10 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_cs_mainbus.c,v 1.6 2011/06/20 05:15:59 matt Exp $
#include <sys/socket.h>
#include <sys/bus.h>
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_ether.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: rd.c,v 1.91 2011/07/28 03:42:20 uebayasi Exp $ */
/* $NetBSD: rd.c,v 1.92 2012/02/02 19:42:59 tls Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -72,10 +72,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.91 2011/07/28 03:42:20 uebayasi Exp $");
__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.92 2012/02/02 19:42:59 tls Exp $");
#include "opt_useleds.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -90,9 +89,7 @@ __KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.91 2011/07/28 03:42:20 uebayasi Exp $");
#include <sys/proc.h>
#include <sys/stat.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <hp300/dev/hpibvar.h>
@ -358,13 +355,11 @@ rdattach(device_t parent, device_t self, void *aux)
if (rddebug & RDB_ERROR)
rderrthresh = 0;
#endif
#if NRND > 0
/*
* attach the device into the random source list
*/
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_DISK, 0);
#endif
}
static int
@ -919,9 +914,7 @@ rdintr(void *arg)
}
if (rdfinish(sc, bp))
rdustart(sc);
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, bp->b_blkno);
#endif
}
static int

View File

@ -1,4 +1,4 @@
/* $NetBSD: rdvar.h,v 1.21 2011/11/19 22:51:19 tls Exp $ */
/* $NetBSD: rdvar.h,v 1.22 2012/02/02 19:42:59 tls Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -80,9 +80,7 @@ struct rd_softc {
int sc_active;
int sc_errcnt;
struct rdstats sc_stats;
#if NRND > 0
krndsource_t rnd_source;
#endif
};
/* sc_flags values */

View File

@ -1,4 +1,4 @@
/* $NetBSD: harmony.c,v 1.25 2011/11/24 03:35:56 mrg Exp $ */
/* $NetBSD: harmony.c,v 1.26 2012/02/02 19:42:59 tls Exp $ */
/* $OpenBSD: harmony.c,v 1.23 2004/02/13 21:28:19 mickey Exp $ */
@ -61,7 +61,7 @@
* Harmony (CS4215/AD1849 LASI) audio interface.
*/
#include "rnd.h"
#include <sys/param.h>
#include <sys/kernel.h>
@ -73,9 +73,7 @@
#include <sys/kmem.h>
#include <uvm/uvm_extern.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <sys/audioio.h>
#include <dev/audio_if.h>
@ -171,7 +169,6 @@ void harmony_try_more(struct harmony_softc *, int, int,
static void harmony_empty_input(struct harmony_softc *);
static void harmony_empty_output(struct harmony_softc *);
#if NRND > 0
void harmony_acc_tmo(void *);
#define ADD_CLKALLICA(sc) do { \
(sc)->sc_acc <<= 1; \
@ -180,7 +177,6 @@ void harmony_acc_tmo(void *);
rnd_add_uint32(&(sc)->sc_rnd_source, \
(sc)->sc_acc_num ^= (sc)->sc_acc); \
} while(0)
#endif
int
harmony_match(device_t parent, struct cfdata *match, void *aux)
@ -323,14 +319,12 @@ harmony_attach(device_t parent, device_t self, void *aux)
audio_attach_mi(&harmony_sa_hw_if, sc, sc->sc_dv);
#if NRND > 0
rnd_attach_source(&sc->sc_rnd_source, device_xname(sc->sc_dv),
RND_TYPE_UNKNOWN, 0);
callout_init(&sc->sc_acc_tmo, 0);
callout_setfunc(&sc->sc_acc_tmo, harmony_acc_tmo, sc);
sc->sc_acc_num = 0xa5a5a5a5;
#endif
}
void
@ -350,7 +344,6 @@ harmony_reset_codec(struct harmony_softc *sc)
WRITE_REG(sc, HARMONY_RESET, 0);
}
#if NRND > 0
void
harmony_acc_tmo(void *v)
{
@ -360,7 +353,6 @@ harmony_acc_tmo(void *v)
ADD_CLKALLICA(sc);
callout_schedule(&sc->sc_acc_tmo, 1);
}
#endif
/*
* interrupt handler
@ -374,9 +366,7 @@ harmony_intr(void *vsc)
sc = vsc;
r = 0;
#if NRND > 0
ADD_CLKALLICA(sc);
#endif
mutex_spin_enter(&sc->sc_intr_lock);
@ -1221,9 +1211,7 @@ harmony_start_cp(struct harmony_softc *sc, int start)
RCURADD_BUFMASK, &sc->sc_capture);
}
#if NRND > 0
callout_schedule(&sc->sc_acc_tmo, 1);
#endif
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: harmonyvar.h,v 1.6 2011/11/23 23:07:29 jmcneill Exp $ */
/* $NetBSD: harmonyvar.h,v 1.7 2012/02/02 19:42:59 tls Exp $ */
/* $OpenBSD: harmonyvar.h,v 1.8 2003/08/15 13:25:53 mickey Exp $ */
@ -106,11 +106,9 @@ struct harmony_softc {
int sc_micpreamp, sc_ov, sc_outputgain;
int sc_teleshare;
#if NRND > 0
krndsource_t sc_rnd_source;
struct callout sc_acc_tmo;
uint32_t sc_acc, sc_acc_num, sc_acc_cnt;
#endif
};
#define READ_REG(sc, reg) \

View File

@ -1,4 +1,4 @@
/* $NetBSD: fdc_pnpbios.c,v 1.16 2011/07/01 18:14:15 dyoung Exp $ */
/* $NetBSD: fdc_pnpbios.c,v 1.17 2012/02/02 19:42:59 tls Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -34,9 +34,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fdc_pnpbios.c,v 1.16 2011/07/01 18:14:15 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: fdc_pnpbios.c,v 1.17 2012/02/02 19:42:59 tls Exp $");
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -44,9 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: fdc_pnpbios.c,v 1.16 2011/07/01 18:14:15 dyoung Exp
#include <sys/device.h>
#include <sys/buf.h>
#include <sys/queue.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <sys/bus.h>
#include <machine/intr.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_gm.c,v 1.40 2011/11/19 22:51:20 tls Exp $ */
/* $NetBSD: if_gm.c,v 1.41 2012/02/02 19:42:59 tls Exp $ */
/*-
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
@ -27,10 +27,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.40 2011/11/19 22:51:20 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.41 2012/02/02 19:42:59 tls Exp $");
#include "opt_inet.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/device.h>
@ -41,9 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.40 2011/11/19 22:51:20 tls Exp $");
#include <sys/systm.h>
#include <sys/callout.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <uvm/uvm_extern.h>
@ -86,9 +83,7 @@ struct gmac_softc {
struct callout sc_tick_ch;
char sc_laddr[6];
#if NRND > 0
krndsource_t sc_rnd_source; /* random source */
#endif
};
#define sc_if sc_ethercom.ec_if
@ -252,9 +247,7 @@ gmac_attach(device_t parent, device_t self, void *aux)
if_attach(ifp);
ether_ifattach(ifp, laddr);
#if NRND > 0
rnd_attach_source(&sc->sc_rnd_source, xname, RND_TYPE_NET, 0);
#endif
}
u_int
@ -337,9 +330,7 @@ gmac_intr(void *v)
if (status & GMAC_INT_TXEMPTY)
gmac_tint(sc);
#if NRND > 0
rnd_add_uint32(&sc->sc_rnd_source, status);
#endif
return 1;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_aumac.c,v 1.33 2012/01/03 07:36:02 kiyohara Exp $ */
/* $NetBSD: if_aumac.c,v 1.34 2012/02/02 19:42:59 tls Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -46,9 +46,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.33 2012/01/03 07:36:02 kiyohara Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.34 2012/02/02 19:42:59 tls Exp $");
#include "rnd.h"
#include <sys/param.h>
#include <sys/bus.h>
@ -71,9 +71,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.33 2012/01/03 07:36:02 kiyohara Exp $
#include <net/if_ether.h>
#include <net/bpf.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <dev/mii/mii.h>
#include <dev/mii/miivar.h>
@ -142,9 +140,7 @@ struct aumac_softc {
int sc_rxptr; /* next ready Rx descriptor */
#if NRND > 0
krndsource_t rnd_source;
#endif
#ifdef AUMAC_EVENT_COUNTERS
struct evcnt sc_ev_txstall; /* Tx stalled */
@ -341,9 +337,8 @@ aumac_attach(device_t parent, device_t self, void *aux)
if_attach(ifp);
ether_ifattach(ifp, enaddr);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(self), RND_TYPE_NET, 0);
#endif
rnd_attach_source(&sc->rnd_source, device_xname(self),
RND_TYPE_NET, 0);
#ifdef AUMAC_EVENT_COUNTERS
evcnt_attach_dynamic(&sc->sc_ev_txstall, EVCNT_TYPE_MISC,
@ -532,10 +527,7 @@ aumac_intr(void *arg)
status = aumac_rxintr(sc);
status += aumac_txintr(sc);
#if NRND > 0
if (RND_ENABLED(&sc->rnd_source))
rnd_add_uint32(&sc->rnd_source, status);
#endif
rnd_add_uint32(&sc->rnd_source, status);
return status;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: aevar.h,v 1.4 2011/11/19 22:51:20 tls Exp $ */
/* $NetBSD: aevar.h,v 1.5 2012/02/02 19:43:00 tls Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -33,14 +33,10 @@
#ifndef _MIPS_ATHEROS_DEV_AEVAR_H_
#define _MIPS_ATHEROS_DEV_AEVAR_H_
#include "rnd.h"
#include <sys/queue.h>
#include <sys/callout.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
/*
* Misc. definitions for the Digital Semiconductor ``Tulip'' (21x4x)
@ -186,9 +182,7 @@ struct ae_softc {
int sc_rxptr; /* next ready RX descriptor/descsoft */
#if NRND > 0
krndsource_t sc_rnd_source; /* random source */
#endif
};
#endif

View File

@ -1,4 +1,4 @@
/* $Id: if_ae.c,v 1.21 2011/07/10 06:24:19 matt Exp $ */
/* $Id: if_ae.c,v 1.22 2012/02/02 19:43:00 tls Exp $ */
/*-
* Copyright (c) 2006 Urbana-Champaign Independent Media Center.
* Copyright (c) 2006 Garrett D'Amore.
@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.21 2011/07/10 06:24:19 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ae.c,v 1.22 2012/02/02 19:43:00 tls Exp $");
#include <sys/param.h>
@ -384,10 +384,8 @@ ae_attach(device_t parent, device_t self, void *aux)
ether_ifattach(ifp, enaddr);
ether_set_ifflags_cb(&sc->sc_ethercom, ae_ifflags_cb);
#if NRND > 0
rnd_attach_source(&sc->sc_rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_NET, 0);
#endif
/*
* Make sure the interface is shutdown during reboot.
@ -487,9 +485,7 @@ ae_detach(device_t self, int flags)
/* Delete all remaining media. */
ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY);
#if NRND > 0
rnd_detach_source(&sc->sc_rnd_source);
#endif
ether_ifdetach(ifp);
if_detach(ifp);
@ -999,10 +995,8 @@ ae_intr(void *arg)
/* Try to get more packets going. */
ae_start(ifp);
#if NRND > 0
if (handled)
rnd_add_uint32(&sc->sc_rnd_source, status);
#endif
return (handled);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbjcnvar.h,v 1.3 2011/02/01 03:16:54 matt Exp $ */
/* $NetBSD: sbjcnvar.h,v 1.4 2012/02/02 19:43:00 tls Exp $ */
/*
* Copyright 2000, 2001
@ -65,7 +65,7 @@
*/
#include "rnd.h"
#if NRND > 0 && defined(RND_SBJCN)
#ifdef RND_SBJCN
#include <sys/rnd.h>
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbscn.c,v 1.36 2011/07/10 23:32:03 matt Exp $ */
/* $NetBSD: sbscn.c,v 1.37 2012/02/02 19:43:00 tls Exp $ */
/*
* Copyright 2000, 2001
@ -109,7 +109,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbscn.c,v 1.36 2011/07/10 23:32:03 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbscn.c,v 1.37 2012/02/02 19:43:00 tls Exp $");
#define SBSCN_DEBUG
@ -117,7 +117,7 @@ __KERNEL_RCSID(0, "$NetBSD: sbscn.c,v 1.36 2011/07/10 23:32:03 matt Exp $");
#include "ioconf.h"
#include "rnd.h"
#if NRND > 0 && defined(RND_SBSCN)
#ifdef RND_SBSCN
#include <sys/rnd.h>
#endif
@ -382,7 +382,7 @@ sbscn_attach_channel(struct sbscn_softc *sc, int chan, int intr)
ch->ch_si = softint_establish(SOFTINT_SERIAL, sbscn_soft, ch);
#if NRND > 0 && defined(RND_SBSCN)
#ifdef RND_SBSCN
rnd_attach_source(&ch->ch_rnd_source, device_xname(sc->sc_dev),
RND_TYPE_TTY, 0);
#endif
@ -1661,7 +1661,7 @@ XXX
/* Wake up the poller. */
softint_schedule(ch->ch_si);
#if NRND > 0 && defined(RND_SBSCN)
#ifdef RND_SBSCN
rnd_add_uint32(&ch->ch_rnd_source, isr | sr);
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbscnvar.h,v 1.5 2011/11/19 22:51:20 tls Exp $ */
/* $NetBSD: sbscnvar.h,v 1.6 2012/02/02 19:43:00 tls Exp $ */
/*
* Copyright 2000, 2001
@ -65,7 +65,7 @@
*/
#include "rnd.h"
#if NRND > 0 && defined(RND_SBSCN)
#ifdef RND_SBSCN
#include <sys/rnd.h>
#endif
@ -156,7 +156,7 @@ struct sbscn_channel {
u_char ch_i_dcd_pin, ch_i_cts_pin, ch_i_dsr_pin, ch_i_ri_pin;
u_char ch_o_dtr_pin, ch_o_rts_pin;
#if NRND > 0 && defined(RND_SBSCN)
#ifdef RND_SBSCN
krndsource_t ch_rnd_source;
#endif
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: mb8795.c,v 1.49 2010/04/24 19:58:13 dbj Exp $ */
/* $NetBSD: mb8795.c,v 1.50 2012/02/02 19:43:00 tls Exp $ */
/*
* Copyright (c) 1998 Darrin B. Jewell
* All rights reserved.
@ -25,10 +25,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.49 2010/04/24 19:58:13 dbj Exp $");
__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.50 2012/02/02 19:43:00 tls Exp $");
#include "opt_inet.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -39,9 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.49 2010/04/24 19:58:13 dbj Exp $");
#include <sys/malloc.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -140,10 +137,8 @@ mb8795_config(struct mb8795_softc *sc, int *media, int nmedia, int defmedia)
if (sc->sc_sh == NULL)
panic("mb8795_config: can't establish shutdownhook");
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_NET, 0);
#endif
DPRINTF(("%s: leaving mb8795_config()\n",sc->sc_dev.dv_xname));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mb8795var.h,v 1.12 2011/11/19 22:51:20 tls Exp $ */
/* $NetBSD: mb8795var.h,v 1.13 2012/02/02 19:43:00 tls Exp $ */
/*
* Copyright (c) 1998 Darrin B. Jewell
* All rights reserved.
@ -24,10 +24,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "rnd.h" /* is random device-driver configured? */
#if NRND > 0
#include <sys/rnd.h>
#endif /* NRND */
#define MB8795_NRXBUFS (32)
@ -71,9 +68,7 @@ struct mb8795_softc {
struct ifmedia sc_media;
#if NRND > 0
krndsource_t rnd_source;
#endif /* NRND */
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: fdc_pnpbus.c,v 1.3 2011/07/01 16:55:42 dyoung Exp $ */
/* $NetBSD: fdc_pnpbus.c,v 1.4 2012/02/02 19:43:00 tls Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -34,9 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fdc_pnpbus.c,v 1.3 2011/07/01 16:55:42 dyoung Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: fdc_pnpbus.c,v 1.4 2012/02/02 19:43:00 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -44,9 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: fdc_pnpbus.c,v 1.3 2011/07/01 16:55:42 dyoung Exp $"
#include <sys/device.h>
#include <sys/buf.h>
#include <sys/queue.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <sys/bus.h>
#include <machine/intr.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sq.c,v 1.42 2011/07/01 18:53:47 dyoung Exp $ */
/* $NetBSD: if_sq.c,v 1.43 2012/02/02 19:43:00 tls Exp $ */
/*
* Copyright (c) 2001 Rafal K. Boni
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_sq.c,v 1.42 2011/07/01 18:53:47 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_sq.c,v 1.43 2012/02/02 19:43:00 tls Exp $");
#include <sys/param.h>
@ -927,10 +927,8 @@ sq_intr(void *arg)
handled++;
}
#if NRND > 0
if (handled)
rnd_add_uint32(&sc->rnd_source, stat);
#endif
return handled;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sqvar.h,v 1.13 2011/11/19 22:51:20 tls Exp $ */
/* $NetBSD: sqvar.h,v 1.14 2012/02/02 19:43:00 tls Exp $ */
/*
* Copyright (c) 2001 Rafal K. Boni
@ -30,14 +30,10 @@
#ifndef _ARCH_SGIMIPS_HPC_SQVAR_H_
#define _ARCH_SGIMIPS_HPC_SQVAR_H_
#include "rnd.h"
#include <sys/queue.h>
#include <sys/callout.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <sgimips/hpc/hpcvar.h>
#include <sgimips/hpc/hpcreg.h>
@ -156,9 +152,7 @@ struct sq_softc {
struct evcnt sq_intrcnt; /* count interrupts */
#if NRND > 0
krndsource_t rnd_source; /* random source */
#endif
struct hpc_values *hpc_regs; /* HPC register definitions */
int sq_trace_idx;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_mec.c,v 1.47 2011/11/19 22:51:20 tls Exp $ */
/* $NetBSD: if_mec.c,v 1.48 2012/02/02 19:43:00 tls Exp $ */
/*-
* Copyright (c) 2004, 2008 Izumi Tsutsui. All rights reserved.
@ -61,10 +61,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.47 2011/11/19 22:51:20 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.48 2012/02/02 19:43:00 tls Exp $");
#include "opt_ddb.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -77,9 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.47 2011/11/19 22:51:20 tls Exp $");
#include <sys/ioctl.h>
#include <sys/errno.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -316,9 +313,7 @@ struct mec_softc {
int sc_rxptr; /* next ready RX buffer */
#if NRND > 0
krndsource_t sc_rnd_source; /* random source */
#endif
#ifdef MEC_EVENT_COUNTERS
struct evcnt sc_ev_txpkts; /* TX packets queued total */
struct evcnt sc_ev_txdpad; /* TX packets padded in txdesc buf */
@ -624,10 +619,8 @@ mec_attach(device_t parent, device_t self, void *aux)
/* establish interrupt */
cpu_intr_establish(maa->maa_intr, maa->maa_intrmask, mec_intr, sc);
#if NRND > 0
rnd_attach_source(&sc->sc_rnd_source, device_xname(self),
RND_TYPE_NET, 0);
#endif
#ifdef MEC_EVENT_COUNTERS
evcnt_attach_dynamic(&sc->sc_ev_txpkts , EVCNT_TYPE_MISC,
@ -1619,10 +1612,8 @@ mec_intr(void *arg)
mec_start(ifp);
}
#if NRND > 0
if (handled)
rnd_add_uint32(&sc->sc_rnd_source, statreg);
#endif
return handled;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sci.c,v 1.53 2011/04/24 16:26:57 rmind Exp $ */
/* $NetBSD: sci.c,v 1.54 2012/02/02 19:43:00 tls Exp $ */
/*-
* Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu. All rights reserved.
@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.53 2011/04/24 16:26:57 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.54 2012/02/02 19:43:00 tls Exp $");
#include "opt_kgdb.h"
#include "opt_sci.h"
@ -1263,7 +1263,7 @@ sciintr(void *arg)
/* Wake up the poller. */
softint_schedule(sc->sc_si);
#if NRND > 0 && defined(RND_SCI)
#ifdef RND_SCI
rnd_add_uint32(&sc->rnd_source, iir | lsr);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: scif.c,v 1.60 2011/04/24 16:26:57 rmind Exp $ */
/* $NetBSD: scif.c,v 1.61 2012/02/02 19:43:00 tls Exp $ */
/*-
* Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu. All rights reserved.
@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.60 2011/04/24 16:26:57 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.61 2012/02/02 19:43:00 tls Exp $");
#include "opt_kgdb.h"
#include "opt_scif.h"
@ -1401,7 +1401,7 @@ scifintr(void *arg)
/* Wake up the poller. */
softint_schedule(sc->sc_si);
#if NRND > 0 && defined(RND_SCIF)
#ifdef RND_SCIF
rnd_add_uint32(&sc->rnd_source, iir | lsr);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ec.c,v 1.19 2011/11/19 22:51:21 tls Exp $ */
/* $NetBSD: if_ec.c,v 1.20 2012/02/02 19:43:00 tls Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,11 +34,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.19 2011/11/19 22:51:21 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.20 2012/02/02 19:43:00 tls Exp $");
#include "opt_inet.h"
#include "opt_ns.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -49,9 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.19 2011/11/19 22:51:21 tls Exp $");
#include <sys/syslog.h>
#include <sys/device.h>
#include <sys/endian.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -101,9 +98,7 @@ struct ec_softc {
u_char sc_colliding; /* nonzero if the net is colliding */
uint32_t sc_backoff_seed; /* seed for the backoff PRNG */
#if NRND > 0
krndsource_t rnd_source;
#endif
};
/* Macros to read and write the CSR. */
@ -249,10 +244,8 @@ ec_attach(device_t parent, device_t self, void *aux)
bus_intr_establish(mbma->mbma_bustag, mbma->mbma_pri, IPL_NET, 0,
ec_intr, sc);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(self),
RND_TYPE_NET, 0);
#endif
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.95 2011/11/19 22:51:21 tls Exp $ */
/* $NetBSD: fd.c,v 1.96 2012/02/02 19:43:01 tls Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -64,9 +64,8 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.95 2011/11/19 22:51:21 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.96 2012/02/02 19:43:01 tls Exp $");
#include "rnd.h"
#include "opt_ddb.h"
#include "opt_m68k_arch.h"
@ -88,9 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.95 2011/11/19 22:51:21 tls Exp $");
#include <sys/syslog.h>
#include <sys/queue.h>
#include <sys/fdio.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <uvm/uvm_extern.h>
@ -244,9 +241,7 @@ struct fd_softc {
#define SEC_P01 0x01 /* second part */
#define SEC_P11 0x03 /* both part */
#if NRND > 0
krndsource_t rnd_source;
#endif
};
/* floppy driver configuration */
@ -605,10 +600,8 @@ fdattach(device_t parent, device_t self, void *aux)
*/
mountroothook_establish(fd_mountroot_hook, fd->sc_dev);
#if NRND > 0
rnd_attach_source(&fd->rnd_source, device_xname(fd->sc_dev),
RND_TYPE_DISK, 0);
#endif
}
inline struct fd_type *
@ -737,9 +730,7 @@ fdfinish(struct fd_softc *fd, struct buf *bp)
bp->b_resid = fd->sc_bcount;
fd->sc_skip = 0;
#if NRND > 0
rnd_add_uint32(&fd->rnd_source, bp->b_blkno);
#endif
biodone(bp);
/* turn off motor 5s from now */

View File

@ -1,4 +1,4 @@
/* $NetBSD: fwhrng.c,v 1.4 2011/11/19 22:51:21 tls Exp $ */
/* $NetBSD: fwhrng.c,v 1.5 2012/02/02 19:43:01 tls Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@ -29,13 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fwhrng.c,v 1.4 2011/11/19 22:51:21 tls Exp $");
#include "rnd.h"
#if NRND == 0
#error fwhrng requires rnd pseudo-device
#endif
__KERNEL_RCSID(0, "$NetBSD: fwhrng.c,v 1.5 2012/02/02 19:43:01 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipmi.c,v 1.51 2012/01/10 15:23:11 njoly Exp $ */
/* $NetBSD: ipmi.c,v 1.52 2012/02/02 19:43:01 tls Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.51 2012/01/10 15:23:11 njoly Exp $");
__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.52 2012/02/02 19:43:01 tls Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -66,6 +66,7 @@ __KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.51 2012/01/10 15:23:11 njoly Exp $");
#include <sys/kthread.h>
#include <sys/bus.h>
#include <sys/intr.h>
#include <sys/rnd.h>
#include <x86/smbiosvar.h>
@ -87,13 +88,15 @@ struct ipmi_sensor {
sysmon_envsys_lim_t i_limits, i_deflims;
uint32_t i_props, i_defprops;
SLIST_ENTRY(ipmi_sensor) i_list;
int32_t i_prevval; /* feed rnd source on change */
krndsource_t i_rnd;
};
int ipmi_nintr;
int ipmi_dbg = 0;
int ipmi_enabled = 0;
#define SENSOR_REFRESH_RATE (5 * hz)
#define SENSOR_REFRESH_RATE (hz / 2)
#define SMBIOS_TYPE_IPMI 0x26
@ -1499,6 +1502,10 @@ ipmi_convert_sensor(uint8_t *reading, struct ipmi_sensor *psensor)
val = 0;
break;
}
if (val != psensor->i_prevval) {
rnd_add_uint32(&psensor->i_rnd, val);
psensor->i_prevval = val;
}
return val;
}
@ -1852,6 +1859,22 @@ add_child_sensors(struct ipmi_softc *sc, uint8_t *psdr, int count,
ipmi_is_dupname(psensor->i_envdesc));
}
/*
* Add entropy source.
*/
switch (psensor->i_envtype) {
case ENVSYS_STEMP:
case ENVSYS_SFANRPM:
rnd_attach_source(&psensor->i_rnd,
psensor->i_envdesc,
RND_TYPE_ENV, 0);
break;
default: /* XXX intrusion sensors? */
rnd_attach_source(&psensor->i_rnd,
psensor->i_envdesc,
RND_TYPE_POWER, 0);
}
dbg_printf(5, "add sensor:%.4x %.2x:%d ent:%.2x:%.2x %s\n",
s1->sdrhdr.record_id, s1->sensor_type,
typ, s1->entity_id, s1->entity_instance,

View File

@ -1,5 +1,5 @@
/* $OpenBSD: via.c,v 1.8 2006/11/17 07:47:56 tom Exp $ */
/* $NetBSD: via_padlock.c,v 1.20 2012/01/17 03:39:33 jakllsch Exp $ */
/* $NetBSD: via_padlock.c,v 1.21 2012/02/02 19:43:01 tls Exp $ */
/*-
* Copyright (c) 2003 Jason Wright
@ -20,14 +20,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.20 2012/01/17 03:39:33 jakllsch Exp $");
#ifdef _KERNEL_OPT
# include "rnd.h"
# if NRND == 0
# error padlock requires rnd pseudo-devices
# endif
#endif
__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.21 2012/02/02 19:43:01 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: xbdvar.h,v 1.13 2011/11/19 22:51:21 tls Exp $ */
/* $NetBSD: xbdvar.h,v 1.14 2012/02/02 19:43:01 tls Exp $ */
/*
*
@ -39,9 +39,7 @@ struct xbd_softc {
struct dk_intf *sc_di; /* pseudo-disk interface */
struct simplelock sc_slock; /* our lock */
int sc_shutdown; /* about to be removed */
#if NRND > 0
krndsource_t sc_rnd_source;
#endif
};
struct xbd_attach_args {

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_xennet_xenbus.c,v 1.57 2012/01/04 10:48:24 cherry Exp $ */
/* $NetBSD: if_xennet_xenbus.c,v 1.58 2012/02/02 19:43:01 tls Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -85,11 +85,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.57 2012/01/04 10:48:24 cherry Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.58 2012/02/02 19:43:01 tls Exp $");
#include "opt_xen.h"
#include "opt_nfs_boot.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/device.h>
@ -98,9 +97,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.57 2012/01/04 10:48:24 cherry
#include <sys/proc.h>
#include <sys/systm.h>
#include <sys/intr.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -204,9 +201,7 @@ struct xennet_xenbus_softc {
unsigned long sc_rx_feature;
#define FEATURE_RX_FLIP 0
#define FEATURE_RX_COPY 1
#if NRND > 0
krndsource_t sc_rnd_source;
#endif
};
#define SC_NLIVEREQ(sc) ((sc)->sc_rx_ring.req_prod_pvt - \
(sc)->sc_rx_ring.sring->rsp_prod)
@ -397,10 +392,8 @@ xennet_xenbus_attach(device_t parent, device_t self, void *aux)
return;
}
#if NRND > 0
rnd_attach_source(&sc->sc_rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
if (!pmf_device_register(self, xennet_xenbus_suspend,
xennet_xenbus_resume))
@ -439,10 +432,8 @@ xennet_xenbus_detach(device_t self, int flags)
ether_ifdetach(ifp);
if_detach(ifp);
#if NRND > 0
/* Unhook the entropy source. */
rnd_detach_source(&sc->sc_rnd_source);
#endif
while (xengnt_status(sc->sc_tx_ring_gntref)) {
tsleep(xennet_xenbus_detach, PRIBIO, "xnet_txref", hz/2);
@ -991,9 +982,7 @@ xennet_handler(void *arg)
xennet_tx_complete(sc);
#if NRND > 0
rnd_add_uint32(&sc->sc_rnd_source, sc->sc_tx_ring.req_prod_pvt);
#endif
again:
DPRINTFN(XEDB_EVENT, ("xennet_handler prod %d cons %d\n",
@ -1166,9 +1155,7 @@ xennet_start(struct ifnet *ifp)
DPRINTFN(XEDB_FOLLOW, ("%s: xennet_start()\n", device_xname(sc->sc_dev)));
#if NRND > 0
rnd_add_uint32(&sc->sc_rnd_source, sc->sc_tx_ring.req_prod_pvt);
#endif
xennet_tx_complete(sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pciback.c,v 1.6 2011/12/07 15:47:43 cegger Exp $ */
/* $NetBSD: pciback.c,v 1.7 2012/02/02 19:43:01 tls Exp $ */
/*
* Copyright (c) 2009 Manuel Bouyer.
@ -26,10 +26,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pciback.c,v 1.6 2011/12/07 15:47:43 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: pciback.c,v 1.7 2012/02/02 19:43:01 tls Exp $");
#include "opt_xen.h"
#include "rnd.h"
#include <sys/types.h>
#include <sys/param.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: xbd_xenbus.c,v 1.51 2012/01/27 19:48:39 para Exp $ */
/* $NetBSD: xbd_xenbus.c,v 1.52 2012/02/02 19:43:01 tls Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -50,10 +50,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.51 2012/01/27 19:48:39 para Exp $");
__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.52 2012/02/02 19:43:01 tls Exp $");
#include "opt_xen.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/buf.h>
@ -73,9 +73,7 @@ __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.51 2012/01/27 19:48:39 para Exp $")
#include <uvm/uvm.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <xen/hypervisor.h>
#include <xen/evtchn.h>
@ -154,9 +152,7 @@ struct xbd_xenbus_softc {
u_long sc_info; /* VDISK_* */
u_long sc_handle; /* from backend */
int sc_cache_flush; /* backend supports BLKIF_OP_FLUSH_DISKCACHE */
#if NRND > 0
krndsource_t sc_rnd_source;
#endif
};
#if 0
@ -305,10 +301,8 @@ xbd_xenbus_attach(device_t parent, device_t self, void *aux)
return;
}
#if NRND > 0
rnd_attach_source(&sc->sc_rnd_source, device_xname(self),
RND_TYPE_DISK, RND_FLAG_NO_COLLECT | RND_FLAG_NO_ESTIMATE);
#endif
if (!pmf_device_register(self, xbd_xenbus_suspend, xbd_xenbus_resume))
aprint_error_dev(self, "couldn't establish power handler\n");
@ -370,10 +364,8 @@ xbd_xenbus_detach(device_t dev, int flags)
/* detach disk */
disk_detach(&sc->sc_dksc.sc_dkdev);
disk_destroy(&sc->sc_dksc.sc_dkdev);
#if NRND > 0
/* Unhook the entropy source. */
rnd_detach_source(&sc->sc_rnd_source);
#endif
}
hypervisor_mask_event(sc->sc_evtchn);
@ -720,10 +712,8 @@ next:
disk_unbusy(&sc->sc_dksc.sc_dkdev,
(bp->b_bcount - bp->b_resid),
(bp->b_flags & B_READ));
#if NRND > 0
rnd_add_uint32(&sc->sc_rnd_source,
bp->b_blkno);
#endif
biodone(bp);
SLIST_INSERT_HEAD(&sc->sc_xbdreq_head, xbdreq, req_next);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: xpci_xenbus.c,v 1.9 2011/12/07 15:47:43 cegger Exp $ */
/* $NetBSD: xpci_xenbus.c,v 1.10 2012/02/02 19:43:01 tls Exp $ */
/*
* Copyright (c) 2009 Manuel Bouyer.
@ -26,10 +26,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.9 2011/12/07 15:47:43 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.10 2012/02/02 19:43:01 tls Exp $");
#include "opt_xen.h"
#include "rnd.h"
#include <sys/types.h>
#include <sys/param.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: files,v 1.1042 2012/01/31 05:08:14 macallan Exp $
# $NetBSD: files,v 1.1043 2012/02/02 19:43:01 tls Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20100430
@ -1449,8 +1449,6 @@ file dev/mm.c
file dev/mulaw.c mulaw needs-flag
file dev/nullcons_subr.c nullcons needs-flag
file dev/radio.c radio needs-flag
file dev/rnd.c
file dev/rndpool.c
file dev/rndpseudo.c rnd needs-flag
file dev/sequencer.c sequencer needs-flag
file dev/video.c video needs-flag
@ -1510,6 +1508,8 @@ file kern/kern_prot.c
file kern/kern_ras.c
file kern/kern_rate.c
file kern/kern_resource.c
file kern/kern_rndpool.c
file kern/kern_rndq.c
file kern/kern_runq.c
file kern/kern_rwlock.c
file kern/kern_rwlock_obj.c

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_tz.c,v 1.84 2011/10/02 22:20:33 jmcneill Exp $ */
/* $NetBSD: acpi_tz.c,v 1.85 2012/02/02 19:43:02 tls Exp $ */
/*
* Copyright (c) 2003 Jared D. McNeill <jmcneill@invisible.ca>
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.84 2011/10/02 22:20:33 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.85 2012/02/02 19:43:02 tls Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -39,6 +39,7 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.84 2011/10/02 22:20:33 jmcneill Exp $"
#include <sys/module.h>
#include <sys/systm.h>
#include <sys/kmem.h>
#include <sys/rnd.h>
#include <dev/acpi/acpireg.h>
#include <dev/acpi/acpivar.h>
@ -95,6 +96,7 @@ struct acpitz_zone {
uint32_t fanmin;
uint32_t fanmax;
uint32_t fancurrent;
uint32_t fanprev;
};
struct acpitz_softc {
@ -111,6 +113,8 @@ struct acpitz_softc {
bool sc_have_fan;
struct cpu_info **sc_psl;
size_t sc_psl_size;
krndsource_t sc_tmp_rs;
krndsource_t sc_fan_rs;
};
static int acpitz_match(device_t, cfdata_t, void *);
@ -163,6 +167,8 @@ acpitz_attach(device_t parent, device_t self, void *aux)
{
struct acpitz_softc *sc = device_private(self);
struct acpi_attach_args *aa = aux;
char tmpname[sizeof(sc->sc_tmp_rs.name)];
char fanname[sizeof(sc->sc_fan_rs.name)];
ACPI_INTEGER val;
ACPI_STATUS rv;
@ -211,6 +217,20 @@ acpitz_attach(device_t parent, device_t self, void *aux)
acpitz_init_envsys(self);
if (sc->sc_have_fan) {
snprintf(fanname, sizeof(fanname), "%s-fan",
device_xname(self));
snprintf(tmpname, sizeof(tmpname), "%s-tmp",
device_xname(self));
rnd_attach_source(&sc->sc_fan_rs,
fanname, RND_TYPE_ENV, 0);
rnd_attach_source(&sc->sc_tmp_rs,
tmpname, RND_TYPE_ENV, 0);
} else {
rnd_attach_source(&sc->sc_tmp_rs,
device_xname(self), RND_TYPE_ENV, 0);
}
callout_schedule(&sc->sc_callout, sc->sc_zone.tzp * hz / 10);
}
@ -226,6 +246,11 @@ acpitz_detach(device_t self, int flags)
callout_halt(&sc->sc_callout, NULL);
callout_destroy(&sc->sc_callout);
rnd_detach_source(&sc->sc_tmp_rs);
if (sc->sc_have_fan) {
rnd_detach_source(&sc->sc_fan_rs);
}
pmf_device_deregister(self);
acpi_deregister_notify(sc->sc_node);
@ -295,10 +320,19 @@ acpitz_get_status(void *opaque)
if (sc->sc_first != false)
sc->sc_zone.prevtmp = tmp; /* XXX: Sanity check? */
if (acpitz_get_fanspeed(dv, &fmin, &fmax, &fcurrent) == 0) {
if (sc->sc_zone.prevtmp != sc->sc_zone.tmp) {
rnd_add_uint32(&sc->sc_tmp_rs, sc->sc_zone.tmp);
}
if (fcurrent != ATZ_TMP_INVALID)
if (acpitz_get_fanspeed(dv, &fmin, &fmax, &fcurrent) == 0) {
if (fcurrent != ATZ_TMP_INVALID) {
sc->sc_zone.fanprev = sc->sc_zone.fancurrent;
sc->sc_zone.fancurrent = fcurrent;
if (sc->sc_zone.fanprev != sc->sc_zone.fancurrent) {
rnd_add_uint32(&sc->sc_fan_rs,
sc->sc_zone.fancurrent);
}
}
}
sc->sc_temp_sensor.state = ENVSYS_SVALID;

View File

@ -1,4 +1,4 @@
/* $NetBSD: fdc_acpi.c,v 1.41 2010/08/07 09:55:59 jruoho Exp $ */
/* $NetBSD: fdc_acpi.c,v 1.42 2012/02/02 19:43:02 tls Exp $ */
/*
* Copyright (c) 2002 Jared D. McNeill <jmcneill@invisible.ca>
@ -31,16 +31,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fdc_acpi.c,v 1.41 2010/08/07 09:55:59 jruoho Exp $");
__KERNEL_RCSID(0, "$NetBSD: fdc_acpi.c,v 1.42 2012/02/02 19:43:02 tls Exp $");
#include <sys/param.h>
#include <sys/device.h>
#include <sys/disk.h>
#include <sys/systm.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <dev/acpi/acpireg.h>
#include <dev/acpi/acpivar.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_ataraid.c,v 1.38 2011/06/12 03:35:52 rmind Exp $ */
/* $NetBSD: ld_ataraid.c,v 1.39 2012/02/02 19:43:02 tls Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -47,10 +47,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.38 2011/06/12 03:35:52 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.39 2012/02/02 19:43:02 tls Exp $");
#include "bio.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -66,9 +66,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.38 2011/06/12 03:35:52 rmind Exp $"
#include <sys/malloc.h>
#include <sys/vnode.h>
#include <sys/kauth.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#if NBIO > 0
#include <dev/ata/atavar.h>
#include <dev/ata/atareg.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: wd.c,v 1.391 2012/01/24 20:04:07 jakllsch Exp $ */
/* $NetBSD: wd.c,v 1.392 2012/02/02 19:43:02 tls Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@ -54,12 +54,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.391 2012/01/24 20:04:07 jakllsch Exp $");
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.392 2012/02/02 19:43:02 tls Exp $");
#include "opt_ata.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@ -78,9 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.391 2012/01/24 20:04:07 jakllsch Exp $");
#include <sys/proc.h>
#include <sys/reboot.h>
#include <sys/vnode.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <sys/intr.h>
#include <sys/bus.h>
@ -391,10 +387,8 @@ wdattach(device_t parent, device_t self, void *aux)
disk_init(&wd->sc_dk, device_xname(wd->sc_dev), &wddkdriver);
disk_attach(&wd->sc_dk);
wd->sc_wdc_bio.lp = wd->sc_dk.dk_label;
#if NRND > 0
rnd_attach_source(&wd->rnd_source, device_xname(wd->sc_dev),
RND_TYPE_DISK, 0);
#endif
/* Discover wedges on this disk. */
dkwedge_discover(&wd->sc_dk);
@ -462,10 +456,8 @@ wddetach(device_t self, int flags)
pmf_device_deregister(self);
#if NRND > 0
/* Unhook the entropy source. */
rnd_detach_source(&sc->rnd_source);
#endif
callout_destroy(&sc->sc_restart_ch);
@ -829,9 +821,7 @@ noerror: if ((wd->sc_wdc_bio.flags & ATA_CORR) || wd->retries > 0)
}
disk_unbusy(&wd->sc_dk, (bp->b_bcount - bp->b_resid),
(bp->b_flags & B_READ));
#if NRND > 0
rnd_add_uint32(&wd->rnd_source, bp->b_blkno);
#endif
/* XXX Yuck, but we don't want to increment openings in this case */
if (__predict_false(bp->b_iodone == wd_split_mod15_write))
biodone(bp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdvar.h,v 1.39 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: wdvar.h,v 1.40 2012/02/02 19:43:02 tls Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@ -31,6 +31,8 @@
#include "opt_wd_softbadsect.h"
#endif
#include <sys/rnd.h>
struct wd_softc {
/* General disk infos */
device_t sc_dev;
@ -66,9 +68,7 @@ struct wd_softc {
SLIST_HEAD(, disk_badsectors) sc_bslist;
u_int sc_bscount;
#endif
#if NRND > 0
krndsource_t rnd_source;
#endif
};
#define sc_drive sc_wdc_bio.drive

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_fxp_cardbus.c,v 1.49 2011/09/05 04:36:50 msaitoh Exp $ */
/* $NetBSD: if_fxp_cardbus.c,v 1.50 2012/02/02 19:43:02 tls Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -34,10 +34,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_fxp_cardbus.c,v 1.49 2011/09/05 04:36:50 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_fxp_cardbus.c,v 1.50 2012/02/02 19:43:02 tls Exp $");
#include "opt_inet.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -49,9 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_fxp_cardbus.c,v 1.49 2011/09/05 04:36:50 msaitoh
#include <sys/errno.h>
#include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_rtk_cardbus.c,v 1.46 2011/08/01 11:20:27 drochner Exp $ */
/* $NetBSD: if_rtk_cardbus.c,v 1.47 2012/02/02 19:43:02 tls Exp $ */
/*
* Copyright (c) 2000 Masanori Kanaoka
@ -36,10 +36,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_rtk_cardbus.c,v 1.46 2011/08/01 11:20:27 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_rtk_cardbus.c,v 1.47 2012/02/02 19:43:02 tls Exp $");
#include "opt_inet.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -61,9 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_rtk_cardbus.c,v 1.46 2011/08/01 11:20:27 drochner
#include <netinet/if_inarp.h>
#endif
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <sys/bus.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: rbus_ppb.c,v 1.41 2011/08/01 11:20:28 drochner Exp $ */
/* $NetBSD: rbus_ppb.c,v 1.42 2012/02/02 19:43:02 tls Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rbus_ppb.c,v 1.41 2011/08/01 11:20:28 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: rbus_ppb.c,v 1.42 2012/02/02 19:43:02 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -47,9 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: rbus_ppb.c,v 1.41 2011/08/01 11:20:28 drochner Exp $
#include <sys/device.h>
#include <sys/kmem.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <machine/endian.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: rd.c,v 1.29 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: rd.c,v 1.30 2012/02/02 19:43:02 tls Exp $ */
/*-
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@ -72,9 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.29 2011/11/19 22:51:22 tls Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.30 2012/02/02 19:43:02 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -91,9 +89,7 @@ __KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.29 2011/11/19 22:51:22 tls Exp $");
#include <sys/proc.h>
#include <sys/stat.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <dev/gpib/gpibvar.h>
#include <dev/gpib/cs80busvar.h>
@ -142,9 +138,7 @@ struct rd_softc {
struct callout sc_restart_ch;
#if NRND > 0
krndsource_t rnd_source;
#endif
};
#define RDUNIT(dev) DISKUNIT(dev)
@ -412,13 +406,11 @@ rdattach(device_t parent, device_t self, void *aux)
if (rddebug & RDB_ERROR)
rderrthresh = 0;
#endif
#if NRND > 0
/*
* attach the device into the random source list
*/
rnd_attach_source(&sc->rnd_source, device_xname(&sc->sc_dev),
RND_TYPE_DISK, 0);
#endif
}
/*
@ -798,9 +790,7 @@ rdintr(struct rd_softc *sc)
}
if (rdfinish(sc, bp) != NULL)
rdustart(sc);
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, bp->b_blkno);
#endif
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_iop.c,v 1.33 2008/12/15 18:35:48 mhitch Exp $ */
/* $NetBSD: ld_iop.c,v 1.34 2012/02/02 19:43:02 tls Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -36,9 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ld_iop.c,v 1.33 2008/12/15 18:35:48 mhitch Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: ld_iop.c,v 1.34 2012/02/02 19:43:02 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -50,9 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld_iop.c,v 1.33 2008/12/15 18:35:48 mhitch Exp $");
#include <sys/dkio.h>
#include <sys/disk.h>
#include <sys/proc.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <sys/bus.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: am7990.c,v 1.73 2010/04/05 07:19:33 joerg Exp $ */
/* $NetBSD: am7990.c,v 1.74 2012/02/02 19:43:02 tls Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -65,9 +65,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.73 2010/04/05 07:19:33 joerg Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.74 2012/02/02 19:43:02 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -78,9 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.73 2010/04/05 07:19:33 joerg Exp $");
#include <sys/malloc.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -449,9 +445,7 @@ am7990_intr(void *arg)
if (isr & LE_C0_TINT)
am7990_tint(sc);
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, isr);
#endif
return (1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: am79900.c,v 1.22 2010/04/05 07:19:33 joerg Exp $ */
/* $NetBSD: am79900.c,v 1.23 2012/02/02 19:43:02 tls Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -103,9 +103,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.22 2010/04/05 07:19:33 joerg Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.23 2012/02/02 19:43:02 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -116,9 +114,7 @@ __KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.22 2010/04/05 07:19:33 joerg Exp $");
#include <sys/malloc.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -470,9 +466,7 @@ am79900_intr(void *arg)
if (isr & LE_C0_TINT)
am79900_tint(sc);
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, isr);
#endif
return (1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: com.c,v 1.303 2011/11/27 18:17:08 jakllsch Exp $ */
/* $NetBSD: com.c,v 1.304 2012/02/02 19:43:02 tls Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.303 2011/11/27 18:17:08 jakllsch Exp $");
__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.304 2012/02/02 19:43:02 tls Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@ -76,7 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: com.c,v 1.303 2011/11/27 18:17:08 jakllsch Exp $");
#include "opt_ntp.h"
#include "rnd.h"
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
#include <sys/rnd.h>
#endif
@ -554,7 +554,7 @@ fifodone:
sc->sc_si = softint_establish(SOFTINT_SERIAL, comsoft, sc);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_TTY, 0);
#endif
@ -684,7 +684,7 @@ com_detach(device_t self, int flags)
/* Unhook the soft interrupt handler. */
softint_disestablish(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
/* Unhook the entropy source. */
rnd_detach_source(&sc->rnd_source);
#endif
@ -2070,7 +2070,7 @@ again: do {
/* Wake up the poller. */
softint_schedule(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
rnd_add_uint32(&sc->rnd_source, iir | lsr);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: comvar.h,v 1.72 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: comvar.h,v 1.73 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -36,7 +36,7 @@
#include "opt_com.h"
#include "opt_kgdb.h"
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
#include <sys/rnd.h>
#endif
@ -227,7 +227,7 @@ struct com_softc {
struct pps_state sc_pps_state; /* pps state */
#if NRND > 0 && defined(RND_COM)
#ifdef RND_COM
krndsource_t rnd_source;
#endif
kmutex_t sc_lock;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cs89x0.c,v 1.32 2010/11/13 13:52:00 uebayasi Exp $ */
/* $NetBSD: cs89x0.c,v 1.33 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 2004 Christopher Gilbert
@ -212,7 +212,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cs89x0.c,v 1.32 2010/11/13 13:52:00 uebayasi Exp $");
__KERNEL_RCSID(0, "$NetBSD: cs89x0.c,v 1.33 2012/02/02 19:43:03 tls Exp $");
#include "opt_inet.h"
@ -226,10 +226,7 @@ __KERNEL_RCSID(0, "$NetBSD: cs89x0.c,v 1.32 2010/11/13 13:52:00 uebayasi Exp $")
#include <sys/ioctl.h>
#include <sys/errno.h>
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_ether.h>
@ -491,10 +488,8 @@ cs_attach(struct cs_softc *sc, u_int8_t *enaddr, int *media,
if_attach(ifp);
ether_ifattach(ifp, sc->sc_enaddr);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
sc->sc_cfgflags |= CFGFLG_ATTACHED;
if (pmf_device_register1(sc->sc_dev, NULL, NULL, cs_shutdown))
@ -519,9 +514,7 @@ cs_detach(struct cs_softc *sc)
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
if (sc->sc_cfgflags & CFGFLG_ATTACHED) {
#if NRND > 0
rnd_detach_source(&sc->rnd_source);
#endif
ether_ifdetach(ifp);
if_detach(ifp);
sc->sc_cfgflags &= ~CFGFLG_ATTACHED;
@ -1390,9 +1383,7 @@ cs_intr(void *arg)
{
struct cs_softc *sc = arg;
u_int16_t Event;
#if NRND > 0
u_int16_t rndEvent;
#endif
/*printf("cs_intr %p\n", sc);*/
/* Ignore any interrupts that happen while the chip is being reset */
@ -1411,9 +1402,7 @@ cs_intr(void *arg)
if ((Event & REG_NUM_MASK) == 0 || Event == 0xffff)
return 0; /* not ours */
#if NRND > 0
rndEvent = Event;
#endif
/* Process all the events in the Interrupt Status Queue */
while ((Event & REG_NUM_MASK) != 0 && Event != 0xffff) {
@ -1446,9 +1435,7 @@ cs_intr(void *arg)
}
/* have handled the interrupt */
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, rndEvent);
#endif
return 1;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: cs89x0var.h,v 1.15 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: cs89x0var.h,v 1.16 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright 1997
@ -104,9 +104,7 @@ struct cs_softc {
int eeprom_size; /* how large is the eeprom (in bytes) */
u_int16_t *eeprom_data; /* copy of the eeprom data */
#if NRND > 0
krndsource_t rnd_source; /* random source */
#endif
/* power management */
int (*sc_enable)(struct cs_softc *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: dp8390.c,v 1.79 2010/04/11 09:58:36 tsutsui Exp $ */
/* $NetBSD: dp8390.c,v 1.80 2012/02/02 19:43:03 tls Exp $ */
/*
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@ -14,11 +14,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.79 2010/04/11 09:58:36 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.80 2012/02/02 19:43:03 tls Exp $");
#include "opt_ipkdb.h"
#include "opt_inet.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -29,9 +28,7 @@ __KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.79 2010/04/11 09:58:36 tsutsui Exp $");
#include <sys/socket.h>
#include <sys/syslog.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -156,10 +153,8 @@ dp8390_config(struct dp8390_softc *sc)
if_attach(ifp);
ether_ifattach(ifp, sc->sc_enaddr);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
/* The attach is successful. */
sc->sc_flags |= DP8390_ATTACHED;
@ -627,9 +622,7 @@ dp8390_intr(void *arg)
bus_space_handle_t regh = sc->sc_regh;
struct ifnet *ifp = &sc->sc_ec.ec_if;
uint8_t isr;
#if NRND > 0
uint8_t rndisr;
#endif
if (sc->sc_enabled == 0 ||
!device_is_active(sc->sc_dev))
@ -645,9 +638,7 @@ dp8390_intr(void *arg)
if (isr == 0)
return 0;
#if NRND > 0
rndisr = isr;
#endif
/* Loop until there are no more new interrupts. */
for (;;) {
@ -825,9 +816,7 @@ dp8390_intr(void *arg)
}
out:
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, rndisr);
#endif
return 1;
}
@ -1258,9 +1247,7 @@ dp8390_detach(struct dp8390_softc *sc, int flags)
/* Delete all remaining media. */
ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY);
#if NRND > 0
rnd_detach_source(&sc->rnd_source);
#endif
ether_ifdetach(ifp);
if_detach(ifp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: dp8390var.h,v 1.31 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: dp8390var.h,v 1.32 2012/02/02 19:43:03 tls Exp $ */
/*
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@ -13,10 +13,7 @@
* the author assume any responsibility for damages incurred with its use.
*/
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
/*
* We include MII glue here -- some DP8390 compatible chips have
@ -71,9 +68,7 @@ struct dp8390_softc {
int sc_enabled; /* boolean; power enabled on interface */
#if NRND > 0
krndsource_t rnd_source; /* random source */
#endif
int (*test_mem)(struct dp8390_softc *);
void (*init_card)(struct dp8390_softc *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: elink3.c,v 1.131 2010/04/05 07:19:34 joerg Exp $ */
/* $NetBSD: elink3.c,v 1.132 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@ -62,10 +62,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.131 2010/04/05 07:19:34 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.132 2012/02/02 19:43:03 tls Exp $");
#include "opt_inet.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -78,9 +77,7 @@ __KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.131 2010/04/05 07:19:34 joerg Exp $");
#include <sys/syslog.h>
#include <sys/select.h>
#include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -490,10 +487,8 @@ epconfig(struct ep_softc *sc, u_short chipset, u_int8_t *enaddr)
GO_WINDOW(1); /* Window 1 is operating window */
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
sc->tx_start_thresh = 20; /* probably a good starting point. */
@ -1433,10 +1428,8 @@ epintr(void *arg)
epstart(ifp);
}
#if NRND > 0
if (status)
rnd_add_uint32(&sc->rnd_source, status);
#endif
}
/* no more interrupts */
@ -2031,9 +2024,7 @@ ep_detach(device_t self, int flags)
/* Delete all remaining media. */
ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY);
#if NRND > 0
rnd_detach_source(&sc->rnd_source);
#endif
ether_ifdetach(ifp);
if_detach(ifp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: elink3var.h,v 1.37 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: elink3var.h,v 1.38 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 1994 Herb Peyerl <hpeyerl@beer.org>
@ -30,11 +30,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
/*
* Ethernet software status per interface.
@ -101,9 +97,7 @@ struct ep_softc {
#define ELINK_IS_BUS_32(a) ((a) & 0x2)
int ep_pktlenshift; /* scale factor for pkt lengths */
#if NRND > 0
krndsource_t rnd_source;
#endif
/* power management hooks */
int (*enable)(struct ep_softc *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: elinkxl.c,v 1.113 2010/11/13 13:52:01 uebayasi Exp $ */
/* $NetBSD: elinkxl.c,v 1.114 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -30,9 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.113 2010/11/13 13:52:01 uebayasi Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.114 2012/02/02 19:43:03 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -45,9 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.113 2010/11/13 13:52:01 uebayasi Exp $
#include <sys/syslog.h>
#include <sys/select.h>
#include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -440,10 +436,8 @@ ex_config(struct ex_softc *sc)
/* TODO: set queues to 0 */
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
if (pmf_device_register1(sc->sc_dev, NULL, NULL, ex_shutdown))
pmf_class_network_register(sc->sc_dev, &sc->sc_ethercom.ec_if);
@ -1420,10 +1414,8 @@ ex_intr(void *arg)
}
}
#if NRND > 0
if (stat)
rnd_add_uint32(&sc->rnd_source, stat);
#endif
}
/* no more interrupts */
@ -1707,9 +1699,7 @@ ex_detach(struct ex_softc *sc)
/* Delete all remaining media. */
ifmedia_delete_instance(&sc->ex_mii.mii_media, IFM_INST_ANY);
#if NRND > 0
rnd_detach_source(&sc->rnd_source);
#endif
ether_ifdetach(ifp);
if_detach(ifp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: elinkxlvar.h,v 1.23 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: elinkxlvar.h,v 1.24 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -29,11 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
/*
* Ethernet software status per interface.
@ -109,9 +105,7 @@ struct ex_softc {
#define EX_FLAGS_POWERMGMT 0x2000
#define EX_FLAGS_ATTACHED 0x4000 /* attach has succeeded */
#if NRND > 0
krndsource_t rnd_source;
#endif
/* power management hooks */
int (*enable)(struct ex_softc *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: gem.c,v 1.97 2011/05/22 11:19:23 jdc Exp $ */
/* $NetBSD: gem.c,v 1.98 2012/02/02 19:43:03 tls Exp $ */
/*
*
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.97 2011/05/22 11:19:23 jdc Exp $");
__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.98 2012/02/02 19:43:03 tls Exp $");
#include "opt_inet.h"
@ -171,9 +171,7 @@ gem_detach(struct gem_softc *sc, int flags)
#endif
evcnt_detach(&sc->sc_ev_intr);
#if NRND > 0
rnd_detach_source(&sc->rnd_source);
#endif
ether_ifdetach(ifp);
if_detach(ifp);
ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY);
@ -580,10 +578,8 @@ gem_attach(struct gem_softc *sc, const uint8_t *enaddr)
ether_ifattach(ifp, enaddr);
ether_set_ifflags_cb(&sc->sc_ethercom, gem_ifflags_cb);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
evcnt_attach_dynamic(&sc->sc_ev_intr, EVCNT_TYPE_INTR,
NULL, device_xname(sc->sc_dev), "interrupts");
@ -2236,9 +2232,7 @@ gem_intr(void *v)
if ((status & GEM_INTR_MIF) != 0)
aprintf_debug_dev(sc->sc_dev, "MIF interrupt\n");
*/
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, status);
#endif
return (r);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: gemvar.h,v 1.22 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: gemvar.h,v 1.23 2012/02/02 19:43:03 tls Exp $ */
/*
*
@ -33,14 +33,10 @@
#define _IF_GEMVAR_H
#include "rnd.h"
#include <sys/queue.h>
#include <sys/callout.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
/*
* Misc. definitions for the Sun ``Gem'' Ethernet controller family driver.
@ -216,9 +212,7 @@ struct gem_softc {
void (*sc_hwreset)(struct gem_softc *);
void (*sc_hwinit)(struct gem_softc *);
#if NRND > 0
krndsource_t rnd_source;
#endif
struct evcnt sc_ev_intr;
#ifdef GEM_COUNTERS

View File

@ -1,4 +1,4 @@
/* $NetBSD: hme.c,v 1.86 2010/04/05 07:19:34 joerg Exp $ */
/* $NetBSD: hme.c,v 1.87 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -34,12 +34,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.86 2010/04/05 07:19:34 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.87 2012/02/02 19:43:03 tls Exp $");
/* #define HMEDEBUG */
#include "opt_inet.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -51,9 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.86 2010/04/05 07:19:34 joerg Exp $");
#include <sys/malloc.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -324,10 +321,8 @@ hme_config(struct hme_softc *sc)
aprint_error_dev(sc->sc_dev,
"couldn't establish power handler\n");
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
callout_init(&sc->sc_tick_ch, 0);
}
@ -1162,9 +1157,7 @@ hme_intr(void *v)
if ((status & HME_SEB_STAT_RXTOHOST) != 0)
r |= hme_rint(sc);
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, status);
#endif
return (r);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hmevar.h,v 1.22 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: hmevar.h,v 1.23 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -29,12 +29,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "rnd.h"
#include <sys/callout.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
struct hme_ring {
@ -94,9 +91,7 @@ struct hme_softc {
void (*sc_hwreset)(struct hme_softc *);
void (*sc_hwinit)(struct hme_softc *);
#if NRND > 0
krndsource_t rnd_source;
#endif
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82557.c,v 1.138 2011/09/02 03:16:18 msaitoh Exp $ */
/* $NetBSD: i82557.c,v 1.139 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@ -66,9 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.138 2011/09/02 03:16:18 msaitoh Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.139 2012/02/02 19:43:03 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -85,9 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.138 2011/09/02 03:16:18 msaitoh Exp $")
#include <machine/endian.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -412,10 +408,8 @@ fxp_attach(struct fxp_softc *sc)
*/
if_attach(ifp);
ether_ifattach(ifp, enaddr);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
#ifdef FXP_EVENT_COUNTERS
evcnt_attach_dynamic(&sc->sc_ev_txstall, EVCNT_TYPE_MISC,
@ -1149,10 +1143,8 @@ fxp_intr(void *arg)
}
}
#if NRND > 0
if (claimed)
rnd_add_uint32(&sc->rnd_source, statack);
#endif
return (claimed);
}
@ -2526,9 +2518,7 @@ fxp_detach(struct fxp_softc *sc, int flags)
/* Delete all remaining media. */
ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY);
#if NRND > 0
rnd_detach_source(&sc->rnd_source);
#endif
ether_ifdetach(ifp);
if_detach(ifp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82557var.h,v 1.49 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: i82557var.h,v 1.50 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2001 The NetBSD Foundation, Inc.
@ -241,10 +241,7 @@ struct fxp_softc {
void (*sc_disable)(struct fxp_softc *);
int sc_eeprom_size; /* log2 size of EEPROM */
#if NRND > 0
krndsource_t rnd_source; /* random source */
#endif
};
#ifdef FXP_EVENT_COUNTERS

View File

@ -1,4 +1,4 @@
/* $NetBSD: lan9118.c,v 1.14 2010/04/05 07:19:35 joerg Exp $ */
/* $NetBSD: lan9118.c,v 1.15 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 2008 KIYOHARA Takashi
* All rights reserved.
@ -25,7 +25,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.14 2010/04/05 07:19:35 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.15 2012/02/02 19:43:03 tls Exp $");
/*
* The LAN9118 Family
@ -47,8 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.14 2010/04/05 07:19:35 joerg Exp $");
* Also support HP Auto-MDIX.
*/
#include "rnd.h"
#include <sys/param.h>
#include <sys/callout.h>
#include <sys/device.h>
@ -67,9 +65,7 @@ __KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.14 2010/04/05 07:19:35 joerg Exp $");
#include <dev/mii/miivar.h>
#include <net/bpf.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <dev/ic/lan9118reg.h>
#include <dev/ic/lan9118var.h>
@ -282,10 +278,8 @@ lan9118_attach(struct lan9118_softc *sc)
callout_init(&sc->sc_tick, 0);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
return 0;
}
@ -341,10 +335,7 @@ lan9118_intr(void *arg)
if (!IFQ_IS_EMPTY(&ifp->if_snd))
lan9118_start(ifp);
#if NRND > 0
if (RND_ENABLED(&sc->rnd_source))
rnd_add_uint32(&sc->rnd_source, datum);
#endif
rnd_add_uint32(&sc->rnd_source, datum);
return handled;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: lan9118var.h,v 1.3 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: lan9118var.h,v 1.4 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 2008 KIYOHARA Takashi
* All rights reserved.
@ -28,11 +28,7 @@
#ifndef _LAN9118VAR_H_
#define _LAN9118VAR_H_
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
#define LAN9118_DEFAULT_TX_FIF_SZ 5 /*kB*/
@ -75,9 +71,7 @@ struct lan9118_softc {
#define LAN9118_FLAGS_SWAP 0x00000001
#define LAN9118_FLAGS_NO_EEPROM 0x00000002
#if NRND > 0
krndsource_t rnd_source;
#endif
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: lance.c,v 1.45 2010/04/05 07:19:35 joerg Exp $ */
/* $NetBSD: lance.c,v 1.46 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -65,9 +65,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lance.c,v 1.45 2010/04/05 07:19:35 joerg Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: lance.c,v 1.46 2012/02/02 19:43:03 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -78,9 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: lance.c,v 1.45 2010/04/05 07:19:35 joerg Exp $");
#include <sys/malloc.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -258,10 +254,8 @@ lance_config(struct lance_softc *sc)
sc->sc_tbufaddr = malloc(sc->sc_ntbuf * sizeof(int), M_DEVBUF,
M_WAITOK);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: lancevar.h,v 1.14 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: lancevar.h,v 1.15 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -30,11 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
struct lance_softc {
device_t sc_dev; /* base device glue */
@ -115,9 +111,7 @@ struct lance_softc {
#endif
uint8_t sc_enaddr[ETHER_ADDR_LEN];
uint8_t sc_pad[2];
#if NRND > 0
krndsource_t rnd_source;
#endif
void (*sc_meminit)(struct lance_softc *);
void (*sc_start)(struct ifnet *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_aac.c,v 1.25 2010/11/13 13:52:01 uebayasi Exp $ */
/* $NetBSD: ld_aac.c,v 1.26 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -30,9 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ld_aac.c,v 1.25 2010/11/13 13:52:01 uebayasi Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: ld_aac.c,v 1.26 2012/02/02 19:43:03 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -43,9 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld_aac.c,v 1.25 2010/11/13 13:52:01 uebayasi Exp $")
#include <sys/endian.h>
#include <sys/dkio.h>
#include <sys/disk.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <sys/bus.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_cac.c,v 1.25 2009/05/12 14:25:17 cegger Exp $ */
/* $NetBSD: ld_cac.c,v 1.26 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 2000, 2006 The NetBSD Foundation, Inc.
@ -34,9 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ld_cac.c,v 1.25 2009/05/12 14:25:17 cegger Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: ld_cac.c,v 1.26 2012/02/02 19:43:03 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -47,9 +45,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld_cac.c,v 1.25 2009/05/12 14:25:17 cegger Exp $");
#include <sys/endian.h>
#include <sys/dkio.h>
#include <sys/disk.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <sys/bus.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_icp.c,v 1.24 2010/11/13 13:52:01 uebayasi Exp $ */
/* $NetBSD: ld_icp.c,v 1.25 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -34,9 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ld_icp.c,v 1.24 2010/11/13 13:52:01 uebayasi Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: ld_icp.c,v 1.25 2012/02/02 19:43:03 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -47,9 +45,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld_icp.c,v 1.24 2010/11/13 13:52:01 uebayasi Exp $")
#include <sys/endian.h>
#include <sys/dkio.h>
#include <sys/disk.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <sys/bus.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: ld_mlx.c,v 1.19 2009/01/16 04:20:28 mhitch Exp $ */
/* $NetBSD: ld_mlx.c,v 1.20 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,9 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ld_mlx.c,v 1.19 2009/01/16 04:20:28 mhitch Exp $");
#include "rnd.h"
__KERNEL_RCSID(0, "$NetBSD: ld_mlx.c,v 1.20 2012/02/02 19:43:03 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -47,9 +45,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld_mlx.c,v 1.19 2009/01/16 04:20:28 mhitch Exp $");
#include <sys/endian.h>
#include <sys/dkio.h>
#include <sys/disk.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <machine/vmparam.h>
#include <sys/bus.h>

View File

@ -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,

View File

@ -1,4 +1,4 @@
/* $NetBSD: lemacvar.h,v 1.10 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: lemacvar.h,v 1.11 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 1997 Matt Thomas <matt@3am-software.com>
@ -27,10 +27,8 @@
#ifndef _LEMAC_VAR_H
#define _LEMAC_VAR_H
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
/*
* Ethernet status, per interface.
@ -79,9 +77,7 @@ typedef struct {
unsigned char sc_enaddr[ETHER_ADDR_LEN]; /* current Ethernet address */
char sc_prodname[LEMAC_EEP_PRDNMSZ+1]; /* product name DE20x-xx */
u_int8_t sc_eeprom[LEMAC_EEP_SIZE]; /* local copy eeprom */
#if NRND > 0
krndsource_t rnd_source;
#endif
} lemac_softc_t;
#define sc_if sc_ec.ec_if

View File

@ -1,4 +1,4 @@
/* $NetBSD: mb86950.c,v 1.18 2010/04/05 07:19:35 joerg Exp $ */
/* $NetBSD: mb86950.c,v 1.19 2012/02/02 19:43:03 tls Exp $ */
/*
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.18 2010/04/05 07:19:35 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.19 2012/02/02 19:43:03 tls Exp $");
/*
* Device driver for Fujitsu mb86950 based Ethernet cards.
@ -120,7 +120,6 @@ __KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.18 2010/04/05 07:19:35 joerg Exp $");
*/
#include "opt_inet.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -130,9 +129,7 @@ __KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.18 2010/04/05 07:19:35 joerg Exp $");
#include <sys/socket.h>
#include <sys/syslog.h>
#include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -296,10 +293,8 @@ mb86950_config(struct mb86950_softc *sc, int *media,
ether_ifattach(ifp, sc->sc_enaddr);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(&sc->sc_dev),
RND_TYPE_NET, 0);
#endif
/* XXX No! This doesn't work - DLCR6 of the mb86950 is different
@ -984,10 +979,9 @@ mb86950_detach(struct mb86950_softc *sc)
/* Delete all media. */
ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY);
#if NRND > 0
/* Unhook the entropy source. */
rnd_detach_source(&sc->rnd_source);
#endif
ether_ifdetach(ifp);
if_detach(ifp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mb86950var.h,v 1.6 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: mb86950var.h,v 1.7 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 1995 Mika Kortelainen
@ -59,9 +59,7 @@ struct mb86950_softc {
u_int8_t sc_enaddr[ETHER_ADDR_LEN];
#if NRND > 0
krndsource_t rnd_source;
#endif
u_int32_t sc_stat; /* driver status */

View File

@ -1,4 +1,4 @@
/* $NetBSD: mb86960.c,v 1.77 2010/04/05 07:19:35 joerg Exp $ */
/* $NetBSD: mb86960.c,v 1.78 2012/02/02 19:43:03 tls Exp $ */
/*
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.77 2010/04/05 07:19:35 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.78 2012/02/02 19:43:03 tls Exp $");
/*
* Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
@ -48,7 +48,6 @@ __KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.77 2010/04/05 07:19:35 joerg Exp $");
*/
#include "opt_inet.h"
#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -58,9 +57,7 @@ __KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.77 2010/04/05 07:19:35 joerg Exp $");
#include <sys/socket.h>
#include <sys/syslog.h>
#include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h>
#include <net/if_dl.h>
@ -252,10 +249,9 @@ mb86960_config(struct mb86960_softc *sc, int *media, int nmedia, int defmedia)
if_attach(ifp);
ether_ifattach(ifp, sc->sc_enaddr);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_NET, 0);
#endif
/* Print additional info when attached. */
aprint_normal_dev(sc->sc_dev, "Ethernet address %s\n",
ether_sprintf(sc->sc_enaddr));
@ -1149,10 +1145,8 @@ mb86960_intr(void *arg)
if ((ifp->if_flags & IFF_OACTIVE) == 0)
mb86960_start(ifp);
#if NRND > 0
if (rstat != 0 || tstat != 0)
rnd_add_uint32(&sc->rnd_source, rstat + tstat);
#endif
/*
* Get interrupt conditions, masking unneeded flags.
@ -1821,10 +1815,9 @@ mb86960_detach(struct mb86960_softc *sc)
/* Delete all media. */
ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY);
#if NRND > 0
/* Unhook the entropy source. */
rnd_detach_source(&sc->rnd_source);
#endif
ether_ifdetach(ifp);
if_detach(ifp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mb86960var.h,v 1.38 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: mb86960var.h,v 1.39 2012/02/02 19:43:03 tls Exp $ */
/*
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
@ -44,11 +44,7 @@
* they are useful.
*/
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
/*
* Default settings for fe driver specific options.
@ -161,9 +157,7 @@ struct mb86960_softc {
uint8_t sc_enaddr[ETHER_ADDR_LEN];
#if NRND > 0
krndsource_t rnd_source;
#endif
uint32_t sc_stat; /* driver status */
#define FE_STAT_ENABLED 0x0001 /* power enabled on interface */

View File

@ -1,4 +1,4 @@
/* $NetBSD: mtd803.c,v 1.24 2010/04/05 07:19:35 joerg Exp $ */
/* $NetBSD: mtd803.c,v 1.25 2012/02/02 19:43:03 tls Exp $ */
/*-
*
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mtd803.c,v 1.24 2010/04/05 07:19:35 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: mtd803.c,v 1.25 2012/02/02 19:43:03 tls Exp $");
#include <sys/param.h>
@ -175,10 +175,9 @@ mtd_config(struct mtd_softc *sc)
if_attach(ifp);
ether_ifattach(ifp, sc->eaddr);
#if NRND > 0
/* Initialise random source */
rnd_attach_source(&sc->rnd_src, device_xname(&sc->dev), RND_TYPE_NET, 0);
#endif
rnd_attach_source(&sc->rnd_src, device_xname(&sc->dev),
RND_TYPE_NET, 0);
/* Add shutdown hook to reset card when we reboot */
sc->sd_hook = shutdownhook_establish(mtd_shutdown, sc);
@ -737,11 +736,11 @@ mtd_irq_h(void *args)
for(;;) {
status = MTD_READ_4(sc, MTD_ISR);
#if NRND > 0
/* Add random seed before masking out bits */
if (status)
rnd_add_uint32(&sc->rnd_src, status);
#endif
status &= MTD_ISR_MASK;
if (!status) /* We didn't ask for this */
break;
@ -890,8 +889,6 @@ mtd_shutdown (void *arg)
struct mtd_softc *sc = arg;
struct ifnet *ifp = &sc->ethercom.ec_if;
#if NRND > 0
rnd_detach_source(&sc->rnd_src);
#endif
mtd_stop(ifp, 1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mtd803var.h,v 1.7 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: mtd803var.h,v 1.8 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -31,6 +31,7 @@
#include <sys/device.h>
#include <sys/socket.h>
#include <sys/rnd.h>
#include <net/if.h>
#include <net/if_ether.h>
#include <net/if_media.h>
@ -74,9 +75,7 @@ struct mtd_softc {
void * buf;
bus_dmamap_t buf_dma_map;
#if NRND > 0
krndsource_t rnd_src;
#endif
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: pckbc.c,v 1.52 2011/11/19 22:51:22 tls Exp $ */
/* $NetBSD: pckbc.c,v 1.53 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 2004 Ben Harris.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.52 2011/11/19 22:51:22 tls Exp $");
__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.53 2012/02/02 19:43:03 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -46,21 +46,16 @@ __KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.52 2011/11/19 22:51:22 tls Exp $");
#include <dev/pckbport/pckbportvar.h>
#include "rnd.h"
#include "locators.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
/* data per slave device */
struct pckbc_slotdata {
int polling; /* don't process data in interrupt handler */
int poll_data; /* data read from inr handler if polling */
int poll_stat; /* status read from inr handler if polling */
#if NRND > 0
krndsource_t rnd_source;
#endif
};
static void pckbc_init_slotdata(struct pckbc_slotdata *);
@ -275,11 +270,10 @@ pckbc_attach_slot(struct pckbc_softc *sc, pckbc_slot_t slot)
t->t_slotdata[slot] = NULL;
}
#if NRND > 0
if (child != NULL && t->t_slotdata[slot] != NULL)
rnd_attach_source(&t->t_slotdata[slot]->rnd_source,
device_xname(child), RND_TYPE_TTY, 0);
#endif
return child != NULL;
}
@ -517,9 +511,7 @@ pckbcintr_hard(void *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 (q->polling) {
q->poll_data = data;
@ -600,9 +592,7 @@ pckbcintr(void *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
pckbportintr(t->t_pt, slot, data);
}

Some files were not shown because too many files have changed in this diff Show More