]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ChangeLog, ntp_refclock.h, ntp_refclock.c, refclock_mx4200.c:
authorHarlan Stenn <stenn@ntp.org>
Sat, 4 Dec 1999 22:35:14 +0000 (22:35 -0000)
committerHarlan Stenn <stenn@ntp.org>
Sat, 4 Dec 1999 22:35:14 +0000 (22:35 -0000)
  * ntpd/ntp_refclock.c (refclock_open): "flags" processing cleanup
  (refclock_open): PPS device initialization cleanup
  * include/ntp_refclock.h (LDISC_CHU):
  (LDISC_PPS): Clean up comments
  From: Dave Mills <mills@udel.edu>

bk: 38499722uODhzKzw0x_uDQ2p4MEY7Q

ChangeLog
include/ntp_refclock.h
ntpd/ntp_refclock.c
ntpd/refclock_mx4200.c

index 1adc3366f0ac0f1483f144635f51d71247d74aeb..218f2b63ff15f92f65bafc1e6f7fd56c5de512b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+1999-12-04  Harlan Stenn  <stenn@whimsy.udel.edu>
+
+       * ntpd/ntp_refclock.c (refclock_open): "flags" processing cleanup
+       (refclock_open): PPS device initialization cleanup
+       * include/ntp_refclock.h (LDISC_CHU): 
+       (LDISC_PPS): Clean up comments
+       From: Dave Mills <mills@udel.edu>
+
 1999-12-03  Sven Dietrich <sven_dietrich@trimble.com>
 
        * libntp/mexit.c: Moved WINNT port specific file to ports/winnt/libntp
index ad278a3c557665bf14fb04b51728e6f0306a5dfc..fd1d0801d98e64381d6dfe8340b9bfe59bd4aa52 100644 (file)
@@ -165,8 +165,8 @@ struct refclockbug {
 #define LDISC_CLK      0x1     /* tty_clk \n intercept */
 #define LDISC_CLKPPS   0x2     /* tty_clk \377 intercept */
 #define LDISC_ACTS     0x4     /* tty_clk #* intercept */
-#define LDISC_CHU      0x8     /* tty_chu */
-#define LDISC_PPS      0x10    /* ppsclock */
+#define LDISC_CHU      0x8     /* depredated */
+#define LDISC_PPS      0x10    /* ppsclock, ppsapi */
 #define LDISC_RAW      0x20    /* raw binary */
 
 struct refclockproc {
index 0845ffc84afede1aae8adbe265127523a7fbd9ba..b40bd5b23dd70180a3f4e1e2613de7388aee232c 100644 (file)
@@ -756,10 +756,11 @@ int
 refclock_open(
        char *dev,              /* device name pointer */
        int speed,              /* serial port speed (code) */
-       int flags               /* line discipline flags */
+       int lflags              /* line discipline flags */
        )
 {
        int fd, i;
+       int flags;
 #ifdef HAVE_TERMIOS
        struct termios ttyb, *ttyp;
 #endif /* HAVE_TERMIOS */
@@ -773,9 +774,16 @@ refclock_open(
        u_long ltemp;
 #endif /* TIOCMGET */
 
+       flags = lflags;
+       if (strcmp(dev, pps_device) == 0)
+               flags |= LDISC_PPS;
+
        /*
         * Open serial port and set default options
         */
+       flags = lflags;
+       if (strcmp(dev, pps_device) == 0)
+               flags |= LDISC_PPS;
 #ifdef O_NONBLOCK
        fd = open(dev, O_RDWR | O_NONBLOCK, 0777);
 #else
@@ -937,12 +945,6 @@ refclock_open(
                    "refclock_open: fd %d ioctl failed: %m", fd);
                return (0);
        }
-
-       /*
-        * If this is the PPS device, so say and initialize the thing.
-        */
-       if (strcmp(dev, pps_device) == 0)
-               (void)refclock_ioctl(fd, LDISC_PPS);
        return (fd);
 }
 #endif /* HAVE_TERMIOS || HAVE_SYSV_TTYS || HAVE_BSD_TTYS */
@@ -958,7 +960,7 @@ refclock_open(
  * their many other variants. The routine returns 1 if success and 0 if
  * failure.
  */
-int
+static int
 refclock_ioctl(
        int fd,                 /* file descriptor */
        int flags               /* line discipline flags */
index 28f563f8a809df418b875bb2e14fde552d3748b7..16791b6c45607c13693957eff24a1885d04a52d6 100644 (file)
@@ -246,7 +246,7 @@ mx4200_start(
         * Open serial port
         */
        (void)sprintf(gpsdev, DEVICE, unit);
-       if (!(fd = refclock_open(gpsdev, SPEED232, LDISC_PPS))) {
+       if (!(fd = refclock_open(gpsdev, SPEED232))) {
            return (0);
        }
 #ifdef HAVE_TIOCGPPSEV