Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc/dev catch up with sd changes.
details: https://anonhg.NetBSD.org/src/rev/a89abc173b86
branches: trunk
changeset: 349480:a89abc173b86
user: christos <christos%NetBSD.org@localhost>
date: Sun Dec 11 16:25:54 2016 +0000
description:
catch up with sd changes.
diffstat:
sys/arch/sparc/dev/tctrl.c | 43 ++++++++++++++++++++++---------------------
1 files changed, 22 insertions(+), 21 deletions(-)
diffs (81 lines):
diff -r 9273b6101b90 -r a89abc173b86 sys/arch/sparc/dev/tctrl.c
--- a/sys/arch/sparc/dev/tctrl.c Sun Dec 11 15:47:06 2016 +0000
+++ b/sys/arch/sparc/dev/tctrl.c Sun Dec 11 16:25:54 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tctrl.c,v 1.59 2014/07/25 08:10:34 dholland Exp $ */
+/* $NetBSD: tctrl.c,v 1.60 2016/12/11 16:25:54 christos Exp $ */
/*-
* Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tctrl.c,v 1.59 2014/07/25 08:10:34 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tctrl.c,v 1.60 2016/12/11 16:25:54 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1447,42 +1447,43 @@
{
struct tctrl_softc *sc = v;
device_t dv;
- struct sd_softc *sd = NULL;
- struct lance_softc *le = NULL;
- int ticks = hz/2;
- int rcount, wcount;
- int s;
+ struct sd_softc *sd;
- while (sd == NULL) {
+ for (sd = NULL; sd == NULL;) {
dv = device_find_by_xname("sd0");
if (dv != NULL)
sd = device_private(dv);
else
tsleep(&sc->sc_events, PWAIT, "probe_disk", hz);
}
+
dv = device_find_by_xname("le0");
- if (dv != NULL)
- le = device_private(dv);
- printf("found %s\n", device_xname(sd->sc_dev));
- rcount = sd->sc_dk.dk_stats->io_rxfer;
- wcount = sd->sc_dk.dk_stats->io_wxfer;
+
+ struct lance_softc *le = dv != NULL ? device_private(dv) : NULL;
+ struct dk_softc *dk = &sd->sc_dksc;
+ printf("found %s\n", device_xname(dk->sc_dev));
+
+ struct io_stats *io = dk->sc_dkdev.dk_stats;
+ int rcount = io->io_rxfer;
+ int wcount = io->io_wxfer;
tctrl_read_event_status(sc);
- while (1) {
+ int ticks = hz / 2;
+ for (;;) {
tsleep(&sc->sc_events, PWAIT, "tctrl_event", ticks);
- s = splhigh();
- if ((rcount != sd->sc_dk.dk_stats->io_rxfer) ||
- (wcount != sd->sc_dk.dk_stats->io_wxfer)) {
- rcount = sd->sc_dk.dk_stats->io_rxfer;
- wcount = sd->sc_dk.dk_stats->io_wxfer;
+ int s = splhigh();
+ if ((rcount != io->io_rxfer) || (wcount != io->io_wxfer)) {
+ rcount = io->io_rxfer;
+ wcount = io->io_wxfer;
sc->sc_lcdwanted |= TS102_LCD_DISK_ACTIVE;
} else
sc->sc_lcdwanted &= ~TS102_LCD_DISK_ACTIVE;
+
if (le != NULL) {
- if (le->sc_havecarrier != 0) {
+ if (le->sc_havecarrier != 0)
sc->sc_lcdwanted |= TS102_LCD_LAN_ACTIVE;
- } else
+ else
sc->sc_lcdwanted &= ~TS102_LCD_LAN_ACTIVE;
}
splx(s);
Home |
Main Index |
Thread Index |
Old Index