summaryrefslogtreecommitdiff
path: root/ppsthread.h
Commit message (Collapse)AuthorAgeFilesLines
* SPDXify the licerse references.Eric S. Raymond2018-03-081-1/+1
|
* Adds Linux "fake PPS" detection and avoidance.Fred Wright2016-12-231-0/+2
| | | | | | | | | | | | | | | | | | | | | If the Linux kernel is built with CONFIG_PPS_CLIENT_KTIMER=y, then a synthetic PPS source is added to allow testing without a real PPS source. However, this source doesn't even run at exactly 1Hz, so any attempt to use it for real time synchronization is disastrous. To make matters worse, this is usually the first PPS driver configured, causing it to appear as /dev/pps0, which is the implied PPS device used by the "Magic HAT" kludge. This change adds detection for the fake source (based on its name), both to provide a warning if it is configured explicitly, and to skip over it when applying the "Magic HAT" kludge. TESTED: Tested both gpsmon and gpsd on a Beaglebone Black with added symlinks for testing "Magic HAT". Did this with kernels with and without the KTIMER enabled. Verified that the proper PPS device is selected by "Magic HAT", and that a warning is generated when expected.
* Rename PPS_M IN_FIXES to NTP_MIN_FIXESGary E. Miller2016-04-131-2/+0
| | | | | | | | | This applies to not just PPS, but all NTP reportable time. Even with a valid fix, the frist 3 times may be off. Don't send bad time to ntp/chrony. Move the definition into gpsd.h to be widely available not depending on scons options.
* Bad NMEA time was still leaking, require 3 fixes for time.Gary E. Miller2016-04-051-0/+2
|
* Remove duplicate definition of timespec_diff_ns()Gary E. Miller2015-06-041-5/+0
| | | | | Plus a logical reordering of things so more timespec stuff is in timespec.h
* Fix overflow issue on 32 bit binaries.Gary E. Miller2015-06-031-3/+3
| | | | | | | | | Timespec is a 62 bit number, it does not fit in the 32 bits of a long. Use 'long long' instead. 'long long' is always at least 64 bits long and is the same as a native int when compiled as 64 bit. Note that many 64 bit OS still run 32 bit binaries, and many small devices like RasPi's are 32 bit.
* Increase consistency of names. No code changes.Eric S. Raymond2015-04-011-1/+1
|
* Further thread-monitor interface simplification.Eric S. Raymond2015-04-011-4/+1
| | | | | | Remove the wrap hook. The only thing it was doing was closing the chrony fd. which can be done just as cleanly by whatever calls the pps_thread_deactivate() function.
* Clean up PPS monitor interface with renames, and additional documentation.Eric S. Raymond2015-04-011-5/+19
|
* Thread monitor interface simplification.Eric S. Raymond2015-04-011-2/+0
| | | | | | With a bit of refactoring we can eliminate one of the hooks. PPS observed live, telnetting to localhost:2947 with gpsd running.
* Information hiding. Move kernelpps_handle out of thread-context structure...Eric S. Raymond2015-03-311-17/+0
| | | | | | ...stash it in an inner context. PPS observed live on GR601-W.
* The comments says include inistd.h, but it was not included.Gary E. Miller2015-03-311-0/+1
| | | | Source now compiles.
* ppsthread.[ch] and timespec_str.c are now fully detached from the rest of GPSD.Eric S. Raymond2015-03-311-10/+10
| | | | | | This means they could be dropped into NTP or another time-service program. The only requirement is to set -DHAVE_SYS_TIMEPPS_H if you want the RFC2783 code compiled in.
* Die, splint, die...Gary E. Miller2015-03-301-2/+0
|
* Retire splint from our set of static analyzers.Eric S. Raymond2015-03-301-7/+7
| | | | | | | | | | | | | | | | | | | The proximate cause was that we've been seing emission of error messages that were randomly and disturbingly variable across different environments - notably Raspbian and Gentoo splint gave nontrivially different results than Ubuntu 14.10 splint. And this was *not* due to Ubuntu patches! A pristine splint built from the 3.1.2 tarball on Ubuntu didn't match the Raspbian and Gentoo results either. But this has been coming for a while. Easy access to more modern static analyzers such as coverity, scan-build and cppcheck has been decreasing the utility of splint, which is unmaintained and somewhat buggy and not easy to use. Only file not cleaned is ppsthread.c, because Gary has been working on it during this cleanup. All regression tests pass. PPS observed live on GR601-W.
* Doc & interface cleanup of ppsthread code. PPS observed live.Eric S. Raymond2015-03-201-8/+10
|
* Simplify the thread-monitor interface.Eric S. Raymond2015-03-111-6/+5
| | | | PPS observed live on GR601W.
* chronfd doesn't belong in the thread context, move it back out to session.Eric S. Raymond2015-03-081-1/+0
|
* Hide a macro that doesn't need to be exposed.Eric S. Raymond2015-03-081-0/+14
|
* Eliminate timestamp-T use from PPS thread code.Eric S. Raymond2015-03-081-3/+3
| | | | PPS observed live on GR-601W. All regression yests pass.
* Decouple (mostly) the PPS thread-monitor from the session structure.Eric S. Raymond2015-03-081-6/+18
| | | | | | | | | | | | This is the big step towards ntplib. A couple of minor issues remain to be ironed out, the most significant of which is what to do about the timestamp_t type. This changes some field offsets of private fields in struct gps_device_t. Probably does not require a version bump as access to them is all through the libgpsd API. All regression tests pass. PPS observed live in gpsmon direct mode.
* ppsthread.c gets its own header. Another step towards ntplib.Eric S. Raymond2015-03-071-0/+45
| | | | All regression tests pass.
* Revert "Another step in prying ntplib loose. Partly decouple ppsthread.c ↵Eric S. Raymond2015-03-071-47/+0
| | | | | | fom sessions." Previous approch was a bit too frontal.
* Revert "ntplib extraction requires libgpsd object format bump to 23."Eric S. Raymond2015-03-071-8/+12
| | | | We need to sneak up on this in a more subtle way.
* ntplib extraction requires libgpsd object format bump to 23.Eric S. Raymond2015-03-071-12/+8
| | | | | | The new struct ppsthread_t isolates the interface to the PPS monitor loop. It will need more members before we're done, including some reporting hooks.
* Another step in prying ntplib loose. Partly decouple ppsthread.c fom sessions.Eric S. Raymond2015-03-071-0/+47
All regression tests pass.