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