Commit c86b48d6 authored by Cesar Prados's avatar Cesar Prados Committed by Alessandro Rubini

pdelay/pclock: pclock calculates path delay and offset to master

when the slave pclock receives sync and follow up
calculates offset to master, and after pdelay follow up,
the path delay.
Signed-off-by: Cesar Prados's avatarC.Prados <c.prados@gsi.de>
parent 2bdcc35c
......@@ -185,7 +185,10 @@ int st_com_slave_handle_sync(struct pp_instance *ppi, unsigned char *buf,
ppi->flags &= ~PPI_FLAG_WAITING_FOR_F_UP;
to_TimeInternal(&ppi->t1,
&sync.originTimestamp);
pp_servo_got_sync(ppi);
if (GLBS(ppi)->delay_mech)
pp_servo_got_psync(ppi);
else
pp_servo_got_sync(ppi);
return 0;
}
......@@ -231,7 +234,11 @@ int st_com_slave_handle_followup(struct pp_instance *ppi, unsigned char *buf,
if (ret < 0)
return ret;
pp_servo_got_sync(ppi);
if (GLBS(ppi)->delay_mech)
pp_servo_got_psync(ppi);
else
pp_servo_got_sync(ppi);
return 0;
}
......
......@@ -76,9 +76,9 @@ int pp_pclock(struct pp_instance *ppi, unsigned char *pkt, int plen)
resp.requestingPortIdentity.portNumber) &&
(ppi->flags & PPI_FLAG_FROM_CURRENT_PARENT)) {
to_TimeInternal(&ppi->t2,
to_TimeInternal(&ppi->t4,
&resp.requestReceiptTimestamp);
ppi->t4 = ppi->last_rcv_time;
ppi->t6 = ppi->last_rcv_time;
} else {
pp_diag(ppi, frames, 2, "pp_pclock : "
......@@ -102,10 +102,10 @@ int pp_pclock(struct pp_instance *ppi, unsigned char *pkt, int plen)
respFllw.requestingPortIdentity.portNumber) &&
(ppi->flags & PPI_FLAG_FROM_CURRENT_PARENT)) {
to_TimeInternal(&ppi->t3,
to_TimeInternal(&ppi->t5,
&respFllw.responseOriginTimestamp);
//pp_servo_got_resp(ppi);
pp_servo_got_presp(ppi);
} else {
pp_diag(ppi, frames, 2, "pp_pclock : "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment