Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
White Rabbit Switch - Software
Commits
d8718e55
Commit
d8718e55
authored
Jul 21, 2015
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr: trivial: add tracing of the hooks
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
f47f5656
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
hooks.c
proto-ext-whiterabbit/hooks.c
+14
-0
No files found.
proto-ext-whiterabbit/hooks.c
View file @
d8718e55
...
...
@@ -8,6 +8,7 @@ static int wr_init(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
struct
wr_dsport
*
wrp
=
WR_DSPOR
(
ppi
);
pp_diag
(
ppi
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
wrp
->
wrStateTimeout
=
WR_DEFAULT_STATE_TIMEOUT_MS
;
wrp
->
calPeriod
=
WR_DEFAULT_CAL_PERIOD
;
wrp
->
wrModeOn
=
0
;
...
...
@@ -26,6 +27,7 @@ static int wr_open(struct pp_globals *ppg, struct pp_runtime_opts *rt_opts)
{
int
i
;
pp_diag
(
NULL
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
/* If current arch (e.g. wrpc) is not using the 'pp_links style'
* configuration, just assume there is one ppi instance,
* already configured properly by the arch's main loop */
...
...
@@ -64,6 +66,7 @@ static int wr_listening(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
struct
wr_dsport
*
wrp
=
WR_DSPOR
(
ppi
);
pp_diag
(
ppi
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
wrp
->
wrMode
=
NON_WR
;
return
0
;
}
...
...
@@ -75,6 +78,8 @@ static int wr_master_msg(struct pp_instance *ppi, unsigned char *pkt, int plen,
MsgSignaling
wrsig_msg
;
TimeInternal
*
time
=
&
ppi
->
last_rcv_time
;
pp_diag
(
ppi
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
switch
(
msgtype
)
{
/* This case is modified from the default one */
...
...
@@ -104,6 +109,7 @@ static int wr_master_msg(struct pp_instance *ppi, unsigned char *pkt, int plen,
static
int
wr_new_slave
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
pp_diag
(
ppi
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
wr_servo_init
(
ppi
);
return
0
;
}
...
...
@@ -115,6 +121,8 @@ static int wr_handle_resp(struct pp_instance *ppi)
TimeInternal
*
ofm
=
&
DSCUR
(
ppi
)
->
offsetFromMaster
;
struct
wr_dsport
*
wrp
=
WR_DSPOR
(
ppi
);
pp_diag
(
ppi
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
/* FIXME: check sub-nano relevance of correction filed */
cField_to_TimeInternal
(
&
correction_field
,
hdr
->
correctionfield
);
...
...
@@ -146,6 +154,7 @@ static int wr_handle_resp(struct pp_instance *ppi)
static
void
wr_s1
(
struct
pp_instance
*
ppi
,
MsgHeader
*
hdr
,
MsgAnnounce
*
ann
)
{
pp_diag
(
ppi
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
WR_DSPOR
(
ppi
)
->
parentIsWRnode
=
((
ann
->
ext_specific
&
WR_NODE_MODE
)
!=
NON_WR
);
WR_DSPOR
(
ppi
)
->
parentWrModeOn
=
...
...
@@ -159,6 +168,7 @@ static void wr_s1(struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann)
static
int
wr_execute_slave
(
struct
pp_instance
*
ppi
)
{
pp_diag
(
ppi
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
if
(
!
WR_DSPOR
(
ppi
)
->
doRestart
)
return
0
;
...
...
@@ -170,6 +180,7 @@ static int wr_execute_slave(struct pp_instance *ppi)
static
void
wr_handle_announce
(
struct
pp_instance
*
ppi
)
{
pp_diag
(
ppi
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
if
((
WR_DSPOR
(
ppi
)
->
wrConfig
&
WR_S_ONLY
)
&&
(
1
/* FIXME: Recommended State, see page 33*/
)
&&
(
WR_DSPOR
(
ppi
)
->
parentWrConfig
&
WR_M_ONLY
)
&&
...
...
@@ -183,6 +194,7 @@ static int wr_handle_followup(struct pp_instance *ppi,
TimeInternal
*
precise_orig_timestamp
,
TimeInternal
*
correction_field
)
{
pp_diag
(
ppi
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
if
(
!
WR_DSPOR
(
ppi
)
->
wrModeOn
)
return
0
;
...
...
@@ -195,6 +207,7 @@ static int wr_handle_followup(struct pp_instance *ppi,
int
wr_pack_announce
(
struct
pp_instance
*
ppi
)
{
pp_diag
(
ppi
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
if
(
WR_DSPOR
(
ppi
)
->
wrConfig
!=
NON_WR
&&
WR_DSPOR
(
ppi
)
->
wrConfig
!=
WR_S_ONLY
)
{
msg_pack_announce_wr_tlv
(
ppi
);
...
...
@@ -207,6 +220,7 @@ void wr_unpack_announce(void *buf, MsgAnnounce *ann)
{
int
msg_len
=
htons
(
*
(
UInteger16
*
)
(
buf
+
2
));
pp_diag
(
NULL
,
ext
,
2
,
"hook: %s
\n
"
,
__func__
);
if
(
msg_len
>
PP_ANNOUNCE_LENGTH
)
msg_unpack_announce_wr_tlv
(
buf
,
ann
);
}
...
...
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