Commit 571388cf authored by Omar Gabella's avatar Omar Gabella

comeback to test fw in full WR but without autoneg

parent 14d6c928
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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. */
......
......@@ -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
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment