Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/isa Enable this is a non-entropy rnd source.



details:   https://anonhg.NetBSD.org/src/rev/7e44521fc529
branches:  trunk
changeset: 467900:7e44521fc529
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Tue Mar 30 21:02:41 1999 +0000

description:
Enable this is a non-entropy rnd source.

diffstat:

 sys/dev/isa/cs89x0.c    |  34 +++++++++++++++++++++++++++-------
 sys/dev/isa/cs89x0var.h |   6 +++++-
 2 files changed, 32 insertions(+), 8 deletions(-)

diffs (110 lines):

diff -r 9024333b57ca -r 7e44521fc529 sys/dev/isa/cs89x0.c
--- a/sys/dev/isa/cs89x0.c      Tue Mar 30 21:01:42 1999 +0000
+++ b/sys/dev/isa/cs89x0.c      Tue Mar 30 21:02:41 1999 +0000
@@ -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 @@
        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 @@
 {
        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 @@
        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 @@
        }
 
        /* have handled the interupt */
+#if NRND > 0
+       rnd_add_uint32(&sc->rnd_source, rndEvent);
+#endif
        return 1;
 }
 
diff -r 9024333b57ca -r 7e44521fc529 sys/dev/isa/cs89x0var.h
--- a/sys/dev/isa/cs89x0var.h   Tue Mar 30 21:01:42 1999 +0000
+++ b/sys/dev/isa/cs89x0var.h   Tue Mar 30 21:02:41 1999 +0000
@@ -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 @@
        int     sc_carrier;             /* has carrier */
 
        u_int8_t sc_enaddr[6];          /* MAC address */
+
+#if NRND > 0
+       rndsource_element_t rnd_source; /* random source */
+#endif
 };
 
 /*



Home | Main Index | Thread Index | Old Index