Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x68k/dev Change the implementation of ms(4) polling...
details: https://anonhg.NetBSD.org/src/rev/043a3f23e44f
branches: trunk
changeset: 480504:043a3f23e44f
user: itohy <itohy%NetBSD.org@localhost>
date: Fri Jan 14 08:22:42 2000 +0000
description:
Change the implementation of ms(4) polling to use timeout(9) software
interrupt in order to eliminate glitches on MPU interrupt levels.
I don't know whether this is a good solution, but it does work.
diffstat:
sys/arch/x68k/dev/ms.c | 35 +++++++++++++++++++++--------------
1 files changed, 21 insertions(+), 14 deletions(-)
diffs (83 lines):
diff -r fb44b6289338 -r 043a3f23e44f sys/arch/x68k/dev/ms.c
--- a/sys/arch/x68k/dev/ms.c Fri Jan 14 08:21:22 2000 +0000
+++ b/sys/arch/x68k/dev/ms.c Fri Jan 14 08:22:42 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ms.c,v 1.8 1999/03/24 14:07:38 minoura Exp $ */
+/* $NetBSD: ms.c,v 1.9 2000/01/14 08:22:42 itohy Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -137,7 +137,7 @@
static int ms_match __P((struct device*, struct cfdata*, void*));
static void ms_attach __P((struct device*, struct device*, void*));
static void ms_trigger __P((struct zs_chanstate*, int));
-void ms_modem __P((void));
+void ms_modem __P((void *));
struct cfattach ms_ca = {
sizeof(struct ms_softc), ms_match, ms_attach
@@ -235,11 +235,12 @@
ms->ms_ready = 1; /* start accepting events */
ms->ms_rts = 1;
- s = splzs();
- ms_trigger(ms->ms_cs, 1); /* set MSCTR high (standby) */
- splx(s);
ms->ms_byteno = -1;
ms->ms_nodata = 0;
+
+ /* start sequencer */
+ ms_modem(ms);
+
return (0);
}
@@ -253,6 +254,7 @@
ms = ms_cd.cd_devs[minor(dev)];
ms->ms_ready = 0; /* stop accepting events */
+ untimeout(ms_modem, ms);
ev_fini(&ms->ms_events);
ms->ms_events.ev_io = NULL;
@@ -654,21 +656,23 @@
* called after system tick interrupt is done.
*/
void
-ms_modem(void)
+ms_modem(arg)
+ void *arg;
{
- struct ms_softc *ms = ms_cd.cd_devs[0];
+ struct ms_softc *ms = arg;
+ int s;
- /* we are in higher intr. level than splzs. no need splzs(). */
if (!ms->ms_ready)
return;
- if (ms->ms_nodata++ > 300) { /* XXX */
- log(LOG_ERR, "%s: no data for 3 secs. resetting.\n",
+
+ s = splzs();
+
+ if (ms->ms_nodata++ > 250) { /* XXX */
+ log(LOG_ERR, "%s: no data for 5 secs. resetting.\n",
ms->ms_dev.dv_xname);
+ ms->ms_byteno = -1;
ms->ms_nodata = 0;
- ms->ms_byteno = -1;
- ms->ms_rts = 1;
- ms_trigger(ms->ms_cs, 1);
- return;
+ ms->ms_rts = 0;
}
if (ms->ms_rts) {
@@ -682,4 +686,7 @@
ms->ms_rts = 1;
ms_trigger(ms->ms_cs, ms->ms_rts);
}
+
+ (void) splx(s);
+ timeout(ms_modem, ms, 2);
}
Home |
Main Index |
Thread Index |
Old Index