Commit b6c53e91 authored by Adam Wujek's avatar Adam Wujek 💬

Merge branch "adam-makefile"

Another try to fix makefile
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parents ac9a913c b9408acd
......@@ -221,7 +221,7 @@ static struct pp_argname arg_mech[] = {
{"request-response", PP_E2E_MECH},
{"delay", PP_E2E_MECH},
{"e2e", PP_E2E_MECH},
#ifdef CONFIG_P2P
#ifdef CONFIG_HAS_P2P
{"peer-delay", PP_P2P_MECH},
{"pdelay", PP_P2P_MECH},
{"p2p", PP_P2P_MECH},
......@@ -411,16 +411,15 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
case ARG_INT:
if (sscanf(line, "%i", &(cfg_arg.i)) != 1) {
pp_diag(NULL, config, 1, "line %i: \"%s\": not int\n",
lineno, word);
pp_error("line %i: \"%s\": not int\n", lineno, word);
return -1;
}
break;
case ARG_INT2:
if (sscanf(line, "%i,%i", cfg_arg.i2, &cfg_arg.i2[1]) < 0) {
pp_diag(NULL, config, 1, "line %i: wrong arg \"%s\""
" for \"%s\"\n", lineno, line, word);
pp_error("line %i: wrong arg \"%s\" for \"%s\"\n",
lineno, line, word);
return -1;
}
break;
......@@ -437,8 +436,8 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
if (!strcmp(line, n->name))
break;
if (!n->name) {
pp_diag(NULL, config, 1, "line %i: wrong arg \"%s\""
" for \"%s\"\n", lineno, line, word);
pp_error("line %i: wrong arg \"%s\" for \"%s\"\n",
lineno, line, word);
return -1;
}
cfg_arg.i = n->value;
......@@ -446,8 +445,8 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
case ARG_TIME:
if(parse_time(&cfg_arg.ts, line)) {
pp_diag(NULL, config, 1, "line %i: wrong arg \"%s\" for "
"\"%s\"\n", lineno, line, word);
pp_error("line %i: wrong arg \"%s\" for \"%s\"\n",
lineno, line, word);
return -1;
}
break;
......
......@@ -120,8 +120,8 @@ static int unix_recv_msg(struct pp_instance *ppi, int fd, void *pkt, int len,
}
/* This is not really hw... */
pp_diag(ppi, time, 2, "recv stamp: %i.%09i (%s)\n",
(int)t->secs, (int)(t->scaled_nsecs >> 16),
pp_diag(ppi, time, 1, "recv stamp: %lli.%09i (%s)\n",
(long long)t->secs, (int)(t->scaled_nsecs >> 16),
tv ? "kernel" : "user");
return ret;
}
......@@ -198,7 +198,6 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
/* To fake a network frame loss, set the timestamp and do not send */
if (ppsi_drop_tx()) {
if (t)
ppi->t_ops->get(ppi, t);
pp_diag(ppi, frames, 1, "Drop sent frame\n");
return len;
......@@ -213,7 +212,6 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
memcpy(hdr->h_dest, macaddr[is_pdelay], ETH_ALEN);
memcpy(hdr->h_source, ch->addr, ETH_ALEN);
if (t)
ppi->t_ops->get(ppi, t);
ret = send(ch->fd, hdr, len, 0);
......@@ -222,6 +220,9 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
strerror(errno));
return ret;
}
pp_diag(ppi, time, 1, "send stamp: %lli.%09i (%s)\n",
(long long)t->secs, (int)(t->scaled_nsecs >> 16),
"user");
if (pp_diag_allow(ppi, frames, 2))
dump_1588pkt("send: ", pkt, len, t, -1);
return ret;
......@@ -236,7 +237,6 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
memcpy(hdr->h_dest, macaddr[is_pdelay], ETH_ALEN);
memcpy(vhdr->h_source, ch->addr, ETH_ALEN);
if (t)
ppi->t_ops->get(ppi, t);
ret = send(ch->fd, vhdr, len, 0);
......@@ -245,6 +245,9 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
strerror(errno));
return ret;
}
pp_diag(ppi, time, 1, "send stamp: %lli.%09i (%s)\n",
(long long)t->secs, (int)(t->scaled_nsecs >> 16),
"user");
if (pp_diag_allow(ppi, frames, 2))
dump_1588pkt("send: ", vhdr, len, t, ppi->peer_vid);
......@@ -253,7 +256,6 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
addr.sin_port = htons(udpport[chtype]);
addr.sin_addr.s_addr = ppi->mcast_addr[is_pdelay];
if (t)
ppi->t_ops->get(ppi, t);
ret = sendto(ppi->ch[chtype].fd, pkt, len, 0,
......@@ -264,6 +266,11 @@ static int unix_net_send(struct pp_instance *ppi, void *pkt, int len,
strerror(errno));
return ret;
}
pp_diag(ppi, time, 1, "send stamp: %lli.%09i (%s)\n",
(long long)t->secs, (int)(t->scaled_nsecs >> 16),
"user");
if (pp_diag_allow(ppi, frames, 2))
dump_payloadpkt("send: ", pkt, len, t);
return ret;
default:
......
......@@ -246,6 +246,8 @@ static int wrs_recv_msg(struct pp_instance *ppi, int fd, void *pkt, int len,
} else {
mark_incorrect(t);
}
} else {
mark_incorrect(t);
}
drop:
......
......@@ -183,7 +183,7 @@ static int wrdate_get(struct pp_time *t)
} while((tmp1 != taih) || (tmp2 != tail));
t->secs = tail | ((uint64_t)taih << 32);
t->scaled_nsecs = nsec << 16;
t->scaled_nsecs = (int64_t)nsec << 16;
return 0;
}
......
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