Enable this is a non-entropy rnd source.
This commit is contained in:
parent
9d0dcbced4
commit
2f91607aff
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cs89x0.c,v 1.8 1999/03/25 23:23:16 thorpej Exp $ */
|
||||
/* $NetBSD: cs89x0.c,v 1.9 1999/03/30 21:02:41 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997
|
||||
|
@ -198,6 +198,11 @@
|
|||
#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>
|
||||
#include <net/if_media.h>
|
||||
|
@ -206,6 +211,12 @@
|
|||
#include <netinet/if_inarp.h>
|
||||
#endif
|
||||
|
||||
#include "bpfilter.h"
|
||||
#if NBPFILTER > 0
|
||||
#include <net/bpf.h>
|
||||
#include <net/bpfdesc.h>
|
||||
#endif
|
||||
|
||||
#include <vm/vm.h>
|
||||
|
||||
#include <machine/bus.h>
|
||||
|
@ -218,12 +229,6 @@
|
|||
#include <dev/isa/cs89x0reg.h>
|
||||
#include <dev/isa/cs89x0var.h>
|
||||
|
||||
#include "bpfilter.h"
|
||||
#if NBPFILTER > 0
|
||||
#include <net/bpf.h>
|
||||
#include <net/bpfdesc.h>
|
||||
#endif
|
||||
|
||||
#ifdef SHARK
|
||||
#include <arm32/shark/sequoia.h>
|
||||
#endif
|
||||
|
@ -481,6 +486,11 @@ cs_attach(sc, enaddr, media, nmedia, defmedia)
|
|||
bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
|
||||
#endif
|
||||
|
||||
#if NRND > 0
|
||||
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
|
||||
RND_TYPE_NET, 0);
|
||||
#endif
|
||||
|
||||
/* Reset the chip */
|
||||
if (cs_reset_chip(sc) == CS_ERROR)
|
||||
printf("%s: reset failed\n", sc->sc_dev.dv_xname);
|
||||
|
@ -1258,6 +1268,9 @@ cs_intr(arg)
|
|||
{
|
||||
struct cs_softc *sc = arg;
|
||||
u_int16_t Event;
|
||||
#if NRND > 0
|
||||
u_int16_t rndEvent;
|
||||
#endif
|
||||
|
||||
/* Ignore any interrupts that happen while the chip is being reset */
|
||||
if (sc->sc_resetting) {
|
||||
|
@ -1272,6 +1285,10 @@ cs_intr(arg)
|
|||
if ((Event & REG_NUM_MASK) == 0)
|
||||
return 0; /* not ours */
|
||||
|
||||
#if NRND > 0
|
||||
rndEvent = Event;
|
||||
#endif
|
||||
|
||||
/* Process all the events in the Interrupt Status Queue */
|
||||
while (Event != 0) {
|
||||
/* Dispatch to an event handler based on the register number */
|
||||
|
@ -1300,6 +1317,9 @@ cs_intr(arg)
|
|||
}
|
||||
|
||||
/* have handled the interupt */
|
||||
#if NRND > 0
|
||||
rnd_add_uint32(&sc->rnd_source, rndEvent);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cs89x0var.h,v 1.7 1998/08/07 05:55:14 thorpej Exp $ */
|
||||
/* $NetBSD: cs89x0var.h,v 1.8 1999/03/30 21:02:41 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997
|
||||
|
@ -104,6 +104,10 @@ struct cs_softc {
|
|||
int sc_carrier; /* has carrier */
|
||||
|
||||
u_int8_t sc_enaddr[6]; /* MAC address */
|
||||
|
||||
#if NRND > 0
|
||||
rndsource_element_t rnd_source; /* random source */
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue