Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/dev Add rnd entropy gathering.



details:   https://anonhg.NetBSD.org/src/rev/1ea5bd439a83
branches:  trunk
changeset: 513235:1ea5bd439a83
user:      mjl <mjl%NetBSD.org@localhost>
date:      Thu Jul 26 21:31:45 2001 +0000

description:
Add rnd entropy gathering.

diffstat:

 sys/arch/macppc/dev/if_gm.c |  18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (60 lines):

diff -r b17ec6d6e6ff -r 1ea5bd439a83 sys/arch/macppc/dev/if_gm.c
--- a/sys/arch/macppc/dev/if_gm.c       Thu Jul 26 20:20:15 2001 +0000
+++ b/sys/arch/macppc/dev/if_gm.c       Thu Jul 26 21:31:45 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gm.c,v 1.14 2001/07/22 11:29:46 wiz Exp $   */
+/*     $NetBSD: if_gm.c,v 1.15 2001/07/26 21:31:45 mjl Exp $   */
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -28,6 +28,7 @@
 
 #include "opt_inet.h"
 #include "opt_ns.h"
+#include "rnd.h"
 #include "bpfilter.h"
 
 #include <sys/param.h>
@@ -39,6 +40,10 @@
 #include <sys/systm.h>
 #include <sys/callout.h>
 
+#if NRND > 0
+#include <sys/rnd.h>
+#endif
+
 #include <uvm/uvm_extern.h>
 
 #include <net/if.h>
@@ -81,6 +86,10 @@
        struct mii_data sc_mii;
        struct callout sc_tick_ch;
        char sc_laddr[6];
+
+#if NRND > 0
+       rndsource_element_t sc_rnd_source; /* random source */
+#endif
 };
 
 #define sc_if sc_ethercom.ec_if
@@ -246,6 +255,10 @@
 
        if_attach(ifp);
        ether_ifattach(ifp, laddr);
+#if NRND > 0 
+       rnd_attach_source(&sc->sc_rnd_source, sc->sc_dev.dv_xname,
+           RND_TYPE_NET, 0); 
+#endif
 }
 
 u_int
@@ -338,6 +351,9 @@
        if (status & GMAC_INT_TXEMPTY)
                gmac_tint(sc);
 
+#if NRND > 0 
+       rnd_add_uint32(&sc->sc_rnd_source, status);
+#endif  
        return 1;
 }
 



Home | Main Index | Thread Index | Old Index