Commit 3568b8b8 authored by Alessandro Rubini's avatar Alessandro Rubini

trivial: remove needless "delay_req_hdr" field

This field is not needed, because we issue the response immediately,
using the last received header. The copy is not needed, nor the field.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent e0c2c1e7
......@@ -182,7 +182,6 @@ struct pp_instance {
UInteger16 sent_seq[__PP_NR_MESSAGES_TYPES]; /* last sent this type */
MsgHeader received_ptp_header;
MsgHeader delay_req_hdr;
char *iface_name; /* for direct actions on hardware */
char *port_name; /* for diagnostics, mainly */
int port_idx;
......
......@@ -80,9 +80,8 @@ static int wr_master_msg(struct pp_instance *ppi, unsigned char *pkt, int plen,
/* This case is modified from the default one */
case PPM_DELAY_REQ:
msg_copy_header(&ppi->delay_req_hdr, hdr);
ppi->delay_req_hdr.correctionfield.msb = 0;
ppi->delay_req_hdr.correctionfield.lsb =
hdr->correctionfield.msb = 0;
hdr->correctionfield.lsb =
phase_to_cf_units(ppi->last_rcv_time.phase);
msg_issue_delay_resp(ppi, time);
msgtype = PPM_NOTHING_TO_DO;
......
......@@ -398,7 +398,7 @@ int msg_issue_delay_resp(struct pp_instance *ppi, TimeInternal *time)
Timestamp rcv_tstamp;
from_TimeInternal(time, &rcv_tstamp);
msg_pack_delay_resp(ppi, &ppi->delay_req_hdr, &rcv_tstamp);
msg_pack_delay_resp(ppi, &ppi->received_ptp_header, &rcv_tstamp);
return __send_and_log(ppi, PP_DELAY_RESP_LENGTH, PPM_DELAY_RESP,
PP_NP_GEN);
......
......@@ -71,8 +71,6 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
break;
case PPM_DELAY_REQ:
msg_copy_header(&ppi->delay_req_hdr,
&ppi->received_ptp_header);
msg_issue_delay_resp(ppi, &ppi->last_rcv_time);
break;
......
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