Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
7559ded4
Commit
7559ded4
authored
Mar 21, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arch-wrpc: dump frames using the new diagnostic tools
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
17cb1360
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
25 deletions
+8
-25
wrc_ptp_ppsi.c
arch-wrpc/wrc_ptp_ppsi.c
+0
-12
wrpc-socket.c
arch-wrpc/wrpc-socket.c
+8
-13
No files found.
arch-wrpc/wrc_ptp_ppsi.c
View file @
7559ded4
...
...
@@ -210,18 +210,6 @@ int wrc_ptp_update()
delay_ms
=
pp_state_machine
(
ppi
,
NULL
,
0
);
return
0
;
}
if
(
pp_diag_verbosity
>
1
)
{
int
j
;
pp_printf
(
"recvd: %i
\n
"
,
i
);
for
(
j
=
0
;
j
<
i
;
j
++
)
{
pp_printf
(
"%02x "
,
packet
[
j
]);
if
(
(
j
+
1
)
%
16
==
0
)
pp_printf
(
"
\n
"
);
}
pp_printf
(
"
\n
"
);
}
/* Warning: PP_ETHERTYPE is endian-agnostic by design */
delay_ms
=
pp_state_machine
(
ppi
,
packet
,
i
);
}
return
0
;
...
...
arch-wrpc/wrpc-socket.c
View file @
7559ded4
...
...
@@ -45,8 +45,6 @@ static int wrpc_net_recv(struct pp_instance *ppi, void *pkt, int len,
sock
=
NP
(
ppi
)
->
ch
[
PP_NP_EVT
].
custom
;
got
=
ptpd_netif_recvfrom
(
sock
,
&
addr
,
pkt
,
len
,
&
wr_ts
);
/* FIXME check mac of received packet? */
if
(
t
)
{
t
->
seconds
=
wr_ts
.
sec
;
t
->
nanoseconds
=
wr_ts
.
nsec
;
...
...
@@ -58,6 +56,11 @@ static int wrpc_net_recv(struct pp_instance *ppi, void *pkt, int len,
#endif
t
->
raw_ahead
=
wr_ts
.
raw_ahead
;
}
/* The header is separate, so dump payload only */
if
(
got
>
0
&&
pp_diag_allow
(
ppi
,
frames
,
2
))
dump_payloadpkt
(
"recv: "
,
pkt
,
got
,
t
);
return
got
;
}
...
...
@@ -70,17 +73,6 @@ static int wrpc_net_send(struct pp_instance *ppi, void *pkt, int len,
wr_sockaddr_t
addr
;
sock
=
NP
(
ppi
)
->
ch
[
PP_NP_EVT
].
custom
;
if
(
pp_diag_verbosity
>
1
)
{
int
j
;
pp_printf
(
"sent: %i
\n
"
,
len
);
for
(
j
=
0
;
j
<
len
;
j
++
)
{
pp_printf
(
"%02x "
,
((
char
*
)
pkt
)[
j
]);
if
(
(
j
+
1
)
%
16
==
0
)
pp_printf
(
"
\n
"
);
}
pp_printf
(
"
\n
"
);
}
addr
.
ethertype
=
ETH_P_1588
;
memcpy
(
&
addr
.
mac
,
PP_MCAST_MACADDRESS
,
sizeof
(
mac_addr_t
));
...
...
@@ -95,6 +87,9 @@ static int wrpc_net_send(struct pp_instance *ppi, void *pkt, int len,
PP_VPRINTF
(
"%s: snt=%d, sec=%d, nsec=%d
\n
"
,
__func__
,
snt
,
t
->
seconds
,
t
->
nanoseconds
);
}
/* The header is separate, so dump payload only */
if
(
snt
>
0
&&
pp_diag_allow
(
ppi
,
frames
,
2
))
dump_payloadpkt
(
"send: "
,
pkt
,
len
,
t
);
return
snt
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment