Commit 5b0bd076 authored by Alessandro Rubini's avatar Alessandro Rubini

kill MSG_SEND_AND_RET_VARLEN (no effect).

This kills MSG_SEND_AND_RET_VARLEN, turning everything into
MSG_SEND_AND_RET. Such macro now receives the length argument and
doesn't receive the "pdelay" argument any more, because it is zero by
design in this implementation.

This commit has no effect on the compiled files.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 55237723
......@@ -269,5 +269,5 @@ int msg_issue_wrsig(struct pp_instance *ppi, Enumeration16 wr_msg_id)
{
int len;
len = msg_pack_wrsig(ppi, wr_msg_id);
MSG_SEND_AND_RET_VARLEN(SIGNALING, GEN, 0, len);
MSG_SEND_AND_RET(SIGNALING, GEN, len);
}
......@@ -36,9 +36,9 @@ int st_com_master_handle_sync(struct pp_instance *ppi, unsigned char *buf,
int st_com_slave_handle_followup(struct pp_instance *ppi, unsigned char *buf,
int len);
#define MSG_SEND_AND_RET_VARLEN(_name, _chan, _pdelay, _size) \
#define MSG_SEND_AND_RET(_name, _chan, _size) \
if (pp_net_ops.send(ppi, ppi->buf_out, _size,\
&ppi->last_snt_time, PP_NP_ ## _chan , _pdelay) < _size) { \
&ppi->last_snt_time, PP_NP_ ## _chan , 0) < _size) { \
if (pp_verbose_frames) \
PP_PRINTF("%s(%d) Message can't be sent -> FAULTY\n", \
pp_msg_names[PPM_ ## _name], PPM_ ## _name); \
......@@ -52,7 +52,4 @@ int st_com_slave_handle_followup(struct pp_instance *ppi, unsigned char *buf,
ppi->sent_seq_id[PPM_ ## _name]++; \
return 0;
#define MSG_SEND_AND_RET(_name, _chan, _pdelay)\
MSG_SEND_AND_RET_VARLEN(_name, _chan, _pdelay, PP_## _name ##_LENGTH)
#endif /* __COMMON_FUN_H */
......@@ -447,7 +447,7 @@ int msg_issue_announce(struct pp_instance *ppi)
{
int len;
len = msg_pack_announce(ppi);
MSG_SEND_AND_RET_VARLEN(ANNOUNCE, GEN, 0, len);
MSG_SEND_AND_RET(ANNOUNCE, GEN, len);
}
/* Pack and send on event multicast ip adress a Sync message */
......@@ -460,7 +460,7 @@ int msg_issue_sync(struct pp_instance *ppi)
msg_pack_sync(ppi, &orig_tstamp);
MSG_SEND_AND_RET(SYNC, EVT, 0);
MSG_SEND_AND_RET(SYNC, EVT, PP_SYNC_LENGTH);
}
/* Pack and send on general multicast ip address a FollowUp message */
......@@ -471,7 +471,7 @@ int msg_issue_followup(struct pp_instance *ppi, TimeInternal *time)
msg_pack_follow_up(ppi, &prec_orig_tstamp);
MSG_SEND_AND_RET(FOLLOW_UP, GEN, 0);
MSG_SEND_AND_RET(FOLLOW_UP, GEN, PP_FOLLOW_UP_LENGTH);
}
/* Pack and send on event multicast ip adress a DelayReq message */
......@@ -484,7 +484,7 @@ int msg_issue_delay_req(struct pp_instance *ppi)
msg_pack_delay_req(ppi, &orig_tstamp);
MSG_SEND_AND_RET(DELAY_REQ, EVT, 0);
MSG_SEND_AND_RET(DELAY_REQ, EVT, PP_PDELAY_REQ_LENGTH);
}
/* Pack and send on event multicast ip adress a DelayResp message */
......@@ -495,5 +495,5 @@ int msg_issue_delay_resp(struct pp_instance *ppi, TimeInternal *time)
msg_pack_delay_resp(ppi, &ppi->delay_req_hdr, &rcv_tstamp);
MSG_SEND_AND_RET(DELAY_RESP, GEN, 0);
MSG_SEND_AND_RET(DELAY_RESP, GEN, PP_DELAY_RESP_LENGTH);
}
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