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
47
Issues
47
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
d7c142a7
Commit
d7c142a7
authored
Feb 27, 2017
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
time-wrpc: exclude WRPC_FAULTS specific code when not used
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
bcc1fdae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
ppsi.h
include/ppsi/ppsi.h
+6
-0
wrpc-socket.c
time-wrpc/wrpc-socket.c
+8
-5
No files found.
include/ppsi/ppsi.h
View file @
d7c142a7
...
...
@@ -27,6 +27,12 @@
#undef ARRAY_SIZE
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#ifdef CONFIG_WRPC_FAULTS
# define CONFIG_HAS_WRPC_FAULTS 1
#else
# define CONFIG_HAS_WRPC_FAULTS 0
#endif
/* We can't include pp-printf.h when building freestading, so have it here */
extern
int
pp_printf
(
const
char
*
fmt
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
...
...
time-wrpc/wrpc-socket.c
View file @
d7c142a7
...
...
@@ -78,11 +78,13 @@ static int wrpc_net_recv(struct pp_instance *ppi, void *pkt, int len,
dump_payloadpkt
(
"recv: "
,
pkt
,
got
,
t
);
#endif
if
(
ppsi_drop_rx
())
{
if
(
CONFIG_HAS_WRPC_FAULTS
&&
ppsi_drop_rx
())
{
pp_diag
(
ppi
,
frames
,
1
,
"Drop received frame
\n
"
);
return
-
2
;
}
usleep
(
frame_rx_delay_us
);
if
(
CONFIG_HAS_WRPC_FAULTS
)
usleep
(
frame_rx_delay_us
);
return
got
;
}
...
...
@@ -105,13 +107,14 @@ static int wrpc_net_send(struct pp_instance *ppi, void *pkt, int len,
* to transmit it for real, if we want to get back our
* hardware stamp. Thus, remember if we drop, and use this info.
*/
drop
=
ppsi_drop_tx
();
if
(
CONFIG_HAS_WRPC_FAULTS
)
drop
=
ppsi_drop_tx
();
sock
=
ppi
->
ch
[
PP_NP_EVT
].
custom
;
addr
.
ethertype
=
htons
(
ETH_P_1588
);
memcpy
(
&
addr
.
mac
,
macaddr
[
is_pdelay
],
sizeof
(
mac_addr_t
));
if
(
drop
)
{
if
(
CONFIG_HAS_WRPC_FAULTS
&&
drop
)
{
addr
.
ethertype
=
1
;
addr
.
mac
[
0
]
=
0x22
;
/* pfilter uses mac; drop for nodes too */
}
...
...
@@ -128,7 +131,7 @@ static int wrpc_net_send(struct pp_instance *ppi, void *pkt, int len,
__func__
,
snt
,
(
long
)
t
->
secs
,
(
long
)(
t
->
scaled_nsecs
>>
16
));
}
if
(
drop
)
{
if
(
CONFIG_HAS_WRPC_FAULTS
&&
drop
)
{
pp_diag
(
ppi
,
frames
,
1
,
"Drop sent frame
\n
"
);
return
-
2
;
}
...
...
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