Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Check for DCD status change interrupts which sign...
details: https://anonhg.NetBSD.org/src/rev/a2334dce458e
branches: trunk
changeset: 481814:a2334dce458e
user: jonathan <jonathan%NetBSD.org@localhost>
date: Sun Feb 06 23:23:37 2000 +0000
description:
Check for DCD status change interrupts which signal PPS events, even
if the line discipline is ignoring carrier (e.g., via comparam()'s
setting of sc->sc_msr_mask). Move PPS timestamp outside the normal
status-change processing, and ignore sc_msr_mask when testing
for PPS events.
diffstat:
sys/dev/ic/com.c | 82 ++++++++++++++++++++++++++++----------------------------
1 files changed, 41 insertions(+), 41 deletions(-)
diffs (113 lines):
diff -r af08f415c4f3 -r a2334dce458e sys/dev/ic/com.c
--- a/sys/dev/ic/com.c Sun Feb 06 21:45:03 2000 +0000
+++ b/sys/dev/ic/com.c Sun Feb 06 23:23:37 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.166 2000/01/23 21:06:01 soda Exp $ */
+/* $NetBSD: com.c,v 1.167 2000/02/06 23:23:37 jonathan Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -1936,7 +1936,7 @@
cc = sc->sc_rbavail;
do {
- u_char msr, delta;
+ u_char msr, delta, ppsdelta;
lsr = bus_space_read_1(iot, ioh, com_lsr);
#if defined(DDB) || defined(KGDB)
@@ -2014,55 +2014,55 @@
msr = bus_space_read_1(iot, ioh, com_msr);
delta = msr ^ sc->sc_msr;
sc->sc_msr = msr;
- if (ISSET(delta, sc->sc_msr_mask)) {
- SET(sc->sc_msr_delta, delta);
-
- /*
- * Pulse-per-second clock signal on edge of DCD?
- */
- if (ISSET(delta, sc->sc_ppsmask)) {
- struct timeval tv;
- if (ISSET(msr, sc->sc_ppsmask) ==
- sc->sc_ppsassert) {
- /* XXX nanotime() */
- microtime(&tv);
- TIMEVAL_TO_TIMESPEC(&tv,
- &sc->ppsinfo.assert_timestamp);
- if (sc->ppsparam.mode & PPS_OFFSETASSERT) {
- timespecadd(&sc->ppsinfo.assert_timestamp,
- &sc->ppsparam.assert_offset,
+ /*
+ * Pulse-per-second (PSS) signals on edge of DCD?
+ * Process these even if line discipline is ignoring DCD.
+ */
+ ppsdelta = delta & sc->sc_ppsmask;
+ if (ppsdelta) {
+ struct timeval tv;
+ if (ppsdelta == sc->sc_ppsassert) {
+ /* XXX nanotime() */
+ microtime(&tv);
+ TIMEVAL_TO_TIMESPEC(&tv,
+ &sc->ppsinfo.assert_timestamp);
+ if (sc->ppsparam.mode & PPS_OFFSETASSERT) {
+ timespecadd(&sc->ppsinfo.assert_timestamp,
+ &sc->ppsparam.assert_offset,
&sc->ppsinfo.assert_timestamp);
- }
+ }
#ifdef PPS_SYNC
- if (sc->ppsparam.mode & PPS_HARDPPSONASSERT)
- hardpps(&tv, tv.tv_usec);
+ if (sc->ppsparam.mode & PPS_HARDPPSONASSERT)
+ hardpps(&tv, tv.tv_usec);
#endif
- sc->ppsinfo.assert_sequence++;
- sc->ppsinfo.current_mode =
- sc->ppsparam.mode;
+ sc->ppsinfo.assert_sequence++;
+ sc->ppsinfo.current_mode = sc->ppsparam.mode;
- } else if (ISSET(msr, sc->sc_ppsmask) ==
- sc->sc_ppsclear) {
- /* XXX nanotime() */
- microtime(&tv);
- TIMEVAL_TO_TIMESPEC(&tv,
+ } else if (ppsdelta == sc->sc_ppsclear) {
+ /* XXX nanotime() */
+ microtime(&tv);
+ TIMEVAL_TO_TIMESPEC(&tv,
+ &sc->ppsinfo.clear_timestamp);
+ if (sc->ppsparam.mode & PPS_OFFSETCLEAR) {
+ timespecadd(&sc->ppsinfo.clear_timestamp,
+ &sc->ppsparam.clear_offset,
&sc->ppsinfo.clear_timestamp);
- if (sc->ppsparam.mode & PPS_OFFSETCLEAR) {
- timespecadd(&sc->ppsinfo.clear_timestamp,
- &sc->ppsparam.clear_offset,
- &sc->ppsinfo.clear_timestamp);
- }
+ }
#ifdef PPS_SYNC
- if (sc->ppsparam.mode & PPS_HARDPPSONCLEAR)
- hardpps(&tv, tv.tv_usec);
+ if (sc->ppsparam.mode & PPS_HARDPPSONCLEAR)
+ hardpps(&tv, tv.tv_usec);
#endif
- sc->ppsinfo.clear_sequence++;
- sc->ppsinfo.current_mode =
- sc->ppsparam.mode;
- }
+ sc->ppsinfo.clear_sequence++;
+ sc->ppsinfo.current_mode = sc->ppsparam.mode;
}
+ }
+ /*
+ * Process normal status changes
+ */
+ if (ISSET(delta, sc->sc_msr_mask)) {
+ SET(sc->sc_msr_delta, delta);
/*
* Stop output immediately if we lose the output
Home |
Main Index |
Thread Index |
Old Index