Link it all together, but in slave-only mode.
Since the master implementation is still lacking, we will just keep the slave-only flag hard coded for now. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
dae76b951a
commit
ebd353aff6
5
clock.c
5
clock.c
|
@ -334,6 +334,11 @@ void clock_path_delay(struct clock *c, struct timespec req, struct timestamp rx,
|
||||||
pr_debug("path delay %10lld", c->path_delay);
|
pr_debug("path delay %10lld", c->path_delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int clock_slave_only(struct clock *c)
|
||||||
|
{
|
||||||
|
return c->dds.slaveOnly;
|
||||||
|
}
|
||||||
|
|
||||||
void clock_synchronize(struct clock *c,
|
void clock_synchronize(struct clock *c,
|
||||||
struct timespec ingress_ts, struct timestamp origin_ts,
|
struct timespec ingress_ts, struct timestamp origin_ts,
|
||||||
Integer64 correction1, Integer64 correction2)
|
Integer64 correction1, Integer64 correction2)
|
||||||
|
|
7
clock.h
7
clock.h
|
@ -126,6 +126,13 @@ void clock_path_delay(struct clock *c, struct timespec req, struct timestamp rx,
|
||||||
*/
|
*/
|
||||||
int clock_poll(struct clock *c);
|
int clock_poll(struct clock *c);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain the slave-only flag from a clock's default data set.
|
||||||
|
* @param c The clock instance.
|
||||||
|
* @return The value of the clock's slave-only flag.
|
||||||
|
*/
|
||||||
|
int clock_slave_only(struct clock *c);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide a data point to synchronize the clock.
|
* Provide a data point to synchronize the clock.
|
||||||
* @param c The clock instance to synchronize.
|
* @param c The clock instance to synchronize.
|
||||||
|
|
|
@ -135,6 +135,7 @@ int main(int argc, char *argv[])
|
||||||
phc = NULL;
|
phc = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ds.slaveOnly = TRUE; // TODO - make this programmable.
|
||||||
ds.priority1 = 128;
|
ds.priority1 = 128;
|
||||||
ds.clockQuality.clockClass = 248;
|
ds.clockQuality.clockClass = 248;
|
||||||
ds.clockQuality.clockAccuracy = 0xfe;
|
ds.clockQuality.clockAccuracy = 0xfe;
|
||||||
|
|
2
makefile
2
makefile
|
@ -32,7 +32,7 @@ DEPEND = $(OBJ:.o=.d)
|
||||||
srcdir := $(dir $(lastword $(MAKEFILE_LIST)))
|
srcdir := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||||
VPATH = $(srcdir)
|
VPATH = $(srcdir)
|
||||||
|
|
||||||
all: $(OBJ)
|
all: linuxptp
|
||||||
|
|
||||||
linuxptp: $(OBJ)
|
linuxptp: $(OBJ)
|
||||||
|
|
||||||
|
|
3
port.c
3
port.c
|
@ -584,7 +584,8 @@ struct foreign_clock *port_compute_best(struct port *p)
|
||||||
|
|
||||||
void port_dispatch(struct port *p, enum fsm_event event)
|
void port_dispatch(struct port *p, enum fsm_event event)
|
||||||
{
|
{
|
||||||
enum port_state next = ptp_fsm(p->state, event);
|
enum port_state next = clock_slave_only(p->clock) ?
|
||||||
|
ptp_slave_fsm(p->state, event) : ptp_fsm(p->state, event);
|
||||||
|
|
||||||
if (PS_INITIALIZING == next) {
|
if (PS_INITIALIZING == next) {
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue