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
dfeb1890
Commit
dfeb1890
authored
Jun 12, 2017
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proto-standard: trivial: merge common code
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
1c2b0811
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
common-fun.c
proto-standard/common-fun.c
+15
-12
No files found.
proto-standard/common-fun.c
View file @
dfeb1890
...
...
@@ -135,6 +135,18 @@ int st_com_slave_handle_sync(struct pp_instance *ppi, unsigned char *buf,
return
0
;
}
static
int
presp_call_servo
(
struct
pp_instance
*
ppi
)
{
int
ret
=
0
;
pp_timeout_set
(
ppi
,
PP_TO_FAULT
);
if
(
pp_hooks
.
handle_presp
)
ret
=
pp_hooks
.
handle_presp
(
ppi
);
else
pp_servo_got_presp
(
ppi
);
return
ret
;
}
int
st_com_peer_handle_pres
(
struct
pp_instance
*
ppi
,
unsigned
char
*
buf
,
int
len
)
{
...
...
@@ -168,13 +180,8 @@ int st_com_peer_handle_pres(struct pp_instance *ppi, unsigned char *buf,
memset
(
&
ppi
->
t5
,
0
,
sizeof
(
ppi
->
t5
));
}
if
(
!
(
hdr
->
flagField
[
0
]
&
PP_TWO_STEP_FLAG
))
{
pp_timeout_set
(
ppi
,
PP_TO_FAULT
);
if
(
pp_hooks
.
handle_presp
)
e
=
pp_hooks
.
handle_presp
(
ppi
);
else
pp_servo_got_presp
(
ppi
);
}
if
(
!
(
hdr
->
flagField
[
0
]
&
PP_TWO_STEP_FLAG
))
e
=
presp_call_servo
(
ppi
);
}
else
{
pp_diag
(
ppi
,
frames
,
2
,
"pp_pclock : "
"PDelay Resp doesn't match PDelay Req
\n
"
);
...
...
@@ -204,11 +211,7 @@ int st_com_peer_handle_pres_followup(struct pp_instance *ppi,
ppi
->
t5
=
respFllw
.
responseOriginTimestamp
;
pp_time_add
(
&
ppi
->
t5
,
&
hdr
->
cField
);
pp_timeout_set
(
ppi
,
PP_TO_FAULT
);
if
(
pp_hooks
.
handle_presp
)
e
=
pp_hooks
.
handle_presp
(
ppi
);
else
pp_servo_got_presp
(
ppi
);
e
=
presp_call_servo
(
ppi
);
}
else
{
pp_diag
(
ppi
,
frames
,
2
,
"%s: "
"PDelay Resp F-up doesn't match PDelay Req
\n
"
,
...
...
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