Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (2)
Eliminate last use of refclktype.
· 3221d205
Eric S. Raymond
authored
Jun 28, 2016
3221d205
Fix refclock table formatting.
· a24d9930
Eric S. Raymond
authored
Jun 28, 2016
a24d9930
Hide whitespace changes
Inline
Side-by-side
docs/refclock.txt
View file @
a24d9930
...
...
@@ -170,7 +170,7 @@ removed because it duplicates support for the 6021 in the generic
parse driver.
[options="header"]
[cols="1
0%,5
%,5%,80%",options="header"]
[cols="1
6
%,5%,80%",options="header"]
|====================================================================
| Name | Flags | Driver
|link:driver_local.html[local] | D | Undisciplined Local Clock
...
...
include/ntp.h
View file @
a24d9930
...
...
@@ -272,7 +272,7 @@ struct peer {
*/
#ifdef REFCLOCK
struct
refclockproc
*
procptr
;
/* refclock structure pointer */
uint8_t
refclktype
;
/* reference clock type
*/
bool
is_pps_driver
;
/* is this the PPS driver?
*/
uint8_t
refclkunit
;
/* reference clock unit number */
uint8_t
sstclktype
;
/* clock type for system status word */
#endif
/* REFCLOCK */
...
...
@@ -434,13 +434,6 @@ struct peer {
#define LEN_CRYPTO_TO_ZERO (END_CRYPTO_TO_ZERO((struct peer *)0) \
- CRYPTO_TO_ZERO((struct peer *)0))
/*
* Thw last remnant of knowledge of driver type numbers outside of
* refclock_conf.c. Ratained only to avoid a string compare on
* the name.
*/
#define REFCLK_ATOM_PPS 22
/* 1PPS Clock Discipline */
/*
* NTP packet format. The mac field is optional. It isn't really
* an l_fp either, but for now declaring it that way is convenient.
...
...
ntpd/ntp_proto.c
View file @
a24d9930
...
...
@@ -2577,8 +2577,8 @@ clock_select(void)
* are required.
*/
if
(
typepps
!=
NULL
&&
fabs
(
sys_offset
)
<
0
.
4
&&
(
typepps
->
refclktype
!=
REFCLK_ATOM_PPS
||
(
typepps
->
refclktype
==
REFCLK_ATOM_PPS
&&
(
sys_prefer
!=
(
!
typepps
->
is_pps_driver
||
(
typepps
->
is_pps_driver
&&
(
sys_prefer
!=
NULL
||
(
typesystem
==
NULL
&&
sys_minsane
==
0
)))))
{
typesystem
=
typepps
;
sys_clockhop
=
0
;
...
...
ntpd/ntp_refclock.c
View file @
a24d9930
...
...
@@ -197,7 +197,6 @@ refclock_newpeer(
/*
* Initialize structures
*/
peer
->
refclktype
=
clktype
;
peer
->
refclkunit
=
(
uint8_t
)
unit
;
peer
->
flags
|=
FLAG_REFCLOCK
;
peer
->
leap
=
LEAP_NOTINSYNC
;
...
...
@@ -556,8 +555,8 @@ refclock_receive(
clock_filter
(
peer
,
pp
->
offset
,
0
.,
pp
->
jitter
);
if
(
cal_enable
&&
fabs
(
last_offset
)
<
sys_mindisp
&&
sys_peer
!=
NULL
)
{
if
(
sys_peer
->
refclktype
==
REFCLK_ATOM_PPS
&&
peer
->
refclktype
!=
REFCLK_ATOM_PPS
)
if
(
sys_peer
->
is_pps_driver
&&
!
peer
->
is_pps_driver
)
pp
->
fudgetime1
-=
pp
->
offset
*
FUDGEFAC
;
}
}
...
...
ntpd/refclock_conf.c
View file @
a24d9930
...
...
@@ -152,14 +152,8 @@ extern struct refclock refclock_gpsdjson;
/*
* The symbols in the comments are no longer defined, except for REFCLK_ATOM_PPS.
* If you compact or reorder this table, two bad things will happen:
*
* 1. Legacy ntpq instances that think they can deduce driver types from
* address fields will get them wrong.
*
* 2. If the PPS driver entry moves and you don't fix the definition of
* REFCLK_ATOM_PPS to be a corrected index into this table,
* some cases of PPS-assisted time sync will break.
* If you compact or reorder this table, legacy ntpq instances that think they
* can deduce driver types from address fields will get them wrong.
*/
struct
refclock
*
const
refclock_conf
[]
=
{
&
refclock_none
,
/* 0 REFCLK_NONE */
...
...
ntpd/refclock_pps.c
View file @
a24d9930
...
...
@@ -130,6 +130,7 @@ pps_start(
* Allocate and initialize unit structure
*/
pp
=
peer
->
procptr
;
peer
->
is_pps_driver
=
true
;
peer
->
precision
=
PRECISION
;
pp
->
clockname
=
NAME
;
pp
->
clockdesc
=
DESCRIPTION
;
...
...