Pass proper status values to rnd_add_uint32(9) as rnd(9) man page claims.

This commit is contained in:
tsutsui 2022-06-25 02:46:15 +00:00
parent 9e786c4a35
commit 2d39e9ce16
5 changed files with 29 additions and 23 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dp83932.c,v 1.47 2021/02/20 09:36:31 rin Exp $ */
/* $NetBSD: dp83932.c,v 1.48 2022/06/25 02:46:15 tsutsui Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.47 2021/02/20 09:36:31 rin Exp $");
__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.48 2022/06/25 02:46:15 tsutsui Exp $");
#include <sys/param.h>
@ -689,8 +689,8 @@ sonic_txintr(struct sonic_softc *sc)
if (sc->sc_txpending == 0)
ifp->if_timer = 0;
if (count != 0)
rnd_add_uint32(&sc->sc_rndsource, count);
if (totstat != 0)
rnd_add_uint32(&sc->sc_rndsource, totstat);
return totstat;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82557.c,v 1.159 2020/02/07 00:56:48 thorpej Exp $ */
/* $NetBSD: i82557.c,v 1.160 2022/06/25 02:46:15 tsutsui Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.159 2020/02/07 00:56:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.160 2022/06/25 02:46:15 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1074,7 +1074,7 @@ fxp_intr(void *arg)
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
bus_dmamap_t rxmap;
int claimed = 0, rnr;
uint8_t statack;
uint8_t statack, rndstat = 0;
if (!device_is_active(sc->sc_dev) || sc->sc_enabled == 0)
return (0);
@ -1092,6 +1092,7 @@ fxp_intr(void *arg)
}
while ((statack = CSR_READ_1(sc, FXP_CSR_SCB_STATACK)) != 0) {
rndstat = statack;
claimed = 1;
/*
@ -1146,7 +1147,7 @@ fxp_intr(void *arg)
}
if (claimed)
rnd_add_uint32(&sc->rnd_source, statack);
rnd_add_uint32(&sc->rnd_source, rndstat);
return (claimed);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtl8169.c,v 1.171 2022/05/24 20:50:19 andvar Exp $ */
/* $NetBSD: rtl8169.c,v 1.172 2022/06/25 02:46:15 tsutsui Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.171 2022/05/24 20:50:19 andvar Exp $");
__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.172 2022/06/25 02:46:15 tsutsui Exp $");
/* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
/*
@ -1530,7 +1530,7 @@ re_intr(void *arg)
{
struct rtk_softc *sc = arg;
struct ifnet *ifp;
uint16_t status;
uint16_t status, rndstatus = 0;
int handled = 0;
if (!device_has_power(sc->sc_dev))
@ -1550,9 +1550,10 @@ re_intr(void *arg)
/* If the card has gone away the read returns 0xffff. */
if (status == 0xffff)
break;
if (status) {
if (status != 0) {
handled = 1;
CSR_WRITE_2(sc, RTK_ISR, status);
rndstatus = status;
}
if ((status & status_mask) == 0)
@ -1578,7 +1579,7 @@ re_intr(void *arg)
if (handled)
if_schedule_deferred_start(ifp);
rnd_add_uint32(&sc->rnd_source, status);
rnd_add_uint32(&sc->rnd_source, rndstatus);
return handled;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtl81x9.c,v 1.111 2020/03/12 03:01:46 thorpej Exp $ */
/* $NetBSD: rtl81x9.c,v 1.112 2022/06/25 02:46:15 tsutsui Exp $ */
/*
* Copyright (c) 1997, 1998
@ -86,7 +86,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.111 2020/03/12 03:01:46 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.112 2022/06/25 02:46:15 tsutsui Exp $");
#include <sys/param.h>
@ -1166,7 +1166,7 @@ rtk_intr(void *arg)
{
struct rtk_softc *sc;
struct ifnet *ifp;
uint16_t status;
uint16_t status, rndstatus = 0;
int handled;
sc = arg;
@ -1186,8 +1186,10 @@ rtk_intr(void *arg)
if (status == 0xffff)
break; /* Card is gone... */
if (status)
if (status) {
CSR_WRITE_2(sc, RTK_ISR, status);
rndstatus = status;
}
if ((status & RTK_INTRS) == 0)
break;
@ -1214,7 +1216,7 @@ rtk_intr(void *arg)
if_schedule_deferred_start(ifp);
rnd_add_uint32(&sc->rnd_source, status);
rnd_add_uint32(&sc->rnd_source, rndstatus);
return handled;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: tulip.c,v 1.204 2020/03/15 22:19:00 thorpej Exp $ */
/* $NetBSD: tulip.c,v 1.205 2022/06/25 02:46:15 tsutsui Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.204 2020/03/15 22:19:00 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.205 2022/06/25 02:46:15 tsutsui Exp $");
#include <sys/param.h>
@ -1010,7 +1010,7 @@ tlp_intr(void *arg)
{
struct tulip_softc *sc = arg;
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
uint32_t status, rxstatus, txstatus;
uint32_t status, rxstatus, txstatus, rndstatus = 0;
int handled = 0, txthresh;
DPRINTF(sc, ("%s: tlp_intr\n", device_xname(sc->sc_dev)));
@ -1042,8 +1042,10 @@ tlp_intr(void *arg)
for (;;) {
status = TULIP_READ(sc, CSR_STATUS);
if (status)
if (status) {
TULIP_WRITE(sc, CSR_STATUS, status);
rndstatus = status;
}
if ((status & sc->sc_inten) == 0)
break;
@ -1186,7 +1188,7 @@ tlp_intr(void *arg)
if_schedule_deferred_start(ifp);
if (handled)
rnd_add_uint32(&sc->sc_rnd_source, status);
rnd_add_uint32(&sc->sc_rnd_source, rndstatus);
return handled;
}