Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/dev/ic Pull up revisions 1.167-1.168 (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/bfc57be2fd0c
branches:  netbsd-1-4
changeset: 470323:bfc57be2fd0c
user:      he <he%NetBSD.org@localhost>
date:      Tue Feb 08 22:14:27 2000 +0000

description:
Pull up revisions 1.167-1.168 (requested by jonathan):
  Properly catch PPS signals on DCD transitions, even if DCD is
  otherwise ignored.

diffstat:

 sys/dev/ic/com.c |  80 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 40 insertions(+), 40 deletions(-)

diffs (104 lines):

diff -r 050d68cad9d9 -r bfc57be2fd0c sys/dev/ic/com.c
--- a/sys/dev/ic/com.c  Tue Feb 08 22:09:13 2000 +0000
+++ b/sys/dev/ic/com.c  Tue Feb 08 22:14:27 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com.c,v 1.159.2.3 2000/01/20 23:24:39 he Exp $ */
+/*     $NetBSD: com.c,v 1.159.2.4 2000/02/08 22:14:27 he Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -2009,55 +2009,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.
+                */
+               if (delta & sc->sc_ppsmask) {
+                       struct timeval tv;
+                       if ((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,
                                                    &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 ((msr & sc->sc_ppsmask) == 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