summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/com.c18
-rw-r--r--sys/dev/ic/comvar.h10
2 files changed, 26 insertions, 2 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index ba253fa4d19..a569913df4b 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.114 1997/10/18 23:11:45 is Exp $ */
+/* $NetBSD: com.c,v 1.115 1997/10/19 11:45:33 explorer Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995, 1996, 1997
@@ -71,6 +71,12 @@
/*
* COM driver, uses National Semiconductor NS16450/NS16550AF UART
*/
+
+#include "rnd.h"
+#if NRND > 0 && defined(RND_COM)
+#include <sys/rnd.h>
+#endif
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ioctl.h>
@@ -454,6 +460,11 @@ com_attach_subr(sc)
#ifdef __GENERIC_SOFT_INTERRUPTS
sc->sc_si = softintr_establish(IPL_SOFTSERIAL, comsoft, sc);
#endif
+
+#if NRND > 0 && defined(RND_COM)
+ rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
+ RND_TYPE_TTY);
+#endif
}
int
@@ -1607,6 +1618,11 @@ comintr(arg)
}
#endif
#endif
+
+#if NRND > 0 && defined(RND_COM)
+ rnd_add_uint32(&sc->rnd_source, iir | lsr);
+#endif
+
return (1);
}
diff --git a/sys/dev/ic/comvar.h b/sys/dev/ic/comvar.h
index 0142fb5b93b..04e0aed1720 100644
--- a/sys/dev/ic/comvar.h
+++ b/sys/dev/ic/comvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: comvar.h,v 1.16 1997/10/15 22:00:17 thorpej Exp $ */
+/* $NetBSD: comvar.h,v 1.17 1997/10/19 11:45:45 explorer Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -30,6 +30,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "rnd.h"
+#if NRND > 0 && defined(RND_COM)
+#include <sys/rnd.h>
+#endif
+
int comcnattach __P((bus_space_tag_t, int, int, int, tcflag_t));
#ifdef KGDB
@@ -100,6 +105,9 @@ struct com_softc {
sc_rx_ready;
volatile u_char sc_heldchange;
+#if NRND > 0 && defined(RND_COM)
+ rndsource_element_t rnd_source;
+#endif
};
/* Macros to clear/set/test flags. */