Add and/or update rnd_*() hooks

This commit is contained in:
explorer 1997-10-15 05:55:13 +00:00
parent 1d74fdb6a3
commit f9370ddc7a
19 changed files with 283 additions and 21 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dp8390.c,v 1.4 1997/08/24 15:22:28 scottr Exp $ */ /* $NetBSD: dp8390.c,v 1.5 1997/10/15 05:55:13 explorer Exp $ */
/* /*
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@ -14,6 +14,7 @@
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -23,6 +24,9 @@
#include <sys/mbuf.h> #include <sys/mbuf.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_dl.h> #include <net/if_dl.h>
@ -134,6 +138,11 @@ dp8390_config(sc)
printf("type unknown (0x%x) ", sc->type); printf("type unknown (0x%x) ", sc->type);
rv = 0; rv = 0;
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, RND_TYPE_NET);
#endif
out: out:
return (rv); return (rv);
} }
@ -644,6 +653,11 @@ dp8390_intr(arg, slot)
dp8390_xmit(sc); dp8390_xmit(sc);
} }
#if NRND > 0
if (isr)
rnd_add_uint32(&sc->rnd_source, isr);
#endif
/* Handle receiver interrupts. */ /* Handle receiver interrupts. */
if (isr & (ED_ISR_PRX | ED_ISR_RXE | ED_ISR_OVW)) { if (isr & (ED_ISR_PRX | ED_ISR_RXE | ED_ISR_OVW)) {
/* /*

View File

@ -1,4 +1,4 @@
/* $NetBSD: elink3.c,v 1.34 1997/10/14 21:28:37 thorpej Exp $ */ /* $NetBSD: elink3.c,v 1.35 1997/10/15 05:55:26 explorer Exp $ */
/* /*
* Copyright (c) 1996, 1997 Jonathan Stone <jonathan@NetBSD.org> * Copyright (c) 1996, 1997 Jonathan Stone <jonathan@NetBSD.org>
@ -32,6 +32,7 @@
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -42,6 +43,9 @@
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/select.h> #include <sys/select.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_dl.h> #include <net/if_dl.h>
@ -354,6 +358,10 @@ epconfig(sc, chipset, enaddr)
sizeof(struct ether_header)); sizeof(struct ether_header));
#endif #endif
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, RND_TYPE_NET);
#endif
sc->tx_start_thresh = 20; /* probably a good starting point. */ sc->tx_start_thresh = 20; /* probably a good starting point. */
/* Establish callback to reset card when we reboot. */ /* Establish callback to reset card when we reboot. */
@ -1097,6 +1105,7 @@ epintr(arg)
struct ifnet *ifp = &sc->sc_ethercom.ec_if; struct ifnet *ifp = &sc->sc_ethercom.ec_if;
u_int16_t status; u_int16_t status;
int ret = 0; int ret = 0;
int addrandom = 0;
if (sc->enabled == 0) if (sc->enabled == 0)
return (0); return (0);
@ -1145,11 +1154,14 @@ epintr(arg)
(status & S_CARD_FAILURE)?" CARD_FAILURE":""); (status & S_CARD_FAILURE)?" CARD_FAILURE":"");
#endif #endif
if (status & S_RX_COMPLETE) if (status & S_RX_COMPLETE) {
epread(sc); epread(sc);
addrandom = 1;
}
if (status & S_TX_AVAIL) { if (status & S_TX_AVAIL) {
sc->sc_ethercom.ec_if.if_flags &= ~IFF_OACTIVE; sc->sc_ethercom.ec_if.if_flags &= ~IFF_OACTIVE;
epstart(&sc->sc_ethercom.ec_if); epstart(&sc->sc_ethercom.ec_if);
addrandom = 1;
} }
if (status & S_CARD_FAILURE) { if (status & S_CARD_FAILURE) {
printf("%s: adapter failure (%x)\n", printf("%s: adapter failure (%x)\n",
@ -1160,7 +1172,13 @@ epintr(arg)
if (status & S_TX_COMPLETE) { if (status & S_TX_COMPLETE) {
eptxstat(sc); eptxstat(sc);
epstart(ifp); epstart(ifp);
addrandom = 1;
} }
#if NRND > 0
if (status)
rnd_add_uint32(&sc->rnd_source, status);
#endif
} }
/* no more interrupts */ /* no more interrupts */

View File

@ -1,4 +1,4 @@
/* $NetBSD: elink3var.h,v 1.13 1997/10/14 21:28:39 thorpej Exp $ */ /* $NetBSD: elink3var.h,v 1.14 1997/10/15 05:55:35 explorer Exp $ */
/* /*
* Copyright (c) 1994 Herb Peyerl <hpeyerl@beer.org> * Copyright (c) 1994 Herb Peyerl <hpeyerl@beer.org>
@ -30,6 +30,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 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. * Ethernet software status per interface.
*/ */
@ -82,6 +88,10 @@ struct ep_softc {
#define EP_IS_BUS_32(a) ((a) & 0x2) #define EP_IS_BUS_32(a) ((a) & 0x2)
int ep_pktlenshift; /* scale factor for pkt lengths */ int ep_pktlenshift; /* scale factor for pkt lengths */
#if NRND > 0
rndsource_element_t rnd_source;
#endif
/* power management hooks */ /* power management hooks */
int (*enable) __P((struct ep_softc *)); int (*enable) __P((struct ep_softc *));
void (*disable) __P((struct ep_softc *)); void (*disable) __P((struct ep_softc *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: lemac.c,v 1.1 1997/07/31 21:54:58 matt Exp $ */ /* $NetBSD: lemac.c,v 1.2 1997/10/15 05:55:45 explorer Exp $ */
/*- /*-
* Copyright (c) 1994, 1995, 1997 Matt Thomas <matt@3am-software.com> * Copyright (c) 1994, 1995, 1997 Matt Thomas <matt@3am-software.com>
@ -33,6 +33,8 @@
* This driver supports the LEMAC DE203/204/205 cards. * This driver supports the LEMAC DE203/204/205 cards.
*/ */
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/mbuf.h> #include <sys/mbuf.h>
@ -42,6 +44,9 @@
#include <sys/errno.h> #include <sys/errno.h>
#include <sys/malloc.h> #include <sys/malloc.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_types.h> #include <net/if_types.h>
@ -988,6 +993,12 @@ lemac_intr(
LEMAC_OUTB(sc, LEMAC_REG_CTL, LEMAC_INB(sc, LEMAC_REG_CTL) ^ LEMAC_CTL_LED); LEMAC_OUTB(sc, LEMAC_REG_CTL, LEMAC_INB(sc, LEMAC_REG_CTL) ^ LEMAC_CTL_LED);
LEMAC_INTR_ENABLE(sc); /* Unmask interrupts */ LEMAC_INTR_ENABLE(sc); /* Unmask interrupts */
#if NRND > 0
if (cs_value)
rnd_add_uint32(&sc->rnd_source, cs_value);
#endif
return 1; return 1;
} }
@ -1047,6 +1058,11 @@ lemac_ifattach(
#if NBPFILTER > 0 #if NBPFILTER > 0
bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header)); bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif #endif
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dv.dv_xname, RND_TYPE_NET);
#endif
ifmedia_init(&sc->sc_ifmedia, 0, ifmedia_init(&sc->sc_ifmedia, 0,
lemac_ifmedia_change, lemac_ifmedia_change,
lemac_ifmedia_status); lemac_ifmedia_status);

View File

@ -1,4 +1,4 @@
/* $NetBSD: lemacvar.h,v 1.1 1997/07/31 21:55:00 matt Exp $ */ /* $NetBSD: lemacvar.h,v 1.2 1997/10/15 05:55:55 explorer Exp $ */
/* /*
* Copyright (c) 1997 Matt Thomas <matt@3am-software.com> * Copyright (c) 1997 Matt Thomas <matt@3am-software.com>
@ -27,6 +27,11 @@
#ifndef _LEMAC_VAR_H #ifndef _LEMAC_VAR_H
#define _LEMAC_VAR_H #define _LEMAC_VAR_H
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
/* /*
* Ethernet status, per interface. * Ethernet status, per interface.
*/ */
@ -71,6 +76,9 @@ typedef struct {
unsigned char sc_enaddr[6]; /* current Ethernet address */ unsigned char sc_enaddr[6]; /* current Ethernet address */
char sc_prodname[LEMAC_EEP_PRDNMSZ+1]; /* product name DE20x-xx */ char sc_prodname[LEMAC_EEP_PRDNMSZ+1]; /* product name DE20x-xx */
u_int8_t sc_eeprom[LEMAC_EEP_SIZE]; /* local copy eeprom */ u_int8_t sc_eeprom[LEMAC_EEP_SIZE]; /* local copy eeprom */
#if NRND > 0
rndsource_element_t rnd_source;
#endif
} lemac_softc_t; } lemac_softc_t;
#define sc_if sc_ec.ec_if #define sc_if sc_ec.ec_if

View File

@ -45,6 +45,7 @@
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -54,6 +55,9 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_dl.h> #include <net/if_dl.h>
@ -197,6 +201,10 @@ struct fe_softc {
u_char filter[FE_FILTER_LEN]; /* new filter value. */ u_char filter[FE_FILTER_LEN]; /* new filter value. */
u_int8_t sc_enaddr[ETHER_ADDR_LEN]; u_int8_t sc_enaddr[ETHER_ADDR_LEN];
#if NRND > 0
rndsource_element_t rnd_source;
#endif
}; };
/* Standard driver entry points. These can be static. */ /* Standard driver entry points. These can be static. */
@ -1134,6 +1142,11 @@ feattach(parent, self, aux)
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE, sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_NET, feintr, sc); IPL_NET, feintr, sc);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_NET);
#endif
} }
/* /*
@ -1910,6 +1923,11 @@ feintr(arg)
if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0) if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0)
fe_start(&sc->sc_ethercom.ec_if); fe_start(&sc->sc_ethercom.ec_if);
#if NRND > 0
if (rstat != 0 || tstat != 0)
rnd_add_uint32(&sc->rnd_source, rstat + tstat);
#endif
/* /*
* Get interrupt conditions, masking unneeded flags. * Get interrupt conditions, masking unneeded flags.
*/ */

