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
571388cf
Commit
571388cf
authored
Nov 14, 2022
by
Omar Gabella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comeback to test fw in full WR but without autoneg
parent
14d6c928
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
72 additions
and
72 deletions
+72
-72
ieee1588_types.h
include/ppsi/ieee1588_types.h
+3
-3
state-wr-calibrated.c
proto-ext-whiterabbit/state-wr-calibrated.c
+13
-13
state-wr-calibration.c
proto-ext-whiterabbit/state-wr-calibration.c
+6
-6
state-wr-locked.c
proto-ext-whiterabbit/state-wr-locked.c
+9
-9
state-wr-present.c
proto-ext-whiterabbit/state-wr-present.c
+9
-9
state-wr-resp-calib-req.c
proto-ext-whiterabbit/state-wr-resp-calib-req.c
+11
-11
common-fun.c
proto-standard/common-fun.c
+2
-2
msg.c
proto-standard/msg.c
+8
-8
state-slave.c
proto-standard/state-slave.c
+11
-11
No files found.
include/ppsi/ieee1588_types.h
View file @
571388cf
...
...
@@ -107,10 +107,10 @@ struct FaultRecord { /* page 14 (34) -- never used */
/* Common Message header (table 18, page 124) */
typedef
struct
MsgHeader
{
#ifdef BROADCAST_BASE
//
#ifdef BROADCAST_BASE
// KM3NeT: We need the targetIdentity of the packet for base modules
PortIdentity
targetIdentity
;
#endif
//
PortIdentity targetIdentity;
//
#endif
Nibble
transportSpecific
;
Enumeration4
messageType
;
UInteger4
versionPTP
;
...
...
proto-ext-whiterabbit/state-wr-calibrated.c
View file @
571388cf
...
...
@@ -48,20 +48,20 @@ int wr_calibrated(struct pp_instance *ppi, unsigned char *pkt, int plen)
else
if
((
wrp
->
msgTmpWrMessageID
==
WR_MODE_ON
)
&&
(
wrp
->
wrMode
==
WR_SLAVE
))
{
#ifdef BROADCAST_BASE
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_calibrated_2
++
;
#endif // BROADCAST_BASE && BC_EXTRA_MON
ppi
->
next_state
=
WRS_WR_LINK_ON
;
}
#else
//
#ifdef BROADCAST_BASE
//
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_calibrated_2++;
//
#endif // BROADCAST_BASE && BC_EXTRA_MON
//
ppi->next_state = WRS_WR_LINK_ON;
//
}
//
#else
ppi
->
next_state
=
WRS_WR_LINK_ON
;
#endif // BROADCAST_BASE
//
#endif // BROADCAST_BASE
}
}
#endif // BROADCAST_NODE
...
...
proto-ext-whiterabbit/state-wr-calibration.c
View file @
571388cf
...
...
@@ -35,10 +35,10 @@ 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
//
msg_issue_wrsig(ppi, CALIBRATE);
//
#endif
wrp
->
wrPortState
=
WR_PORT_CALIBRATION_0
;
if
(
wrp
->
calibrated
)
wrp
->
wrPortState
=
WR_PORT_CALIBRATION_2
;
...
...
@@ -170,10 +170,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* send deltas to the other port and go to the next state */
#ifndef BROADCAST
//
#ifndef BROADCAST
// Don't send CALIBRATED message, the master don't care about it if broadcast
msg_issue_wrsig
(
ppi
,
CALIBRATED
);
#endif
//
msg_issue_wrsig(ppi, CALIBRATED);
//
#endif
ppi
->
next_state
=
WRS_CALIBRATED
;
wrp
->
calibrated
=
TRUE
;
...
...
proto-ext-whiterabbit/state-wr-locked.c
View file @
571388cf
...
...
@@ -49,20 +49,20 @@ int wr_locked(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
wrp
->
msgTmpWrMessageID
==
CALIBRATE
)
{
#ifdef BROADCAST_BASE
if
(
memcmp
(
ppi
->
received_ptp_header
.
targetIdentity
.
clockIdentity
.
id
,
DSPOR
(
ppi
)
->
portIdentity
.
clockIdentity
.
id
,
PP_CLOCK_IDENTITY_LENGTH
)
==
0
)
{
//
#ifdef BROADCAST_BASE
//
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
//
ppi->next_state = WRS_RESP_CALIB_REQ;
//
}
//
#else
ppi
->
next_state
=
WRS_RESP_CALIB_REQ
;
#endif // BROADCAST_BASE
//
#endif // BROADCAST_BASE
}
}
#endif // BROADCAST_NODE
...
...
proto-ext-whiterabbit/state-wr-present.c
View file @
571388cf
...
...
@@ -72,24 +72,24 @@ int wr_present(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
wrp
->
msgTmpWrMessageID
==
LOCK
)
{
#ifdef BROADCAST_BASE
//
#ifdef BROADCAST_BASE
#ifdef BC_EXTRA_MON
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_3
++
;
#endif // BC_EXTRA_MON
if
(
memcmp
(
ppi
->
received_ptp_header
.
targetIdentity
.
clockIdentity
.
id
,
DSPOR
(
ppi
)
->
portIdentity
.
clockIdentity
.
id
,
PP_CLOCK_IDENTITY_LENGTH
)
==
0
)
{
//
if (memcmp(ppi->received_ptp_header.targetIdentity.clockIdentity.id,
//
DSPOR(ppi)->portIdentity.clockIdentity.id,
//
PP_CLOCK_IDENTITY_LENGTH)==0)
//
{
#ifdef BC_EXTRA_MON
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_4
++
;
#endif // BC_EXTRA_MON
ppi
->
next_state
=
WRS_S_LOCK
;
}
#else
//
ppi->next_state = WRS_S_LOCK;
//
}
//
#else
ppi
->
next_state
=
WRS_S_LOCK
;
#endif // BROADCAST_BASE
//
#endif // BROADCAST_BASE
}
}
#endif // BROADCAST_NODE
...
...
proto-ext-whiterabbit/state-wr-resp-calib-req.c
View file @
571388cf
...
...
@@ -49,27 +49,27 @@ int wr_resp_calib_req(struct pp_instance *ppi, unsigned char *pkt, int plen)
&
(
wrp
->
msgTmpWrMessageID
));
if
(
wrp
->
msgTmpWrMessageID
==
CALIBRATED
)
{
#ifdef BROADCAST_BASE
if
(
memcmp
(
ppi
->
received_ptp_header
.
targetIdentity
.
clockIdentity
.
id
,
DSPOR
(
ppi
)
->
portIdentity
.
clockIdentity
.
id
,
PP_CLOCK_IDENTITY_LENGTH
)
==
0
)
{
if
(
send_pattern
)
wrp
->
ops
->
calib_pattern_disable
(
ppi
);
//
#ifdef BROADCAST_BASE
//
if (memcmp(ppi->received_ptp_header.targetIdentity.clockIdentity.id,
//
DSPOR(ppi)->portIdentity.clockIdentity.id,
//
PP_CLOCK_IDENTITY_LENGTH)==0)
//
{
//
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
//
ppi->next_state = WRS_CALIBRATION;
//
}
//
#else
if
(
send_pattern
)
wrp
->
ops
->
calib_pattern_disable
(
ppi
);
if
(
wrp
->
wrMode
==
WR_MASTER
)
ppi
->
next_state
=
WRS_WR_LINK_ON
;
else
ppi
->
next_state
=
WRS_CALIBRATION
;
#endif // BROADCAST_BASE
//
#endif // BROADCAST_BASE
}
}
#endif // BROADCAST_NODE
...
...
proto-standard/common-fun.c
View file @
571388cf
...
...
@@ -95,9 +95,9 @@ int st_com_execute_slave(struct pp_instance *ppi)
ppi
->
next_state
=
PPS_MASTER
;
}
else
{
// KM3NeT If we are a BM we should wait in WR_PRESENT for a targeted LOCK message
#ifndef BROADCAST_BASE
//
#ifndef BROADCAST_BASE
ppi
->
next_state
=
PPS_LISTENING
;
#endif // BROADCAST_BASE
//
#endif // BROADCAST_BASE
pp_timeout_set
(
ppi
,
PP_TO_ANN_RECEIPT
);
#ifdef BROADCAST_NODE
/* Reception Announce timeout expires, the link must be rebooted. */
...
...
proto-standard/msg.c
View file @
571388cf
...
...
@@ -35,14 +35,14 @@ int msg_unpack_header(struct pp_instance *ppi, void *buf, int plen)
hdr
->
sequenceId
=
htons
(
*
(
UInteger16
*
)
(
buf
+
30
));
hdr
->
logMessageInterval
=
(
*
(
Integer8
*
)
(
buf
+
33
));
#ifdef BROADCAST_BASE
// KM3NeT: If the message is a Signaling, I associate the targetIdentity with the header.
if
(
hdr
->
messageType
==
PPM_SIGNALING
)
{
memcpy
(
hdr
->
targetIdentity
.
clockIdentity
.
id
,(
buf
+
34
),
PP_CLOCK_IDENTITY_LENGTH
);
hdr
->
targetIdentity
.
portNumber
=
(
*
(
UInteger16
*
)
(
buf
+
42
));
}
#endif
//
#ifdef BROADCAST_BASE
//
// KM3NeT: If the message is a Signaling, I associate the targetIdentity with the header.
//
if(hdr->messageType == PPM_SIGNALING)
//
{
//
memcpy(hdr->targetIdentity.clockIdentity.id,(buf+34),PP_CLOCK_IDENTITY_LENGTH);
//
hdr->targetIdentity.portNumber = (*(UInteger16 *) (buf + 42));
//
}
//
#endif
/*
* This FLAG_FROM_CURRENT_PARENT must be killed. Meanwhile, say it's
...
...
proto-standard/state-slave.c
View file @
571388cf
...
...
@@ -35,17 +35,17 @@ static int slave_handle_response(struct pp_instance *ppi, unsigned char *pkt,
MsgHeader
*
hdr
=
&
ppi
->
received_ptp_header
;
MsgDelayResp
resp
;
#ifdef BROADCAST_BASE
if
(
memcmp
(
hdr
->
targetIdentity
.
clockIdentity
.
id
,
DSPOR
(
ppi
)
->
portIdentity
.
clockIdentity
.
id
,
PP_CLOCK_IDENTITY_LENGTH
)
!=
0
)
{
pp_diag
(
ppi
,
frames
,
1
,
"KM3NET BROADCAST targetIdentity != portIdentity
\n
"
);
return
0
;
}
else
{
pp_diag
(
ppi
,
frames
,
1
,
"KM3NET BROADCAST targetIdentity == portIdentity
\n
"
);
}
#endif //BROADCAST_BASE
//
#ifdef BROADCAST_BASE
//
if (memcmp(hdr->targetIdentity.clockIdentity.id,
//
DSPOR(ppi)->portIdentity.clockIdentity.id,
//
PP_CLOCK_IDENTITY_LENGTH)!=0) {
//
pp_diag(ppi, frames, 1, "KM3NET BROADCAST targetIdentity != portIdentity\n");
//
return 0;
//
}
//
else {
//
pp_diag(ppi, frames, 1, "KM3NET BROADCAST targetIdentity == portIdentity\n");
//
}
//
#endif //BROADCAST_BASE
msg_unpack_delay_resp
(
pkt
,
&
resp
);
...
...
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