summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authortls <tls@NetBSD.org>2012-02-02 19:42:57 +0000
committertls <tls@NetBSD.org>2012-02-02 19:42:57 +0000
commitcc9ee3de3e25ef31d3a97dc35bedc36945e35d2a (patch)
tree06a2889eb6b4b02bc8b8bba6b5cc3f9b1938d18b /sys/dev/ic
parentf622122a62827e27b444c2f95632d61f73357ced (diff)
Entropy-pool implementation move and cleanup.
1) Move core entropy-pool code and source/sink/sample management code to sys/kern from sys/dev. 2) Remove use of NRND as test for presence of entropy-pool code throughout source tree. 3) Remove use of RND_ENABLED in device drivers as microoptimization to avoid expensive operations on disabled entropy sources; make the rnd_add calls do this directly so all callers benefit. 4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might have lead to slight entropy overestimation for some sources. 5) Add new source types for environmental sensors, power sensors, VM system events, and skew between clocks, with a sample implementation for each. ok releng to go in before the branch due to the difficulty of later pullup (widespread #ifdef removal and moved files). Tested with release builds on amd64 and evbarm and live testing on amd64.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/am7990.c10
-rw-r--r--sys/dev/ic/am79900.c10
-rw-r--r--sys/dev/ic/com.c12
-rw-r--r--sys/dev/ic/comvar.h6
-rw-r--r--sys/dev/ic/cs89x0.c17
-rw-r--r--sys/dev/ic/cs89x0var.h4
-rw-r--r--sys/dev/ic/dp8390.c17
-rw-r--r--sys/dev/ic/dp8390var.h7
-rw-r--r--sys/dev/ic/elink3.c13
-rw-r--r--sys/dev/ic/elink3var.h8
-rw-r--r--sys/dev/ic/elinkxl.c14
-rw-r--r--sys/dev/ic/elinkxlvar.h8
-rw-r--r--sys/dev/ic/gem.c10
-rw-r--r--sys/dev/ic/gemvar.h8
-rw-r--r--sys/dev/ic/hme.c11
-rw-r--r--sys/dev/ic/hmevar.h7
-rw-r--r--sys/dev/ic/i82557.c14
-rw-r--r--sys/dev/ic/i82557var.h5
-rw-r--r--sys/dev/ic/lan9118.c15
-rw-r--r--sys/dev/ic/lan9118var.h8
-rw-r--r--sys/dev/ic/lance.c10
-rw-r--r--sys/dev/ic/lancevar.h8
-rw-r--r--sys/dev/ic/ld_aac.c8
-rw-r--r--sys/dev/ic/ld_cac.c8
-rw-r--r--sys/dev/ic/ld_icp.c8
-rw-r--r--sys/dev/ic/ld_mlx.c8
-rw-r--r--sys/dev/ic/lemac.c11
-rw-r--r--sys/dev/ic/lemacvar.h8
-rw-r--r--sys/dev/ic/mb86950.c12
-rw-r--r--sys/dev/ic/mb86950var.h4
-rw-r--r--sys/dev/ic/mb86960.c15
-rw-r--r--sys/dev/ic/mb86960var.h8
-rw-r--r--sys/dev/ic/mtd803.c15
-rw-r--r--sys/dev/ic/mtd803var.h5
-rw-r--r--sys/dev/ic/pckbc.c16
-rw-r--r--sys/dev/ic/pckbcvar.h7
-rw-r--r--sys/dev/ic/rtl81x9.c16
-rw-r--r--sys/dev/ic/rtl81x9var.h9
-rw-r--r--sys/dev/ic/seeq8005.c12
-rw-r--r--sys/dev/ic/seeq8005var.h7
-rw-r--r--sys/dev/ic/smc91cxx.c14
-rw-r--r--sys/dev/ic/smc91cxxvar.h9
-rw-r--r--sys/dev/ic/tulip.c13
-rw-r--r--sys/dev/ic/tulipvar.h8
44 files changed, 96 insertions, 347 deletions
diff --git a/sys/dev/ic/am7990.c b/sys/dev/ic/am7990.c
index d43bc81abc5..0142fef78b5 100644
--- a/sys/dev/ic/am7990.c
+++ b/sys/dev/ic/am7990.c
@@ -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);
}
diff --git a/sys/dev/ic/am79900.c b/sys/dev/ic/am79900.c
index 4be36bb6193..ae9646a7314 100644
--- a/sys/dev/ic/am79900.c
+++ b/sys/dev/ic/am79900.c
@@ -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);
}
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index db1554e35eb..f1d8d7b01b2 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -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
diff --git a/sys/dev/ic/comvar.h b/sys/dev/ic/comvar.h
index 52e804dbe74..2ef880de278 100644
--- a/sys/dev/ic/comvar.h
+++ b/sys/dev/ic/comvar.h
@@ -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;
diff --git a/sys/dev/ic/cs89x0.c b/sys/dev/ic/cs89x0.c
index 237bfb5a3dd..e92714dc9c6 100644
--- a/sys/dev/ic/cs89x0.c
+++ b/sys/dev/ic/cs89x0.c
@@ -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;
}
diff --git a/sys/dev/ic/cs89x0var.h b/sys/dev/ic/cs89x0var.h
index 6d433d83530..9453d7ea6ea 100644
--- a/sys/dev/ic/cs89x0var.h
+++ b/sys/dev/ic/cs89x0var.h
@@ -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 *);
diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c
index b00fc84daa9..a29cc3853d4 100644
--- a/sys/dev/ic/dp8390.c
+++ b/sys/dev/ic/dp8390.c
@@ -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);
diff --git a/sys/dev/ic/dp8390var.h b/sys/dev/ic/dp8390var.h
index daf23afd520..635e2ecb4d1 100644
--- a/sys/dev/ic/dp8390var.h
+++ b/sys/dev/ic/dp8390var.h
@@ -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 *);
diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c
index 8574dee2da7..5f98788e123 100644
--- a/sys/dev/ic/elink3.c
+++ b/sys/dev/ic/elink3.c
@@ -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);
diff --git a/sys/dev/ic/elink3var.h b/sys/dev/ic/elink3var.h
index bef646843f0..30711686d4b 100644
--- a/sys/dev/ic/elink3var.h
+++ b/sys/dev/ic/elink3var.h
@@ -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 *);
diff --git a/sys/dev/ic/elinkxl.c b/sys/dev/ic/elinkxl.c
index c0e90d0cc07..a76c6efcac9 100644
--- a/sys/dev/ic/elinkxl.c
+++ b/sys/dev/ic/elinkxl.c
@@ -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);
diff --git a/sys/dev/ic/elinkxlvar.h b/sys/dev/ic/elinkxlvar.h
index b327dfa9302..b2f01c842cf 100644
--- a/sys/dev/ic/elinkxlvar.h
+++ b/sys/dev/ic/elinkxlvar.h
@@ -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 *);
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c
index fbc62249d65..928cabb2398 100644
--- a/sys/dev/ic/gem.c
+++ b/sys/dev/ic/gem.c
@@ -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);
}
diff --git a/sys/dev/ic/gemvar.h b/sys/dev/ic/gemvar.h
index cdf5b5b1406..d3c8d0b69ae 100644
--- a/sys/dev/ic/gemvar.h
+++ b/sys/dev/ic/gemvar.h
@@ -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
diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c
index 4fbbda86f2c..ddb9d7d8940 100644
--- a/sys/dev/ic/hme.c
+++ b/sys/dev/ic/hme.c
@@ -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);
}
diff --git a/sys/dev/ic/hmevar.h b/sys/dev/ic/hmevar.h
index ed24b11d4f1..cc83fa08d4f 100644
--- a/sys/dev/ic/hmevar.h
+++ b/sys/dev/ic/hmevar.h
@@ -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
};
diff --git a/sys/dev/ic/i82557.c b/sys/dev/ic/i82557.c
index a6151a56951..ec6b9c8db55 100644
--- a/sys/dev/ic/i82557.c
+++ b/sys/dev/ic/i82557.c
@@ -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);
diff --git a/sys/dev/ic/i82557var.h b/sys/dev/ic/i82557var.h
index 792913ef555..c9008f36dc8 100644
--- a/sys/dev/ic/i82557var.h
+++ b/sys/dev/ic/i82557var.h
@@ -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
diff --git a/sys/dev/ic/lan9118.c b/sys/dev/ic/lan9118.c
index 1d2d3357a7f..cd080695079 100644
--- a/sys/dev/ic/lan9118.c
+++ b/sys/dev/ic/lan9118.c
@@ -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;
}
diff --git a/sys/dev/ic/lan9118var.h b/sys/dev/ic/lan9118var.h
index 7a4fc836550..1cdc5fdd72b 100644
--- a/sys/dev/ic/lan9118var.h
+++ b/sys/dev/ic/lan9118var.h
@@ -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
};
diff --git a/sys/dev/ic/lance.c b/sys/dev/ic/lance.c
index de4bce9709b..6308e2cc9f0 100644
--- a/sys/dev/ic/lance.c
+++ b/sys/dev/ic/lance.c
@@ -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
diff --git a/sys/dev/ic/lancevar.h b/sys/dev/ic/lancevar.h
index ed8d5a53b5d..11d4b3a7225 100644
--- a/sys/dev/ic/lancevar.h
+++ b/sys/dev/ic/lancevar.h
@@ -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 *);
diff --git a/sys/dev/ic/ld_aac.c b/sys/dev/ic/ld_aac.c
index fe185b39fcc..de664a7ce36 100644
--- a/sys/dev/ic/ld_aac.c
+++ b/sys/dev/ic/ld_aac.c
@@ -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>
diff --git a/sys/dev/ic/ld_cac.c b/sys/dev/ic/ld_cac.c
index f15bac7ab35..e8b14e4d3fa 100644
--- a/sys/dev/ic/ld_cac.c
+++ b/sys/dev/ic/ld_cac.c
@@ -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>
diff --git a/sys/dev/ic/ld_icp.c b/sys/dev/ic/ld_icp.c
index bdeeb7fa1e5..c4ca80a42a6 100644
--- a/sys/dev/ic/ld_icp.c
+++ b/sys/dev/ic/ld_icp.c
@@ -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>
diff --git a/sys/dev/ic/ld_mlx.c b/sys/dev/ic/ld_mlx.c
index 0d804f57317..51e16806e15 100644
--- a/sys/dev/ic/ld_mlx.c
+++ b/sys/dev/ic/ld_mlx.c
@@ -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>
diff --git a/sys/dev/ic/lemac.c b/sys/dev/ic/lemac.c
index 62fce6e7063..ff92829d4a0 100644
--- a/sys/dev/ic/lemac.c
+++ b/sys/dev/ic/lemac.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lemac.c,v 1.39 2010/11/13 13:52:01 uebayasi Exp $ */
+/* $NetBSD: lemac.c,v 1.40 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1994, 1995, 1997 Matt Thomas <matt@3am-software.com>
@@ -34,10 +34,9 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.39 2010/11/13 13:52:01 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.40 2012/02/02 19:43:03 tls Exp $");
#include "opt_inet.h"
-#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -48,9 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.39 2010/11/13 13:52:01 uebayasi Exp $");
#include <sys/errno.h>
#include <sys/malloc.h>
#include <sys/device.h>
-#if NRND > 0
#include <sys/rnd.h>
-#endif
#include <net/if.h>
#include <net/if_types.h>
@@ -955,10 +952,8 @@ lemac_intr(
LEMAC_OUTB(sc, LEMAC_REG_CTL, LEMAC_INB(sc, LEMAC_REG_CTL) ^ LEMAC_CTL_LED);
LEMAC_INTR_ENABLE(sc); /* Unmask interrupts */
-#if NRND > 0
if (cs_value)
rnd_add_uint32(&sc->rnd_source, cs_value);
-#endif
return 1;
}
@@ -1016,10 +1011,8 @@ lemac_ifattach(
if_attach(ifp);
ether_ifattach(ifp, sc->sc_enaddr);
-#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(&sc->sc_dv),
RND_TYPE_NET, 0);
-#endif
ifmedia_init(&sc->sc_ifmedia, 0,
lemac_ifmedia_change,
diff --git a/sys/dev/ic/lemacvar.h b/sys/dev/ic/lemacvar.h
index 6b1cf6c5e7d..e0e6cf2c7a2 100644
--- a/sys/dev/ic/lemacvar.h
+++ b/sys/dev/ic/lemacvar.h
@@ -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
diff --git a/sys/dev/ic/mb86950.c b/sys/dev/ic/mb86950.c
index 33bd71e40f0..05c8ceab101 100644
--- a/sys/dev/ic/mb86950.c
+++ b/sys/dev/ic/mb86950.c
@@ -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);
diff --git a/sys/dev/ic/mb86950var.h b/sys/dev/ic/mb86950var.h
index b4e2aafbb4c..230de8b4c44 100644
--- a/sys/dev/ic/mb86950var.h
+++ b/sys/dev/ic/mb86950var.h
@@ -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 */
diff --git a/sys/dev/ic/mb86960.c b/sys/dev/ic/mb86960.c
index e62b4f8e73a..12919ef03d7 100644
--- a/sys/dev/ic/mb86960.c
+++ b/sys/dev/ic/mb86960.c
@@ -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);
diff --git a/sys/dev/ic/mb86960var.h b/sys/dev/ic/mb86960var.h
index dc703308ebf..fde21286b1f 100644
--- a/sys/dev/ic/mb86960var.h
+++ b/sys/dev/ic/mb86960var.h
@@ -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 */
diff --git a/sys/dev/ic/mtd803.c b/sys/dev/ic/mtd803.c
index 3b4b90f2222..5b28ff168e3 100644
--- a/sys/dev/ic/mtd803.c
+++ b/sys/dev/ic/mtd803.c
@@ -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);
}
diff --git a/sys/dev/ic/mtd803var.h b/sys/dev/ic/mtd803var.h
index bb4f95f7c51..57e87e21bd8 100644
--- a/sys/dev/ic/mtd803var.h
+++ b/sys/dev/ic/mtd803var.h
@@ -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
};
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c
index ca567b5b144..17ffb89c3f9 100644
--- a/sys/dev/ic/pckbc.c
+++ b/sys/dev/ic/pckbc.c
@@ -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);
}
diff --git a/sys/dev/ic/pckbcvar.h b/sys/dev/ic/pckbcvar.h
index eeec1230d23..9f4d24845f1 100644
--- a/sys/dev/ic/pckbcvar.h
+++ b/sys/dev/ic/pckbcvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbcvar.h,v 1.18 2010/11/14 03:22:01 uebayasi Exp $ */
+/* $NetBSD: pckbcvar.h,v 1.19 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 1998
@@ -34,10 +34,9 @@
#include <dev/pckbport/pckbportvar.h>
-#include "rnd.h"
-#if NRND > 0
+
+
#include <sys/rnd.h>
-#endif
typedef void *pckbc_tag_t;
typedef int pckbc_slot_t;
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c
index b06623fb77b..4da14131685 100644
--- a/sys/dev/ic/rtl81x9.c
+++ b/sys/dev/ic/rtl81x9.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rtl81x9.c,v 1.92 2010/11/13 13:52:02 uebayasi Exp $ */
+/* $NetBSD: rtl81x9.c,v 1.93 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -86,9 +86,8 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.92 2010/11/13 13:52:02 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.93 2012/02/02 19:43:03 tls Exp $");
-#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -107,9 +106,7 @@ __KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.92 2010/11/13 13:52:02 uebayasi Exp $"
#include <net/if_media.h>
#include <net/bpf.h>
-#if NRND > 0
#include <sys/rnd.h>
-#endif
#include <sys/bus.h>
#include <machine/endian.h>
@@ -742,10 +739,8 @@ rtk_attach(struct rtk_softc *sc)
if_attach(ifp);
ether_ifattach(ifp, eaddr);
-#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(self),
RND_TYPE_NET, 0);
-#endif
return;
fail_4:
@@ -830,9 +825,7 @@ rtk_detach(struct rtk_softc *sc)
/* Delete all remaining media. */
ifmedia_delete_instance(&sc->mii.mii_media, IFM_INST_ANY);
-#if NRND > 0
rnd_detach_source(&sc->rnd_source);
-#endif
ether_ifdetach(ifp);
if_detach(ifp);
@@ -1213,10 +1206,7 @@ rtk_intr(void *arg)
if (IFQ_IS_EMPTY(&ifp->if_snd) == 0)
rtk_start(ifp);
-#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 handled;
}
diff --git a/sys/dev/ic/rtl81x9var.h b/sys/dev/ic/rtl81x9var.h
index 692db4b94d0..106502ed433 100644
--- a/sys/dev/ic/rtl81x9var.h
+++ b/sys/dev/ic/rtl81x9var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rtl81x9var.h,v 1.52 2011/11/22 18:42:57 garbled Exp $ */
+/* $NetBSD: rtl81x9var.h,v 1.53 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -34,11 +34,7 @@
* FreeBSD Id: if_rlreg.h,v 1.9 1999/06/20 18:56:09 wpaul Exp
*/
-#include "rnd.h"
-
-#if NRND > 0
#include <sys/rnd.h>
-#endif
#define RTK_ETHER_ALIGN 2
#define RTK_RXSTAT_LEN 4
@@ -226,9 +222,8 @@ struct rtk_softc {
/* Power management hooks. */
int (*sc_enable) (struct rtk_softc *);
void (*sc_disable) (struct rtk_softc *);
-#if NRND > 0
+
krndsource_t rnd_source;
-#endif
};
#define RE_TX_DESC_CNT(sc) ((sc)->re_ldata.re_tx_desc_cnt)
diff --git a/sys/dev/ic/seeq8005.c b/sys/dev/ic/seeq8005.c
index 280d0fb85a5..365c6788f49 100644
--- a/sys/dev/ic/seeq8005.c
+++ b/sys/dev/ic/seeq8005.c
@@ -1,4 +1,4 @@
-/* $NetBSD: seeq8005.c,v 1.45 2010/04/05 07:19:36 joerg Exp $ */
+/* $NetBSD: seeq8005.c,v 1.46 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 2000, 2001 Ben Harris
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: seeq8005.c,v 1.45 2010/04/05 07:19:36 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: seeq8005.c,v 1.46 2012/02/02 19:43:03 tls Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -82,10 +82,7 @@ __KERNEL_RCSID(0, "$NetBSD: seeq8005.c,v 1.45 2010/04/05 07:19:36 joerg Exp $");
#include <net/bpf.h>
#include <net/bpfdesc.h>
-#include "rnd.h"
-#if NRND > 0
#include <sys/rnd.h>
-#endif
#include <sys/bus.h>
#include <sys/intr.h>
@@ -290,11 +287,9 @@ seeq8005_attach(struct seeq8005_softc *sc, const u_int8_t *myaddr, int *media,
printf("\n");
-#if NRND > 0
/* After \n because it can print a line of its own. */
rnd_attach_source(&sc->rnd_source, device_xname(&sc->sc_dev),
RND_TYPE_NET, 0);
-#endif
}
/*
@@ -1032,10 +1027,9 @@ seeq8005intr(void *arg)
ea_rxint(sc);
}
-#if NRND > 0
if (handled)
rnd_add_uint32(&sc->rnd_source, status);
-#endif
+
return handled;
}
diff --git a/sys/dev/ic/seeq8005var.h b/sys/dev/ic/seeq8005var.h
index 3585f92117b..6a10c2adfe5 100644
--- a/sys/dev/ic/seeq8005var.h
+++ b/sys/dev/ic/seeq8005var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: seeq8005var.h,v 1.6 2011/11/19 22:51:22 tls Exp $ */
+/* $NetBSD: seeq8005var.h,v 1.7 2012/02/02 19:43:03 tls Exp $ */
/*
* Copyright (c) 2000 Ben Harris
@@ -38,10 +38,7 @@
#include <net/if_media.h>
-#include "rnd.h"
-#if NRND > 0
#include <sys/rnd.h>
-#endif
/* Enumerate the possible cip variants */
enum seeq_variant {
@@ -85,9 +82,7 @@ struct seeq8005_softc {
enum seeq_variant sc_variant; /* Chip variant */
int sc_flags;
#define SF_8BIT 0x01
-#if NRND > 0
krndsource_t rnd_source;
-#endif
};
extern void seeq8005_attach(struct seeq8005_softc *, const u_int8_t *, int *,
diff --git a/sys/dev/ic/smc91cxx.c b/sys/dev/ic/smc91cxx.c
index 76ae86ce08d..9e8d6175a73 100644
--- a/sys/dev/ic/smc91cxx.c
+++ b/sys/dev/ic/smc91cxx.c
@@ -1,4 +1,4 @@
-/* $NetBSD: smc91cxx.c,v 1.79 2010/11/13 13:52:02 uebayasi Exp $ */
+/* $NetBSD: smc91cxx.c,v 1.80 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -71,10 +71,9 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.79 2010/11/13 13:52:02 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.80 2012/02/02 19:43:03 tls Exp $");
#include "opt_inet.h"
-#include "rnd.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -86,9 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.79 2010/11/13 13:52:02 uebayasi Exp $
#include <sys/malloc.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
-#if NRND > 0
#include <sys/rnd.h>
-#endif
#include <sys/bus.h>
#include <sys/intr.h>
@@ -384,10 +381,8 @@ smc91cxx_attach(struct smc91cxx_softc *sc, u_int8_t *myea)
break;
}
-#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(&sc->sc_dev),
RND_TYPE_NET, 0);
-#endif
callout_init(&sc->sc_mii_callout, 0);
@@ -1131,10 +1126,8 @@ out:
mask |= sc->sc_intmask;
smc91cxx_intr_mask_write(bst, bsh, mask);
-#if NRND > 0
if (status)
rnd_add_uint32(&sc->rnd_source, status);
-#endif
return (1);
}
@@ -1528,9 +1521,8 @@ smc91cxx_detach(device_t self, int flags)
/* Delete all 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);
diff --git a/sys/dev/ic/smc91cxxvar.h b/sys/dev/ic/smc91cxxvar.h
index fb5a1b8b8ad..d15df5e07d9 100644
--- a/sys/dev/ic/smc91cxxvar.h
+++ b/sys/dev/ic/smc91cxxvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: smc91cxxvar.h,v 1.17 2011/11/19 22:51:22 tls Exp $ */
+/* $NetBSD: smc91cxxvar.h,v 1.18 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -30,11 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "rnd.h"
-
-#if NRND > 0
#include <sys/rnd.h>
-#endif
struct smc91cxx_softc {
struct device sc_dev; /* generic device glue */
@@ -60,9 +56,8 @@ struct smc91cxx_softc {
uint8_t sc_intmask;
uint8_t sc_txpacketno; /* cached packetno */
-#if NRND > 0
+
krndsource_t rnd_source;
-#endif
};
#define SMC_SELECT_BANK(sc, x) \
diff --git a/sys/dev/ic/tulip.c b/sys/dev/ic/tulip.c
index 28ac3890f26..1230738b00d 100644
--- a/sys/dev/ic/tulip.c
+++ b/sys/dev/ic/tulip.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tulip.c,v 1.179 2011/08/13 19:23:34 jakllsch Exp $ */
+/* $NetBSD: tulip.c,v 1.180 2012/02/02 19:43:03 tls Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.179 2011/08/13 19:23:34 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.180 2012/02/02 19:43:03 tls Exp $");
#include <sys/param.h>
@@ -525,10 +525,9 @@ tlp_attach(struct tulip_softc *sc, const uint8_t *enaddr)
if_attach(ifp);
ether_ifattach(ifp, enaddr);
ether_set_ifflags_cb(&sc->sc_ethercom, tlp_ifflags_cb);
-#if NRND > 0
+
rnd_attach_source(&sc->sc_rnd_source, device_xname(self),
RND_TYPE_NET, 0);
-#endif
if (pmf_device_register(self, NULL, NULL))
pmf_class_network_register(self, ifp);
@@ -616,9 +615,8 @@ tlp_detach(struct tulip_softc *sc)
/* 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);
@@ -1195,10 +1193,9 @@ tlp_intr(void *arg)
/* Try to get more packets going. */
tlp_start(ifp);
-#if NRND > 0
if (handled)
rnd_add_uint32(&sc->sc_rnd_source, status);
-#endif
+
return (handled);
}
diff --git a/sys/dev/ic/tulipvar.h b/sys/dev/ic/tulipvar.h
index 72e2e6b2363..1a5b9438962 100644
--- a/sys/dev/ic/tulipvar.h
+++ b/sys/dev/ic/tulipvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: tulipvar.h,v 1.66 2011/11/19 22:51:22 tls Exp $ */
+/* $NetBSD: tulipvar.h,v 1.67 2012/02/02 19:43:04 tls Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -33,14 +33,10 @@
#ifndef _DEV_IC_TULIPVAR_H_
#define _DEV_IC_TULIPVAR_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)
@@ -447,9 +443,7 @@ struct tulip_softc {
int sc_rxptr; /* next ready RX descriptor/descsoft */
-#if NRND > 0
krndsource_t sc_rnd_source; /* random source */
-#endif
};
#endif