View File

@ -45,6 +45,7 @@
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -54,6 +55,9 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_dl.h> #include <net/if_dl.h>
@ -197,6 +201,10 @@ struct fe_softc {
u_char filter[FE_FILTER_LEN]; /* new filter value. */ u_char filter[FE_FILTER_LEN]; /* new filter value. */
u_int8_t sc_enaddr[ETHER_ADDR_LEN]; u_int8_t sc_enaddr[ETHER_ADDR_LEN];
#if NRND > 0
rndsource_element_t rnd_source;
#endif
}; };
/* Standard driver entry points. These can be static. */ /* Standard driver entry points. These can be static. */
@ -1134,6 +1142,11 @@ feattach(parent, self, aux)
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE, sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_NET, feintr, sc); IPL_NET, feintr, sc);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_NET);
#endif
} }
/* /*
@ -1910,6 +1923,11 @@ feintr(arg)
if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0) if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0)
fe_start(&sc->sc_ethercom.ec_if); fe_start(&sc->sc_ethercom.ec_if);
#if NRND > 0
if (rstat != 0 || tstat != 0)
rnd_add_uint32(&sc->rnd_source, rstat + tstat);
#endif
/* /*
* Get interrupt conditions, masking unneeded flags. * Get interrupt conditions, masking unneeded flags.
*/ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: smc91cxx.c,v 1.4 1997/10/14 21:41:00 thorpej Exp $ */ /* $NetBSD: smc91cxx.c,v 1.5 1997/10/15 05:56:03 explorer Exp $ */
/*- /*-
* Copyright (c) 1997 The NetBSD Foundation, Inc. * Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -78,6 +78,7 @@
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -88,6 +89,9 @@
#include <sys/malloc.h> #include <sys/malloc.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/errno.h> #include <sys/errno.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <machine/bus.h> #include <machine/bus.h>
#include <machine/intr.h> #include <machine/intr.h>
@ -260,6 +264,10 @@ smc91cxx_attach(sc, myea)
#if NBPFILTER > 0 #if NBPFILTER > 0
bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header)); bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif #endif
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, RND_TYPE_NET);
#endif
} }
/* /*
@ -826,6 +834,11 @@ smc91cxx_intr(arg)
mask |= bus_space_read_1(bst, bsh, INTR_MASK_REG_B); mask |= bus_space_read_1(bst, bsh, INTR_MASK_REG_B);
bus_space_write_1(bst, bsh, INTR_MASK_REG_B, mask); bus_space_write_1(bst, bsh, INTR_MASK_REG_B, mask);
#if NRND > 0
if (status)
rnd_add_uint32(&sc->rnd_source, status);
#endif
return (1); return (1);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: smc91cxxvar.h,v 1.3 1997/10/14 21:41:01 thorpej Exp $ */ /* $NetBSD: smc91cxxvar.h,v 1.4 1997/10/15 05:56:13 explorer Exp $ */
/*- /*-
* Copyright (c) 1997 The NetBSD Foundation, Inc. * Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -37,6 +37,12 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
struct smc91cxx_softc { struct smc91cxx_softc {
struct device sc_dev; /* generic device glue */ struct device sc_dev; /* generic device glue */
struct ethercom sc_ec; /* ethernet common glue */ struct ethercom sc_ec; /* ethernet common glue */
@ -50,6 +56,10 @@ struct smc91cxx_softc {
int (*sc_enable) __P((struct smc91cxx_softc *)); int (*sc_enable) __P((struct smc91cxx_softc *));
void (*sc_disable) __P((struct smc91cxx_softc *)); void (*sc_disable) __P((struct smc91cxx_softc *));
int sc_enabled; int sc_enabled;
#if NRND > 0
rndsource_element_t rnd_source;
#endif
}; };
#define SMC_SELECT_BANK(sc, x) \ #define SMC_SELECT_BANK(sc, x) \

