From 9a4c1cdd86d7786f8068ade7eb4b8e54feb43d95 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 11 Jan 2010 17:18:13 +0000 Subject: [PATCH] update ntpd to 4.2.6 (#6457) SVN-Revision: 19108 --- net/ntpd/Makefile | 4 +- net/ntpd/patches/100-ntpd_nmea.patch | 104 --------------------------- 2 files changed, 2 insertions(+), 106 deletions(-) delete mode 100644 net/ntpd/patches/100-ntpd_nmea.patch diff --git a/net/ntpd/Makefile b/net/ntpd/Makefile index c0963a795..2ce27568e 100644 --- a/net/ntpd/Makefile +++ b/net/ntpd/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ntp -PKG_VERSION:=4.2.4p8 +PKG_VERSION:=4.2.6 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ -PKG_MD5SUM:=fe137056e7e611798a46971a783567ce +PKG_MD5SUM:=4d64a99592b818aa9419fc9dcb149746 PKG_BUILD_DEPENDS:=libelf diff --git a/net/ntpd/patches/100-ntpd_nmea.patch b/net/ntpd/patches/100-ntpd_nmea.patch deleted file mode 100644 index d2b7a5be6..000000000 --- a/net/ntpd/patches/100-ntpd_nmea.patch +++ /dev/null @@ -1,104 +0,0 @@ ---- a/ntpd/refclock_nmea.c -+++ b/ntpd/refclock_nmea.c -@@ -11,6 +11,7 @@ - - #include - #include -+#include - - #include "ntpd.h" - #include "ntp_io.h" -@@ -72,6 +73,7 @@ extern int async_write(int, const void * - #define RANGEGATE 500000 /* range gate (ns) */ - - #define LENNMEA 75 /* min timecode length */ -+#define LENPPS LINUXPPS_MAX_NAME_LEN - - /* - * Tables to compute the ddd of year form icky dd/mm timecode. Viva la -@@ -92,6 +94,7 @@ struct nmeaunit { - pps_params_t pps_params; /* pps parameters */ - pps_info_t pps_info; /* last pps data */ - pps_handle_t handle; /* pps handlebars */ -+ int handle_created; /* pps handle created flag */ - #endif /* HAVE_PPSAPI */ - }; - -@@ -140,7 +143,12 @@ nmea_start( - register struct nmeaunit *up; - struct refclockproc *pp; - int fd; -+#ifdef PPS_HAVE_FINDPATH -+ char id[LENPPS] = "", -+ path[LENPPS]; -+#endif /* PPS_HAVE_FINDPATH */ - char device[20]; -+ uint bits, mask=~0, outb=0; - - /* - * Open serial port. Use CLK line discipline, if available. -@@ -225,18 +233,42 @@ nmea_start( - memcpy((char *)&pp->refid, REFID, 4); - up->pollcnt = 2; - gps_send(pp->io.fd,"$PMOTG,RMC,0000*1D\r\n", peer); -+ gps_send(pp->io.fd,"$PGRMO,,2\r\n", peer); -+ gps_send(pp->io.fd,"$PGRMO,GPRMC,1\r\n", peer); -+ gps_send(pp->io.fd,"$PGRMO,,,,,,,,,,,,2\r\n", peer); -+ -+ mask &= ~TIOCM_RTS; -+ mask &= ~TIOCM_DTR; -+ outb |= TIOCM_RTS; -+ ioctl(fd, TIOCMGET, &bits); -+ bits &= mask; -+ bits |= outb; -+ ioctl(fd, TIOCMSET, &bits); - - #ifdef HAVE_PPSAPI - /* - * Start the PPSAPI interface if it is there. Default to use - * the assert edge and do not enable the kernel hardpps. - */ -+#ifdef PPS_HAVE_FINDPATH -+ /* Get the PPS source's real name */ -+ time_pps_readlink(device, LENPPS, path, LENPPS); -+ -+ /* Try to find the source */ -+ fd = time_pps_findpath(path, LENPPS, id, LENPPS); -+ if (fd < 0) { -+ msyslog(LOG_ERR, "refclock_nmea: cannot find PPS path \"%s\" in the system", path); -+ return (0); -+ } -+ msyslog(LOG_INFO, "refclock_nmea: found PPS source \"%s\" at id #%d on \"%s\"", path, fd, id); -+#endif /* PPS_HAVE_FINDPATH */ - if (time_pps_create(fd, &up->handle) < 0) { -- up->handle = 0; -+ up->handle_created = 0; - msyslog(LOG_ERR, - "refclock_nmea: time_pps_create failed: %m"); - return (1); - } -+ up->handle_created = ~0; - return(nmea_ppsapi(peer, 0, 0)); - #else - return (1); -@@ -258,8 +290,10 @@ nmea_shutdown( - pp = peer->procptr; - up = (struct nmeaunit *)pp->unitptr; - #ifdef HAVE_PPSAPI -- if (up->handle != 0) -+ if (up->handle_created) { - time_pps_destroy(up->handle); -+ up->handle_created = 0; -+ } - #endif /* HAVE_PPSAPI */ - io_closeclock(&pp->io); - free(up); -@@ -367,7 +401,7 @@ nmea_pps( - /* - * Convert the timespec nanoseconds field to ntp l_fp units. - */ -- if (up->handle == 0) -+ if (!up->handle_created) - return (0); - timeout.tv_sec = 0; - timeout.tv_nsec = 0; -- 2.30.2