Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci PR 31304: Contribute to the random pool. From Rh...



details:   https://anonhg.NetBSD.org/src/rev/8a9de21f2c6f
branches:  trunk
changeset: 588191:8a9de21f2c6f
user:      rpaulo <rpaulo%NetBSD.org@localhost>
date:      Sat Feb 11 13:04:44 2006 +0000

description:
PR 31304: Contribute to the random pool. From Rhialto.

diffstat:

 sys/dev/pci/if_sk.c    |  13 +++++++++++--
 sys/dev/pci/if_skvar.h |  11 ++++++++++-
 2 files changed, 21 insertions(+), 3 deletions(-)

diffs (80 lines):

diff -r 0a49d7f78d78 -r 8a9de21f2c6f sys/dev/pci/if_sk.c
--- a/sys/dev/pci/if_sk.c       Sat Feb 11 12:57:03 2006 +0000
+++ b/sys/dev/pci/if_sk.c       Sat Feb 11 13:04:44 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sk.c,v 1.18 2005/11/23 18:56:22 riz Exp $   */
+/*     $NetBSD: if_sk.c,v 1.19 2006/02/11 13:04:44 rpaulo Exp $        */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -122,6 +122,7 @@
  */
 
 #include "bpfilter.h"
+#include "rnd.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -151,6 +152,9 @@
 #if NBPFILTER > 0
 #include <net/bpf.h>
 #endif
+#if NRND > 0
+#include <sys/rnd.h>
+#endif
 
 #include <dev/mii/mii.h>
 #include <dev/mii/miivar.h>
@@ -1305,7 +1309,7 @@
        ether_ifattach(ifp, sc_if->sk_enaddr);
 
 #if NRND > 0
-        rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
+        rnd_attach_source(&sc->rnd_source, sc->sk_dev.dv_xname,
             RND_TYPE_NET, 0);
 #endif
 
@@ -2170,6 +2174,11 @@
        if (ifp1 != NULL && !IFQ_IS_EMPTY(&ifp1->if_snd))
                sk_start(ifp1);
 
+#if NRND > 0
+       if (RND_ENABLED(&sc->rnd_source))
+               rnd_add_uint32(&sc->rnd_source, status);
+#endif
+
        return (claimed);
 }
 
diff -r 0a49d7f78d78 -r 8a9de21f2c6f sys/dev/pci/if_skvar.h
--- a/sys/dev/pci/if_skvar.h    Sat Feb 11 12:57:03 2006 +0000
+++ b/sys/dev/pci/if_skvar.h    Sat Feb 11 13:04:44 2006 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_skvar.h,v 1.7 2005/12/11 12:22:49 christos Exp $ */
+/* $NetBSD: if_skvar.h,v 1.8 2006/02/11 13:04:44 rpaulo Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -87,6 +87,12 @@
 #ifndef _DEV_PCI_IF_SKVAR_H_
 #define _DEV_PCI_IF_SKVAR_H_
 
+#include "rnd.h"
+
+#if NRND > 0
+#include <sys/rnd.h>
+#endif
+
 struct sk_jslot {
        caddr_t                 sk_buf;
        int                     sk_inuse;
@@ -208,6 +214,9 @@
        u_int32_t               sk_intrmask;
        bus_dma_tag_t           sc_dmatag;
        struct sk_if_softc      *sk_if[2];
+#if NRND > 0
+       rndsource_element_t     rnd_source;
+#endif
 };
 
 /* Softc for each logical interface */



Home | Main Index | Thread Index | Old Index