View File

@ -45,6 +45,7 @@
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -54,6 +55,9 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_dl.h> #include <net/if_dl.h>
@ -197,6 +201,10 @@ struct fe_softc {
u_char filter[FE_FILTER_LEN]; /* new filter value. */ u_char filter[FE_FILTER_LEN]; /* new filter value. */
u_int8_t sc_enaddr[ETHER_ADDR_LEN]; u_int8_t sc_enaddr[ETHER_ADDR_LEN];
#if NRND > 0
rndsource_element_t rnd_source;
#endif
}; };
/* Standard driver entry points. These can be static. */ /* Standard driver entry points. These can be static. */
@ -1134,6 +1142,11 @@ feattach(parent, self, aux)
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE, sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_NET, feintr, sc); IPL_NET, feintr, sc);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_NET);
#endif
} }
/* /*
@ -1910,6 +1923,11 @@ feintr(arg)
if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0) if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0)
fe_start(&sc->sc_ethercom.ec_if); fe_start(&sc->sc_ethercom.ec_if);
#if NRND > 0
if (rstat != 0 || tstat != 0)
rnd_add_uint32(&sc->rnd_source, rstat + tstat);
#endif
/* /*
* Get interrupt conditions, masking unneeded flags. * Get interrupt conditions, masking unneeded flags.
*/ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ed.c,v 1.115 1997/10/14 23:06:30 thorpej Exp $ */ /* $NetBSD: if_ed.c,v 1.116 1997/10/15 05:58:59 explorer Exp $ */
/* /*
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@ -27,7 +27,6 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0 #if NRND > 0
#include <sys/rnd.h> #include <sys/rnd.h>
#endif #endif
@ -1078,8 +1077,7 @@ edattach(parent, self, aux)
IPL_NET, edintr, sc); IPL_NET, edintr, sc);
#if NRND > 0 #if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, RND_TYPE_NET);
RND_TYPE_NET);
#endif #endif
} }
@ -1775,7 +1773,8 @@ edintr(arg)
} }
#if NRND > 0 #if NRND > 0
rnd_add_uint32(&sc->rnd_source, isr); if (isr)
rnd_add_uint32(&sc->rnd_source, isr);
#endif #endif
isr = NIC_GET(iot, ioh, nicbase, ED_P0_ISR); isr = NIC_GET(iot, ioh, nicbase, ED_P0_ISR);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_eg.c,v 1.36 1997/04/28 17:04:14 mycroft Exp $ */ /* $NetBSD: if_eg.c,v 1.37 1997/10/15 05:59:16 explorer Exp $ */
/* /*
* Copyright (c) 1993 Dean Huxley <dean@fsa.ca> * Copyright (c) 1993 Dean Huxley <dean@fsa.ca>
@ -39,6 +39,7 @@
* - get rid of isa indirect stuff * - get rid of isa indirect stuff
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
@ -50,6 +51,9 @@
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/select.h> #include <sys/select.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_dl.h> #include <net/if_dl.h>
@ -113,6 +117,10 @@ struct eg_softc {
u_int8_t eg_incount; /* Number of buffers currently used */ u_int8_t eg_incount; /* Number of buffers currently used */
caddr_t eg_inbuf; /* Incoming packet buffer */ caddr_t eg_inbuf; /* Incoming packet buffer */
caddr_t eg_outbuf; /* Outgoing packet buffer */ caddr_t eg_outbuf; /* Outgoing packet buffer */
#if NRND > 0
rndsource_element_t rnd_source;
#endif
}; };
int egprobe __P((struct device *, void *, void *)); int egprobe __P((struct device *, void *, void *));
@ -475,6 +483,10 @@ egattach(parent, self, aux)
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE, sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_NET, egintr, sc); IPL_NET, egintr, sc);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, RND_TYPE_NET);
#endif
} }
void void
@ -712,6 +724,10 @@ egintr(arg)
egprintpcb(sc); egprintpcb(sc);
break; break;
} }
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, sc->eg_pcb[0]);
#endif
} }
return serviced; return serviced;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_el.c,v 1.48 1997/09/10 05:40:23 mycroft Exp $ */ /* $NetBSD: if_el.c,v 1.49 1997/10/15 05:59:26 explorer Exp $ */
/* /*
* Copyright (c) 1994, Matthew E. Kimmel. Permission is hereby granted * Copyright (c) 1994, Matthew E. Kimmel. Permission is hereby granted
@ -19,6 +19,7 @@
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -28,6 +29,9 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_dl.h> #include <net/if_dl.h>
@ -81,6 +85,10 @@ struct el_softc {
struct ethercom sc_ethercom; /* ethernet common */ struct ethercom sc_ethercom; /* ethernet common */
bus_space_tag_t sc_iot; /* bus space identifier */ bus_space_tag_t sc_iot; /* bus space identifier */
bus_space_handle_t sc_ioh; /* i/o handle */ bus_space_handle_t sc_ioh; /* i/o handle */
#if NRND > 0
rndsource_element_t rnd_source;
#endif
}; };
/* /*
@ -248,6 +256,11 @@ elattach(parent, self, aux)
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE, sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_NET, elintr, sc); IPL_NET, elintr, sc);
#if NRND > 0
DPRINTF(("Attaching to random...\n"));
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, RND_TYPE_NET);
#endif
DPRINTF(("elattach() finished.\n")); DPRINTF(("elattach() finished.\n"));
} }
@ -546,6 +559,10 @@ elintr(arg)
if ((bus_space_read_1(iot, ioh, EL_AS) & EL_AS_RXBUSY) != 0) if ((bus_space_read_1(iot, ioh, EL_AS) & EL_AS_RXBUSY) != 0)
break; break;
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, rxstat);
#endif
DPRINTF(("<rescan> ")); DPRINTF(("<rescan> "));
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ep_isa.c,v 1.17 1997/10/14 21:32:48 thorpej Exp $ */ /* $NetBSD: if_ep_isa.c,v 1.18 1997/10/15 05:59:34 explorer Exp $ */
/*- /*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -86,7 +86,6 @@
#include <net/if_ether.h> #include <net/if_ether.h>
#include <net/if_media.h> #include <net/if_media.h>
#ifdef INET #ifdef INET
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/in_systm.h> #include <netinet/in_systm.h>

View File

@ -45,6 +45,7 @@
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -54,6 +55,9 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_dl.h> #include <net/if_dl.h>
@ -197,6 +201,10 @@ struct fe_softc {
u_char filter[FE_FILTER_LEN]; /* new filter value. */ u_char filter[FE_FILTER_LEN]; /* new filter value. */
u_int8_t sc_enaddr[ETHER_ADDR_LEN]; u_int8_t sc_enaddr[ETHER_ADDR_LEN];
#if NRND > 0
rndsource_element_t rnd_source;
#endif
}; };
/* Standard driver entry points. These can be static. */ /* Standard driver entry points. These can be static. */
@ -1134,6 +1142,11 @@ feattach(parent, self, aux)
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE, sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_NET, feintr, sc); IPL_NET, feintr, sc);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_NET);
#endif
} }
/* /*
@ -1910,6 +1923,11 @@ feintr(arg)
if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0) if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0)
fe_start(&sc->sc_ethercom.ec_if); fe_start(&sc->sc_ethercom.ec_if);
#if NRND > 0
if (rstat != 0 || tstat != 0)
rnd_add_uint32(&sc->rnd_source, rstat + tstat);
#endif
/* /*
* Get interrupt conditions, masking unneeded flags. * Get interrupt conditions, masking unneeded flags.
*/ */

