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
9a448f44
Commit
9a448f44
authored
Sep 28, 2022
by
Omar Gabella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new monitoring ++
parent
e50ae501
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
100 additions
and
2 deletions
+100
-2
state-wr-calibrated.c
proto-ext-whiterabbit/state-wr-calibrated.c
+8
-0
state-wr-calibration.c
proto-ext-whiterabbit/state-wr-calibration.c
+41
-1
state-wr-link-on.c
proto-ext-whiterabbit/state-wr-link-on.c
+10
-0
state-wr-locked.c
proto-ext-whiterabbit/state-wr-locked.c
+9
-1
state-wr-resp-calib-req.c
proto-ext-whiterabbit/state-wr-resp-calib-req.c
+8
-0
wr-api.h
proto-ext-whiterabbit/wr-api.h
+24
-0
No files found.
proto-ext-whiterabbit/state-wr-calibrated.c
View file @
9a448f44
...
...
@@ -15,6 +15,10 @@
*/
int
wr_calibrated
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibrated_1
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
struct
wr_dsport
*
wrp
=
WR_DSPOR
(
ppi
);
MsgSignaling
wrsig_msg
;
...
...
@@ -49,6 +53,10 @@ int wr_calibrated(struct pp_instance *ppi, unsigned char *pkt, int plen)
DSPOR
(
ppi
)
->
portIdentity
.
clockIdentity
.
id
,
PP_CLOCK_IDENTITY_LENGTH
)
==
0
)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibrated_2
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
ppi
->
next_state
=
WRS_WR_LINK_ON
;
}
#else
...
...
proto-ext-whiterabbit/state-wr-calibration.c
View file @
9a448f44
...
...
@@ -15,6 +15,10 @@
*/
int
wr_calibration
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibration_00
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
struct
wr_dsport
*
wrp
=
WR_DSPOR
(
ppi
);
int
sendmsg
=
0
;
uint32_t
delta
;
...
...
@@ -31,7 +35,7 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
sendmsg
)
{
__pp_timeout_set
(
ppi
,
PP_TO_EXT_0
,
wrp
->
calPeriod
);
#ifndef BROADCAST
#ifndef BROADCAST
// Don't send CALIBRATE message, the master don't care about it if broadcast
msg_issue_wrsig
(
ppi
,
CALIBRATE
);
#endif
...
...
@@ -45,6 +49,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
switch
(
wrp
->
wrPortState
)
{
case
WR_PORT_CALIBRATION_0
:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibration_0
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* enable pattern sending */
if
(
wrp
->
ops
->
calib_pattern_enable
(
ppi
,
0
,
0
,
0
)
==
WR_HW_CALIB_OK
)
...
...
@@ -53,6 +61,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
break
;
case
WR_PORT_CALIBRATION_1
:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibration_1
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* enable Tx calibration */
if
(
wrp
->
ops
->
calib_enable
(
ppi
,
WR_HW_CALIB_TX
)
==
WR_HW_CALIB_OK
)
...
...
@@ -61,6 +73,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
break
;
case
WR_PORT_CALIBRATION_2
:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibration_2
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* wait until Tx calibration is finished */
if
(
wrp
->
ops
->
calib_poll
(
ppi
,
WR_HW_CALIB_TX
,
&
delta
)
==
WR_HW_CALIB_READY
)
{
...
...
@@ -79,6 +95,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
}
case
WR_PORT_CALIBRATION_3
:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibration_3
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* disable Tx calibration */
if
(
wrp
->
ops
->
calib_disable
(
ppi
,
WR_HW_CALIB_TX
)
==
WR_HW_CALIB_OK
)
...
...
@@ -87,6 +107,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
break
;
case
WR_PORT_CALIBRATION_4
:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibration_4
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* disable pattern sending */
if
(
wrp
->
ops
->
calib_pattern_disable
(
ppi
)
==
WR_HW_CALIB_OK
)
wrp
->
wrPortState
=
WR_PORT_CALIBRATION_5
;
...
...
@@ -94,6 +118,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
break
;
case
WR_PORT_CALIBRATION_5
:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibration_5
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* enable Rx calibration using the pattern sent by other port */
if
(
wrp
->
ops
->
calib_enable
(
ppi
,
WR_HW_CALIB_RX
)
==
WR_HW_CALIB_OK
)
...
...
@@ -102,6 +130,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
break
;
case
WR_PORT_CALIBRATION_6
:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibration_6
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* wait until Rx calibration is finished */
if
(
wrp
->
ops
->
calib_poll
(
ppi
,
WR_HW_CALIB_RX
,
&
delta
)
==
WR_HW_CALIB_READY
)
{
...
...
@@ -121,6 +153,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
}
case
WR_PORT_CALIBRATION_7
:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibration_7
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* disable Rx calibration */
if
(
wrp
->
ops
->
calib_disable
(
ppi
,
WR_HW_CALIB_RX
)
==
WR_HW_CALIB_OK
)
...
...
@@ -128,6 +164,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
else
break
;
case
WR_PORT_CALIBRATION_8
:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_calibration_8
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* send deltas to the other port and go to the next state */
#ifndef BROADCAST
...
...
proto-ext-whiterabbit/state-wr-link-on.c
View file @
9a448f44
...
...
@@ -15,6 +15,10 @@
*/
int
wr_link_on
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_link_on_1
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
struct
wr_dsport
*
wrp
=
WR_DSPOR
(
ppi
);
int
e
=
0
;
...
...
@@ -35,7 +39,13 @@ int wr_link_on(struct pp_instance *ppi, unsigned char *pkt, int plen)
return
-
1
;
if
(
wrp
->
wrMode
==
WR_SLAVE
)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_link_on_2
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
ppi
->
next_state
=
PPS_SLAVE
;
}
else
ppi
->
next_state
=
PPS_MASTER
;
...
...
proto-ext-whiterabbit/state-wr-locked.c
View file @
9a448f44
...
...
@@ -15,6 +15,10 @@
*/
int
wr_locked
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_locked_1
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
int
e
=
0
,
sendmsg
=
0
;
MsgSignaling
wrsig_msg
;
struct
wr_dsport
*
wrp
=
WR_DSPOR
(
ppi
);
...
...
@@ -49,7 +53,11 @@ int wr_locked(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
memcmp
(
ppi
->
received_ptp_header
.
targetIdentity
.
clockIdentity
.
id
,
DSPOR
(
ppi
)
->
portIdentity
.
clockIdentity
.
id
,
PP_CLOCK_IDENTITY_LENGTH
)
==
0
)
{
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_locked_2
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
ppi
->
next_state
=
WRS_RESP_CALIB_REQ
;
}
#else
...
...
proto-ext-whiterabbit/state-wr-resp-calib-req.c
View file @
9a448f44
...
...
@@ -11,6 +11,10 @@
int
wr_resp_calib_req
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_resp_calib_req_1
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
struct
wr_dsport
*
wrp
=
WR_DSPOR
(
ppi
);
MsgSignaling
wrsig_msg
;
int
e
=
0
,
enable
=
0
;
...
...
@@ -52,6 +56,10 @@ int wr_resp_calib_req(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
if
(
send_pattern
)
wrp
->
ops
->
calib_pattern_disable
(
ppi
);
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_resp_calib_req_2
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
ppi
->
next_state
=
WRS_CALIBRATION
;
}
#else
...
...
proto-ext-whiterabbit/wr-api.h
View file @
9a448f44
...
...
@@ -80,6 +80,30 @@ struct wr_dsport {
UInteger32
ctr_wr_s_lock_5
;
UInteger32
ctr_wr_s_lock_6
;
UInteger32
ctr_wr_s_lock_7
;
UInteger32
ctr_wr_locked_1
;
UInteger32
ctr_wr_locked_2
;
UInteger32
ctr_wr_resp_calib_req_1
;
UInteger32
ctr_wr_resp_calib_req_2
;
UInteger32
ctr_wr_calibration_00
;
UInteger32
ctr_wr_calibration_0
;
UInteger32
ctr_wr_calibration_1
;
UInteger32
ctr_wr_calibration_2
;
UInteger32
ctr_wr_calibration_3
;
UInteger32
ctr_wr_calibration_4
;
UInteger32
ctr_wr_calibration_5
;
UInteger32
ctr_wr_calibration_6
;
UInteger32
ctr_wr_calibration_7
;
UInteger32
ctr_wr_calibration_8
;
UInteger32
ctr_wr_calibrated_1
;
UInteger32
ctr_wr_calibrated_2
;
UInteger32
ctr_wr_link_on_1
;
UInteger32
ctr_wr_link_on_2
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
};
...
...
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