Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Add rnd(9) support.
details: https://anonhg.NetBSD.org/src/rev/59e3797e2d18
branches: trunk
changeset: 457620:59e3797e2d18
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Mon Jul 08 03:22:38 2019 +0000
description:
Add rnd(9) support.
diffstat:
sys/arch/arm/altera/cycv_gmac.c | 5 +++--
sys/arch/arm/amlogic/meson_dwmac.c | 5 +++--
sys/arch/arm/rockchip/rk_gmac.c | 5 +++--
sys/arch/arm/sunxi/sunxi_gmac.c | 5 +++--
sys/dev/ic/dwc_gmac.c | 9 +++++++--
sys/dev/ic/dwc_gmac_var.h | 4 ++--
6 files changed, 21 insertions(+), 12 deletions(-)
diffs (166 lines):
diff -r a9de01a7c43a -r 59e3797e2d18 sys/arch/arm/altera/cycv_gmac.c
--- a/sys/arch/arm/altera/cycv_gmac.c Mon Jul 08 03:04:15 2019 +0000
+++ b/sys/arch/arm/altera/cycv_gmac.c Mon Jul 08 03:22:38 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cycv_gmac.c,v 1.2 2019/02/23 17:18:38 martin Exp $ */
+/* $NetBSD: cycv_gmac.c,v 1.3 2019/07/08 03:22:38 msaitoh Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cycv_gmac.c,v 1.2 2019/02/23 17:18:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cycv_gmac.c,v 1.3 2019/07/08 03:22:38 msaitoh Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -38,6 +38,7 @@
#include <sys/intr.h>
#include <sys/systm.h>
#include <sys/gpio.h>
+#include <sys/rndsource.h>
#include <net/if.h>
#include <net/if_ether.h>
diff -r a9de01a7c43a -r 59e3797e2d18 sys/arch/arm/amlogic/meson_dwmac.c
--- a/sys/arch/arm/amlogic/meson_dwmac.c Mon Jul 08 03:04:15 2019 +0000
+++ b/sys/arch/arm/amlogic/meson_dwmac.c Mon Jul 08 03:22:38 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: meson_dwmac.c,v 1.5 2019/04/19 19:07:56 jmcneill Exp $ */
+/* $NetBSD: meson_dwmac.c,v 1.6 2019/07/08 03:22:38 msaitoh Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.5 2019/04/19 19:07:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.6 2019/07/08 03:22:38 msaitoh Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -36,6 +36,7 @@
#include <sys/intr.h>
#include <sys/systm.h>
#include <sys/gpio.h>
+#include <sys/rndsource.h>
#include <net/if.h>
#include <net/if_ether.h>
diff -r a9de01a7c43a -r 59e3797e2d18 sys/arch/arm/rockchip/rk_gmac.c
--- a/sys/arch/arm/rockchip/rk_gmac.c Mon Jul 08 03:04:15 2019 +0000
+++ b/sys/arch/arm/rockchip/rk_gmac.c Mon Jul 08 03:22:38 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_gmac.c,v 1.12 2019/05/05 19:10:05 jmcneill Exp $ */
+/* $NetBSD: rk_gmac.c,v 1.13 2019/07/08 03:22:38 msaitoh Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_gmac.c,v 1.12 2019/05/05 19:10:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_gmac.c,v 1.13 2019/07/08 03:22:38 msaitoh Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -36,6 +36,7 @@
#include <sys/intr.h>
#include <sys/systm.h>
#include <sys/gpio.h>
+#include <sys/rndsource.h>
#include <net/if.h>
#include <net/if_ether.h>
diff -r a9de01a7c43a -r 59e3797e2d18 sys/arch/arm/sunxi/sunxi_gmac.c
--- a/sys/arch/arm/sunxi/sunxi_gmac.c Mon Jul 08 03:04:15 2019 +0000
+++ b/sys/arch/arm/sunxi/sunxi_gmac.c Mon Jul 08 03:22:38 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_gmac.c,v 1.4 2019/05/27 23:27:26 jmcneill Exp $ */
+/* $NetBSD: sunxi_gmac.c,v 1.5 2019/07/08 03:22:38 msaitoh Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_gmac.c,v 1.4 2019/05/27 23:27:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_gmac.c,v 1.5 2019/07/08 03:22:38 msaitoh Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -36,6 +36,7 @@
#include <sys/intr.h>
#include <sys/systm.h>
#include <sys/gpio.h>
+#include <sys/rndsource.h>
#include <net/if.h>
#include <net/if_ether.h>
diff -r a9de01a7c43a -r 59e3797e2d18 sys/dev/ic/dwc_gmac.c
--- a/sys/dev/ic/dwc_gmac.c Mon Jul 08 03:04:15 2019 +0000
+++ b/sys/dev/ic/dwc_gmac.c Mon Jul 08 03:22:38 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_gmac.c,v 1.62 2019/05/23 13:10:51 msaitoh Exp $ */
+/* $NetBSD: dwc_gmac.c,v 1.63 2019/07/08 03:22:38 msaitoh Exp $ */
/*-
* Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.62 2019/05/23 13:10:51 msaitoh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.63 2019/07/08 03:22:38 msaitoh Exp $");
/* #define DWC_GMAC_DEBUG 1 */
@@ -57,6 +57,7 @@
#include <sys/systm.h>
#include <sys/sockio.h>
#include <sys/cprng.h>
+#include <sys/rndsource.h>
#include <net/if.h>
#include <net/if_ether.h>
@@ -333,6 +334,8 @@
ether_ifattach(ifp, enaddr);
ether_set_ifflags_cb(&sc->sc_ec, dwc_gmac_ifflags_cb);
if_register(ifp);
+ rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
+ RND_TYPE_NET, RND_FLAG_DEFAULT);
/*
* Enable interrupts
@@ -1455,6 +1458,8 @@
#endif
}
+ rnd_add_uint32(&sc->rnd_source, dma_status);
+
/* ack interrupt */
if (dma_status)
bus_space_write_4(sc->sc_bst, sc->sc_bsh,
diff -r a9de01a7c43a -r 59e3797e2d18 sys/dev/ic/dwc_gmac_var.h
--- a/sys/dev/ic/dwc_gmac_var.h Mon Jul 08 03:04:15 2019 +0000
+++ b/sys/dev/ic/dwc_gmac_var.h Mon Jul 08 03:22:38 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_gmac_var.h,v 1.13 2019/02/23 17:18:07 martin Exp $ */
+/* $NetBSD: dwc_gmac_var.h,v 1.14 2019/07/08 03:22:38 msaitoh Exp $ */
/*-
* Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
@@ -109,7 +109,7 @@
short sc_if_flags; /* shadow of ether flags */
uint16_t sc_mii_clk;
bool sc_stopping;
-
+ krndsource_t rnd_source;
kmutex_t *sc_lock; /* lock for softc operations */
struct if_percpuq *sc_ipq; /* softint-based input queues */
Home |
Main Index |
Thread Index |
Old Index