Commit 4f221227 authored by Davide Ciminaghi's avatar Davide Ciminaghi Committed by Alessandro Rubini

compliance, 11.4.3 b: peer-delay, fix support for 1-step

If no follow-up is to be received, we trigger pp_servo_got_presp()
on reception of peer delay response.
parent c7627fa8
......@@ -198,6 +198,7 @@ int st_com_peer_handle_pres(struct pp_instance *ppi, unsigned char *buf,
{
MsgPDelayResp resp;
MsgHeader *hdr = &ppi->received_ptp_header;
int e = 0;
if (len < PP_PDELAY_RESP_LENGTH)
return -1;
......@@ -230,11 +231,17 @@ int st_com_peer_handle_pres(struct pp_instance *ppi, unsigned char *buf,
/* Save correctionField of pdelay_resp, see 11.4.3 d 3/4 */
cField_to_TimeInternal(&ppi->cField, hdr->correctionfield);
if (!(hdr->flagField[0] & PP_TWO_STEP_FLAG)) {
if (pp_hooks.handle_presp)
e = pp_hooks.handle_presp(ppi);
else
pp_servo_got_presp(ppi);
}
} else {
pp_diag(ppi, frames, 2, "pp_pclock : "
"PDelay Resp doesn't match PDelay Req\n");
}
return 0;
return e;
}
......
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