View File

@ -45,6 +45,7 @@
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -54,6 +55,9 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_dl.h> #include <net/if_dl.h>
@ -197,6 +201,10 @@ struct fe_softc {
u_char filter[FE_FILTER_LEN]; /* new filter value. */ u_char filter[FE_FILTER_LEN]; /* new filter value. */
u_int8_t sc_enaddr[ETHER_ADDR_LEN]; u_int8_t sc_enaddr[ETHER_ADDR_LEN];
#if NRND > 0
rndsource_element_t rnd_source;
#endif
}; };
/* Standard driver entry points. These can be static. */ /* Standard driver entry points. These can be static. */
@ -1134,6 +1142,11 @@ feattach(parent, self, aux)
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE, sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_NET, feintr, sc); IPL_NET, feintr, sc);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
RND_TYPE_NET);
#endif
} }
/* /*
@ -1910,6 +1923,11 @@ feintr(arg)
if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0) if ((sc->sc_ethercom.ec_if.if_flags & IFF_OACTIVE) == 0)
fe_start(&sc->sc_ethercom.ec_if); fe_start(&sc->sc_ethercom.ec_if);
#if NRND > 0
if (rstat != 0 || tstat != 0)
rnd_add_uint32(&sc->rnd_source, rstat + tstat);
#endif
/* /*
* Get interrupt conditions, masking unneeded flags. * Get interrupt conditions, masking unneeded flags.
*/ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_hp.c,v 1.24 1997/03/15 18:11:44 is Exp $ */ /* $NetBSD: if_hp.c,v 1.25 1997/10/15 05:59:55 explorer Exp $ */
/* XXX THIS DRIVER IS BROKEN. IT WILL NOT EVEN COMPILE. */ /* XXX THIS DRIVER IS BROKEN. IT WILL NOT EVEN COMPILE. */
@ -55,6 +55,8 @@
#include "hp.h" #include "hp.h"
#if NHP > 0 #if NHP > 0
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/mbuf.h> #include <sys/mbuf.h>
@ -64,6 +66,9 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/errno.h> #include <sys/errno.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_ether.h> #include <net/if_ether.h>
@ -136,7 +141,10 @@ struct hp_softc {
caddr_t ns_bpf; caddr_t ns_bpf;
#endif #endif
u_int8_t ns_addrp[ETHER_ADDR_LEN]; /* hardware Ethernet address */ u_int8_t ns_addrp[ETHER_ADDR_LEN]; /* hardware Ethernet address */
#if NRND > 0
rndsource_element_t rnd_source;
#endif
} }
hp_softc[NHP]; hp_softc[NHP];
#define ENBUFSIZE (sizeof(struct ether_header) + ETHERMTU + 2 + ETHER_MIN_LEN) #define ENBUFSIZE (sizeof(struct ether_header) + ETHERMTU + 2 + ETHER_MIN_LEN)
@ -421,6 +429,11 @@ hpattach(dvp)
bpfattach(&ns->ns_bpf, ifp, DLT_EN10MB, bpfattach(&ns->ns_bpf, ifp, DLT_EN10MB,
sizeof(struct ether_header)); sizeof(struct ether_header));
#endif #endif
#if NRND > 0
rnd_attach_source(&ns->rnd_source, ns->sc_dev.dv_xname, RND_TYPE_NET);
#endif
} }
/* /*
* Initialization of interface; set up initialization block * Initialization of interface; set up initialization block
@ -768,6 +781,11 @@ loop:
outb(hpc + ds_cmd, cmd); outb(hpc + ds_cmd, cmd);
outb(hpc + ds0_imr, 0xff); outb(hpc + ds0_imr, 0xff);
#if NRND > 0
if (irs)
rnd_add_uint32(&sc->rnd_source, isr);
#endif
/* Still more to do? */ /* Still more to do? */
isr = inb(hpc + ds0_isr); isr = inb(hpc + ds0_isr);
if (isr) if (isr)

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ie.c,v 1.60 1997/09/07 10:16:07 mycroft Exp $ */ /* $NetBSD: if_ie.c,v 1.61 1997/10/15 06:00:11 explorer Exp $ */
/*- /*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum. * Copyright (c) 1993, 1994, 1995 Charles Hannum.
@ -106,6 +106,7 @@ iomem, and to make 16-pointers, we subtract sc_maddr and and with 0xffff.
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -117,6 +118,9 @@ iomem, and to make 16-pointers, we subtract sc_maddr and and with 0xffff.
#include <sys/errno.h> #include <sys/errno.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_types.h> #include <net/if_types.h>
@ -266,6 +270,10 @@ struct ie_softc {
#endif #endif
u_int8_t sc_enaddr[6]; u_int8_t sc_enaddr[6];
u_int8_t sc_pad[2]; u_int8_t sc_pad[2];
#if NRND > 0
rndsource_element_t rnd_source;
#endif
}; };
void iewatchdog __P((struct ifnet *)); void iewatchdog __P((struct ifnet *));
@ -855,6 +863,10 @@ ieattach(parent, self, aux)
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE, sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_NET, ieintr, sc); IPL_NET, ieintr, sc);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, RND_TYPE_NET);
#endif
} }
/* /*
@ -934,6 +946,11 @@ loop:
printf("%s: cna\n", sc->sc_dev.dv_xname); printf("%s: cna\n", sc->sc_dev.dv_xname);
#endif #endif
#if NRND > 0
if (status & (IE_ST_FR | IE_ST_CX))
rnd_add_uint32(&sc->rnd_source, status);
#endif
/* Clear the interrupt latch on the 3C507. */ /* Clear the interrupt latch on the 3C507. */
if (sc->hard_type == IE_3C507) if (sc->hard_type == IE_3C507)
outb(PORT + IE507_ICTRL, 1); outb(PORT + IE507_ICTRL, 1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_iy.c,v 1.13 1997/04/28 18:30:20 mycroft Exp $ */ /* $NetBSD: if_iy.c,v 1.14 1997/10/15 06:00:26 explorer Exp $ */
/* #define IYDEBUG */ /* #define IYDEBUG */
/* #define IYMEMDEBUG */ /* #define IYMEMDEBUG */
/*- /*-
@ -34,6 +34,7 @@
*/ */
#include "bpfilter.h" #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -45,6 +46,9 @@
#include <sys/errno.h> #include <sys/errno.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/device.h> #include <sys/device.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <net/if_types.h> #include <net/if_types.h>
@ -109,6 +113,10 @@ struct iy_softc {
#ifdef IYDEBUG #ifdef IYDEBUG
int sc_debug; int sc_debug;
#endif #endif
#if NRND > 0
rndsource_element_t rnd_source;
#endif
}; };
void iywatchdog __P((struct ifnet *)); void iywatchdog __P((struct ifnet *));
@ -327,6 +335,10 @@ iyattach(parent, self, aux)
sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE, sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
IPL_NET, iyintr, sc); IPL_NET, iyintr, sc);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, RND_TYPE_NET);
#endif
temp = bus_space_read_1(iot, ioh, INT_NO_REG); temp = bus_space_read_1(iot, ioh, INT_NO_REG);
bus_space_write_1(iot, ioh, INT_NO_REG, (temp & 0xf8) | sc->mappedirq); bus_space_write_1(iot, ioh, INT_NO_REG, (temp & 0xf8) | sc->mappedirq);
} }
@ -826,6 +838,11 @@ iyintr(arg)
iy_intr_tx(sc); iy_intr_tx(sc);
bus_space_write_1(iot, ioh, STATUS_REG, TX_INT); bus_space_write_1(iot, ioh, STATUS_REG, TX_INT);
} }
#if NRND > 0
rnd_add_uint32(&sc->rnd_source, status);
#endif
return 1; return 1;
} }