Commit a0ee7410 authored by Adam Wujek's avatar Adam Wujek

include/ppsi: rename is_pdelay to delay_mechanism in struct pp_msgtype_info

It no longer keeps information if mechanism is pdelay, but which kind
of mechanism.
Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent 0572fe61
......@@ -59,7 +59,7 @@ struct pp_msgtype_info {
pp_std_messages msg_type;
uint16_t msglen;
unsigned char chtype;
unsigned char is_pdelay;
unsigned char delay_mechanism;
unsigned char controlField; /* Table 23 */
unsigned char logMessageInterval; /* Table 24, see defines */
......
......@@ -33,12 +33,12 @@ static int bare_net_send(struct pp_instance *ppi, void *pkt, int len,enum pp_msg
[MECH_E2E] = PP_MCAST_MACADDRESS,
[MECH_P2P] = PP_PDELAY_MACADDRESS,
};
int is_pdelay = mf->is_pdelay;
int delay_mechanism = mf->delay_mechanism;
int ret;
hdr->h_proto = htons(ETH_P_1588);
memcpy(hdr->h_dest, macaddr[is_pdelay], ETH_ALEN);
memcpy(hdr->h_dest, macaddr[delay_mechanism], ETH_ALEN);
/* raw socket implementation always uses gen socket */
memcpy(hdr->h_source, ppi->ch[PP_NP_GEN].addr, 6);
......
......@@ -185,7 +185,7 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,enum pp_msg
struct pp_vlanhdr *vhdr = pkt;
struct pp_channel *ch = ppi->ch + chtype;
struct pp_time *t = &ppi->last_snt_time;
int is_pdelay = mf->is_pdelay;
int delay_mechanism = mf->delay_mechanism;
static const uint16_t udpport[] = {
[PP_NP_GEN] = PP_GEN_PORT,
[PP_NP_EVT] = PP_EVT_PORT,
......@@ -209,7 +209,7 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,enum pp_msg
ch = ppi->ch + PP_NP_GEN;
hdr->h_proto = htons(ETH_P_1588);
memcpy(hdr->h_dest, macaddr[is_pdelay], ETH_ALEN);
memcpy(hdr->h_dest, macaddr[delay_mechanism], ETH_ALEN);
memcpy(hdr->h_source, ch->addr, ETH_ALEN);
TOPS(ppi)->get(ppi, t);
......@@ -234,7 +234,7 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,enum pp_msg
vhdr->h_tci = htons(ppi->peer_vid); /* prio is 0 */
vhdr->h_tpid = htons(0x8100);
memcpy(hdr->h_dest, macaddr[is_pdelay], ETH_ALEN);
memcpy(hdr->h_dest, macaddr[delay_mechanism], ETH_ALEN);
memcpy(vhdr->h_source, ch->addr, ETH_ALEN);
TOPS(ppi)->get(ppi, t);
......@@ -254,7 +254,7 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,enum pp_msg
case PPSI_PROTO_UDP:
addr.sin_family = AF_INET;
addr.sin_port = htons(udpport[chtype]);
addr.sin_addr.s_addr = ppi->mcast_addr[is_pdelay];
addr.sin_addr.s_addr = ppi->mcast_addr[delay_mechanism];
TOPS(ppi)->get(ppi, t);
......
......@@ -124,7 +124,7 @@ static int wrpc_net_send(struct pp_instance *ppi, void *pkt, int len, enum pp_ms
struct wr_timestamp wr_ts;
struct wr_sockaddr addr;
struct pp_time *t = &ppi->last_snt_time;
int is_pdelay = mf->is_pdelay;
int delay_mechanism = mf->delay_mechanism;
static const uint8_t macaddr[MECH_MAX_SUPPORTED + 1][ETH_ALEN] = {
[MECH_E2E] = PP_MCAST_MACADDRESS,
[MECH_P2P] = PP_PDELAY_MACADDRESS,
......@@ -141,7 +141,7 @@ static int wrpc_net_send(struct pp_instance *ppi, void *pkt, int len, enum pp_ms
sock = ppi->ch[PP_NP_EVT].custom;
addr.ethertype = htons(ETH_P_1588);
memcpy(&addr.mac, macaddr[is_pdelay], sizeof(mac_addr_t));
memcpy(&addr.mac, macaddr[delay_mechanism], sizeof(mac_addr_t));
if (CONFIG_HAS_WRPC_FAULTS && drop) {
addr.ethertype = 1;
addr.mac[0] = 0x22; /* pfilter uses mac; drop for nodes too */
......
......@@ -492,7 +492,7 @@ static int wrs_net_send(struct pp_instance *ppi, void *pkt, int len,enum pp_msg_
struct pp_vlanhdr *vhdr = pkt;
struct pp_channel *ch = ppi->ch + chtype;
struct pp_time *t = &ppi->last_snt_time;
int is_pdelay = mf->is_pdelay;
int delay_mechanism = mf->delay_mechanism;
static uint16_t udpport[] = {
[PP_NP_GEN] = PP_GEN_PORT,
[PP_NP_EVT] = PP_EVT_PORT,
......@@ -524,7 +524,7 @@ static int wrs_net_send(struct pp_instance *ppi, void *pkt, int len,enum pp_msg_
if (drop)
hdr->h_proto++;
memcpy(hdr->h_dest, macaddr[is_pdelay], ETH_ALEN);
memcpy(hdr->h_dest, macaddr[delay_mechanism], ETH_ALEN);
memcpy(hdr->h_source, ch->addr, ETH_ALEN);
if (t)
......@@ -555,7 +555,7 @@ static int wrs_net_send(struct pp_instance *ppi, void *pkt, int len,enum pp_msg_
if (drop)
hdr->h_proto++;
memcpy(hdr->h_dest, macaddr[is_pdelay], ETH_ALEN);
memcpy(hdr->h_dest, macaddr[delay_mechanism], ETH_ALEN);
memcpy(vhdr->h_source, ch->addr, ETH_ALEN);
if (t)
......@@ -583,7 +583,7 @@ static int wrs_net_send(struct pp_instance *ppi, void *pkt, int len,enum pp_msg_
fd = ppi->ch[chtype].fd;
addr.sin_family = AF_INET;
addr.sin_port = htons(udpport[chtype]);
addr.sin_addr.s_addr = ppi->mcast_addr[is_pdelay];
addr.sin_addr.s_addr = ppi->mcast_addr[delay_mechanism];
if (drop)
addr.sin_port = 3200;
ret = sendto(fd, pkt, len, 0, (struct sockaddr *)&addr,
......
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